mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2024-12-28 20:43:42 +01:00
Fixed a little displaying error in the dialog code
This commit is contained in:
parent
8f5eb159a1
commit
f03281507c
2 changed files with 25 additions and 12 deletions
|
@ -239,16 +239,18 @@ int _choice_call_before_end(Game *game, unsigned int org_i) {
|
||||||
dsize(">", &FONT_USED, &arrow_width, &arrow_height);
|
dsize(">", &FONT_USED, &arrow_width, &arrow_height);
|
||||||
/* Add the character spacing of the font to it. */
|
/* Add the character spacing of the font to it. */
|
||||||
arrow_width += FONT_USED.char_spacing;
|
arrow_width += FONT_USED.char_spacing;
|
||||||
|
for(i=0;i<_choices_amount;i++){
|
||||||
|
dtext(i*choice_size+arrow_width+PXSIZE,
|
||||||
|
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE, C_BLACK,
|
||||||
|
_choices+pos);
|
||||||
|
pos += strlen(_choices+pos)+1;
|
||||||
|
}
|
||||||
do{
|
do{
|
||||||
/* Display the diffrent choices. */
|
/* Display the diffrent choices. */
|
||||||
for(i=0;i<_choices_amount;i++){
|
for(i=0;i<_choices_amount;i++){
|
||||||
if(i == selected) dtext(i*choice_size+PXSIZE,
|
if(i == selected) dtext(i*choice_size+PXSIZE,
|
||||||
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE,
|
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE,
|
||||||
C_BLACK, ">");
|
C_BLACK, ">");
|
||||||
dtext(i*choice_size+arrow_width+PXSIZE,
|
|
||||||
(BOX_HEIGHT+CHOICE_BOX_PADDING_TOP)*PXSIZE, C_BLACK,
|
|
||||||
_choices+pos);
|
|
||||||
pos += strlen(_choices+pos)+1;
|
|
||||||
}
|
}
|
||||||
blit();
|
blit();
|
||||||
key = getkey().key;
|
key = getkey().key;
|
||||||
|
|
27
src/main.c
27
src/main.c
|
@ -108,13 +108,11 @@ int main(void) {
|
||||||
dgray(DGRAY_ON);
|
dgray(DGRAY_ON);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
showtext_dialog(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.", true, true);
|
showtext_dialog(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.", true, true);
|
||||||
int in = showtext_dialog_ask(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.", true, false, "Lorem\0Ipsum\0Dolor", 3, 0);
|
int in = showtext_dialog_ask(&game, &player_face_img, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet.", true, false, "Lorem\0Ipsum\0Dolor", 3, 0);
|
||||||
if(in==2) showtext_dialog(&game, &player_face_img, "You choosed Dolor", false, true);
|
if(in==2) showtext_dialog(&game, &player_face_img, "You choosed Dolor", false, true);
|
||||||
else if(in==1) showtext_dialog(&game, &player_face_img, "You choosed Ipsum", false, true);
|
else if(in==1) showtext_dialog(&game, &player_face_img, "You choosed Ipsum", false, true);
|
||||||
else showtext_dialog(&game, &player_face_img, "You choosed Lorem", false, true);
|
else showtext_dialog(&game, &player_face_img, "You choosed Lorem", false, true);
|
||||||
*/
|
|
||||||
|
|
||||||
do{
|
do{
|
||||||
/* clear screen */
|
/* clear screen */
|
||||||
|
@ -128,22 +126,35 @@ int main(void) {
|
||||||
{
|
{
|
||||||
dfont( NULL );
|
dfont( NULL );
|
||||||
drect( 5, 5,390, 55, C_WHITE );
|
drect( 5, 5,390, 55, C_WHITE );
|
||||||
dprint( 10, 10, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d", 0, worldRPG[0]->xmin, worldRPG[0]->ymin, worldRPG[0]->xmax, worldRPG[0]->ymax );
|
dprint(10, 10, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
|
||||||
dprint( 10, 20, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d", 1, worldRPG[1]->xmin, worldRPG[1]->ymin, worldRPG[1]->xmax, worldRPG[1]->ymax );
|
0, worldRPG[0]->xmin, worldRPG[0]->ymin,
|
||||||
dprint( 10, 30, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d", 2, worldRPG[2]->xmin, worldRPG[2]->ymin, worldRPG[2]->xmax, worldRPG[2]->ymax );
|
worldRPG[0]->xmax, worldRPG[0]->ymax);
|
||||||
dprint( 10, 40, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d", 3, worldRPG[3]->xmin, worldRPG[3]->ymin, worldRPG[3]->xmax, worldRPG[3]->ymax );
|
dprint(10, 20, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
|
||||||
|
1, worldRPG[1]->xmin, worldRPG[1]->ymin,
|
||||||
|
worldRPG[1]->xmax, worldRPG[1]->ymax);
|
||||||
|
dprint(10, 30, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
|
||||||
|
2, worldRPG[2]->xmin, worldRPG[2]->ymin,
|
||||||
|
worldRPG[2]->xmax, worldRPG[2]->ymax);
|
||||||
|
dprint(10, 40, C_RED, "Map[%d] : Xmn %d Ymn %d Xmx %d Ymx %d",
|
||||||
|
3, worldRPG[3]->xmin, worldRPG[3]->ymin,
|
||||||
|
worldRPG[3]->xmax, worldRPG[3]->ymax);
|
||||||
}
|
}
|
||||||
if (game.debug_player)
|
if (game.debug_player)
|
||||||
{
|
{
|
||||||
dfont( NULL );
|
dfont( NULL );
|
||||||
drect( 5, 55,390, 75, C_WHITE );
|
drect( 5, 55,390, 75, C_WHITE );
|
||||||
dprint( 10, 60, C_BLUE, "X= %d - Y= %d / Wx= %d - Wy= %d", game.player.x, game.player.y, game.player.wx, game.player.wy );
|
dprint( 10, 60, C_BLUE, "X= %d - Y= %d / Wx= %d - Wy= %d",
|
||||||
|
game.player.x, game.player.y, game.player.wx,
|
||||||
|
game.player.wy );
|
||||||
}
|
}
|
||||||
if (game.debug_extra)
|
if (game.debug_extra)
|
||||||
{
|
{
|
||||||
dfont( NULL );
|
dfont( NULL );
|
||||||
for (int i=0; i<game.map_level->nbextradata; i++ )
|
for (int i=0; i<game.map_level->nbextradata; i++ )
|
||||||
dprint( 10, 90+i*15, C_RED, "X= %d - Y= %d - T: %s", game.map_level->extradata[i].x, game.map_level->extradata[i].y, game.map_level->extradata[i].dialog );
|
dprint( 10, 90+i*15, C_RED, "X= %d - Y= %d - T: %s",
|
||||||
|
game.map_level->extradata[i].x,
|
||||||
|
game.map_level->extradata[i].y,
|
||||||
|
game.map_level->extradata[i].dialog );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue