From 06a77797ca5d383ab751001d476492c16b6a7f19 Mon Sep 17 00:00:00 2001 From: RallyBlock Date: Mon, 9 Nov 2026 15:29:06 -0500 Subject: [PATCH] Orbit camera, cursor on, pop moveMap freecam --- client.cs | 41 +++++++++++++++++++++++++++++++++++++---- ui.cs | 2 +- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/client.cs b/client.cs index 69dea46..e395f04 100644 --- a/client.cs +++ b/client.cs @@ -9,6 +9,8 @@ $RPGClient::Dist = 14; $RPGClient::HelloPending = 0; $RPGClient::HelloLast = ""; $RPGClient::TopDownWatchSched = 0; +$RPGClient::CamSched = 0; +$RPGClient::MoveMapHeld = 0; function RPGClient_NormPos(%ctrl, %pos) { @@ -122,6 +124,17 @@ function RPGClient_EnableOverlay() RPGClient_KeyMap.bind(keyboard0, minus, RPGClient_ZoomOut); Canvas.pushDialog(RPGClient_Mouse, 0); RPGClient_KeyMap.push(); + if (isObject(moveMap) && !$RPGClient::MoveMapHeld) + { + moveMap.pop(); + $RPGClient::MoveMapHeld = 1; + } + $mvFreeLook = 0; + $firstPerson = 0; + if (isObject(Canvas)) + { + Canvas.cursorOn(); + } if (isObject(PlayGui)) { PlayGui.killToolHud(); @@ -130,6 +143,13 @@ function RPGClient_EnableOverlay() function RPGClient_DisableOverlay() { + cancel($RPGClient::CamSched); + $RPGClient::CamSched = 0; + if ($RPGClient::MoveMapHeld && isObject(moveMap)) + { + moveMap.push(); + $RPGClient::MoveMapHeld = 0; + } if (isObject(RPGClient_KeyMap)) { RPGClient_KeyMap.pop(); @@ -139,6 +159,10 @@ function RPGClient_DisableOverlay() Canvas.popDialog(RPGClient_Mouse); RPGClient_Mouse.delete(); } + if (isObject(Canvas) && Canvas.isCursorOn()) + { + Canvas.cursorOff(); + } $RPGClient::Active = 0; } @@ -172,12 +196,22 @@ function RPGClient_ApplyCamera() return; } %conn.setControlObject(%cam); - %rot = "0 0" SPC mSin($RPGClient::Yaw / 2) SPC mCos($RPGClient::Yaw / 2); - %cam.setOrbitMode(%body, %body.getTransform(), 4, 32, $RPGClient::Dist); + $mvFreeLook = 0; + %cam.setOrbitMode(%body, %cam.getTransform(), 0, 32, $RPGClient::Dist); %cam.thirdPersonOnly = 1; commandToServer('RPG_CamSync', $RPGClient::Yaw, $RPGClient::Dist); } +function RPGClient_ScheduleCamera() +{ + cancel($RPGClient::CamSched); + $RPGClient::CamSched = schedule(50, 0, RPGClient_ApplyCamera); + schedule(200, 0, RPGClient_ApplyCamera); + schedule(500, 0, RPGClient_ApplyCamera); + schedule(1200, 0, RPGClient_ApplyCamera); + schedule(2500, 0, RPGClient_ApplyCamera); +} + function RPGClient_YawLeft(%val) { if (!$RPGClient::Active || %val == 0) @@ -300,8 +334,7 @@ function clientCmdRPG_TopDown(%on, %yaw, %dist) $RPGClient::Dist = %dist > 0 ? %dist : 14; RPGClient_EnableOverlay(); RPGClient_BindKeys(); - schedule(50, 0, RPGClient_ApplyCamera); - schedule(200, 0, RPGClient_ApplyCamera); + RPGClient_ScheduleCamera(); } else { diff --git a/ui.cs b/ui.cs index 5ed973e..cc75ddd 100644 --- a/ui.cs +++ b/ui.cs @@ -8,7 +8,7 @@ function RPGClient_RunCmd(%cmd) { return; } - commandToServer('message', "/rpg " @ %cmd); + commandToServer('Message', "/rpg " @ %cmd); } function RPGClient_ToggleMenu(%name, %cmd)