Sherman's menu integrated. Added NPC display names above the characters.

pull/35/head
sigonasr2 12 months ago
parent 390e7fefbf
commit db93e05afc
  1. 12
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 3
      Adventures in Lestoria/ConsumableCraftingWindow.cpp
  3. 11
      Adventures in Lestoria/NPC.cpp
  4. 11
      Adventures in Lestoria/ShermanWindow.cpp
  5. 2
      Adventures in Lestoria/Version.h
  6. 2
      Adventures in Lestoria/assets/config/NPCs.txt

@ -1780,6 +1780,12 @@ void AiL::InitializeLevel(std::string mapFile,MapName map){
void AiL::LoadLevel(MapName map){
if(game->MAP_DATA.count(map)==0)ERR(std::format("WARNING! Could not load map {}! Does not exist! Refer to levels.txt for valid maps.",map));
if(game->MAP_DATA[map].GetMapType()=="Hub"&&GameState::STATE!=GameState::states[States::GAME_HUB])ERR("WARNING! A hub level should only be initiated in the GAME_HUB game state!");
#pragma region Reset Environmental Audio
for(EnvironmentalAudio&audio:MAP_DATA[GetCurrentLevel()].environmentalAudioData){
audio.Deactivate();
}
#pragma endregion
SPAWNER_LIST.clear();
foregroundTileGroups.clear();
@ -1806,12 +1812,6 @@ void AiL::LoadLevel(MapName map){
GetPlayer()->ResetAccumulatedXP();
ZONE_LIST=game->MAP_DATA[game->GetCurrentLevel()].ZoneData;
#pragma region Reset Environmental Audio
for(EnvironmentalAudio&audio:MAP_DATA[map].environmentalAudioData){
audio.Deactivate();
}
#pragma endregion
#pragma region Monster Spawn Data Setup
for(auto&[key,value]:MAP_DATA[map].SpawnerData){

@ -1,3 +1,4 @@
#pragma region License
/*
License (OLC-3)
@ -128,7 +129,7 @@ void Menu::InitializeConsumableCraftingWindow(){
Player::AddMoneyListener(moneyDisplay);
#pragma endregion
consumableCraftingWindow->ADD("Leave Button",MenuComponent)(geom2d::rect<float>{{consumableCraftingWindow->size.x/2-48,28+consumableCraftingWindow->size.y-44+6},{96,24}},"Leave",MenuType::ENUM_END,
consumableCraftingWindow->ADD("Back Button",MenuComponent)(geom2d::rect<float>{{consumableCraftingWindow->size.x/2-48,28+consumableCraftingWindow->size.y-44+6},{96,24}},"Back",MenuType::ENUM_END,
[](MenuFuncData data){
Menu::CloseMenu();
return true;

@ -41,16 +41,22 @@ All rights reserved.
#include "MonsterStrategyHelpers.h"
#include "util.h"
#include "Menu.h"
#include "Unlock.h"
#include "MenuComponent.h"
using A=Attribute;
INCLUDE_game
INCLUDE_DATA
void Monster::STRATEGY::NPC(Monster&m,float fElapsedTime,std::string strategy){
if(m.phase==0){ //Initialization.
if(m.npcData.function.length()>0){
m.SetStrategyDrawOverlayFunction([](AiL*game,Monster&m,const std::string&strategy){
game->KEY_CONFIRM.DrawInput(m.GetPos()+vf2d{ConfigFloatArr("Interaction Display Offset",0),ConfigFloatArr("Interaction Display Offset",1)},"Interact",uint8_t(util::lerp(0.f,255.f,m.F(A::TARGET_TIMER)/ConfigFloat("Interaction Display Ease in Timer"))));
vf2d nameTextSize=game->GetTextSizeProp(m.GetName());
uint8_t alpha=uint8_t(util::lerp(0.f,255.f,m.F(A::TARGET_TIMER)/ConfigFloat("Interaction Display Ease in Timer")));
game->view.DrawShadowStringPropDecal(m.GetPos()-vf2d{0,12}-nameTextSize/2.f,m.GetName(),{255,255,0},{0,0,0});
game->KEY_CONFIRM.DrawInput(m.GetPos()+vf2d{ConfigFloatArr("Interaction Display Offset",0),ConfigFloatArr("Interaction Display Offset",1)},"Interact",alpha);
});
}
m.phase=1;
@ -63,7 +69,8 @@ void Monster::STRATEGY::NPC(Monster&m,float fElapsedTime,std::string strategy){
Menu::OpenMenu(MenuType::BLACKSMITH);
}else
if(m.npcData.function=="PotionCrafting"){
Menu::OpenMenu(MenuType::CRAFT_CONSUMABLE);
Menu::OpenMenu(MenuType::SHERMAN);
Component<MenuComponent>(SHERMAN,"Consumable Crafting Button")->SetGrayedOut(!Unlock::IsUnlocked("NPCs.Sherman.Potion Crafting Unlock Condition"_S));
}else
if(m.npcData.function=="TravelingMerchant"){
Menu::OpenMenu(MenuType::MERCHANT);

@ -41,10 +41,15 @@ All rights reserved.
#include "GameState.h"
void Menu::InitializeShermanWindow(){
Menu*shermanWindow=CreateMenu(SHERMAN,CENTERED,vi2d{144,120});
Menu*shermanWindow=CreateMenu(SHERMAN,CENTERED,vi2d{144,60});
shermanWindow->ADD("Leave Button",MenuComponent)(geom2d::rect<float>{{-48.f,4.f},{96.f,24.f}},"Leave",MenuType::ENUM_END,[](MenuFuncData data){
shermanWindow->ADD("Leave Button",MenuComponent)(geom2d::rect<float>{{0.f,4.f},{144.f,24.f}},"Leave",MenuType::ENUM_END,[](MenuFuncData data){
GameState::ChangeState(States::OVERWORLD_MAP,0.3f);
return true;
},vf2d{2.f,2.f})END;
},vf2d{2.f,2.f},ButtonAttr::FIT_TO_LABEL)END;
shermanWindow->ADD("Consumable Crafting Button",MenuComponent)(geom2d::rect<float>{{0.f,32.f},{144.f,24.f}},"Consumable Crafting",MenuType::ENUM_END,[](MenuFuncData data){
Menu::OpenMenu(CRAFT_CONSUMABLE);
return true;
},vf2d{2.f,2.f},ButtonAttr::FIT_TO_LABEL)END
->SetGrayedOut(true);
}

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 6578
#define VERSION_BUILD 6587
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -26,6 +26,8 @@ NPCs
{
Strategy = NPC
Potion Crafting Unlock Condition = BOSS_1_B
#Size of each animation frame
SheetFrameSize = 24,24

Loading…
Cancel
Save