mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Add a flag for colors with alpha
This commit is contained in:
parent
324c389e87
commit
f479f69735
|
@ -37,6 +37,7 @@ enum
|
||||||
CFGFLAG_GAME=1<<8,
|
CFGFLAG_GAME=1<<8,
|
||||||
CFGFLAG_NONTEEHISTORIC=1<<9,
|
CFGFLAG_NONTEEHISTORIC=1<<9,
|
||||||
CFGFLAG_COLLIGHT=1<<10,
|
CFGFLAG_COLLIGHT=1<<10,
|
||||||
|
CFGFLAG_COLALPHA=1<<11,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -708,8 +708,9 @@ struct CIntVariableData
|
||||||
|
|
||||||
struct CColVariableData : public CIntVariableData
|
struct CColVariableData : public CIntVariableData
|
||||||
{
|
{
|
||||||
template<class... T> CColVariableData(bool b, T... t) : CIntVariableData{t...}, m_Light(b) {}
|
template<class... T> CColVariableData(bool l, bool a, T... t) : CIntVariableData{t...}, m_Light(l), m_Alpha(a) {}
|
||||||
bool m_Light;
|
bool m_Light;
|
||||||
|
bool m_Alpha;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CStrVariableData
|
struct CStrVariableData
|
||||||
|
@ -755,7 +756,7 @@ static void ColVariableCommand(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
||||||
if(pResult->NumArguments())
|
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;
|
*(pData->m_pVariable) = Val;
|
||||||
if(pResult->m_ClientID != IConsole::CLIENT_ID_GAME)
|
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) \
|
#define MACRO_CONFIG_COL(Name,ScriptName,Def,Min,Max,Flags,Desc) \
|
||||||
{ \
|
{ \
|
||||||
static CColVariableData Data = { static_cast<bool>((Flags) & CFGFLAG_COLLIGHT), this, &g_Config.m_##Name, Min, Max, Def }; \
|
static CColVariableData Data = { static_cast<bool>((Flags) & CFGFLAG_COLLIGHT), static_cast<bool>((Flags) & CFGFLAG_COLALPHA), this, &g_Config.m_##Name, Min, Max, Def }; \
|
||||||
Register(#ScriptName, "?i", Flags, ColVariableCommand, &Data, Desc); \
|
Register(#ScriptName, "?i", Flags, ColVariableCommand, &Data, Desc); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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(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_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(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")
|
MACRO_CONFIG_INT(UiColorizeGametype, ui_colorize_gametype, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Highlight gametype")
|
||||||
|
|
Loading…
Reference in a new issue