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 c73088b21e3a1d3b24a5a15c47ac019f5d4ae2e2
parent 817795817215f13c7fce23d90ef0886cfeee0ac0
Auteurice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Tue, 28 Jan 2025 19:28:29 +0100

Des boites autour du texte

On calcule pas la largeur des boites, valeur de 20 arbitraires

Diffstat:
Minterface.c | 17+++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/interface.c b/interface.c @@ -184,10 +184,12 @@ int displaypile(pile p, pile curmenu, int coloffset, int lineoffset, bool select } int displaytextblock(char *text, int coloffset, int lineoffset) { + int nbl=nblines(text); + nbl==0 ? nbl++ : nbl; + displaybox(coloffset,lineoffset,20,nbl+1); + coloffset++;lineoffset++; tb_printf(coloffset, lineoffset, TB_DEFAULT, TB_DEFAULT, text); - int nbl=nblines(text)+lineoffset; - hr(coloffset,nbl,2); - return nbl+1; + return nbl+lineoffset+1; } int debug(int l, pile curmenu,struct tb_event ev) { @@ -213,7 +215,6 @@ int display(pile** piles, pile curmenu, bool selection, char* cmd, char* res, ch lineoffset2=displaypile(*piles[PLAYEDENNEMY], curmenu, CARD_NAME_SIZE*3+2, 0, selection); displaypile(*piles[PLAYEDENNEMYARGS], curmenu, CARD_NAME_SIZE*4+2, 0, selection); - lineoffset1=hr(0,max(lineoffset1,lineoffset2),CARD_NAME_SIZE*5); int lo=lineoffset1; lineoffset1=displaytextblock(res,0,lo); @@ -226,10 +227,10 @@ int display(pile** piles, pile curmenu, bool selection, char* cmd, char* res, ch lo=max(lineoffset1,lineoffset2); lo=displaytextblock("\ - * enter to select card\n\ - * arrows to move selection\n\ - * m to create arg (if no whitespace)\n\ - * e to end turn and output res\n",0,lo); +* enter to select card\n\ +* arrows to move selection\n\ +* m to create arg (if no whitespace)\n\ +* e to end turn and output res\n",0,lo); lo=hr(0,lo,CARD_NAME_SIZE*5);