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:
@@ -584,7 +584,7 @@ std::string InputGroup::GetDisplayName(){
|
||||
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;
|
||||
|
||||
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 offset=-((buttonImgSize+descriptionTextSize)/2.f);
|
||||
vf2d preDescriptionTextSize=game->GetTextSizeProp(preDisplayText)*textScale;
|
||||
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){
|
||||
if(std::holds_alternative<Decal*>(button)){
|
||||
Decal*img=std::get<Decal*>(button);
|
||||
|
||||
Reference in New Issue
Block a user