Fix crash when hovering over a blank item loadout slot in the item loadout menu. Tutorial tasks now are only drawn while a stage is being actively played. Tutorial tasks get cleared upon a stage completion. Release Build 8210.

This commit is contained in:
sigonasr2 2024-03-20 02:25:52 -05:00
parent 7a683fffa6
commit 48464e3d8b
9 changed files with 22 additions and 13 deletions

View File

@ -355,7 +355,6 @@ bool AiL::OnUserUpdate(float fElapsedTime){
Audio::Update(); Audio::Update();
GameState::STATE->Draw(this); GameState::STATE->Draw(this);
RenderMenu(); RenderMenu();
Tutorial::Draw();
GameState::STATE->DrawOverlay(this); GameState::STATE->DrawOverlay(this);
RenderFadeout(); RenderFadeout();
LoadingScreen::Draw(); LoadingScreen::Draw();

View File

@ -63,8 +63,10 @@ void Menu::InitializeItemLoadoutWindow(){
return true; return true;
},[](MenuFuncData data){ },[](MenuFuncData data){
std::weak_ptr<MenuItemLoadoutButton>loadoutButton=DYNAMIC_POINTER_CAST<MenuItemLoadoutButton>(data.component); std::weak_ptr<MenuItemLoadoutButton>loadoutButton=DYNAMIC_POINTER_CAST<MenuItemLoadoutButton>(data.component);
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(loadoutButton.lock()->GetItem().lock()->DisplayName()); if(!ISBLANK(loadoutButton.lock()->GetItem())){
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(loadoutButton.lock()->GetItem().lock()->Description()); Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(loadoutButton.lock()->GetItem().lock()->DisplayName());
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(loadoutButton.lock()->GetItem().lock()->Description());
}
return true; return true;
},[](MenuFuncData data){ },[](MenuFuncData data){
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel("");
@ -78,8 +80,10 @@ void Menu::InitializeItemLoadoutWindow(){
return true; return true;
},[](MenuFuncData data){ },[](MenuFuncData data){
std::weak_ptr<MenuItemLoadoutButton>loadoutButton=DYNAMIC_POINTER_CAST<MenuItemLoadoutButton>(data.component); std::weak_ptr<MenuItemLoadoutButton>loadoutButton=DYNAMIC_POINTER_CAST<MenuItemLoadoutButton>(data.component);
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(loadoutButton.lock()->GetItem().lock()->DisplayName()); if(!ISBLANK(loadoutButton.lock()->GetItem())){
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(loadoutButton.lock()->GetItem().lock()->Description()); Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(loadoutButton.lock()->GetItem().lock()->DisplayName());
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(loadoutButton.lock()->GetItem().lock()->Description());
}
return true; return true;
},[](MenuFuncData data){ },[](MenuFuncData data){
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel("");
@ -93,8 +97,10 @@ void Menu::InitializeItemLoadoutWindow(){
return true; return true;
},[](MenuFuncData data){ },[](MenuFuncData data){
std::weak_ptr<MenuItemLoadoutButton>loadoutButton=DYNAMIC_POINTER_CAST<MenuItemLoadoutButton>(data.component); std::weak_ptr<MenuItemLoadoutButton>loadoutButton=DYNAMIC_POINTER_CAST<MenuItemLoadoutButton>(data.component);
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(loadoutButton.lock()->GetItem().lock()->DisplayName()); if(!ISBLANK(loadoutButton.lock()->GetItem())){
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(loadoutButton.lock()->GetItem().lock()->Description()); Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(loadoutButton.lock()->GetItem().lock()->DisplayName());
Component<MenuLabel>(ITEM_LOADOUT,"Item Description")->SetLabel(loadoutButton.lock()->GetItem().lock()->Description());
}
return true; return true;
},[](MenuFuncData data){ },[](MenuFuncData data){
Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel(""); Component<MenuLabel>(ITEM_LOADOUT,"Item Name Label")->SetLabel("");

View File

@ -93,4 +93,5 @@ void State_GameRun::OnUserUpdate(AiL*game){
void State_GameRun::Draw(AiL*game){ void State_GameRun::Draw(AiL*game){
game->RenderWorld(game->GetElapsedTime()); game->RenderWorld(game->GetElapsedTime());
game->RenderHud(); game->RenderHud();
Tutorial::Draw();
} }

View File

@ -44,6 +44,7 @@ All rights reserved.
#include "ProgressBar.h" #include "ProgressBar.h"
#include "SoundEffect.h" #include "SoundEffect.h"
#include "Unlock.h" #include "Unlock.h"
#include "Tutorial.h"
INCLUDE_MONSTER_LIST INCLUDE_MONSTER_LIST
INCLUDE_game INCLUDE_game
@ -85,6 +86,7 @@ void State_LevelComplete::OnStateChange(GameState*prevState){
game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP()); game->GetPlayer()->AddXP(game->GetPlayer()->GetAccumulatedXP());
Tutorial::GiveUpCurrentTask();
game->GetPlayer()->SetState(State::NORMAL); game->GetPlayer()->SetState(State::NORMAL);
Menu::OpenMenu(LEVEL_COMPLETE); Menu::OpenMenu(LEVEL_COMPLETE);
}; };

View File

@ -13,7 +13,3 @@ Toggle for displaying error messages
Equip Gear using Start menu tutorial Equip Gear using Start menu tutorial
Steam Controller SDK Steam Controller SDK
Add in vsync system option Add in vsync system option
Hint text does not appear except during actual gameplay.
Terrain Collision Boxes

View File

@ -127,3 +127,7 @@ void Tutorial::Draw(){
const bool Tutorial::TaskIsComplete(TutorialTaskName task){ const bool Tutorial::TaskIsComplete(TutorialTaskName task){
return taskList.at(task)->IsComplete(); return taskList.at(task)->IsComplete();
} }
void Tutorial::GiveUpCurrentTask(){
SetNextTask(TutorialTaskName::NONE);
}

View File

@ -91,6 +91,7 @@ public:
static void SetNextTask(TutorialTaskName task); static void SetNextTask(TutorialTaskName task);
static TutorialTask&GetTask(TutorialTaskName task); static TutorialTask&GetTask(TutorialTaskName task);
static void CompleteTask(TutorialTaskName task); static void CompleteTask(TutorialTaskName task);
static void GiveUpCurrentTask();
private: private:
static TutorialTaskName currentTaskState; static TutorialTaskName currentTaskState;
static std::map<TutorialTaskName,std::unique_ptr<TutorialTask>>taskList; static std::map<TutorialTaskName,std::unique_ptr<TutorialTask>>taskList;

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 5 #define VERSION_MINOR 5
#define VERSION_PATCH 1 #define VERSION_PATCH 1
#define VERSION_BUILD 8208 #define VERSION_BUILD 8210
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a