mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8806 from bencie/allow-reloading
Allow reloading current background entities map
This commit is contained in:
commit
028bd148f3
|
@ -902,16 +902,11 @@ void CMenus::ConchainBackgroundEntities(IConsole::IResult *pResult, void *pUserD
|
|||
if(pResult->NumArguments())
|
||||
{
|
||||
CMenus *pSelf = (CMenus *)pUserData;
|
||||
pSelf->UpdateBackgroundEntities();
|
||||
if(str_comp(g_Config.m_ClBackgroundEntities, pSelf->m_pClient->m_Background.MapName()) != 0)
|
||||
pSelf->m_pClient->m_Background.LoadBackground();
|
||||
}
|
||||
}
|
||||
|
||||
void CMenus::UpdateBackgroundEntities()
|
||||
{
|
||||
if(str_comp(g_Config.m_ClBackgroundEntities, m_pClient->m_Background.MapName()) != 0)
|
||||
m_pClient->m_Background.LoadBackground();
|
||||
}
|
||||
|
||||
void CMenus::ConchainUpdateMusicState(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||
{
|
||||
pfnCallback(pResult, pCallbackUserData);
|
||||
|
|
|
@ -445,7 +445,6 @@ protected:
|
|||
void RenderMenubar(CUIRect Box, IClient::EClientState ClientState);
|
||||
void RenderNews(CUIRect MainView);
|
||||
static void ConchainBackgroundEntities(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||
void UpdateBackgroundEntities();
|
||||
static void ConchainUpdateMusicState(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||
void UpdateMusicState();
|
||||
|
||||
|
|
|
@ -3229,7 +3229,7 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
|
|||
|
||||
if(DoButton_FontIcon(&s_BackgroundEntitiesReload, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &ReloadButton))
|
||||
{
|
||||
UpdateBackgroundEntities();
|
||||
m_pClient->m_Background.LoadBackground();
|
||||
}
|
||||
|
||||
if(DoButton_FontIcon(&s_BackgroundEntitiesMapPicker, FONT_ICON_FOLDER, 0, &Button))
|
||||
|
@ -3402,7 +3402,7 @@ CUi::EPopupMenuFunctionResult CMenus::PopupMapPicker(void *pContext, CUIRect Vie
|
|||
else
|
||||
{
|
||||
str_format(g_Config.m_ClBackgroundEntities, sizeof(g_Config.m_ClBackgroundEntities), "%s/%s", pPopupContext->m_aCurrentMapFolder, SelectedItem.m_aFilename);
|
||||
pMenus->UpdateBackgroundEntities();
|
||||
pMenus->m_pClient->m_Background.LoadBackground();
|
||||
return CUi::POPUP_CLOSE_CURRENT;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue