Compare commits

...

2 commits

Author SHA1 Message Date
KebsCS b7540ec261
Merge 249da5fdb2 into 0feee9aa3e 2024-09-14 23:58:17 +02:00
KebsCS 249da5fdb2
Add mouse click functionality in spectator mode 2024-09-14 20:17:11 +02:00
2 changed files with 22 additions and 0 deletions

View file

@ -98,6 +98,8 @@ MACRO_CONFIG_INT(ClDyncamStabilizing, cl_dyncam_stabilizing, 0, 0, 100, CFGFLAG_
MACRO_CONFIG_INT(ClMultiViewSensitivity, cl_multiview_sensitivity, 100, 0, 200, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Set how fast the camera will move to the desired location (higher = faster)")
MACRO_CONFIG_INT(ClMultiViewZoomSmoothness, cl_multiview_zoom_smoothness, 1300, 50, 5000, CFGFLAG_CLIENT | CFGFLAG_INSENSITIVE, "Set the smoothness of the multi-view zoom (in ms, higher = slower)")
MACRO_CONFIG_INT(ClSpectatorMouseclicks, cl_spectator_mouseclicks, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Enables mouse clicks in spectator mode: Left-click to spectate the closest player, right-click for free-view")
MACRO_CONFIG_INT(EdAutosaveInterval, ed_autosave_interval, 10, 0, 240, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Interval in minutes at which a copy of the current editor map is automatically saved to the 'auto' folder (0 for off)")
MACRO_CONFIG_INT(EdAutosaveMax, ed_autosave_max, 10, 0, 1000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Maximum number of autosaves that are kept per map name (0 = no limit)")
MACRO_CONFIG_INT(EdSmoothZoomTime, ed_smooth_zoom_time, 250, 0, 5000, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Time of smooth zoom animation in the editor in ms (0 for off)")

View file

@ -193,6 +193,26 @@ bool CSpectator::OnInput(const IInput::CEvent &Event)
OnRelease();
return true;
}
if(g_Config.m_ClSpectatorMouseclicks)
{
if(m_pClient->m_Snap.m_SpecInfo.m_Active && !IsActive() && !GameClient()->m_MultiViewActivated &&
!Ui()->IsPopupOpen() && m_pClient->m_GameConsole.IsClosed() && !m_pClient->m_Menus.IsActive())
{
if(Event.m_Flags & IInput::FLAG_PRESS && Event.m_Key == KEY_MOUSE_1)
{
SpectateClosest();
return true;
}
else if(Event.m_Flags & IInput::FLAG_PRESS && Event.m_Key == KEY_MOUSE_2 &&
m_pClient->m_Snap.m_SpecInfo.m_SpectatorId != SPEC_FREEVIEW)
{
Spectate(SPEC_FREEVIEW);
return true;
}
}
}
return false;
}