Orbit camera, cursor on, pop moveMap freecam
This commit is contained in:
1 parent
87e735f892
commit
06a77797ca
2 files changed
+38
-5
No files matched your search
@@ -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
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user