Refactor shopkeeper menu and add money box to overworld menu.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent c8083c3485
commit 9535d6fa54
  1. BIN
      C++ProjectTemplate
  2. 15
      main.cpp

Binary file not shown.

@ -1284,6 +1284,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
if (closest!=nullptr) {
//Run the Interaction for this object.
INTERACTING_WITH=closest;
GAME_STATE=GameState::GAME_WORLD;
Interaction interaction = closest->Interact();
if (interaction.messages.size()>0) {
INTERACTION_MESSAGES=interaction.messages;
@ -1934,8 +1935,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
case GameState::OVERWORLD_EQUIP_MENU:
case GameState::OVERWORLD_EQUIP_PLAYER_MENU:
case GameState::OVERWORLD_STATUS_MENU:
case GameState::OVERWORLD_TARGET_MENU:
case GameState::SHOPKEEPER_MENU:{
case GameState::OVERWORLD_TARGET_MENU:{
DrawGameWorld();
SetDrawTarget(layer::INTERFACE);
if (GAME_STATE!=GameState::GAME_WORLD&&GAME_STATE!=GameState::OVERWORLD_TARGET_MENU) {
@ -1947,6 +1947,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
DrawStringPropDecal(boxPos+textPos,MENU_ITEMS[i]);
}
DrawDecal({static_cast<float>(2+4),static_cast<float>(2+6+OVERWORLD_MENU_SELECTION*16)},SPRITES["cursor.png"]);
DrawMoneyBox({(float)boxPos.x,(float)boxPos.y+5*16+4},{WIDTH/4+4,HEIGHT/6});
}
if (GAME_STATE==GameState::OVERWORLD_EQUIP_PLAYER_MENU||GAME_STATE==GameState::OVERWORLD_EQUIP_MENU||GAME_STATE==GameState::OVERWORLD_EQUIP_ITEM_MENU) {
DrawDialogBox({4,4},{(int)(WIDTH/1.5),HEIGHT/4},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
@ -2070,7 +2071,10 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
if (GAME_STATE==GameState::OVERWORLD_POWER_MENU||GAME_STATE==GameState::OVERWORLD_POWER_PLAYER_MENU||GAME_STATE==GameState::OVERWORLD_GRADE_MENU) {
DrawBattleMoveList(OVERWORLD_POWER_SELECTION_MEMBER);
}
if (GAME_STATE==GameState::SHOPKEEPER_MENU) {
}break;
case GameState::SHOPKEEPER_MENU:{
DrawGameWorld();
SetDrawTarget(layer::INTERFACE);
DrawDialogBox({1,1},{WIDTH/2-2,HEIGHT/2},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
DrawDialogBox({(int)(WIDTH/2+2),2},{(int)(WIDTH/2-4),(int)(HEIGHT/4)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
@ -2089,7 +2093,6 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
if (SHOP_MENU_CURSOR<SHOP_ITEMS.size()) {
DrawStringPropDecal({(int)(WIDTH/2)+6,6},Wrap(SHOP_ITEMS[SHOP_MENU_CURSOR].first->description,(int)(WIDTH/2)-6,true,{1,1}));
}
}
}break;
case GameState::EDITOR:{
DrawGameWorld();
@ -4837,8 +4840,8 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"),
}
//The player's money count. It's shown in a box that is WIDTH/4 and HEIGHT/6 in size.
void DrawMoneyBox(vf2d pos) {
DrawDialogBox(pos,{(int)(WIDTH/4),(int)(HEIGHT/6)},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
void DrawMoneyBox(vf2d pos,vf2d size={(int)(WIDTH/4),(int)(HEIGHT/6)}) {
DrawDialogBox(pos,size,Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220));
std::string drawStr="$ "+std::to_string(MONEY);
vf2d textSize=GetTextSizeProp(drawStr);
vf2d stringOffset={4,2+(HEIGHT/12)-textSize.y};

Loading…
Cancel
Save