mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Move home button to very right so it is consistent with close button ingame (fixes #5881)
This commit is contained in:
parent
f8d9808c18
commit
9cc08cc9d3
|
@ -675,49 +675,6 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
|
||||
if(Client()->State() == IClient::STATE_OFFLINE)
|
||||
{
|
||||
Box.VSplitLeft(33.0f, &Button, &Box);
|
||||
static CButtonContainer s_StartButton;
|
||||
|
||||
TextRender()->SetCurFont(TextRender()->GetFont(TEXT_FONT_ICON_FONT));
|
||||
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
|
||||
|
||||
bool GotNewsOrUpdate = false;
|
||||
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
int State = Updater()->GetCurrentState();
|
||||
bool NeedUpdate = str_comp(Client()->LatestVersion(), "0");
|
||||
if(State == IUpdater::CLEAN && NeedUpdate)
|
||||
{
|
||||
GotNewsOrUpdate = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
GotNewsOrUpdate |= (bool)g_Config.m_UiUnreadNews;
|
||||
|
||||
ColorRGBA HomeButtonColorAlert(0, 1, 0, 0.25f);
|
||||
ColorRGBA HomeButtonColorAlertHover(0, 1, 0, 0.5f);
|
||||
ColorRGBA *pHomeButtonColor = NULL;
|
||||
ColorRGBA *pHomeButtonColorHover = NULL;
|
||||
|
||||
const char *pHomeScreenButtonLabel = "\xEF\x80\x95";
|
||||
if(GotNewsOrUpdate)
|
||||
{
|
||||
pHomeScreenButtonLabel = "\xEF\x87\xAA";
|
||||
pHomeButtonColor = &HomeButtonColorAlert;
|
||||
pHomeButtonColorHover = &HomeButtonColorAlertHover;
|
||||
}
|
||||
|
||||
if(DoButton_MenuTab(&s_StartButton, pHomeScreenButtonLabel, false, &Button, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_HOME], pHomeButtonColor, pHomeButtonColor, pHomeButtonColorHover, 10.0f, 0))
|
||||
{
|
||||
m_ShowStart = true;
|
||||
m_DoubleClickIndex = -1;
|
||||
}
|
||||
|
||||
TextRender()->SetRenderFlags(0);
|
||||
TextRender()->SetCurFont(NULL);
|
||||
|
||||
Box.VSplitLeft(10.0f, 0, &Box);
|
||||
|
||||
// offline menus
|
||||
if(m_ActivePage == PAGE_NEWS)
|
||||
{
|
||||
|
@ -842,6 +799,46 @@ int CMenus::RenderMenubar(CUIRect r)
|
|||
}
|
||||
}
|
||||
|
||||
Box.VSplitRight(33.0f, &Box, &Button);
|
||||
static CButtonContainer s_StartButton;
|
||||
|
||||
TextRender()->SetCurFont(TextRender()->GetFont(TEXT_FONT_ICON_FONT));
|
||||
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
|
||||
|
||||
bool GotNewsOrUpdate = false;
|
||||
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
int State = Updater()->GetCurrentState();
|
||||
bool NeedUpdate = str_comp(Client()->LatestVersion(), "0");
|
||||
if(State == IUpdater::CLEAN && NeedUpdate)
|
||||
{
|
||||
GotNewsOrUpdate = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
GotNewsOrUpdate |= (bool)g_Config.m_UiUnreadNews;
|
||||
|
||||
ColorRGBA HomeButtonColorAlert(0, 1, 0, 0.25f);
|
||||
ColorRGBA HomeButtonColorAlertHover(0, 1, 0, 0.5f);
|
||||
ColorRGBA *pHomeButtonColor = NULL;
|
||||
ColorRGBA *pHomeButtonColorHover = NULL;
|
||||
|
||||
const char *pHomeScreenButtonLabel = "\xEF\x80\x95";
|
||||
if(GotNewsOrUpdate)
|
||||
{
|
||||
pHomeScreenButtonLabel = "\xEF\x87\xAA";
|
||||
pHomeButtonColor = &HomeButtonColorAlert;
|
||||
pHomeButtonColorHover = &HomeButtonColorAlertHover;
|
||||
}
|
||||
|
||||
if(DoButton_MenuTab(&s_StartButton, pHomeScreenButtonLabel, false, &Button, IGraphics::CORNER_T, &m_aAnimatorsSmallPage[SMALL_TAB_HOME], pHomeButtonColor, pHomeButtonColor, pHomeButtonColorHover, 10.0f, 0))
|
||||
{
|
||||
m_ShowStart = true;
|
||||
m_DoubleClickIndex = -1;
|
||||
}
|
||||
|
||||
Box.VSplitRight(5.0f, &Box, &Button);
|
||||
|
||||
TextRender()->SetCurFont(TextRender()->GetFont(TEXT_FONT_ICON_FONT));
|
||||
TextRender()->SetRenderFlags(ETextRenderFlags::TEXT_RENDER_FLAG_ONLY_ADVANCE_WIDTH | ETextRenderFlags::TEXT_RENDER_FLAG_NO_X_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_Y_BEARING | ETextRenderFlags::TEXT_RENDER_FLAG_NO_PIXEL_ALIGMENT | ETextRenderFlags::TEXT_RENDER_FLAG_NO_OVERSIZE);
|
||||
|
||||
|
|
Loading…
Reference in a new issue