diff --git a/C++ProjectTemplate b/C++ProjectTemplate index fa0de58..4728a58 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/layers.h b/layers.h index dc9697f..4aa87e3 100644 --- a/layers.h +++ b/layers.h @@ -3,6 +3,7 @@ namespace layer{ enum layer{ + INTERFACE2, //The highest layer, even better than the interface layer. INTERFACE, //Interface items should be on this layer. On top of everything. COLLISION, //Collision checking layer. This layer is HIGH, diff --git a/main.cpp b/main.cpp index 7fd33ac..ea5b17d 100644 --- a/main.cpp +++ b/main.cpp @@ -202,7 +202,7 @@ public: { srand(time(NULL)); GAME=this; - for (int i=1;i<6;i++) { + for (int i=1;i<7;i++) { CreateLayer(); EnableLayer(i,true); } @@ -279,6 +279,8 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), keyUpdates(); SetDrawTarget(nullptr); Clear(BLANK); + SetDrawTarget(layer::INTERFACE); + Clear(BLANK); SetDrawTarget(layer::COLLISION); if (EDITING_LAYER!=layer::COLLISION) { Clear(MAGENTA); @@ -959,9 +961,10 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), } }break; case BattleState::ITEM_SELECT:{ - HandleInventoryMenu(); if (LeftPressed()&&!(ITEM_SELECTION_CURSOR&1)) { BATTLE_STATE=BattleState::SELECT_ACTION; + } else { + HandleInventoryMenu(); } }break; } @@ -1299,6 +1302,25 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), } } } + if (BATTLE_STATE==BattleState::ITEM_SELECT) { + SetDrawTarget(layer::INTERFACE2); + DrawDecal({static_cast(8+(ITEM_SELECTION_CURSOR)%2*(WIDTH-8)/2),static_cast(12*((ITEM_SELECTION_CURSOR-ITEM_SELECTION_OFFSET)/2)+8)},SPRITES["cursor.png"]); + DrawDialogBox({4,4},{(int)(WIDTH-8),(int)(HEIGHT/2)},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); + DrawDialogBox({(int)(WIDTH*(3.0F/8)),HEIGHT/2+4},{(int)(WIDTH*(5.0F/8)-4),(int)(HEIGHT/4)},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); + DrawStringPropDecal({(int)(WIDTH*(3.0F/8))+4,HEIGHT/2+8},Wrap(PARTY_INVENTORY[ITEM_SELECTION_CURSOR]->description,(int)(WIDTH*(5.0F/8))-4,true,{1,1})); + for (int i=0;i<18;i++) { + if (ITEM_SELECTION_OFFSET+i(16+i%2*(WIDTH-8)/2),static_cast(12*(i/2)+8)},PARTY_INVENTORY[ITEM_SELECTION_OFFSET+i]->name); + } + } + if (ITEM_SELECTION_OFFSET>0) { + DrawRotatedDecal({WIDTH-20,8},SPRITES["cursor.png"],-M_PI_2,{4,4}); + } + if (ITEM_SELECTION_OFFSET+18(8+(ITEM_SELECTION_CURSOR)%2*(WIDTH-8)/2),static_cast(12*((ITEM_SELECTION_CURSOR-ITEM_SELECTION_OFFSET)/2)+8)},SPRITES["cursor.png"]); - DrawDialogBox({4,4},{(int)(WIDTH-8),(int)(HEIGHT/2)},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); - DrawDialogBox({WIDTH/2,HEIGHT/2+4},{(int)(WIDTH/2-4),(int)(HEIGHT/2)},Pixel(70, 33, 105,128),Pixel(62, 54, 69,128),Pixel(185, 148, 255,128)); - for (int i=0;i<18;i++) { - if (ITEM_SELECTION_OFFSET+i(16+i%2*(WIDTH-8)/2),static_cast(12*(i/2)+8)},PARTY_INVENTORY[ITEM_SELECTION_OFFSET+i]->name); - } - } - if (ITEM_SELECTION_OFFSET>0) { - DrawRotatedDecal({WIDTH-20,8},SPRITES["cursor.png"],-M_PI_2,{4,4}); - } - if (ITEM_SELECTION_OFFSET+18