mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Merge pull request #7628 from furo321/refresh-keys
Support `F5` and `Modifer` + `R` for refresh where possible.
This commit is contained in:
commit
df678ea672
|
@ -1115,7 +1115,7 @@ void CMenus::RenderGhost(CUIRect MainView)
|
|||
static CButtonContainer s_DirectoryButton;
|
||||
static CButtonContainer s_ActivateAll;
|
||||
|
||||
if(DoButton_FontIcon(&s_ReloadButton, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &Button) || Input()->KeyPress(KEY_F5))
|
||||
if(DoButton_FontIcon(&s_ReloadButton, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &Button) || Input()->KeyPress(KEY_F5) || (Input()->KeyPress(KEY_R) && Input()->ModifierIsPressed()))
|
||||
{
|
||||
m_pClient->m_Ghost.UnloadAll();
|
||||
GhostlistPopulate();
|
||||
|
|
|
@ -924,7 +924,7 @@ void CMenus::RenderSettingsTee(CUIRect MainView)
|
|||
TextRender()->SetFontPreset(EFontPreset::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);
|
||||
static CButtonContainer s_SkinRefreshButtonID;
|
||||
if(DoButton_Menu(&s_SkinRefreshButtonID, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &RefreshButton))
|
||||
if(DoButton_Menu(&s_SkinRefreshButtonID, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &RefreshButton) || Input()->KeyPress(KEY_F5) || (Input()->KeyPress(KEY_R) && Input()->ModifierIsPressed()))
|
||||
{
|
||||
// reset render flags for possible loading screen
|
||||
TextRender()->SetRenderFlags(0);
|
||||
|
|
|
@ -659,7 +659,7 @@ void CMenus::RenderSettingsCustom(CUIRect MainView)
|
|||
TextRender()->SetFontPreset(EFontPreset::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);
|
||||
static CButtonContainer s_AssetsReloadBtnID;
|
||||
if(DoButton_Menu(&s_AssetsReloadBtnID, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &ReloadButton))
|
||||
if(DoButton_Menu(&s_AssetsReloadBtnID, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &ReloadButton) || Input()->KeyPress(KEY_F5) || (Input()->KeyPress(KEY_R) && Input()->ModifierIsPressed()))
|
||||
{
|
||||
ClearCustomItems(s_CurCustomTab);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue