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::HelloPending = 0;
|
||||||
$RPGClient::HelloLast = "";
|
$RPGClient::HelloLast = "";
|
||||||
$RPGClient::TopDownWatchSched = 0;
|
$RPGClient::TopDownWatchSched = 0;
|
||||||
|
$RPGClient::CamSched = 0;
|
||||||
|
$RPGClient::MoveMapHeld = 0;
|
||||||
|
|
||||||
function RPGClient_NormPos(%ctrl, %pos)
|
function RPGClient_NormPos(%ctrl, %pos)
|
||||||
{
|
{
|
||||||
@@ -122,6 +124,17 @@ function RPGClient_EnableOverlay()
|
|||||||
RPGClient_KeyMap.bind(keyboard0, minus, RPGClient_ZoomOut);
|
RPGClient_KeyMap.bind(keyboard0, minus, RPGClient_ZoomOut);
|
||||||
Canvas.pushDialog(RPGClient_Mouse, 0);
|
Canvas.pushDialog(RPGClient_Mouse, 0);
|
||||||
RPGClient_KeyMap.push();
|
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))
|
if (isObject(PlayGui))
|
||||||
{
|
{
|
||||||
PlayGui.killToolHud();
|
PlayGui.killToolHud();
|
||||||
@@ -130,6 +143,13 @@ function RPGClient_EnableOverlay()
|
|||||||
|
|
||||||
function RPGClient_DisableOverlay()
|
function RPGClient_DisableOverlay()
|
||||||
{
|
{
|
||||||
|
cancel($RPGClient::CamSched);
|
||||||
|
$RPGClient::CamSched = 0;
|
||||||
|
if ($RPGClient::MoveMapHeld && isObject(moveMap))
|
||||||
|
{
|
||||||
|
moveMap.push();
|
||||||
|
$RPGClient::MoveMapHeld = 0;
|
||||||
|
}
|
||||||
if (isObject(RPGClient_KeyMap))
|
if (isObject(RPGClient_KeyMap))
|
||||||
{
|
{
|
||||||
RPGClient_KeyMap.pop();
|
RPGClient_KeyMap.pop();
|
||||||
@@ -139,6 +159,10 @@ function RPGClient_DisableOverlay()
|
|||||||
Canvas.popDialog(RPGClient_Mouse);
|
Canvas.popDialog(RPGClient_Mouse);
|
||||||
RPGClient_Mouse.delete();
|
RPGClient_Mouse.delete();
|
||||||
}
|
}
|
||||||
|
if (isObject(Canvas) && Canvas.isCursorOn())
|
||||||
|
{
|
||||||
|
Canvas.cursorOff();
|
||||||
|
}
|
||||||
$RPGClient::Active = 0;
|
$RPGClient::Active = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,12 +196,22 @@ function RPGClient_ApplyCamera()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
%conn.setControlObject(%cam);
|
%conn.setControlObject(%cam);
|
||||||
%rot = "0 0" SPC mSin($RPGClient::Yaw / 2) SPC mCos($RPGClient::Yaw / 2);
|
$mvFreeLook = 0;
|
||||||
%cam.setOrbitMode(%body, %body.getTransform(), 4, 32, $RPGClient::Dist);
|
%cam.setOrbitMode(%body, %cam.getTransform(), 0, 32, $RPGClient::Dist);
|
||||||
%cam.thirdPersonOnly = 1;
|
%cam.thirdPersonOnly = 1;
|
||||||
commandToServer('RPG_CamSync', $RPGClient::Yaw, $RPGClient::Dist);
|
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)
|
function RPGClient_YawLeft(%val)
|
||||||
{
|
{
|
||||||
if (!$RPGClient::Active || %val == 0)
|
if (!$RPGClient::Active || %val == 0)
|
||||||
@@ -300,8 +334,7 @@ function clientCmdRPG_TopDown(%on, %yaw, %dist)
|
|||||||
$RPGClient::Dist = %dist > 0 ? %dist : 14;
|
$RPGClient::Dist = %dist > 0 ? %dist : 14;
|
||||||
RPGClient_EnableOverlay();
|
RPGClient_EnableOverlay();
|
||||||
RPGClient_BindKeys();
|
RPGClient_BindKeys();
|
||||||
schedule(50, 0, RPGClient_ApplyCamera);
|
RPGClient_ScheduleCamera();
|
||||||
schedule(200, 0, RPGClient_ApplyCamera);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user