diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 8958135..a03e755 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/main.cpp b/main.cpp index de2bedd..e46881f 100644 --- a/main.cpp +++ b/main.cpp @@ -165,7 +165,6 @@ EquipSlot::Equip EQUIP_MENU_SLOT=EquipSlot::WEAPON; int EQUIP_ITEM_MENU_CURSOR=0; int EQUIP_ITEM_MENU_OFFSET=0; std::vector EQUIP_ITEM_MENU_CONTENTS={}; -std::vector> SHOP_MENU_CONTENTS={}; int MESSAGE_BOX_DIALOG_ANSWER=-1; int MESSAGE_BOX_DIALOG_CHOICES_MADE=0; std::vector MESSAGE_BOX_CHOICE_LIST={}; @@ -196,6 +195,11 @@ void DisplayMessageBox(std::string targetT) { messageBoxStopMarker=0; } +void SetupShop(std::vector> shopItems){ + SHOP_ITEMS.clear(); + SHOP_ITEMS=shopItems; +} + bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things. std::vector> MAP={}; //The foreground layer. @@ -2295,6 +2299,18 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), //////////////////INTERFACE LAYER. SetDrawTarget(layer::INTERFACE); + if (GAME_STATE==GameState::SHOPKEEPER_MENU) { + DrawDialogBox({1,1},{WIDTH/2-2,HEIGHT/2},Pixel(70, 33, 105,220),Pixel(62, 54, 69,220),Pixel(185, 148, 255,220)); + for (int i=0;iname,WHITE,AutoScaleText(SHOP_ITEMS[i].first->name,WIDTH*(1.f/3)-14)); + std::string moneyText="$"+std::to_string(SHOP_ITEMS[i].second); + vf2d textSize=GetTextSizeProp(moneyText); + DrawStringPropDecal({WIDTH*(1.f/3)+4,(float)(8+i*12)},moneyText); + vf2d textSize2=(vf2d)GetTextSizeProp("00"); + DrawStringPropDecal({WIDTH*(1.f/3)+4+textSize.x,(float)(8+i*12)},"00",WHITE,{0.4f,0.7f}); + DrawLineDecal({WIDTH*(1.f/3)+4+textSize.x,(float)(8+i*12+textSize2.y*0.7f)},{WIDTH*(1.f/3)+4+textSize.x+textSize2.x*0.4f,(float)(8+i*12+textSize2.y*0.7f)}); + } + } if (BATTLE_ENCOUNTER!=nullptr&&BATTLE_STATE==BattleState::MOVE_SELECT) { vd2d cursorOffset = {-2,-2}; vd2d cursorScale = {1,1}; @@ -4782,6 +4798,11 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), bool MessageBoxAllowedToAdvance() { return messageBoxMarker> shopItems); +extern std::mapITEMLIST; class Shopkeeper_Obj : public Object{ DynamicObject(Shopkeeper_Obj) @@ -221,6 +223,13 @@ class Shopkeeper_Obj : public Object{ } void DialogClosed()override{ GAME_STATE = GameState::SHOPKEEPER_MENU; + SetupShop( + { + {ITEMLIST[ItemName::EGG],8}, + {ITEMLIST[ItemName::COOKIE],4}, + {ITEMLIST[ItemName::PIZZA],36}, + } + ); } }; #endif \ No newline at end of file diff --git a/states.h b/states.h index 33136f2..4078eb7 100644 --- a/states.h +++ b/states.h @@ -18,7 +18,6 @@ namespace GameState{ OVERWORLD_STATUS_MENU, OVERWORLD_TARGET_MENU, SHOPKEEPER_MENU, - SHOPKEEPER_ASK_MENU, }; }