mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Improve layout of demo render popup on 5:4 resolutions
This commit is contained in:
parent
01958378f1
commit
aeb1530966
|
@ -1567,16 +1567,13 @@ int CMenus::Render()
|
||||||
{
|
{
|
||||||
dbg_assert(m_DemolistSelectedIndex >= 0 && !m_vpFilteredDemos[m_DemolistSelectedIndex]->m_IsDir, "m_DemolistSelectedIndex invalid for POPUP_RENDER_DEMO");
|
dbg_assert(m_DemolistSelectedIndex >= 0 && !m_vpFilteredDemos[m_DemolistSelectedIndex]->m_IsDir, "m_DemolistSelectedIndex invalid for POPUP_RENDER_DEMO");
|
||||||
|
|
||||||
CUIRect Label, TextBox, Ok, Abort, Button;
|
CUIRect Row, Ok, Abort;
|
||||||
|
Box.VMargin(60.0f, &Box);
|
||||||
Box.HSplitBottom(20.f, &Box, &Part);
|
Box.HMargin(20.0f, &Box);
|
||||||
Box.HSplitBottom(24.f, &Box, &Part);
|
Box.HSplitBottom(24.0f, &Box, &Row);
|
||||||
Part.VMargin(80.0f, &Part);
|
Box.HSplitBottom(40.0f, &Box, nullptr);
|
||||||
|
Row.VMargin(40.0f, &Row);
|
||||||
Part.VSplitMid(&Abort, &Ok);
|
Row.VSplitMid(&Abort, &Ok, 40.0f);
|
||||||
|
|
||||||
Ok.VMargin(20.0f, &Ok);
|
|
||||||
Abort.VMargin(20.0f, &Abort);
|
|
||||||
|
|
||||||
static CButtonContainer s_ButtonAbort;
|
static CButtonContainer s_ButtonAbort;
|
||||||
if(DoButton_Menu(&s_ButtonAbort, Localize("Abort"), 0, &Abort) || UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE))
|
if(DoButton_Menu(&s_ButtonAbort, Localize("Abort"), 0, &Abort) || UI()->ConsumeHotkey(CUI::HOTKEY_ESCAPE))
|
||||||
|
@ -1609,70 +1606,63 @@ int CMenus::Render()
|
||||||
PopupConfirmDemoReplaceVideo();
|
PopupConfirmDemoReplaceVideo();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Box.HSplitBottom(30.f, &Box, 0);
|
|
||||||
Box.HSplitBottom(20.f, &Box, &Part);
|
|
||||||
Box.HSplitBottom(10.f, &Box, 0);
|
|
||||||
|
|
||||||
float ButtonSize = 20.0f;
|
CUIRect ShowChatCheckbox, UseSoundsCheckbox;
|
||||||
Part.VSplitLeft(113.0f, 0, &Part);
|
Box.HSplitBottom(20.0f, &Box, &Row);
|
||||||
Part.VSplitLeft(200.0f, &Button, &Part);
|
Box.HSplitBottom(10.0f, &Box, nullptr);
|
||||||
if(DoButton_CheckBox(&g_Config.m_ClVideoShowChat, Localize("Show chat"), g_Config.m_ClVideoShowChat, &Button))
|
Row.VSplitMid(&ShowChatCheckbox, &UseSoundsCheckbox, 20.0f);
|
||||||
|
|
||||||
|
if(DoButton_CheckBox(&g_Config.m_ClVideoShowChat, Localize("Show chat"), g_Config.m_ClVideoShowChat, &ShowChatCheckbox))
|
||||||
g_Config.m_ClVideoShowChat ^= 1;
|
g_Config.m_ClVideoShowChat ^= 1;
|
||||||
Part.VSplitLeft(32.0f, 0, &Part);
|
|
||||||
if(DoButton_CheckBox(&g_Config.m_ClVideoSndEnable, Localize("Use sounds"), g_Config.m_ClVideoSndEnable, &Part))
|
if(DoButton_CheckBox(&g_Config.m_ClVideoSndEnable, Localize("Use sounds"), g_Config.m_ClVideoSndEnable, &UseSoundsCheckbox))
|
||||||
g_Config.m_ClVideoSndEnable ^= 1;
|
g_Config.m_ClVideoSndEnable ^= 1;
|
||||||
|
|
||||||
Box.HSplitBottom(20.f, &Box, &Part);
|
CUIRect ShowHudButton;
|
||||||
Part.VSplitLeft(55.0f, 0, &Part);
|
Box.HSplitBottom(20.0f, &Box, &Row);
|
||||||
Part.VSplitLeft(60.0f, 0, &Label);
|
Row.VSplitMid(&Row, &ShowHudButton, 20.0f);
|
||||||
|
|
||||||
|
if(DoButton_CheckBox(&g_Config.m_ClVideoShowhud, Localize("Show ingame HUD"), g_Config.m_ClVideoShowhud, &ShowHudButton))
|
||||||
|
g_Config.m_ClVideoShowhud ^= 1;
|
||||||
|
|
||||||
bool IncDemoSpeed = false, DecDemoSpeed = false;
|
|
||||||
// slowdown
|
// slowdown
|
||||||
Part.VSplitLeft(5.0f, 0, &Part);
|
CUIRect SlowDownButton;
|
||||||
Part.VSplitLeft(ButtonSize, &Button, &Part);
|
Row.VSplitLeft(20.0f, &SlowDownButton, &Row);
|
||||||
|
Row.VSplitLeft(5.0f, nullptr, &Row);
|
||||||
static CButtonContainer s_SlowDownButton;
|
static CButtonContainer s_SlowDownButton;
|
||||||
if(DoButton_FontIcon(&s_SlowDownButton, FONT_ICON_BACKWARD, 0, &Button, IGraphics::CORNER_ALL))
|
if(DoButton_FontIcon(&s_SlowDownButton, FONT_ICON_BACKWARD, 0, &SlowDownButton, IGraphics::CORNER_ALL))
|
||||||
DecDemoSpeed = true;
|
m_Speed = clamp(m_Speed - 1, 0, (int)(g_DemoSpeeds - 1));
|
||||||
|
|
||||||
// paused
|
// paused
|
||||||
Part.VSplitLeft(5.0f, 0, &Part);
|
CUIRect PausedButton;
|
||||||
Part.VSplitLeft(ButtonSize, &Button, &Part);
|
Row.VSplitLeft(20.0f, &PausedButton, &Row);
|
||||||
|
Row.VSplitLeft(5.0f, nullptr, &Row);
|
||||||
static CButtonContainer s_PausedButton;
|
static CButtonContainer s_PausedButton;
|
||||||
if(DoButton_FontIcon(&s_PausedButton, FONT_ICON_PAUSE, 0, &Button, IGraphics::CORNER_ALL))
|
if(DoButton_FontIcon(&s_PausedButton, FONT_ICON_PAUSE, 0, &PausedButton, IGraphics::CORNER_ALL))
|
||||||
m_StartPaused ^= 1;
|
m_StartPaused ^= 1;
|
||||||
|
|
||||||
// fastforward
|
// fastforward
|
||||||
Part.VSplitLeft(5.0f, 0, &Part);
|
CUIRect FastForwardButton;
|
||||||
Part.VSplitLeft(ButtonSize, &Button, &Part);
|
Row.VSplitLeft(20.0f, &FastForwardButton, &Row);
|
||||||
|
Row.VSplitLeft(8.0f, nullptr, &Row);
|
||||||
static CButtonContainer s_FastForwardButton;
|
static CButtonContainer s_FastForwardButton;
|
||||||
if(DoButton_FontIcon(&s_FastForwardButton, FONT_ICON_FORWARD, 0, &Button, IGraphics::CORNER_ALL))
|
if(DoButton_FontIcon(&s_FastForwardButton, FONT_ICON_FORWARD, 0, &FastForwardButton, IGraphics::CORNER_ALL))
|
||||||
IncDemoSpeed = true;
|
m_Speed = clamp(m_Speed + 1, 0, (int)(g_DemoSpeeds - 1));
|
||||||
|
|
||||||
// speed meter
|
// speed meter
|
||||||
Part.VSplitLeft(8.0f, 0, &Part);
|
|
||||||
char aBuffer[128];
|
char aBuffer[128];
|
||||||
const char *pPaused = m_StartPaused ? Localize("(paused)") : "";
|
const char *pPaused = m_StartPaused ? Localize("(paused)") : "";
|
||||||
str_format(aBuffer, sizeof(aBuffer), "%s: ×%g %s", Localize("Speed"), g_aSpeeds[m_Speed], pPaused);
|
str_format(aBuffer, sizeof(aBuffer), "%s: ×%g %s", Localize("Speed"), g_aSpeeds[m_Speed], pPaused);
|
||||||
UI()->DoLabel(&Part, aBuffer, 12.8f, TEXTALIGN_ML);
|
UI()->DoLabel(&Row, aBuffer, 12.8f, TEXTALIGN_ML);
|
||||||
|
|
||||||
if(IncDemoSpeed)
|
Box.HSplitBottom(16.0f, &Box, nullptr);
|
||||||
m_Speed = clamp(m_Speed + 1, 0, (int)(g_DemoSpeeds - 1));
|
Box.HSplitBottom(24.0f, &Box, &Row);
|
||||||
else if(DecDemoSpeed)
|
|
||||||
m_Speed = clamp(m_Speed - 1, 0, (int)(g_DemoSpeeds - 1));
|
|
||||||
|
|
||||||
Part.VSplitLeft(207.0f, 0, &Part);
|
CUIRect Label, TextBox;
|
||||||
if(DoButton_CheckBox(&g_Config.m_ClVideoShowhud, Localize("Show ingame HUD"), g_Config.m_ClVideoShowhud, &Part))
|
Row.VSplitLeft(110.0f, &Label, &TextBox);
|
||||||
g_Config.m_ClVideoShowhud ^= 1;
|
TextBox.VSplitLeft(10.0f, nullptr, &TextBox);
|
||||||
|
UI()->DoLabel(&Label, Localize("Video name:"), 12.8f, TEXTALIGN_ML);
|
||||||
Box.HSplitBottom(20.f, &Box, &Part);
|
UI()->DoEditBox(&m_DemoRenderInput, &TextBox, 12.8f);
|
||||||
Box.HSplitBottom(24.f, &Box, &Part);
|
|
||||||
|
|
||||||
Part.VSplitLeft(60.0f, 0, &Label);
|
|
||||||
Label.VSplitLeft(120.0f, 0, &TextBox);
|
|
||||||
TextBox.VSplitLeft(20.0f, 0, &TextBox);
|
|
||||||
TextBox.VSplitRight(60.0f, &TextBox, 0);
|
|
||||||
UI()->DoLabel(&Label, Localize("Video name:"), 18.0f, TEXTALIGN_ML);
|
|
||||||
UI()->DoEditBox(&m_DemoRenderInput, &TextBox, 12.0f);
|
|
||||||
}
|
}
|
||||||
else if(m_Popup == POPUP_RENDER_DONE)
|
else if(m_Popup == POPUP_RENDER_DONE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue