Enable Keyboard input overlay when using Steam Big Picture. Enable Fullscreen automatically when using Steam Big Picture. Release Build 8394.

pull/57/head
sigonasr2 8 months ago
parent c291aff00a
commit b4c9b29be4
  1. 8
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 6
      Adventures in Lestoria/Adventures in Lestoria.vcxproj.filters
  3. 8
      Adventures in Lestoria/AdventuresInLestoria.cpp
  4. 4
      Adventures in Lestoria/AdventuresInLestoria.h
  5. 9
      Adventures in Lestoria/ClassSelectionWindow.cpp
  6. 55
      Adventures in Lestoria/SteamKeyboardCallbackHandler.cpp
  7. 47
      Adventures in Lestoria/SteamKeyboardCallbackHandler.h
  8. 4
      Adventures in Lestoria/TODO.txt
  9. 2
      Adventures in Lestoria/Version.h
  10. BIN
      x64/Release/Adventures in Lestoria.exe

@ -514,6 +514,10 @@
<SubType> <SubType>
</SubType> </SubType>
</ClInclude> </ClInclude>
<ClInclude Include="SteamKeyboardCallbackHandler.h">
<SubType>
</SubType>
</ClInclude>
<ClInclude Include="steam\isteamapps.h" /> <ClInclude Include="steam\isteamapps.h" />
<ClInclude Include="steam\isteamappticket.h" /> <ClInclude Include="steam\isteamappticket.h" />
<ClInclude Include="steam\isteamclient.h" /> <ClInclude Include="steam\isteamclient.h" />
@ -807,6 +811,10 @@
<SubType> <SubType>
</SubType> </SubType>
</ClCompile> </ClCompile>
<ClCompile Include="SteamKeyboardCallbackHandler.cpp">
<SubType>
</SubType>
</ClCompile>
<ClCompile Include="SwordSlash.cpp"> <ClCompile Include="SwordSlash.cpp">
<SubType> <SubType>
</SubType> </SubType>

@ -621,6 +621,9 @@
<ClInclude Include="steam\steamuniverse.h"> <ClInclude Include="steam\steamuniverse.h">
<Filter>Header Files\steam</Filter> <Filter>Header Files\steam</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="SteamKeyboardCallbackHandler.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="Player.cpp"> <ClCompile Include="Player.cpp">
@ -989,6 +992,9 @@
<ClCompile Include="SwordSlash.cpp"> <ClCompile Include="SwordSlash.cpp">
<Filter>Source Files\Effects</Filter> <Filter>Source Files\Effects</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="SteamKeyboardCallbackHandler.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="cpp.hint" /> <None Include="cpp.hint" />

@ -79,6 +79,7 @@ All rights reserved.
#include "GameSettings.h" #include "GameSettings.h"
#include "LoadingScreen.h" #include "LoadingScreen.h"
#include "Tutorial.h" #include "Tutorial.h"
#include "SteamKeyboardCallbackHandler.h"
INCLUDE_EMITTER_LIST INCLUDE_EMITTER_LIST
INCLUDE_ITEM_CATEGORIES INCLUDE_ITEM_CATEGORIES
@ -2660,7 +2661,11 @@ int main()
windowPosConf={loadSystemFile["Window Pos"].GetInt(0),loadSystemFile["Window Pos"].GetInt(1)}; windowPosConf={loadSystemFile["Window Pos"].GetInt(0),loadSystemFile["Window Pos"].GetInt(1)};
} }
if(loadSystemFile.HasProperty("Window Size"))windowSizeConf={loadSystemFile["Window Size"].GetInt(0),loadSystemFile["Window Size"].GetInt(1)}; if(loadSystemFile.HasProperty("Window Size"))windowSizeConf={loadSystemFile["Window Size"].GetInt(0),loadSystemFile["Window Size"].GetInt(1)};
size_t requiredSize;
getenv_s( &requiredSize, NULL, 0, "SteamTenfoot");
if(loadSystemFile.HasProperty("Fullscreen"))fullscreenConf=loadSystemFile["Fullscreen"].GetBool(); if(loadSystemFile.HasProperty("Fullscreen"))fullscreenConf=loadSystemFile["Fullscreen"].GetBool();
if(requiredSize>0)fullscreenConf=true;
} }
#pragma endregion #pragma endregion
@ -3791,6 +3796,9 @@ bool AiL::Steam_Init(){
SteamUtils()->SetWarningMessageHook([](int severity,const char*message){ SteamUtils()->SetWarningMessageHook([](int severity,const char*message){
std::cout<<std::format("STEAM[{}]: {}",severity,std::string(message))<<std::endl; std::cout<<std::format("STEAM[{}]: {}",severity,std::string(message))<<std::endl;
}); });
if(steamKeyboardCallbackListener==nullptr){
steamKeyboardCallbackListener=new SteamKeyboardCallbackHandler();
}
} }
if(SteamInput()!=nullptr){ if(SteamInput()!=nullptr){
SteamInput()->Init(false); SteamInput()->Init(false);

@ -57,6 +57,9 @@ All rights reserved.
#include "DynamicCounter.h" #include "DynamicCounter.h"
#include "UndefKeys.h" #include "UndefKeys.h"
class SteamKeyboardCallbackHandler;
#define CreateBullet(type) BULLET_LIST.push_back(std::make_unique<type>(type #define CreateBullet(type) BULLET_LIST.push_back(std::make_unique<type>(type
#define EndBullet )); #define EndBullet ));
@ -185,6 +188,7 @@ private:
::discord::Result SetupDiscord(); ::discord::Result SetupDiscord();
#endif #endif
Audio audioEngine; Audio audioEngine;
SteamKeyboardCallbackHandler*steamKeyboardCallbackListener=nullptr;
public: public:
AiL(); AiL();
bool OnUserCreate() override; bool OnUserCreate() override;

@ -45,6 +45,9 @@ All rights reserved.
#include "SaveFileNameButton.h" #include "SaveFileNameButton.h"
#include "TextEntryLabel.h" #include "TextEntryLabel.h"
#include "Checkbox.h" #include "Checkbox.h"
#ifndef __EMSCRIPTEN__
#include <isteamutils.h>
#endif
INCLUDE_game INCLUDE_game
using A=Attribute; using A=Attribute;
@ -68,6 +71,12 @@ void Menu::InitializeClassSelectionWindow(){
Component<TextEntryLabel>(SAVE_FILE_NAME,"Save File Name Text Entry")->SetInput(std::string(SaveFile::GetSaveFileName())); Component<TextEntryLabel>(SAVE_FILE_NAME,"Save File Name Text Entry")->SetInput(std::string(SaveFile::GetSaveFileName()));
game->TextEntryEnable(true); game->TextEntryEnable(true);
Menu::OpenMenu(SAVE_FILE_NAME); Menu::OpenMenu(SAVE_FILE_NAME);
vf2d textboxWindowPos=data.component.lock()->rect.pos*game->GetPixelSize();
vf2d textboxWindowSize=data.component.lock()->rect.size*game->GetPixelSize();
if(SteamUtils()){
SteamUtils()->ShowGamepadTextInput(k_EGamepadTextInputModeNormal,k_EGamepadTextInputLineModeSingleLine,"Character Name:",16U,std::string(SaveFile::GetSaveFileName()).c_str());
}
return true; return true;
},vf2d{2.f,2.f})END; },vf2d{2.f,2.f})END;

@ -0,0 +1,55 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#include "SteamKeyboardCallbackHandler.h"
void SteamKeyboardCallbackHandler::TextEntryComplete( GamepadTextInputDismissed_t* pCallback ){
if(SteamUtils()){
if(pCallback->m_bSubmitted){
char enteredText[17];
SteamUtils()->GetEnteredGamepadTextInput(enteredText,16);
Component<TextEntryLabel>(SAVE_FILE_NAME,"Save File Name Text Entry")->SetInput(std::string(enteredText));
if(std::string(enteredText).length()>0){
Component<MenuComponent>(SAVE_FILE_NAME,"Continue Button")->SetGrayedOut(false);
Component<MenuComponent>(SAVE_FILE_NAME,"Continue Button")->Click();
}else{
Component<MenuComponent>(SAVE_FILE_NAME,"Back Button")->Click();
}
}else Component<MenuComponent>(SAVE_FILE_NAME,"Back Button")->Click();
}
};

@ -0,0 +1,47 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#pragma once
#ifndef __EMSCRIPTEN__
#include <steam_api.h>
#endif
#include <string>
#include "TextEntryLabel.h"
class SteamKeyboardCallbackHandler{
STEAM_CALLBACK(SteamKeyboardCallbackHandler,TextEntryComplete,GamepadTextInputDismissed_t);
};

@ -16,10 +16,6 @@ Steam Rich Presence
Add in vsync system option Add in vsync system option
Remove Unlock All Button Remove Unlock All Button
Fix scaling on some UI equip windows.
When your game wants keyboard input (e.g. when naming avatars), you use the API to automatically bring up the text entry UI.
Start your game in fullscreen by default when the user is running Steam Big Picture (the "SteamTenfoot" environment variable will be set) Start your game in fullscreen by default when the user is running Steam Big Picture (the "SteamTenfoot" environment variable will be set)
Sword attack should linger Sword attack should linger

@ -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 8369 #define VERSION_BUILD 8394
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save