Added ability to disable console groups from the scripts

This commit is contained in:
Blixibon 2021-04-23 10:04:23 -05:00
parent ee8bee588a
commit e5ffd26fda

View File

@ -95,8 +95,13 @@ void LoadConsoleGroupsFromFile( IBaseFileSystem *filesystem, const char *pszFile
int index = FindConGroup( pGroup->GetName() ); int index = FindConGroup( pGroup->GetName() );
if (index != -1) if (index != -1)
{ {
g_ConGroups[index]._clr = pGroup->GetColor( "MessageColor" ); Color msgClr = pGroup->GetColor( "MessageColor" );
//g_ConGroups[index].bDisabled = pGroup->GetBool( "Disabled", false );
// Make sure the color isn't 0,0,0,0 before assigning
if (msgClr.GetRawColor() != 0)
g_ConGroups[index]._clr = msgClr;
g_ConGroups[index].bDisabled = pGroup->GetBool( "Disabled", false );
} }
else else
{ {
@ -118,12 +123,12 @@ void PrintAllConsoleGroups()
Msg( "============================================================\n" ); Msg( "============================================================\n" );
for (int i = 0; i < CON_GROUP_MAX; i++) for (int i = 0; i < CON_GROUP_MAX; i++)
{ {
Msg( " # " ); ConColorMsg( g_ConGroups[i].GetColor(), " # %s", g_ConGroups[i].pszName );
ConColorMsg( g_ConGroups[i].GetColor(), "%s", g_ConGroups[i].pszName );
Msg( " - %s ", g_ConGroups[i].pszDescription );
//if (g_ConGroups[i].bDisabled) if (g_ConGroups[i].bDisabled)
// Msg("(DISABLED)"); Msg(" [DISABLED]");
Msg( " - %s ", g_ConGroups[i].pszDescription );
Msg("\n"); Msg("\n");
} }