pipe-game

Un jeu de cartes à piper les une dans les autres - retour accueil

git clone git://bebou.netlib.re/pipe-game
Log | Files | Refs | README |

commit af75295caebefb7f6dfd573ae68b603167aaacc5
parent 258ee6653c2e043fe9e4001e3779cde48faad1d9
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Thu, 30 Jan 2025 21:47:19 +0100

Des titres sur les boites des piles

Diffstat:
Minterface.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/interface.c b/interface.c @@ -183,13 +183,14 @@ void file2pile(FILE* fp, struct pile *p, struct pile **piles) { p->curline=0; } -coord displaybox(int coloffset, int lineoffset, int width, int length, bool selected) { +coord displaybox(char* name, int coloffset, int lineoffset, int width, int length, bool selected) { int color=selected ? TB_DEFAULT : TB_WHITE; length<2 ? length=2 : length; hr(coloffset+1,lineoffset,width-1,selected); hr(coloffset+1,lineoffset+length,width-1,selected); vr(coloffset,lineoffset+1,length-1,selected); vr(coloffset+width,lineoffset+1,length-1,selected); + tb_print(coloffset+2,lineoffset,color,TB_DEFAULT,name); tb_print(coloffset,lineoffset,color,TB_DEFAULT,"╭"); tb_print(coloffset+width,lineoffset,color,TB_DEFAULT,"╮"); tb_print(coloffset,lineoffset+length,color,TB_DEFAULT,"╰"); @@ -203,7 +204,7 @@ coord displaypile(struct pile *p, struct pile *curmenu, int coloffset, int lineo int newlineoffset=lineoffset; int maxwidth=CARD_NAME_SIZE+2; int maxlen=p->cardcount+1; coord begin; begin.x=coloffset; begin.y=lineoffset; - coord end=displaybox(begin.x,begin.y,maxwidth,maxlen,p==curmenu); + coord end=displaybox(p->name, begin.x,begin.y,maxwidth,maxlen,p==curmenu); p->begin=begin; p->end=end; coloffset++; lineoffset++; for (int i=0;i<p->cardcount;i++) { @@ -222,7 +223,7 @@ coord displaypile(struct pile *p, struct pile *curmenu, int coloffset, int lineo coord displaytextblock(char *text, int coloffset, int lineoffset) { coord p; int nbl=nblines(text), w=30; p.y=nbl+lineoffset; p.x=w+coloffset; - displaybox(coloffset,lineoffset,w,nbl,false); + displaybox("",coloffset,lineoffset,w,nbl,false); coloffset++; lineoffset++; tb_printf(coloffset, lineoffset, TB_DEFAULT, TB_DEFAULT, text); return p;