diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
index 85f3eee8..390488e8 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj
@@ -1170,7 +1170,11 @@
-
+
+
+
+
+
diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
index 437e4341..2e952113 100644
--- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
+++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
@@ -1346,7 +1346,19 @@
Documentation\Mechanics
-
+
+ Configurations\Story
+
+
+ Configurations\Story
+
+
+ Configurations\Story
+
+
+ Configurations\Story
+
+
Configurations\Story
diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp
index 57371129..aec06d78 100644
--- a/Adventures in Lestoria/AdventuresInLestoria.cpp
+++ b/Adventures in Lestoria/AdventuresInLestoria.cpp
@@ -437,7 +437,7 @@ bool AiL::DownPressed(){
}
void AiL::HandleUserInput(float fElapsedTime){
- if(!Menu::stack.empty())return; //A window being opened means there's no user input allowed.
+ if(!Menu::stack.empty()||GameState::STATE==GameState::states[States::DIALOG])return; //A window being opened means there's no user input allowed.
if(GetKey(SCROLL).bPressed)displayHud=!displayHud;
bool setIdleAnimation=true;
diff --git a/Adventures in Lestoria/Chapter 2.txt b/Adventures in Lestoria/Chapter 2.txt
deleted file mode 100644
index 15ed0929..00000000
--- a/Adventures in Lestoria/Chapter 2.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-===ARTIFICER_INTRO===
-{BACKGROUND commercial_assets/Forest Clearing Campsite_Day.png}
-
-[Artificer]
-Hello adventurer! Welcome to my artificing station! I have not met you yet, may I have the pleasure of knowing your name?
-
-[You]
-Hello, my name is [You].
-
-[Artificer]
-Excellent! Nice to meet you, [You]. At my station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
-
-Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
-
-This should let you get some use out of all those extra rings you're carrying around, eh?
-
-[You]
-Great, I think I could make good use of this. Thank you.
-
-===ARTIFICER_HELP===
-[Artificer]
-At this station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
-
-Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
-
-You can make use of those extra rings you have been piling up!
\ No newline at end of file
diff --git a/Adventures in Lestoria/GameState.cpp b/Adventures in Lestoria/GameState.cpp
index c43978c5..1f824c30 100644
--- a/Adventures in Lestoria/GameState.cpp
+++ b/Adventures in Lestoria/GameState.cpp
@@ -49,6 +49,8 @@ INCLUDE_game
#define NEW_STATE(state,class) GameState::states[state]=NEW class();
+States::State GameState::currentState;
+
void GameState::Initialize(){
NEW_STATE(States::GAME_RUN,State_GameRun);
NEW_STATE(States::OVERWORLD_MAP,State_OverworldMap);
@@ -62,6 +64,7 @@ void GameState::Initialize(){
void GameState::_ChangeState(States::State newState){
GameState*prevState=STATE;
+ currentState=newState;
if(!states.count(newState)){
ERR("WARNING! State not defined for state "<states;
@@ -76,4 +78,5 @@ public:
virtual void GetAnyMouseRelease(int32_t mouseButton);
static void ChangeState(States::State newState,float fadeOutDuration=0,uint8_t mosaicEffect=1U);
virtual void OnLevelLoad()=0;
+ static States::State GetCurrentState();
};
\ No newline at end of file
diff --git a/Adventures in Lestoria/Menu.cpp b/Adventures in Lestoria/Menu.cpp
index 45913cdb..d29d2ef0 100644
--- a/Adventures in Lestoria/Menu.cpp
+++ b/Adventures in Lestoria/Menu.cpp
@@ -179,7 +179,6 @@ void Menu::MenuSelect(AiL*game){
}
void Menu::Update(AiL*game){
-
if(!draggingComponent){
HoverMenuSelect(game);
}
diff --git a/Adventures in Lestoria/NPC.cpp b/Adventures in Lestoria/NPC.cpp
index 4a340dee..53b06421 100644
--- a/Adventures in Lestoria/NPC.cpp
+++ b/Adventures in Lestoria/NPC.cpp
@@ -67,7 +67,7 @@ void Monster::STRATEGY::NPC(Monster&m,float fElapsedTime,std::string strategy){
float distFromPlayer=geom2d::line(m.GetPos(),game->GetPlayer()->GetPos()).length();
if(distFromPlayerKEY_CONFIRM.Released()&&Menu::stack.size()==0){
+ if(GameState::STATE!=GameState::states[States::DIALOG]&&game->KEY_CONFIRM.Released()&&Menu::stack.size()==0){
if(m.npcData.function=="Blacksmith"){
Menu::OpenMenu(MenuType::BLACKSMITH);
//First reset all items displayed in the blacksmith's shop (showing only our equipment.)
diff --git a/Adventures in Lestoria/State_Dialog.cpp b/Adventures in Lestoria/State_Dialog.cpp
index 97d073b8..107d753d 100644
--- a/Adventures in Lestoria/State_Dialog.cpp
+++ b/Adventures in Lestoria/State_Dialog.cpp
@@ -41,15 +41,15 @@ All rights reserved.
#include "AdventuresInLestoria.h"
void State_Dialog::OnStateChange(GameState*prevState){
- Menu::CloseAllMenus();
+ if(Menu::IsMenuOpen())Menu::CloseAllMenus();
};
void State_Dialog::OnLevelLoad(){}
void State_Dialog::OnUserUpdate(AiL*game){
- GameState::states[States::GAME_RUN]->OnUserUpdate(game);
+ GameState::states[VisualNovel::novel.previousState]->OnUserUpdate(game);
VisualNovel::novel.Update();
game->ClearTimedOutGarbage();
};
void State_Dialog::Draw(AiL*game){
- GameState::states[States::GAME_RUN]->Draw(game);
+ GameState::states[VisualNovel::novel.previousState]->Draw(game);
VisualNovel::novel.Draw(0U);
};
\ No newline at end of file
diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h
index 16d10478..8fd7ba9d 100644
--- a/Adventures in Lestoria/Version.h
+++ b/Adventures in Lestoria/Version.h
@@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 3
-#define VERSION_BUILD 10402
+#define VERSION_BUILD 10415
#define stringify(a) stringify_(a)
#define stringify_(a) #a
diff --git a/Adventures in Lestoria/VisualNovel.cpp b/Adventures in Lestoria/VisualNovel.cpp
index 7b5e8885..576dfe2a 100644
--- a/Adventures in Lestoria/VisualNovel.cpp
+++ b/Adventures in Lestoria/VisualNovel.cpp
@@ -193,6 +193,7 @@ void VisualNovel::Reset(){
commandIndex=0;
}
void VisualNovel::LoadDialog(std::string dialogName,std::functiondialogFinishedCallbackFunc){
+ novel.previousState=GameState::GetCurrentState();
novel.dialogFinishedCallbackFunc=dialogFinishedCallbackFunc;
novel.storyLevel=dialogName;
novel.Reset();
@@ -218,7 +219,7 @@ void VisualNovel::LoadVisualNovel(std::string storyLevelName){
}
void VisualNovel::Update(){
Audio::SetBGMPitch(audioPitch);
- if(transitionTime==0&&game->KEY_CONFIRM.Pressed()){
+ if(transitionTime==0&&game->KEY_CONFIRM.Released()){
activeText=U"";
novel.ExecuteNextCommand();
}
@@ -236,7 +237,9 @@ void VisualNovel::ExecuteNextCommand(){
}else{
if(GameState::STATE==GameState::states[States::DIALOG]){
Reset();
- GameState::STATE=GameState::states[States::GAME_RUN];
+ Menu::themeSelection=novel.prevTheme;
+ GameState::STATE=GameState::states[novel.previousState];
+ GameState::currentState=novel.previousState;
dialogFinishedCallbackFunc();
}else{
if(game->GetCurrentMapName()=="NPCs.Greg.Camp Notification Unlock Condition"_S&&
diff --git a/Adventures in Lestoria/VisualNovel.h b/Adventures in Lestoria/VisualNovel.h
index a1803b3a..c1dfbdb6 100644
--- a/Adventures in Lestoria/VisualNovel.h
+++ b/Adventures in Lestoria/VisualNovel.h
@@ -41,6 +41,7 @@ All rights reserved.
#include "safemap.h"
#include
#include "olcPGEX_TTF.h"
+#include "GameState.h"
class VisualNovel;
@@ -180,6 +181,7 @@ public:
private:
static std::setgraphicsToLoad;
static safemap>>storyLevelData;
+ States::State previousState{};
static VisualNovel novel;
VisualNovel();
diff --git a/Adventures in Lestoria/assets/config/story/Chapter 2.txt b/Adventures in Lestoria/assets/config/story/Chapter 2.txt
index e69de29b..15ed0929 100644
--- a/Adventures in Lestoria/assets/config/story/Chapter 2.txt
+++ b/Adventures in Lestoria/assets/config/story/Chapter 2.txt
@@ -0,0 +1,26 @@
+===ARTIFICER_INTRO===
+{BACKGROUND commercial_assets/Forest Clearing Campsite_Day.png}
+
+[Artificer]
+Hello adventurer! Welcome to my artificing station! I have not met you yet, may I have the pleasure of knowing your name?
+
+[You]
+Hello, my name is [You].
+
+[Artificer]
+Excellent! Nice to meet you, [You]. At my station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
+
+Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
+
+This should let you get some use out of all those extra rings you're carrying around, eh?
+
+[You]
+Great, I think I could make good use of this. Thank you.
+
+===ARTIFICER_HELP===
+[Artificer]
+At this station you have the ability to refine and fix up imperfect jewelry discovered while exploring!
+
+Disassemble rings that are undesirable to you and retrieve fragments of them, then use the Refine station to empower your equipment further!
+
+You can make use of those extra rings you have been piling up!
\ No newline at end of file
diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe
index ce61df1f..36c99ab4 100644
Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ