Open Binding panel when controller configuration is selected. Move steam API initialization to the beginning of the program's execution. Release Build 8442.
This commit is contained in:
parent
66cb19abc5
commit
0f2deb5f99
@ -321,19 +321,21 @@ bool AiL::OnUserCreate(){
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
State_OverworldMap::SetStageMarker("starting_map_name"_S);
|
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;
|
utils::datafile::INITIAL_SETUP_COMPLETE=true;
|
||||||
|
|
||||||
ValidateGameStatus(); //Checks to make sure everything has been initialized properly.
|
ValidateGameStatus(); //Checks to make sure everything has been initialized properly.
|
||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
SetupDiscord();
|
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
|
#endif
|
||||||
|
|
||||||
gameInitialized=true;
|
gameInitialized=true;
|
||||||
@ -2650,8 +2652,26 @@ datafiledoubledata AiL::GetDoubleList(std::string key){
|
|||||||
return {DATA,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()
|
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;
|
AiL demo;
|
||||||
|
|
||||||
@ -3808,26 +3828,6 @@ int AiL::GetLoadoutSize()const{
|
|||||||
return loadout.size();
|
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){
|
void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle){
|
||||||
for(int i=0;i<Input::controllerCount;i++){
|
for(int i=0;i<Input::controllerCount;i++){
|
||||||
SteamInput()->ActivateActionSet(Input::steamControllers[i],actionSetHandle);
|
SteamInput()->ActivateActionSet(Input::steamControllers[i],actionSetHandle);
|
||||||
|
@ -309,7 +309,6 @@ public:
|
|||||||
const bool GameInitialized()const;
|
const bool GameInitialized()const;
|
||||||
rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true);
|
rcode LoadResource(Renderable&renderable,std::string_view imgPath,bool filter=false,bool clamp=true);
|
||||||
void UpdateMonsters();
|
void UpdateMonsters();
|
||||||
bool Steam_Init();
|
|
||||||
void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle);
|
void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle);
|
||||||
|
|
||||||
struct TileGroupData{
|
struct TileGroupData{
|
||||||
|
@ -99,6 +99,7 @@ class Input{
|
|||||||
friend class InputGroup;
|
friend class InputGroup;
|
||||||
friend class State_MainMenu;
|
friend class State_MainMenu;
|
||||||
friend class InputHelper;
|
friend class InputHelper;
|
||||||
|
friend class Menu;
|
||||||
friend class AiL;
|
friend class AiL;
|
||||||
InputType type;
|
InputType type;
|
||||||
int key; //This will be interpreted differently depending on input 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){
|
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);
|
ChangeKeybindDisplayType(CONTROLLER);
|
||||||
Component<MenuLabel>(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Controller Mappings");
|
Component<MenuLabel>(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Controller Mappings");
|
||||||
|
if(SteamInput()){
|
||||||
|
SteamInput()->ShowBindingPanel(Input::steamControllers[Input::activeSteamControllerIndex]);
|
||||||
|
}else{
|
||||||
Menu::OpenMenu(INPUT_KEY_DISPLAY);
|
Menu::OpenMenu(INPUT_KEY_DISPLAY);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
},vf2d{1.5f,2.f})END;
|
},vf2d{1.5f,2.f})END;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 8427
|
#define VERSION_BUILD 8442
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user