Adjustments to order of entering a stage

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
mac-build
sigonasr2, Sig, Sigo 9 months ago
parent 678f10ebb1
commit 65587bed88
  1. 3
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 3
      Adventures in Lestoria/ItemLoadoutWindow.cpp
  3. 7
      Adventures in Lestoria/OverworldMapLevelWindow.cpp
  4. 2
      Adventures in Lestoria/SaveFile.h
  5. 3
      Adventures in Lestoria/Tutorial.cpp
  6. 21
      Adventures in Lestoria/Tutorial.h

@ -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();

@ -52,7 +52,8 @@ void Menu::InitializeItemLoadoutWindow(){
itemLoadoutWindow->ADD("Loadout Label",MenuLabel)(geom2d::rect<float>{{0,24},{itemLoadoutWindowWidth,24}},"Setup Item Loadout",2,ComponentAttr::SHADOW|ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE)END;
itemLoadoutWindow->ADD("Loadout Description Label",MenuLabel)(geom2d::rect<float>{{0,48},{itemLoadoutWindowWidth,24}},"Bring up to 3 items with you.",1,ComponentAttr::SHADOW)END;
itemLoadoutWindow->ADD("Loadout Map Name Label",MenuLabel)(geom2d::rect<float>{{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<float>{{0,58},{itemLoadoutWindowWidth,24}},"Bring up to 3 items with you.",1,ComponentAttr::SHADOW)END;
float buttonBorderPadding=64;

@ -60,11 +60,11 @@ void Menu::InitializeOverworldMapLevelWindow(){
levelSelectWindow->ADD("Encounters Label",MenuLabel)(geom2d::rect<float>{{0,52},{windowSize.x-1,12}},"Encounters:",1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END;
levelSelectWindow->ADD("Spawns List",EncountersSpawnListScrollableWindowComponent)(geom2d::rect<float>{{1,64},{windowSize.x-2,84}},ComponentAttr::BACKGROUND)END;
levelSelectWindow->ADD("Change Loadout Button",MenuComponent)(geom2d::rect<float>{{0,152},{windowSize.x-1,12}},"Change Loadout",[](MenuFuncData data){
levelSelectWindow->ADD("Enter Button",MenuComponent)(geom2d::rect<float>{{0,166},{windowSize.x-1,16}},"Enter",[](MenuFuncData data){
Component<MenuLabel>(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<float>{{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<MenuComponent>(type,"Enter Button")->Click();
}
}}},
{{game->KEY_CHANGE_LOADOUT},{"Change Loadout",[](MenuType type){
Component<MenuComponent>(type,"Change Loadout Button")->Click();
}}},
{{game->KEY_SHOULDER,Pressed},{"Scroll Encounters",[](MenuType type){
Component<EncountersSpawnListScrollableWindowComponent>(type,"Spawns List")->Scroll(-1.0f);
}}},

@ -37,7 +37,7 @@ All rights reserved.
#pragma endregion
#pragma once
#undef GetSaveFileName(); //Stupid Windows
#undef GetSaveFileName //Stupid Windows
namespace SaveFileOperation{
enum Operation{

@ -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<class>());
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();

@ -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<TutorialTaskName,std::unique_ptr<TutorialTask>>taskList;
};
class ChangeLoadoutTask:protected TutorialTask{
inline ChangeLoadoutTask():TutorialTask(){};
virtual inline void Initialize()override final{
Component<MenuComponent>(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<MenuComponent>(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();
}
}

Loading…
Cancel
Save