mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Allow reloading current background entities map
This commit is contained in:
parent
77790f677e
commit
d8e82bbb1d
|
@ -902,16 +902,11 @@ void CMenus::ConchainBackgroundEntities(IConsole::IResult *pResult, void *pUserD
|
||||||
if(pResult->NumArguments())
|
if(pResult->NumArguments())
|
||||||
{
|
{
|
||||||
CMenus *pSelf = (CMenus *)pUserData;
|
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)
|
void CMenus::ConchainUpdateMusicState(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
|
||||||
{
|
{
|
||||||
pfnCallback(pResult, pCallbackUserData);
|
pfnCallback(pResult, pCallbackUserData);
|
||||||
|
|
|
@ -445,7 +445,6 @@ protected:
|
||||||
void RenderMenubar(CUIRect Box, IClient::EClientState ClientState);
|
void RenderMenubar(CUIRect Box, IClient::EClientState ClientState);
|
||||||
void RenderNews(CUIRect MainView);
|
void RenderNews(CUIRect MainView);
|
||||||
static void ConchainBackgroundEntities(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
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);
|
static void ConchainUpdateMusicState(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
|
||||||
void UpdateMusicState();
|
void UpdateMusicState();
|
||||||
|
|
||||||
|
|
|
@ -3229,7 +3229,7 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
|
||||||
|
|
||||||
if(DoButton_FontIcon(&s_BackgroundEntitiesReload, FONT_ICON_ARROW_ROTATE_RIGHT, 0, &ReloadButton))
|
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))
|
if(DoButton_FontIcon(&s_BackgroundEntitiesMapPicker, FONT_ICON_FOLDER, 0, &Button))
|
||||||
|
@ -3402,7 +3402,7 @@ CUi::EPopupMenuFunctionResult CMenus::PopupMapPicker(void *pContext, CUIRect Vie
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
str_format(g_Config.m_ClBackgroundEntities, sizeof(g_Config.m_ClBackgroundEntities), "%s/%s", pPopupContext->m_aCurrentMapFolder, SelectedItem.m_aFilename);
|
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;
|
return CUi::POPUP_CLOSE_CURRENT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue