643
644
645
646
647
648
649
650
651
652
653
654
655
656
|
return;
}
s=sqlite3_mprintf("\x0C\x0E%s:%d\\ %s\x0B\x0F%s",classes[objects[n]->class]->name,objects[n]->image,classes[objects[n]->class]->name,classes[objects[n]->class]->gamehelp);
if(!s) fatal("Allocation failed\n");
modal_draw_popup(s);
sqlite3_free(s);
}
static void do_import_moves(const char*arg) {
FILE*fp;
int i;
if(!arg || !arg[strspn(arg," \t")]) return;
fp=popen(arg,"r");
if(!fp) {
|
>
>
>
>
>
>
>
>
>
>
>
|
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
|
return;
}
s=sqlite3_mprintf("\x0C\x0E%s:%d\\ %s\x0B\x0F%s",classes[objects[n]->class]->name,objects[n]->image,classes[objects[n]->class]->name,classes[objects[n]->class]->gamehelp);
if(!s) fatal("Allocation failed\n");
modal_draw_popup(s);
sqlite3_free(s);
}
static void describe_inventory(int n) {
unsigned char*s;
if(n<0 || n>=ninventory) return;
if(!classes[inventory[n].class]->gamehelp) return;
if(classes[inventory[n].class]->gamehelp[0]==16) return;
s=sqlite3_mprintf("\x0C\x0E%s:%d\\ %s\x0B\x0F%s",classes[inventory[n].class]->name,inventory[n].image,classes[inventory[n].class]->name,classes[inventory[n].class]->gamehelp);
if(!s) fatal("Allocation failed\n");
modal_draw_popup(s);
sqlite3_free(s);
}
static void do_import_moves(const char*arg) {
FILE*fp;
int i;
if(!arg || !arg[strspn(arg," \t")]) return;
fp=popen(arg,"r");
if(!fp) {
|
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
|
}
break;
case SDL_MOUSEBUTTONDOWN:
if(ev.button.x<left_margin) {
if(ev.button.y<48) break;
if(side_mode) {
// Inventory
//TODO
} else {
// Move list
i=(ev.button.y+4)/16-(screen->h-68)/32-4;
if(i<0) game_command(0,'- ',-i,0,0,0); else if(i>0) game_command(0,'+ ',i,0,0,0);
goto replay;
}
break;
|
|
>
>
|
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
|
}
break;
case SDL_MOUSEBUTTONDOWN:
if(ev.button.x<left_margin) {
if(ev.button.y<48) break;
if(side_mode) {
// Inventory
describe_inventory((ev.button.y-52)/picture_size);
timerflag=0;
redraw_game();
} else {
// Move list
i=(ev.button.y+4)/16-(screen->h-68)/32-4;
if(i<0) game_command(0,'- ',-i,0,0,0); else if(i>0) game_command(0,'+ ',i,0,0,0);
goto replay;
}
break;
|