Add tutorial button to use into the center of the display string instead of the beginning for clarity. Release Build 8472.

This commit is contained in:
sigonasr2 2024-03-27 00:35:38 -05:00
parent daa90538ad
commit 18bfa4a26b
7 changed files with 29 additions and 8 deletions

View File

@ -2700,6 +2700,7 @@ bool Steam_Init(){
int main() int main()
{ {
if(PACK_KEY=="INSERT_PACK_KEY_HERE")ERR("ERROR! Starting the game with the default pack ID is not allowed!")
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it. if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it.
if(Steam_Init()){ if(Steam_Init()){

View File

@ -584,7 +584,7 @@ std::string InputGroup::GetDisplayName(){
return combinationDisplay; return combinationDisplay;
} }
void InputGroup::DrawInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,InputType type,vf2d textScale)const{ void InputGroup::DrawInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,InputType type,vf2d textScale,const std::string_view preDisplayText)const{
std::vector<Input>displayKeys; std::vector<Input>displayKeys;
auto OriginalGameIcon=[](std::optional<Input>input)->bool{ auto OriginalGameIcon=[](std::optional<Input>input)->bool{
@ -627,8 +627,28 @@ void InputGroup::DrawInput(const std::variant<AiL*const,TileTransformedView*cons
} }
} }
vf2d descriptionTextSize=game->GetTextSizeProp(displayText); vf2d preDescriptionTextSize=game->GetTextSizeProp(preDisplayText)*textScale;
vf2d offset=-((buttonImgSize+descriptionTextSize)/2.f); vf2d descriptionTextSize=game->GetTextSizeProp(displayText)*textScale;
vf2d offset=-((buttonImgSize+descriptionTextSize)/2.f)-preDescriptionTextSize/2.f;
#pragma region Render Pre-Display Text
#pragma region Render Macro
#define Render(rendererType) \
std::get<rendererType*const>(renderer)->DrawShadowStringPropDecal(pos+offset,preDisplayText,{255,255,255,alpha},{0,0,0,alpha},textScale);
#pragma endregion
if(std::holds_alternative<AiL*const>(renderer)){
Render(AiL);
}else
if(std::holds_alternative<TileTransformedView*const>(renderer)){
Render(TileTransformedView);
}else
if(std::holds_alternative<ViewPort*const>(renderer)){
Render(ViewPort);
}else ERR("Could not find proper renderer for rendering Inputs!");
offset.x+=preDescriptionTextSize.x;
#pragma endregion
for(size_t index=0;auto&button:buttonImgs){ for(size_t index=0;auto&button:buttonImgs){
if(std::holds_alternative<Decal*>(button)){ if(std::holds_alternative<Decal*>(button)){
Decal*img=std::get<Decal*>(button); Decal*img=std::get<Decal*>(button);

View File

@ -182,7 +182,7 @@ public:
//Draws an input display with accompanying text centered at given position. //Draws an input display with accompanying text centered at given position.
void DrawPrimaryInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha)const; void DrawPrimaryInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha)const;
void DrawPrimaryInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,const InputType type,vf2d textScale={1.f,1.f})const; void DrawPrimaryInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,const InputType type,vf2d textScale={1.f,1.f})const;
void DrawInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,const InputType type,vf2d textScale={1.f,1.f})const; void DrawInput(const std::variant<AiL*const,TileTransformedView*const,ViewPort*const>renderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,const InputType type,vf2d textScale={1.f,1.f},const std::string_view preDisplayText="")const;
const std::optional<Input>GetPrimaryKey(InputType type)const; const std::optional<Input>GetPrimaryKey(InputType type)const;
}; };

View File

@ -346,12 +346,12 @@ private:
virtual inline void Draw()const override final{ virtual inline void Draw()const override final{
if(Input::UsingGamepad()){ if(Input::UsingGamepad()){
STEAMINPUT( STEAMINPUT(
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"Open the #FFCF0CCharacter#FFFFFF menu and equip your new gear.",180,InputType::STEAM); startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"to equip your new gear.",255,InputType::STEAM,{0.85f,1.f},"Open the #FFCF0CCharacter#FFFFFF menu with ");
)else{ )else{
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"Open the #FFCF0CCharacter#FFFFFF menu and equip your new gear.",180,InputType::CONTROLLER); startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"to equip your new gear.",255,InputType::CONTROLLER,{0.85f,1.f},"Open the #FFCF0CCharacter#FFFFFF menu with ");
} }
}else{ }else{
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"Open the #FFCF0CCharacter#FFFFFF menu and equip your new gear.",180,InputType::KEY); startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"to equip your new gear.",255,InputType::KEY,{0.85f,1.f},"Open the #FFCF0CCharacter#FFFFFF menu with ");
} }
} }
}; };

View File

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