mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Rename CURRENT to CURRENT_MAP
This commit is contained in:
parent
0f177bad46
commit
2dc725e0f6
|
@ -39,7 +39,7 @@ void CBackground::OnInit()
|
||||||
{
|
{
|
||||||
m_pImages->m_pClient = GameClient();
|
m_pImages->m_pClient = GameClient();
|
||||||
Kernel()->RegisterInterface(m_pBackgroundMap);
|
Kernel()->RegisterInterface(m_pBackgroundMap);
|
||||||
if(g_Config.m_ClBackgroundEntities[0] != '\0' && str_comp(g_Config.m_ClBackgroundEntities, CURRENT))
|
if(g_Config.m_ClBackgroundEntities[0] != '\0' && str_comp(g_Config.m_ClBackgroundEntities, CURRENT_MAP))
|
||||||
LoadBackground();
|
LoadBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ void CBackground::LoadBackground()
|
||||||
NeedImageLoading = true;
|
NeedImageLoading = true;
|
||||||
m_Loaded = true;
|
m_Loaded = true;
|
||||||
}
|
}
|
||||||
else if(str_comp(g_Config.m_ClBackgroundEntities, CURRENT) == 0)
|
else if(str_comp(g_Config.m_ClBackgroundEntities, CURRENT_MAP) == 0)
|
||||||
{
|
{
|
||||||
m_pMap = Kernel()->RequestInterface<IEngineMap>();
|
m_pMap = Kernel()->RequestInterface<IEngineMap>();
|
||||||
if(m_pMap->IsLoaded())
|
if(m_pMap->IsLoaded())
|
||||||
|
@ -91,7 +91,7 @@ void CBackground::LoadBackground()
|
||||||
|
|
||||||
void CBackground::OnMapLoad()
|
void CBackground::OnMapLoad()
|
||||||
{
|
{
|
||||||
if(str_comp(g_Config.m_ClBackgroundEntities, CURRENT) == 0 || str_comp(g_Config.m_ClBackgroundEntities, m_aMapName))
|
if(str_comp(g_Config.m_ClBackgroundEntities, CURRENT_MAP) == 0 || str_comp(g_Config.m_ClBackgroundEntities, m_aMapName))
|
||||||
{
|
{
|
||||||
m_LastLoad = 0;
|
m_LastLoad = 0;
|
||||||
LoadBackground();
|
LoadBackground();
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <game/client/components/maplayers.h>
|
#include <game/client/components/maplayers.h>
|
||||||
|
|
||||||
// Special value to use background of current map
|
// Special value to use background of current map
|
||||||
#define CURRENT "%current%"
|
#define CURRENT_MAP "%current%"
|
||||||
|
|
||||||
class CBackgroundEngineMap : public CMap
|
class CBackgroundEngineMap : public CMap
|
||||||
{
|
{
|
||||||
|
|
|
@ -2178,13 +2178,13 @@ void CMenus::RenderSettingsDDNet(CUIRect MainView)
|
||||||
DoEditBox(g_Config.m_ClBackgroundEntities, &Left, g_Config.m_ClBackgroundEntities, sizeof(g_Config.m_ClBackgroundEntities), 14.0f, &s_Map);
|
DoEditBox(g_Config.m_ClBackgroundEntities, &Left, g_Config.m_ClBackgroundEntities, sizeof(g_Config.m_ClBackgroundEntities), 14.0f, &s_Map);
|
||||||
|
|
||||||
aRects[1].HSplitTop(20.0f, &Button, &aRects[1]);
|
aRects[1].HSplitTop(20.0f, &Button, &aRects[1]);
|
||||||
bool UseCurrentMap = str_comp(g_Config.m_ClBackgroundEntities, CURRENT) == 0;
|
bool UseCurrentMap = str_comp(g_Config.m_ClBackgroundEntities, CURRENT_MAP) == 0;
|
||||||
if(DoButton_CheckBox(&UseCurrentMap, Localize("Use current map as background"), UseCurrentMap, &Button))
|
if(DoButton_CheckBox(&UseCurrentMap, Localize("Use current map as background"), UseCurrentMap, &Button))
|
||||||
{
|
{
|
||||||
if(UseCurrentMap)
|
if(UseCurrentMap)
|
||||||
g_Config.m_ClBackgroundEntities[0] = '\0';
|
g_Config.m_ClBackgroundEntities[0] = '\0';
|
||||||
else
|
else
|
||||||
str_copy(g_Config.m_ClBackgroundEntities, CURRENT, sizeof(g_Config.m_ClBackgroundEntities));
|
str_copy(g_Config.m_ClBackgroundEntities, CURRENT_MAP, sizeof(g_Config.m_ClBackgroundEntities));
|
||||||
}
|
}
|
||||||
|
|
||||||
aRects[1].HSplitTop(20.0f, &Button, 0);
|
aRects[1].HSplitTop(20.0f, &Button, 0);
|
||||||
|
|
Loading…
Reference in a new issue