diff --git a/client.cs b/client.cs index d6f8290..736c109 100644 --- a/client.cs +++ b/client.cs @@ -1,4 +1,4 @@ -// Client_RPG — top-down camera, click-to-move, and RPG windows for GameMode_RPG. +// Client_RPG - top-down camera, click-to-move, and RPG windows for GameMode_RPG. exec("./ui.cs"); // The server probes with RPG_Probe; reply with serverCmdRPG_Hello(2) to play. @@ -91,7 +91,7 @@ function RPGClient_EnableOverlay() { return; } - %mouse = new GuiMouseEventCtrl(RPGClient_Mouse) + new GuiMouseEventCtrl(RPGClient_Mouse) { className = "RPGClient_Mouse"; horizSizing = "width"; @@ -282,7 +282,7 @@ function RPGClient_Hud_Ensure() { return; } - RPGClient_Hud = new GuiTextCtrl() + new GuiTextCtrl(RPGClient_Hud) { horizSizing = "width"; vertSizing = "top"; @@ -334,35 +334,32 @@ function RPGClient_Dialog_Show(%title, %body, %sec) function RPGClient_List_Begin(%title, %page, %pages) { - if (isObject(RPGClient_List)) - { - RPGClient_List.delete(); - } - RPGClient_List = ""; - RPGClient_ListTitle = %title @ " (" @ (%page + 1) @ "/" @ %pages @ ")"; + $RPGClient::ListBody = ""; + $RPGClient::ListTitle = %title @ " (" @ (%page + 1) @ "/" @ %pages @ ")"; } function RPGClient_List_Row(%row) { - RPGClient_List = RPGClient_List @ %row @ "\n"; + $RPGClient::ListBody = $RPGClient::ListBody @ %row @ "\n"; } function RPGClient_List_End() { - if (RPGClient_List !$= "") + if ($RPGClient::ListBody !$= "") { - messageBoxOK(RPGClient_ListTitle, RPGClient_List, ""); + messageBoxOK($RPGClient::ListTitle, $RPGClient::ListBody, ""); } } -package RPGClient_Disconnect +package RPGClient_Cleanup { - function disconnect() + function disconnectedCleanup(%doReconnect) { RPGClient_DisableOverlay(); - Parent::disconnect(); + RPGClient_UnbindKeys(); + Parent::disconnectedCleanup(%doReconnect); } }; -activatePackage(RPGClient_Disconnect); +activatePackage(RPGClient_Cleanup); echo("Client_RPG loaded (protocol " @ $RPGClient::Version @ ")");