Open Binding panel when controller configuration is selected. Move steam API initialization to the beginning of the program's execution. Release Build 8442.

pull/57/head
sigonasr2 8 months ago
parent b9f9d0ceb2
commit 561f403cd2
  1. 54
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 1
      Adventures in Lestoria/Key.h
  4. 6
      Adventures in Lestoria/SettingsWindow.cpp
  5. 2
      Adventures in Lestoria/Version.h
  6. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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;i<Input::controllerCount;i++){
SteamInput()->ActivateActionSet(Input::steamControllers[i],actionSetHandle);

@ -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{

@ -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.

@ -217,7 +217,11 @@ void Menu::InitializeSettingsWindow(){
settingsList->ADD("Controller Bindings Button",MenuComponent)(geom2d::rect<float>{{28,148.f},vf2d{settingsList->rect.size.x-12-56,24}},"Controller Bindings",[&](MenuFuncData data){
ChangeKeybindDisplayType(CONTROLLER);
Component<MenuLabel>(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;

@ -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

Loading…
Cancel
Save