Fixed the lazy "fix" which caused mobs that Login or Logout to lose their hotkey mode; even when they transfer to another mob.

This commit is contained in:
Giacomand
2014-04-12 20:49:56 +01:00
parent 1d25935a47
commit 16ae0d9f0d
2 changed files with 19 additions and 4 deletions
@@ -1,11 +1,12 @@
/mob/living/silicon/robot/Login()
..()
regenerate_icons()
show_laws(0)
if(mind) ticker.mode.remove_revolutionary(mind)
winset(src, null, "mainwindow.macro=borgmacro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")
/mob/living/silicon/robot/update_hotkey_mode()
winset(src, null, "mainwindow.macro=borghotkeymode hotkey_toggle.is-checked=true mapwindow.map.focus=true input.background-color=#F0F0F0")
return
/mob/living/silicon/robot/update_normal_mode()
winset(src, null, "mainwindow.macro=borgmacro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")
+15 -1
View File
@@ -47,6 +47,20 @@
if(isobj(loc))
var/obj/Loc=loc
Loc.on_log()
//set macro to normal incase it was overriden (like cyborg currently does)
update_interface()
/mob/proc/update_interface()
if(client)
if(winget(src, "hotkey_toggle", "is-checked"))
update_hotkey_mode()
else
update_normal_mode()
/mob/proc/update_hotkey_mode()
winset(src, null, "mainwindow.macro=hotkeymode hotkey_toggle.is-checked=true mapwindow.map.focus=true input.background-color=#F0F0F0")
/mob/proc/update_normal_mode()
winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")