diff options
Diffstat (limited to 'src/ui.cpp')
-rw-r--r-- | src/ui.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -55,6 +55,9 @@ static unsigned char dialogOptCount = 0; bool fadeEnable = false; + +bool inBattle = false; + namespace ui { /* @@ -435,7 +438,7 @@ namespace ui { if(dialogBoxExists){ glColor3ub(0,0,0); - x=player->loc.x-SCREEN_WIDTH/2+HLINE*8; + x=offset.x-SCREEN_WIDTH/2+HLINE*8; y=(offset.y+SCREEN_HEIGHT/2)-HLINE*8; glRectf(x,y,x+SCREEN_WIDTH-HLINE*16,y-SCREEN_HEIGHT/4); @@ -544,7 +547,11 @@ DONE: player->ground=false; player->loc.y-=HLINE*1.5; } - if(SDL_KEY==SDLK_w)currentWorld=currentWorld->goInsideStructure(player); + if(SDL_KEY==SDLK_w){ + if(inBattle){ + currentWorld=((Arena *)currentWorld)->exitArena(player); + }else currentWorld=currentWorld->goInsideStructure(player); + } if(SDL_KEY==SDLK_SPACE){ // Jump if(player->ground){ player->vel.y=.4; |