mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 04:41:39 +00:00
button_guide: scale max width internally
This commit is contained in:
parent
cede3fa69b
commit
6b6b87879c
4 changed files with 10 additions and 10 deletions
|
|
@ -260,7 +260,7 @@ void ButtonGuide::Draw()
|
||||||
auto iconWidth = Scale(g_iconWidths[btn.Icon]);
|
auto iconWidth = Scale(g_iconWidths[btn.Icon]);
|
||||||
auto iconHeight = Scale(g_iconHeights[btn.Icon]);
|
auto iconHeight = Scale(g_iconHeights[btn.Icon]);
|
||||||
auto textWidth = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str).x;
|
auto textWidth = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str).x;
|
||||||
auto maxWidth = btn.MaxWidth == FLT_MAX ? textWidth : btn.MaxWidth;
|
auto maxWidth = btn.MaxWidth == FLT_MAX ? textWidth : Scale(btn.MaxWidth);
|
||||||
auto textScale = std::min(1.0f, maxWidth / textWidth);
|
auto textScale = std::min(1.0f, maxWidth / textWidth);
|
||||||
|
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
|
|
@ -287,7 +287,7 @@ void ButtonGuide::Draw()
|
||||||
auto iconWidth = Scale(g_iconWidths[btn.Icon]);
|
auto iconWidth = Scale(g_iconWidths[btn.Icon]);
|
||||||
auto iconHeight = Scale(g_iconHeights[btn.Icon]);
|
auto iconHeight = Scale(g_iconHeights[btn.Icon]);
|
||||||
auto textWidth = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str).x;
|
auto textWidth = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str).x;
|
||||||
auto maxWidth = btn.MaxWidth == FLT_MAX ? textWidth : btn.MaxWidth;
|
auto maxWidth = btn.MaxWidth == FLT_MAX ? textWidth : Scale(btn.MaxWidth);
|
||||||
auto textScale = std::min(1.0f, maxWidth / textWidth);
|
auto textScale = std::min(1.0f, maxWidth / textWidth);
|
||||||
|
|
||||||
if (i < g_buttons.size() - 1)
|
if (i < g_buttons.size() - 1)
|
||||||
|
|
|
||||||
|
|
@ -872,7 +872,7 @@ static void DrawDescriptionContainer()
|
||||||
|
|
||||||
if (g_currentPage == WizardPage::InstallSucceeded && textAlpha >= 1.0)
|
if (g_currentPage == WizardPage::InstallSucceeded && textAlpha >= 1.0)
|
||||||
{
|
{
|
||||||
ButtonGuide::Open(Button("Common_Select", Scale(115), selectIcon));
|
ButtonGuide::Open(Button("Common_Select", 115.0f, selectIcon));
|
||||||
}
|
}
|
||||||
else if (g_currentPage != WizardPage::Installing && textAlpha >= 1.0)
|
else if (g_currentPage != WizardPage::Installing && textAlpha >= 1.0)
|
||||||
{
|
{
|
||||||
|
|
@ -884,7 +884,7 @@ static void DrawDescriptionContainer()
|
||||||
|
|
||||||
std::array<Button, 2> buttons =
|
std::array<Button, 2> buttons =
|
||||||
{
|
{
|
||||||
Button("Common_Select", Scale(115), selectIcon),
|
Button("Common_Select", 115.0f, selectIcon),
|
||||||
Button(backKey, FLT_MAX, backIcon)
|
Button(backKey, FLT_MAX, backIcon)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -425,7 +425,7 @@ void MessageWindow::Draw()
|
||||||
|
|
||||||
std::array<Button, 2> buttons =
|
std::array<Button, 2> buttons =
|
||||||
{
|
{
|
||||||
Button("Common_Select", Scale(115), selectIcon),
|
Button("Common_Select", 115.0f, selectIcon),
|
||||||
Button("Common_Back", FLT_MAX, backIcon),
|
Button("Common_Back", FLT_MAX, backIcon),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -470,7 +470,7 @@ void MessageWindow::Draw()
|
||||||
|
|
||||||
std::array<Button, 2> buttons =
|
std::array<Button, 2> buttons =
|
||||||
{
|
{
|
||||||
Button("Common_Select", Scale(115), EButtonIcon::LMB),
|
Button("Common_Select", 115.0f, EButtonIcon::LMB),
|
||||||
Button("Common_Back", FLT_MAX, EButtonIcon::Escape),
|
Button("Common_Back", FLT_MAX, EButtonIcon::Escape),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1790,10 +1790,10 @@ void OptionsMenu::Open(bool isPause, SWA::EMenuType pauseMenuType)
|
||||||
|
|
||||||
std::array<Button, 4> buttons =
|
std::array<Button, 4> buttons =
|
||||||
{
|
{
|
||||||
Button("Common_Switch", Scale(115), EButtonIcon::LBRB, EButtonAlignment::Left, &g_isControlsVisible),
|
Button("Common_Switch", 115.0f, EButtonIcon::LBRB, EButtonAlignment::Left, &g_isControlsVisible),
|
||||||
Button("Common_Reset", Scale(110), EButtonIcon::X, &g_canReset),
|
Button("Common_Reset", 110.0f, EButtonIcon::X, &g_canReset),
|
||||||
Button("Common_Select", Scale(115), EButtonIcon::A, &g_isControlsVisible),
|
Button("Common_Select", 115.0f, EButtonIcon::A, &g_isControlsVisible),
|
||||||
Button("Common_Back", Scale(65), EButtonIcon::B, &g_isControlsVisible)
|
Button("Common_Back", 65.0f, EButtonIcon::B, &g_isControlsVisible)
|
||||||
};
|
};
|
||||||
|
|
||||||
ButtonGuide::Open(buttons);
|
ButtonGuide::Open(buttons);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue