Merge pull request #1679 from Dune-jr/feature-exitbutton

Enhanced the 'X' quit button with the proper icon and a fading red color
This commit is contained in:
oy 2018-11-16 15:47:18 +01:00 committed by GitHub
commit 803f88b81a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1639,14 +1639,23 @@ int CMenus::Render()
ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET); ServerBrowser()->Refresh(IServerBrowser::TYPE_INTERNET);
m_MenuPage = PAGE_INTERNET; m_MenuPage = PAGE_INTERNET;
}*/ }*/
// quit button // quit button
{
CUIRect Button; CUIRect Button;
float TopOffset = 35.0f; float TopOffset = 35.0f;
Screen.HSplitTop(TopOffset, &Button, 0); Screen.HSplitTop(TopOffset, &Button, 0);
Button.VSplitRight(TopOffset - 3.0f, 0, &Button); Button.VSplitRight(TopOffset - 3.0f, 0, &Button);
static CButtonContainer s_QuitButton; static CButtonContainer s_QuitButton;
if(DoButton_Menu(&s_QuitButton, "X", 0, &Button, 0, CUI::CORNER_BL))
// draw red-blending button
vec4 Color = mix(vec4(1.f, 1.f, 1.f, 0.25f), vec4(1.f/0xff*0xf9, 1.f/0xff*0x2b, 1.f/0xff*0x2b, 0.75f), ButtonFade(&s_QuitButton, 0.6f, 0)/0.6f);
RenderTools()->DrawUIRect(&Button, Color, CUI::CORNER_BL|CUI::CORNER_BR|CUI::CORNER_TL, 5.0f);
// draw non-blending X
if(DoButton_SpriteCleanID(&s_QuitButton, IMAGE_TOOLICONS, SPRITE_TOOL_X_A, &Button, false))
m_Popup = POPUP_QUIT; m_Popup = POPUP_QUIT;
}
// render current page // render current page
if(Client()->State() != IClient::STATE_OFFLINE) if(Client()->State() != IClient::STATE_OFFLINE)