diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 31913010..2b406f3f 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -321,19 +321,21 @@ bool AiL::OnUserCreate(){ #endif State_OverworldMap::SetStageMarker("starting_map_name"_S); + if(SteamInput()!=nullptr){ + SteamInput()->Init(false); + Input::LoadSteamButtonIcons(); + Input::ingameControlsHandle=SteamInput()->GetActionSetHandle("InGameControls"); + } + + if(steamKeyboardCallbackListener==nullptr){ + steamKeyboardCallbackListener=new SteamKeyboardCallbackHandler(); + } utils::datafile::INITIAL_SETUP_COMPLETE=true; ValidateGameStatus(); //Checks to make sure everything has been initialized properly. #ifndef __EMSCRIPTEN__ SetupDiscord(); - if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it. - if(Steam_Init()){ - LOG("Steam API Initialized successfully!"); - }else{ - LOG("Steam API failed to initialize!"); - } - #endif gameInitialized=true; @@ -2650,8 +2652,26 @@ datafiledoubledata AiL::GetDoubleList(std::string key){ return {DATA,key}; } +bool Steam_Init(){ + if(SteamAPI_Init()){ + if(SteamUtils()!=nullptr){ + SteamUtils()->SetWarningMessageHook([](int severity,const char*message){ + LOG(std::format("STEAM[{}]: {}",severity,std::string(message))); + }); + } + return true; + } + return false; +} + int main() { + if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it. + if(Steam_Init()){ + LOG("Steam API Initialized successfully!"); + }else{ + LOG("Steam API failed to initialize!"); + } { AiL demo; @@ -3808,26 +3828,6 @@ int AiL::GetLoadoutSize()const{ return loadout.size(); } -bool AiL::Steam_Init(){ - if(SteamAPI_Init()){ - if(SteamUtils()!=nullptr){ - SteamUtils()->SetWarningMessageHook([](int severity,const char*message){ - LOG(std::format("STEAM[{}]: {}",severity,std::string(message))); - }); - if(steamKeyboardCallbackListener==nullptr){ - steamKeyboardCallbackListener=new SteamKeyboardCallbackHandler(); - } - } - if(SteamInput()!=nullptr){ - SteamInput()->Init(false); - Input::LoadSteamButtonIcons(); - Input::ingameControlsHandle=SteamInput()->GetActionSetHandle("InGameControls"); - } - return true; - } - return false; -} - void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle){ for(int i=0;iActivateActionSet(Input::steamControllers[i],actionSetHandle); diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 269d8475..9c82a0f8 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -309,7 +309,6 @@ public: const bool GameInitialized()const; rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true); void UpdateMonsters(); - bool Steam_Init(); void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle); struct TileGroupData{ diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index ff8c3fda..63e47250 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -99,6 +99,7 @@ class Input{ friend class InputGroup; friend class State_MainMenu; friend class InputHelper; + friend class Menu; friend class AiL; InputType type; int key; //This will be interpreted differently depending on input type. diff --git a/Adventures in Lestoria/SettingsWindow.cpp b/Adventures in Lestoria/SettingsWindow.cpp index affa6e3f..52d55a77 100644 --- a/Adventures in Lestoria/SettingsWindow.cpp +++ b/Adventures in Lestoria/SettingsWindow.cpp @@ -217,7 +217,11 @@ void Menu::InitializeSettingsWindow(){ settingsList->ADD("Controller Bindings Button",MenuComponent)(geom2d::rect{{28,148.f},vf2d{settingsList->rect.size.x-12-56,24}},"Controller Bindings",[&](MenuFuncData data){ ChangeKeybindDisplayType(CONTROLLER); Component(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Controller Mappings"); - Menu::OpenMenu(INPUT_KEY_DISPLAY); + if(SteamInput()){ + SteamInput()->ShowBindingPanel(Input::steamControllers[Input::activeSteamControllerIndex]); + }else{ + Menu::OpenMenu(INPUT_KEY_DISPLAY); + } return true; },vf2d{1.5f,2.f})END; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index fb359c01..e75fd84e 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 0 #define VERSION_PATCH 0 -#define VERSION_BUILD 8427 +#define VERSION_BUILD 8442 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index a92a1b16..64f13a7b 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ