Index: game.c ================================================================== --- game.c +++ game.c @@ -171,13 +171,26 @@ static void show_mouse_xy(SDL_Event*ev) { char buf[32]; int x,y; x=(ev->motion.x-left_margin)/picture_size+1; y=ev->motion.y/picture_size+1; - if(ev->motion.x0 && y>0 && x<=pfwidth && y<=pfheight) snprintf(buf,8,"(%2d,%2d)",x,y); - else strcpy(buf," "); + if(ev->motion.xbutton.y<48) { + strcpy(buf," "); + } else if(side_mode) { + // Inventory + x=(ev->button.y-52)/picture_size; + if(x<0 || x>=ninventory) strcpy(buf," "); else snprintf(buf,8,"%7d",inventory[x].value); + } else { + // Move list + x=replay_pos+(ev->button.y+4)/16-(screen->h-68)/32-4; + if(x<0 || x>replay_count) strcpy(buf," "); else snprintf(buf,8,"=%6d",x); + } + } else { + if(x>0 && y>0 && x<=pfwidth && y<=pfheight) snprintf(buf,8,"(%2d,%2d)",x,y); + else strcpy(buf," "); + } SDL_LockSurface(screen); draw_text(0,40,buf,0xF0,0xF1); SDL_UnlockSurface(screen); SDL_Flip(screen); } @@ -579,11 +592,20 @@ if(!gameover && !quiz_text) continue_animation(); timerflag=0; break; case SDL_MOUSEBUTTONDOWN: if(ev.button.xh-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; } else { i=exec_key_binding(&ev,0,(ev.button.x-left_margin)/picture_size+1,ev.button.y/picture_size+1,game_command,0); goto command; } @@ -594,10 +616,11 @@ if(i==-2) { main_options['e']=1; SDL_SetTimer(0,0); return; } + replay: if(inputs_count) { //TODO: Check for solution replay for(i=0;i