diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-11-20 08:49:54 -0500 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-11-20 08:49:54 -0500 |
commit | cc4cd76409894615887e0b39d7db5b722138a613 (patch) | |
tree | db2802e34ba553bf121a7e59cb803d1c0c196e6d /src/ui.cpp | |
parent | 0a30bd1b2e2f02b6f34225d8976f645c99b53b7e (diff) | |
parent | 5598e4d1f52224f2d075dc318868e284b2f20a78 (diff) |
Started inv ui, new item system
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; |