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

This commit is contained in:
sigonasr2 2024-03-25 06:32:43 -05:00
parent c291aff00a
commit b4c9b29be4
10 changed files with 138 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -45,6 +45,9 @@ All rights reserved.
#include "SaveFileNameButton.h"
#include "TextEntryLabel.h"
#include "Checkbox.h"
#ifndef __EMSCRIPTEN__
#include <isteamutils.h>
#endif
INCLUDE_game
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()));
game->TextEntryEnable(true);
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;
},vf2d{2.f,2.f})END;

View File

@ -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();
}
};

View File

@ -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);
};

View File

@ -16,10 +16,6 @@ Steam Rich Presence
Add in vsync system option
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)
Sword attack should linger

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_BUILD 8369
#define VERSION_BUILD 8394
#define stringify(a) stringify_(a)
#define stringify_(a) #a