diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 32518cd5..c598492a 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -77,6 +77,7 @@ All rights reserved. #endif #include "GameSettings.h" #include "LoadingScreen.h" +#include "Tutorial.h" INCLUDE_EMITTER_LIST INCLUDE_ITEM_CATEGORIES @@ -338,10 +339,12 @@ bool AiL::OnUserUpdate(float fElapsedTime){ } LoadingScreen::Update(); InputListener::Update(); + Tutorial::Update(); Audio::Update(); RenderWorld(GetElapsedTime()); GameState::STATE->Draw(this); RenderMenu(); + Tutorial::Draw(); GameState::STATE->DrawOverlay(this); RenderFadeout(); LoadingScreen::Draw(); diff --git a/Adventures in Lestoria/ItemLoadoutWindow.cpp b/Adventures in Lestoria/ItemLoadoutWindow.cpp index 684346c2..8079bf36 100644 --- a/Adventures in Lestoria/ItemLoadoutWindow.cpp +++ b/Adventures in Lestoria/ItemLoadoutWindow.cpp @@ -52,7 +52,8 @@ void Menu::InitializeItemLoadoutWindow(){ itemLoadoutWindow->ADD("Loadout Label",MenuLabel)(geom2d::rect{{0,24},{itemLoadoutWindowWidth,24}},"Setup Item Loadout",2,ComponentAttr::SHADOW|ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE)END; - itemLoadoutWindow->ADD("Loadout Description Label",MenuLabel)(geom2d::rect{{0,48},{itemLoadoutWindowWidth,24}},"Bring up to 3 items with you.",1,ComponentAttr::SHADOW)END; + itemLoadoutWindow->ADD("Loadout Map Name Label",MenuLabel)(geom2d::rect{{0,48},{itemLoadoutWindowWidth,24}},std::format("About to Enter: {}",State_OverworldMap::GetCurrentConnectionPoint().name),1,ComponentAttr::SHADOW)END; + itemLoadoutWindow->ADD("Loadout Description Label",MenuLabel)(geom2d::rect{{0,58},{itemLoadoutWindowWidth,24}},"Bring up to 3 items with you.",1,ComponentAttr::SHADOW)END; float buttonBorderPadding=64; diff --git a/Adventures in Lestoria/OverworldMapLevelWindow.cpp b/Adventures in Lestoria/OverworldMapLevelWindow.cpp index 03c633b0..1447b92f 100644 --- a/Adventures in Lestoria/OverworldMapLevelWindow.cpp +++ b/Adventures in Lestoria/OverworldMapLevelWindow.cpp @@ -60,11 +60,11 @@ void Menu::InitializeOverworldMapLevelWindow(){ levelSelectWindow->ADD("Encounters Label",MenuLabel)(geom2d::rect{{0,52},{windowSize.x-1,12}},"Encounters:",1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; levelSelectWindow->ADD("Spawns List",EncountersSpawnListScrollableWindowComponent)(geom2d::rect{{1,64},{windowSize.x-2,84}},ComponentAttr::BACKGROUND)END; - levelSelectWindow->ADD("Change Loadout Button",MenuComponent)(geom2d::rect{{0,152},{windowSize.x-1,12}},"Change Loadout",[](MenuFuncData data){ + levelSelectWindow->ADD("Enter Button",MenuComponent)(geom2d::rect{{0,166},{windowSize.x-1,16}},"Enter",[](MenuFuncData data){ + Component(ITEM_LOADOUT,"Loadout Map Name Label")->SetLabel(std::format("About to Enter: {}",State_OverworldMap::GetCurrentConnectionPoint().name)); Menu::OpenMenu(ITEM_LOADOUT); return true; })END; - levelSelectWindow->ADD("Enter Button",MenuComponent)(geom2d::rect{{0,166},{windowSize.x-1,16}},"Enter",[](MenuFuncData data){State_OverworldMap::StartLevel();return true;})END; #pragma region Keyboard Navigation Rules levelSelectWindow->SetupKeyboardNavigation( @@ -78,9 +78,6 @@ void Menu::InitializeOverworldMapLevelWindow(){ Component(type,"Enter Button")->Click(); } }}}, - {{game->KEY_CHANGE_LOADOUT},{"Change Loadout",[](MenuType type){ - Component(type,"Change Loadout Button")->Click(); - }}}, {{game->KEY_SHOULDER,Pressed},{"Scroll Encounters",[](MenuType type){ Component(type,"Spawns List")->Scroll(-1.0f); }}}, diff --git a/Adventures in Lestoria/SaveFile.h b/Adventures in Lestoria/SaveFile.h index 08dc109d..c91cbe10 100644 --- a/Adventures in Lestoria/SaveFile.h +++ b/Adventures in Lestoria/SaveFile.h @@ -37,7 +37,7 @@ All rights reserved. #pragma endregion #pragma once -#undef GetSaveFileName(); //Stupid Windows +#undef GetSaveFileName //Stupid Windows namespace SaveFileOperation{ enum Operation{ diff --git a/Adventures in Lestoria/Tutorial.cpp b/Adventures in Lestoria/Tutorial.cpp index 7f270d2e..ce8ce3aa 100644 --- a/Adventures in Lestoria/Tutorial.cpp +++ b/Adventures in Lestoria/Tutorial.cpp @@ -43,7 +43,6 @@ TutorialTaskName Tutorial::currentTaskState=TutorialTaskName::CHANGE_LOADOUT; void Tutorial::Initialize(){ using enum TutorialTaskName; #define CREATETASK(enum,class) taskList.insert(enum,std::make_unique()); - CREATETASK(CHANGE_LOADOUT,ChangeLoadoutTask); CREATETASK(SET_LOADOUT_ITEM,SetLoadoutItemTask); CREATETASK(MOVE_AROUND,MoveAroundTask); ResetTasks(); @@ -88,7 +87,7 @@ void Tutorial::Update(){ } } -void Tutorial::Draw(){} +void Tutorial::Draw()const{} const bool Tutorial::TaskIsComplete(TutorialTaskName task){ return taskList.at(task)->IsComplete(); diff --git a/Adventures in Lestoria/Tutorial.h b/Adventures in Lestoria/Tutorial.h index 1eb2d410..27a59275 100644 --- a/Adventures in Lestoria/Tutorial.h +++ b/Adventures in Lestoria/Tutorial.h @@ -43,7 +43,6 @@ All rights reserved. INCLUDE_game enum class TutorialTaskName{ - CHANGE_LOADOUT, SET_LOADOUT_ITEM, MOVE_AROUND, }; @@ -59,6 +58,7 @@ class TutorialTask{ //Actions that occur when this task is reset/locked. DO NOT CALL DIRECTLY, USE _Initialize()! virtual void Initialize(); virtual void Update(); + virtual void Draw()const; //Returns true when the task has detected it is completed. virtual bool CompleteCondition()=0; //Action occurs when the task completes. @@ -78,19 +78,6 @@ private: static std::unordered_map>taskList; }; -class ChangeLoadoutTask:protected TutorialTask{ - inline ChangeLoadoutTask():TutorialTask(){}; - virtual inline void Initialize()override final{ - Component(OVERWORLD_LEVEL_SELECT,"Enter Button")->SetGrayedOut(true); - } - virtual inline bool CompleteCondition()override final{ - return GameState::STATE==GameState::states[States::GAME_RUN]; - } - virtual inline void OnComplete()override final{ - Component(OVERWORLD_LEVEL_SELECT,"Enter Button")->SetGrayedOut(false); - } -}; - class SetLoadoutItemTask:protected TutorialTask{ inline SetLoadoutItemTask():TutorialTask(){}; virtual inline void Initialize()override final{ @@ -110,13 +97,13 @@ class SetLoadoutItemTask:protected TutorialTask{ }; class MoveAroundTask:protected TutorialTask{ - vf2d initialPlayerPos={}; + vf2d initialPlayerPos=vf2d{}; inline MoveAroundTask():TutorialTask(){}; virtual inline void Initialize()override final{ - initialPlayerPos={}; + initialPlayerPos=vf2d{}; } virtual inline void Update()override final{ - if(!LoadingScreen::loading&&initialPlayerPos=={}){ + if(!LoadingScreen::loading&&initialPlayerPos==vf2d{}){ initialPlayerPos=game->GetPlayer()->GetPos(); } }