generated from sigonasr2/CPlusPlusProjectTemplate
Added overworld command menu
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
7a3238cb99
commit
d6840179f0
Binary file not shown.
34
main.cpp
34
main.cpp
@ -1,4 +1,5 @@
|
||||
#include "item.h"
|
||||
#include "layers.h"
|
||||
#include <string>
|
||||
#define OLC_PGE_APPLICATION
|
||||
#include "pixelGameEngine.h"
|
||||
@ -147,6 +148,7 @@ public:
|
||||
Item*BATTLE_CUSTOM_ITEM;
|
||||
std::vector<Item*> 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<std::string,5> 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<float>(2+4),static_cast<float>(2+6+OVERWORLD_MENU_SELECTION*16)},SPRITES["cursor.png"]);
|
||||
}
|
||||
}break;
|
||||
case GameState::EDITOR:{
|
||||
DrawGameWorld();
|
||||
|
1
states.h
1
states.h
@ -7,6 +7,7 @@ namespace GameState{
|
||||
OBJ_SELECT,
|
||||
ENCOUNTER_SELECT,
|
||||
GAME_WORLD,
|
||||
OVERWORLD_MENU,
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user