diff --git a/C++ProjectTemplate b/C++ProjectTemplate index a55ab2b..a0ad120 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index 5f85a58..001ba68 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,5 @@ #include "item.h" +#include "layers.h" #include #define OLC_PGE_APPLICATION #include "pixelGameEngine.h" @@ -147,6 +148,7 @@ public: Item*BATTLE_CUSTOM_ITEM; std::vector BATTLE_SPOILS_LIST; std::wstring BATTLE_SPOILS_MESSAGE; + int OVERWORLD_MENU_SELECTION=0; bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things. @@ -1010,6 +1012,24 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), case GameState::GAME_WORLD:{ if (GetKey(F5).bPressed) { GAME_STATE=GameState::EDITOR; + } else + if (ACTIONKEYPRESSED) { + GAME_STATE=GameState::OVERWORLD_MENU; + OVERWORLD_MENU_SELECTION=0; + } + }break; + case GameState::OVERWORLD_MENU:{ + if (LeftPressed()) { + GAME_STATE=GameState::GAME_WORLD; + } + if (DownPressed()) { + OVERWORLD_MENU_SELECTION=(OVERWORLD_MENU_SELECTION+1)%5; + } + if (UpPressed()) { + OVERWORLD_MENU_SELECTION--; + if (OVERWORLD_MENU_SELECTION<0) { + OVERWORLD_MENU_SELECTION+=5; + } } }break; case GameState::EDITOR:{ @@ -1130,8 +1150,20 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), } } switch (GAME_STATE) { - case GameState::GAME_WORLD:{ + case GameState::GAME_WORLD: + case GameState::OVERWORLD_MENU:{ DrawGameWorld(); + if (GAME_STATE==GameState::OVERWORLD_MENU) { + SetDrawTarget(layer::INTERFACE); + vi2d boxPos = {2,2}; + DrawDialogBox(boxPos,{(int)(WIDTH*0.25+4),5*16+4},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220)); + const std::array MENU_ITEMS = {"Check","Power","Items","Equip","Status"}; + for (int i=0;i<5;i++) { + vi2d textPos = {12,i*16+6}; + DrawStringPropDecal(boxPos+textPos,MENU_ITEMS[i]); + } + DrawDecal({static_cast(2+4),static_cast(2+6+OVERWORLD_MENU_SELECTION*16)},SPRITES["cursor.png"]); + } }break; case GameState::EDITOR:{ DrawGameWorld(); diff --git a/states.h b/states.h index fca0f9e..6251d54 100644 --- a/states.h +++ b/states.h @@ -7,6 +7,7 @@ namespace GameState{ OBJ_SELECT, ENCOUNTER_SELECT, GAME_WORLD, + OVERWORLD_MENU, }; }