Rename CURRENT to CURRENT_MAP

This commit is contained in:
Dennis Felsing 2020-10-02 16:21:18 +02:00
parent 0f177bad46
commit 2dc725e0f6
3 changed files with 6 additions and 6 deletions

View file

@ -39,7 +39,7 @@ void CBackground::OnInit()
{
m_pImages->m_pClient = GameClient();
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();
}
@ -68,7 +68,7 @@ void CBackground::LoadBackground()
NeedImageLoading = 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>();
if(m_pMap->IsLoaded())
@ -91,7 +91,7 @@ void CBackground::LoadBackground()
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;
LoadBackground();

View file

@ -5,7 +5,7 @@
#include <game/client/components/maplayers.h>
// Special value to use background of current map
#define CURRENT "%current%"
#define CURRENT_MAP "%current%"
class CBackgroundEngineMap : public CMap
{

View file

@ -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);
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(UseCurrentMap)
g_Config.m_ClBackgroundEntities[0] = '\0';
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);