Add settings for info messages

This commit is contained in:
furo 2023-11-20 20:16:07 +01:00
parent 2cb948a57b
commit eff6361c38
3 changed files with 31 additions and 15 deletions

View file

@ -64,6 +64,7 @@ MACRO_CONFIG_INT(ClShowChat, cl_showchat, 1, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE
MACRO_CONFIG_INT(ClShowChatFriends, cl_show_chat_friends, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show only chat messages from friends")
MACRO_CONFIG_INT(ClShowChatSystem, cl_show_chat_system, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show chat messages from the server")
MACRO_CONFIG_INT(ClShowKillMessages, cl_showkillmessages, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show kill messages")
MACRO_CONFIG_INT(ClShowFinishMessages, cl_show_finish_messages, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show finish messages")
MACRO_CONFIG_INT(ClShowVotesAfterVoting, cl_show_votes_after_voting, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show votes window after voting")
MACRO_CONFIG_INT(ClShowLocalTimeAlways, cl_show_local_time_always, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Always show local time")
MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ingame FPS counter")

View file

@ -154,7 +154,7 @@ void CInfoMessages::OnMessage(int MsgType, void *pRawMsg)
if(m_pClient->m_SuppressEvents)
return;
if(MsgType == NETMSGTYPE_SV_KILLMSGTEAM)
if(MsgType == NETMSGTYPE_SV_KILLMSGTEAM && g_Config.m_ClShowKillMessages)
{
CNetMsg_Sv_KillMsgTeam *pMsg = (CNetMsg_Sv_KillMsgTeam *)pRawMsg;
@ -233,7 +233,7 @@ void CInfoMessages::OnMessage(int MsgType, void *pRawMsg)
Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
}
if(MsgType == NETMSGTYPE_SV_KILLMSG)
if(MsgType == NETMSGTYPE_SV_KILLMSG && g_Config.m_ClShowKillMessages)
{
CNetMsg_Sv_KillMsg *pMsg = (CNetMsg_Sv_KillMsg *)pRawMsg;
@ -300,7 +300,7 @@ void CInfoMessages::OnMessage(int MsgType, void *pRawMsg)
Graphics()->MapScreen(ScreenX0, ScreenY0, ScreenX1, ScreenY1);
}
if(MsgType == NETMSGTYPE_SV_RACEFINISH)
if(MsgType == NETMSGTYPE_SV_RACEFINISH && g_Config.m_ClShowFinishMessages)
{
CNetMsg_Sv_RaceFinish *pMsg = (CNetMsg_Sv_RaceFinish *)pRawMsg;
@ -524,11 +524,15 @@ void CInfoMessages::OnRender()
continue;
if(pInfoMsg->m_Type == EType::TYPE_KILL && g_Config.m_ClShowKillMessages)
{
RenderKillMsg(pInfoMsg, StartX, y);
else if(pInfoMsg->m_Type == EType::TYPE_FINISH)
y += 46.0f;
}
else if(pInfoMsg->m_Type == EType::TYPE_FINISH && g_Config.m_ClShowFinishMessages)
{
RenderFinishMsg(pInfoMsg, StartX, y);
y += 46.0f;
y += 46.0f;
}
}
}

View file

@ -2429,7 +2429,7 @@ enum
APPEARANCE_TAB_CHAT = 1,
APPEARANCE_TAB_NAME_PLATE = 2,
APPEARANCE_TAB_HOOK_COLLISION = 3,
APPEARANCE_TAB_KILL_MESSAGES = 4,
APPEARANCE_TAB_INFO_MESSAGES = 4,
APPEARANCE_TAB_LASER = 5,
NUMBER_OF_APPEARANCE_TABS = 6,
};
@ -2459,8 +2459,8 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView)
s_CurTab = APPEARANCE_TAB_NAME_PLATE;
if(DoButton_MenuTab(&s_aPageTabs[APPEARANCE_TAB_HOOK_COLLISION], Localize("Hook Collisions"), s_CurTab == APPEARANCE_TAB_HOOK_COLLISION, &Page4Tab, 0, NULL, NULL, NULL, NULL, 4))
s_CurTab = APPEARANCE_TAB_HOOK_COLLISION;
if(DoButton_MenuTab(&s_aPageTabs[APPEARANCE_TAB_KILL_MESSAGES], Localize("Kill Messages"), s_CurTab == APPEARANCE_TAB_KILL_MESSAGES, &Page5Tab, 0, NULL, NULL, NULL, NULL, 4))
s_CurTab = APPEARANCE_TAB_KILL_MESSAGES;
if(DoButton_MenuTab(&s_aPageTabs[APPEARANCE_TAB_INFO_MESSAGES], Localize("Info Messages"), s_CurTab == APPEARANCE_TAB_INFO_MESSAGES, &Page5Tab, 0, NULL, NULL, NULL, NULL, 4))
s_CurTab = APPEARANCE_TAB_INFO_MESSAGES;
if(DoButton_MenuTab(&s_aPageTabs[APPEARANCE_TAB_LASER], Localize("Laser"), s_CurTab == APPEARANCE_TAB_LASER, &Page6Tab, IGraphics::CORNER_R, NULL, NULL, NULL, NULL, 4))
s_CurTab = APPEARANCE_TAB_LASER;
@ -3005,20 +3005,31 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView)
DoLine_ColorPicker(&s_HookCollHookableCollResetID, ColorPickerLineSize, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Something hookable"), &g_Config.m_ClHookCollColorHookableColl, ColorRGBA(130.0f / 255.0f, 232.0f / 255.0f, 160.0f / 255.0f, 1.0f), false);
DoLine_ColorPicker(&s_HookCollTeeCollResetID, ColorPickerLineSize, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("A Tee"), &g_Config.m_ClHookCollColorTeeColl, ColorRGBA(1.0f, 1.0f, 0.0f, 1.0f), false);
}
else if(s_CurTab == APPEARANCE_TAB_KILL_MESSAGES)
else if(s_CurTab == APPEARANCE_TAB_INFO_MESSAGES)
{
MainView.VSplitMid(&LeftView, &RightView);
// ***** Kill Messages ***** //
// ***** Info Messages ***** //
LeftView.HSplitTop(HeadlineAndVMargin, &Label, &LeftView);
UI()->DoLabel(&Label, Localize("Kill Messages"), HeadlineFontSize, TEXTALIGN_ML);
UI()->DoLabel(&Label, Localize("Info Messages"), HeadlineFontSize, TEXTALIGN_ML);
// General kill messages settings
LeftView.HSplitTop(SectionTotalMargin + 2 * ColorPickerLineSize, &Section, &LeftView);
// General info messages settings
LeftView.HSplitTop(SectionTotalMargin + 2 * LineSize + 2 * ColorPickerLineSize, &Section, &LeftView);
Section.Margin(SectionMargin, &Section);
static CButtonContainer s_KillMessageNormalColorID, s_KillMessageHighlightColorID;
Section.HSplitTop(LineSize, &Button, &Section);
if(DoButton_CheckBox(&g_Config.m_ClShowKillMessages, Localize("Show kill messages"), g_Config.m_ClShowKillMessages, &Button))
{
g_Config.m_ClShowKillMessages ^= 1;
}
Section.HSplitTop(LineSize, &Button, &Section);
if(DoButton_CheckBox(&g_Config.m_ClShowFinishMessages, Localize("Show finish messages"), g_Config.m_ClShowFinishMessages, &Button))
{
g_Config.m_ClShowFinishMessages ^= 1;
}
static CButtonContainer s_KillMessageNormalColorID, s_KillMessageHighlightColorID;
DoLine_ColorPicker(&s_KillMessageNormalColorID, ColorPickerLineSize, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Normal Color"), &g_Config.m_ClKillMessageNormalColor, ColorRGBA(1.0f, 1.0f, 1.0f), false);
DoLine_ColorPicker(&s_KillMessageHighlightColorID, ColorPickerLineSize, ColorPickerLabelSize, ColorPickerLineSpacing, &Section, Localize("Highlight Color"), &g_Config.m_ClKillMessageHighlightColor, ColorRGBA(1.0f, 1.0f, 1.0f), false);
}