diff --git a/client.cs b/client.cs index 736c109..95f81cf 100644 --- a/client.cs +++ b/client.cs @@ -103,7 +103,7 @@ function RPGClient_EnableOverlay() enabled = "1"; }; PlayGui.add(RPGClient_Mouse); - RPGClient_Mouse.pushToBack(); + PlayGui.pushToBack(RPGClient_Mouse); if (isObject(RPGClient_KeyMap)) { RPGClient_KeyMap.delete(); @@ -113,8 +113,8 @@ function RPGClient_EnableOverlay() RPGClient_KeyMap.bind(keyboard0, d, RPGClient_YawRight); RPGClient_KeyMap.bind(keyboard0, left, RPGClient_YawLeft); RPGClient_KeyMap.bind(keyboard0, right, RPGClient_YawRight); - RPGClient_KeyMap.bind(keyboard0, pgup, RPGClient_ZoomIn); - RPGClient_KeyMap.bind(keyboard0, pgdn, RPGClient_ZoomOut); + RPGClient_KeyMap.bind(keyboard0, "pageup", RPGClient_ZoomIn); + RPGClient_KeyMap.bind(keyboard0, "pagedown", RPGClient_ZoomOut); RPGClient_KeyMap.bind(keyboard0, equals, RPGClient_ZoomIn); RPGClient_KeyMap.bind(keyboard0, minus, RPGClient_ZoomOut); Canvas.pushDialog(RPGClient_Mouse, 0); @@ -202,12 +202,18 @@ function RPGClient_ZoomOut(%val) RPGClient_ApplyCamera(); } +function RPGClient_SendHello() +{ + if (!isObject(serverConnection)) + { + return; + } + commandToServer('RPG_Hello', $RPGClient::Version); +} + function clientCmdRPG_Probe() { - if (isObject(serverConnection)) - { - commandToServer('RPG_Hello', $RPGClient::Version); - } + RPGClient_SendHello(); } function clientCmdRPG_Welcome(%serverProto, %accepted) @@ -362,4 +368,15 @@ package RPGClient_Cleanup }; activatePackage(RPGClient_Cleanup); +package RPGClient_Mission +{ + function onMissionDownloadComplete() + { + Parent::onMissionDownloadComplete(); + schedule(200, 0, RPGClient_SendHello); + schedule(2000, 0, RPGClient_SendHello); + } +}; +activatePackage(RPGClient_Mission); + echo("Client_RPG loaded (protocol " @ $RPGClient::Version @ ")");