Merge pull request #47 from Laxa/upstream

Add cl_output_broadcast + add button for it + fix multi-line display.
This commit is contained in:
Dennis Felsing 2014-09-23 18:55:13 +02:00
commit 8abc15f48d
3 changed files with 26 additions and 3 deletions

View file

@ -26,6 +26,7 @@ MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGF
MACRO_CONFIG_INT(ClAutoScreenshot, cl_auto_screenshot, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically take game over screenshot")
MACRO_CONFIG_INT(ClAutoScreenshotMax, cl_auto_screenshot_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically created screenshots (0 = no limit)")
MACRO_CONFIG_INT(ClResetWantedWeaponOnDeath, cl_reset_wanted_weapon_on_death, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Reset wanted weapon on death")
MACRO_CONFIG_INT(ClOutputBroadcast, cl_output_broadcast, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Output broadcasts into console")
MACRO_CONFIG_INT(ClEventthread, cl_eventthread, 0, 0, 1, CFGFLAG_CLIENT, "Enables the usage of a thread to pump the events")

View file

@ -46,7 +46,24 @@ void CBroadcast::OnMessage(int MsgType, void *pRawMsg)
TextRender()->TextEx(&Cursor, m_aBroadcastText, -1);
m_BroadcastRenderOffset = 150*Graphics()->ScreenAspect()-Cursor.m_X/2;
m_BroadcastTime = time_get()+time_freq()*10;
//m_pClient->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "broadcast", m_aBroadcastText);
if (g_Config.m_ClOutputBroadcast)
{
char tmp[1024];
unsigned int i, ii;
for (i = 0, ii = 0; i < strlen(m_aBroadcastText); i++)
{
if (m_aBroadcastText[i] == '\n')
{
tmp[ii] = '\0';
ii = 0;
m_pClient->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "broadcast", tmp);
}
else
{
tmp[ii] = m_aBroadcastText[i];
ii++;
}
}
}
}
}

View file

@ -193,8 +193,13 @@ void CMenus::RenderSettingsGeneral(CUIRect MainView)
Right.HSplitTop(20.0f, &Button, &Right);
Right.HSplitTop(20.0f, &Button, &Right);
if(DoButton_CheckBox(&g_Config.m_ClConfirmDisconnect, Localize("Confirm disconnect from server"), g_Config.m_ClConfirmDisconnect, &Button))
g_Config.m_ClConfirmDisconnect ^= 1;
g_Config.m_ClConfirmDisconnect ^= 1;
Right.HSplitTop(20.0f, &Button, &Right);
if (DoButton_CheckBox(&g_Config.m_ClOutputBroadcast, Localize("Output broadcast to console"), g_Config.m_ClOutputBroadcast, &Button))
{
g_Config.m_ClOutputBroadcast ^= 1;
}
Left.HSplitTop(20.0f, 0, &Left);
Left.HSplitTop(20.0f, &Label, &Left);