aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2015-11-20 08:49:54 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2015-11-20 08:49:54 -0500
commitcc4cd76409894615887e0b39d7db5b722138a613 (patch)
treedb2802e34ba553bf121a7e59cb803d1c0c196e6d /src/ui.cpp
parent0a30bd1b2e2f02b6f34225d8976f645c99b53b7e (diff)
parent5598e4d1f52224f2d075dc318868e284b2f20a78 (diff)
Started inv ui, new item system
Diffstat (limited to 'src/ui.cpp')
-rw-r--r--src/ui.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ui.cpp b/src/ui.cpp
index e6914d5..81c3f9b 100644
--- a/src/ui.cpp
+++ b/src/ui.cpp
@@ -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;