Skip to content

Commit f008aa6

Browse files
committed
feat: sar_cam_drive 2 removes LMB requirement
also unprotected cam drive and linked to boards on website
1 parent f08de1b commit f008aa6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h3>Speedrunning:</h3>
5757
<ul>
5858
<li>Accurate session timing and LiveSplit integration.</li>
5959
<li>Built-in timer and autosplitter with complex custom rule system.</li>
60-
<li>Auto-submission of Challenge Mode runs to the community leaderboards.</li>
60+
<li>Auto-submission of Challenge Mode runs to the <a href="https://board.portal2.sr" target="_blank">community leaderboards.</a></li>
6161
<li>Ghosts of other players from demos or in a <a href="https://github.com/p2sr/GhostServer" target="_blank">ghost server</a>.</li>
6262
<li>Tools for easier segmented run creation.</li>
6363
</ul>

src/Features/Camera.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ Variable sar_cam_control("sar_cam_control", "0", 0, 3,
2727
"2 = Cinematic mode (camera is controlled by predefined path).\n"
2828
"3 = Follow mode (Camera is following the player but not rotating, useful when strafing on gel).\n");
2929

30-
Variable sar_cam_drive("sar_cam_drive", "1", 0, 1,
30+
Variable sar_cam_drive("sar_cam_drive", "2", 0, 2,
3131
"Enables or disables camera drive mode in-game "
32-
"(turning it on is not required for demo player)\n");
32+
"(turning it on is not required for demo player)\n"
33+
"1 = enabled when LMB is held\n"
34+
"2 = always enabled\n");
3335

3436
Variable sar_cam_ortho("sar_cam_ortho", "0", 0, 1, "Enables or disables camera orthographic projection.\n");
3537
Variable sar_cam_ortho_scale("sar_cam_ortho_scale", "1", 0.001f, "Changes the scale of orthographic projection (how many units per pixel).\n");
@@ -90,9 +92,9 @@ float Camera::GetCurrentPathTime() {
9092
//if in drive mode, checks if player wants to control the camera
9193
//for now it requires LMB input (as in demo drive mode)
9294
bool Camera::IsDriving() {
93-
bool drivingInGame = sar_cam_drive.GetBool() && sv_cheats.GetBool() && engine->hoststate->m_activeGame;
95+
bool drivingInGame = sar_cam_drive.GetBool() && engine->hoststate->m_activeGame;
9496
bool drivingInDemo = engine->demoplayer->IsPlaying();
95-
bool wantingToDrive = inputSystem->IsKeyDown(ButtonCode_t::MOUSE_LEFT);
97+
bool wantingToDrive = sar_cam_drive.GetInt() == 2 || inputSystem->IsKeyDown(ButtonCode_t::MOUSE_LEFT);
9698
bool isUI = vgui->IsUIVisible();
9799

98100
return (camera->controlType == Drive || camera->controlType == Follow) && wantingToDrive && (drivingInGame || drivingInDemo) && !isUI;

0 commit comments

Comments
 (0)