diff --git a/src/engine/shared/config.h b/src/engine/shared/config.h index 53549cbcd..a0186e338 100644 --- a/src/engine/shared/config.h +++ b/src/engine/shared/config.h @@ -37,6 +37,7 @@ enum CFGFLAG_GAME=1<<8, CFGFLAG_NONTEEHISTORIC=1<<9, CFGFLAG_COLLIGHT=1<<10, + CFGFLAG_COLALPHA=1<<11, }; #endif diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index 354e1439d..b31d1bb37 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -708,8 +708,9 @@ struct CIntVariableData struct CColVariableData : public CIntVariableData { - template CColVariableData(bool b, T... t) : CIntVariableData{t...}, m_Light(b) {} + template CColVariableData(bool l, bool a, T... t) : CIntVariableData{t...}, m_Light(l), m_Alpha(a) {} bool m_Light; + bool m_Alpha; }; struct CStrVariableData @@ -755,7 +756,7 @@ static void ColVariableCommand(IConsole::IResult *pResult, void *pUserData) if(pResult->NumArguments()) { - int Val = pResult->GetColor(0, pData->m_Light).Pack() & (pData->m_Light ? 0xFFFFFF : 0xFFFFFFFF); + int Val = pResult->GetColor(0, pData->m_Light).Pack() & (pData->m_Alpha ? 0xFFFFFFFF : 0xFFFFFF); *(pData->m_pVariable) = Val; if(pResult->m_ClientID != IConsole::CLIENT_ID_GAME) @@ -936,7 +937,7 @@ CConsole::CConsole(int FlagMask) #define MACRO_CONFIG_COL(Name,ScriptName,Def,Min,Max,Flags,Desc) \ { \ - static CColVariableData Data = { static_cast((Flags) & CFGFLAG_COLLIGHT), this, &g_Config.m_##Name, Min, Max, Def }; \ + static CColVariableData Data = { static_cast((Flags) & CFGFLAG_COLLIGHT), static_cast((Flags) & CFGFLAG_COLALPHA), this, &g_Config.m_##Name, Min, Max, Def }; \ Register(#ScriptName, "?i", Flags, ColVariableCommand, &Data, Desc); \ } diff --git a/src/game/variables.h b/src/game/variables.h index 97778dac0..4138ef4d3 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -89,7 +89,7 @@ MACRO_CONFIG_STR(UiServerAddress, ui_server_address, 64, "localhost:8303", CFGFL MACRO_CONFIG_INT(UiScale, ui_scale, 100, 50, 150, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface scale") MACRO_CONFIG_INT(UiMousesens, ui_mousesens, 200, 1, 100000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Mouse sensitivity for menus/editor") -MACRO_CONFIG_COL(UiColor, ui_color, (int)0xE4A046AF, 0, (int)0xFFFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Interface color") // 160 70 175 228 hasalpha +MACRO_CONFIG_COL(UiColor, ui_color, (int)0xE4A046AF, 0, (int)0xFFFFFFFF, CFGFLAG_CLIENT|CFGFLAG_SAVE|CFGFLAG_COLALPHA, "Interface color") // 160 70 175 228 hasalpha MACRO_CONFIG_INT(UiColorizePing, ui_colorize_ping, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Highlight ping") MACRO_CONFIG_INT(UiColorizeGametype, ui_colorize_gametype, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Highlight gametype")