Make Leave Area button work in the camp. Fix background music volume not being halved when entering/exiting the pause menu. Release Build 7909.

mac-build
sigonasr2 9 months ago
parent dfa06b688d
commit 091a4a20e1
  1. 15
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 3
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 5
      Adventures in Lestoria/Audio.cpp
  4. 2
      Adventures in Lestoria/Menu.cpp
  5. 7
      Adventures in Lestoria/PauseMenu.cpp
  6. 1
      Adventures in Lestoria/State_GameHub.cpp
  7. 1
      Adventures in Lestoria/State_LevelComplete.cpp
  8. 1
      Adventures in Lestoria/TODO.txt
  9. 2
      Adventures in Lestoria/Version.h
  10. BIN
      x64/Release/Adventures in Lestoria.exe

@ -411,8 +411,6 @@ void AiL::HandleUserInput(float fElapsedTime){
bool setIdleAnimation=true;
bool heldDownMovementKey=false; //Is true when a movement key has been held down.
if(KEY_MENU.Released()){
Audio::UpdateBGMVolume(); //When we open the pause menu, it forces the bgm volume to be halved. So we notify the engine that this is happening.
PauseGame();
Menu::OpenMenu(MenuType::PAUSE);
}
if(player->GetVelocity()==vf2d{0,0}&&player->CanMove()){
@ -3376,14 +3374,11 @@ bool AiL::MenuClicksDeactivated()const{
}
bool AiL::GamePaused(){
return fadeOutDuration>0||disableFadeIn||paused||LoadingScreen::loading;
}
void AiL::PauseGame(){
paused=true;
}
void AiL::ResumeGame(){
paused=false;
return
fadeOutDuration>0
||disableFadeIn
||Menu::IsMenuOpen()&&Menu::stack.front()==Menu::menus[MenuType::PAUSE]/*The pause menu would be the only thing open and would be the menu in front.*/
||LoadingScreen::loading;
}
void AiL::EndGame(){

@ -170,7 +170,6 @@ private:
std::map<std::string,std::vector<::ZoneData>>ZONE_LIST;
float lastMouseMovement=0.f; //Amount of time since the last time the cursor was moved or interacted with.
vi2d lastMousePos={};
bool paused=false;
bool gameInitialized=false;
ResourcePack gamepack;
uint8_t mosaicEffectTransition=1U;
@ -300,8 +299,6 @@ public:
void AddZone(const std::string_view zoneName,const ZoneData&zone);
//Returns the last time the mouse was moved or interacted with.
const float LastMouseMovement()const;
void PauseGame();
void ResumeGame();
const bool GameInitialized()const;
rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true);
void UpdateMonsters();

@ -386,11 +386,8 @@ void Audio::UpdateBGMVolume(){
}
float Audio::GetCalculatedBGMVolume(const float channelVol){
float pauseMult=1.f;
for(Menu*menus:Menu::stack){
if(menus==Menu::menus[MenuType::PAUSE]){
if(Menu::IsMenuOpen()&&Menu::stack.front()==Menu::menus[MenuType::PAUSE]){
pauseMult=0.5f;
break;
}
}
return channelVol*GetBGMVolume()*GetMuteMult()*pauseMult;
}

@ -318,6 +318,7 @@ void Menu::OpenMenu(MenuType menu,bool cover){
if(std::holds_alternative<ButtonName>(returnData)&&std::get<ButtonName>(returnData).length()>0||std::holds_alternative<std::weak_ptr<MenuComponent>>(returnData))menus[menu]->SetSelection(returnData,true);
}
stack.push_back(menus[menu]);
Audio::UpdateBGMVolume(); //If we open the pause menu, it forces the bgm volume to be halved. So we notify the engine that this is happening.
}
void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){
@ -644,6 +645,7 @@ void Menu::CloseMenu(){
}else{
ERR("WARNING! Trying to close out no menu?? Why are we doing this?")
}
Audio::UpdateBGMVolume(); //If we close the pause menu, the bgm volume was halved. So we notify the engine that this is happening so it can correct it.
}
std::pair<MenuType,std::string>Menu::GetMemoryLeakReportInfo(){

@ -53,8 +53,6 @@ void Menu::InitializePauseWindow(){
pauseWindow->ADD("Resume Button",MenuComponent)(geom2d::rect<float>{{6.f,0.f},{84.f,24.f}},"Resume",[](MenuFuncData data){
Menu::CloseMenu();
game->ResumeGame();
Audio::UpdateBGMVolume(); //When we open the pause menu, it forces the bgm volume to be halved. So we notify the engine that this is happening.
return true;
},ButtonAttr::FIT_TO_LABEL)END;
pauseWindow->ADD("Character Button",MenuComponent)(geom2d::rect<float>{{6.f,28.f},{84.f,24.f}},"Character",[](MenuFuncData data){
@ -79,8 +77,11 @@ void Menu::InitializePauseWindow(){
}else{
Component<MenuComponent>(LEVEL_COMPLETE,"Next Button")->Disable();
}
game->ResumeGame();
if(GameState::STATE==GameState::states[States::GAME_HUB]){
GameState::ChangeState(States::OVERWORLD_MAP,0.4f);
}else{
GameState::ChangeState(States::LEVEL_COMPLETE,0.4f);
}
return true;
},ButtonAttr::FIT_TO_LABEL)END;

@ -50,7 +50,6 @@ INCLUDE_MONSTER_LIST
INCLUDE_game
void State_GameHub::OnStateChange(GameState*prevState){
Component<MenuComponent>(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(true);
if(Menu::IsMenuOpen()){
Menu::CloseAllMenus();
}

@ -48,7 +48,6 @@ INCLUDE_MONSTER_LIST
INCLUDE_game
void State_LevelComplete::OnStateChange(GameState*prevState){
game->ResumeGame();
if(xpGainSound==std::numeric_limits<size_t>::max()){
xpGainSound=Audio::LoadAndPlay("xpgain.ogg"_SFX,true);
Audio::Engine().SetVolume(xpGainSound,0.f);

@ -19,7 +19,6 @@ Funny text colors with text color override on blacksmith menu
Toggle for displaying error messages
Make 'Leave Area' in pause menu work for camp
Level Up shows Health + and Atk + Indicators
Ranger Backdash range buff?

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 4
#define VERSION_PATCH 4
#define VERSION_BUILD 7906
#define VERSION_BUILD 7909
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save