Changeling Swap Form-related fixes

This commit is contained in:
Krausus
2016-08-25 04:24:27 -04:00
parent 6e1a913d4f
commit 9bba0a7342
8 changed files with 44 additions and 29 deletions
+8 -7
View File
@@ -82,11 +82,12 @@
// Calling update_interface() in /mob/Login() causes the Cyborg to immediately be ghosted; because of winget().
// Calling it in the overriden Login, such as /mob/living/Login() doesn't cause this.
/mob/proc/update_interface()
if(client)
if(winget(src, "mainwindow.hotkey_toggle", "is-checked") == "true")
update_hotkey_mode()
else
update_normal_mode()
spawn() // Spawn off so winget/winset don't delay callers.
if(client)
if(winget(src, "mainwindow.hotkey_toggle", "is-checked") == "true")
update_hotkey_mode()
else
update_normal_mode()
/mob/proc/update_hotkey_mode()
var/hotkeyname = "hotkeymode"
@@ -94,7 +95,7 @@
var/hotkeys = client.hotkeylist[client.hotkeytype]
hotkeyname = hotkeys[client.hotkeyon ? "on" : "off"]
client.hotkeyon = 1
winset(src, null, "mainwindow.macro=[hotkeyname] hotkey_toggle.is-checked=true mapwindow.map.focus=true input.background-color=#F0F0F0")
winset(src, null, "mainwindow.macro=[hotkeyname] hotkey_toggle.is-checked=true mapwindow.map.focus=true input.background-color=#F0F0F0")
/mob/proc/update_normal_mode()
var/hotkeyname = "macro"
@@ -102,4 +103,4 @@
var/hotkeys = client.hotkeylist[client.hotkeytype]//get the list containing the hotkey names
hotkeyname = hotkeys[client.hotkeyon ? "on" : "off"]//get the name of the hotkey, to not clutter winset() to much
client.hotkeyon = 0
winset(src, null, "mainwindow.macro=[hotkeyname] hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")
winset(src, null, "mainwindow.macro=[hotkeyname] hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")