Index: bindings.doc ================================================================== --- bindings.doc +++ bindings.doc @@ -60,10 +60,13 @@ Restart and replay that many moves. '^T' Display the level title popup. +'^d' + Display the help text of the object at the location. + '^o' List objects at the specified coordinates. === Editor commands === Index: game.c ================================================================== --- game.c +++ game.c @@ -383,10 +383,25 @@ exit(0); break; } } } + +static void describe_at(int xy) { + unsigned char*s; + Uint32 n; + if(xy<0 || xy>=64*64) return; + n=playfield[xy]; + if(n==VOIDLINK) return; + while(n!=VOIDLINK && objects[n]->up!=VOIDLINK) n=objects[n]->up; + if(!classes[objects[n]->class]->gamehelp) 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 int game_command(int prev,int cmd,int number,int argc,sqlite3_stmt*args,void*aux) { switch(cmd) { case '\' ': // Play a move if(inputs_count>=inputs_size) { @@ -399,10 +414,13 @@ return -2; case '^Q': // Quit return -1; case '^T': // Show title modal_draw_popup(level_title); + return prev; + case '^d': // Describe object + describe_at(number-65); return prev; case '^o': // List objects list_objects_at(number-65); return prev; case 'go': // Select level Index: picture.c ================================================================== --- picture.c +++ picture.c @@ -565,11 +565,15 @@ Uint8 a,h; Uint16 w; } PopLine; static void pop_bar(int x,int y,PopLine*li,int w) { - + Uint8*p=screen->pixels; + Uint16 pitch=screen->pitch; + if(x+w>=screen->w || y+8>screen->h) return; + p+=(y+3)*pitch+x; + while(w--) *p++=w&1?7:5; } static void pop_char(int x,int y,PopLine*li,Uint8 c,Uint8 v) { Uint8*p=screen->pixels; Uint16 pitch=screen->pitch; @@ -739,11 +743,11 @@ p=strchr(p,'\\')?:""; if(*p) p++; break; case 15: y+=li[ln++].h; - pop_bar(bx,y,li+ln,tw); + pop_bar(bx-8,y,li+ln,tw+22); y+=8; if(ln<64) x=li[ln].a?bx+(tw-li[ln].w)/2:bx; break; case 16: pop_quiz(x,y,li+ln,c,*p);