Hotkey/interface update

This commit is contained in:
Markolie
2015-09-30 01:02:58 +02:00
parent 0034a8a116
commit 2f9fd64a55
12 changed files with 716 additions and 99 deletions
+10 -15
View File
@@ -519,21 +519,16 @@ var/global/nologevent = 0
if(!check_rights(R_SERVER))
return
var/confirm = alert("Restart the game world?", "Restart", "Yes", "Cancel")
if(confirm == "Cancel")
return
if(confirm == "Yes")
var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num
if(isnull(delay))
delay = 50
else
delay = delay * 10
message_admins("[key_name_admin(usr)] has initiated a server restart with a delay of [delay/10] seconds")
log_admin("[key_name(usr)] has initiated a server restart with a delay of [delay/10] seconds")
ticker.delay_end = 0
feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
world.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay)
var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null
if(isnull(delay))
delay = 50
else
delay = delay * 10
message_admins("[key_name_admin(usr)] has initiated a server restart with a delay of [delay/10] seconds")
log_admin("[key_name(usr)] has initiated a server restart with a delay of [delay/10] seconds")
ticker.delay_end = 0
feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
world.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay)
/datum/admins/proc/announce()
set category = "Special Verbs"
+5 -2
View File
@@ -60,7 +60,7 @@
//adv. hotkey mode vars, code using them in /interface/interface.dm//
/////////////////////////////////////////////////////////////////////
var/hotkeytype = "QWERTY" //what set of hotkeys is in use(defaulting to QWERTY because I can't be bothered to ake this save on SQL)
var/hotkeytype = "QWERTY" //what set of hotkeys is in use(defaulting to QWERTY because I can't be bothered to make this save on SQL)
var/hotkeyon = 0 //is the hotkey on?
var/hotkeylist = list( //list defining hotkey types, look at lists in place for structure if adding any if the future
@@ -69,7 +69,10 @@
"off" = "macro"),
"AZERTY" = list(
"on" = "AZERTYon",
"off" = "AZERTYoff")
"off" = "AZERTYoff"),
"Cyborg" = list(
"on" = "borghotkeymode",
"off" = "borgmacro")
)
var/reset_stretch = 0 //Used by things that fiddle with client's stretch-to-fit.
+4
View File
@@ -17,3 +17,7 @@
/mob/camera/Destroy()
..()
return QDEL_HINT_HARDDEL_NOW
/mob/camera/Login()
..()
update_interface()
+3 -1
View File
@@ -2,4 +2,6 @@
..()
if (ghostimage)
ghostimage.icon_state = src.icon_state
updateghostimages()
updateghostimages()
update_interface()
+2
View File
@@ -12,6 +12,8 @@
src << "<span class='notice'>You can ventcrawl! Use alt+click on vents to quickly travel about the station.</span>"
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
update_pipe_vision()
update_interface()
//Round specific stuff like hud updates
if(ticker && ticker.mode)
+11 -1
View File
@@ -6,4 +6,14 @@
if(mind) ticker.mode.remove_revolutionary(mind)
if(mind) ticker.mode.remove_thrall(mind,0)
if(mind) ticker.mode.remove_shadowling(mind)
return
return
/mob/living/silicon/robot/update_hotkey_mode()
client.hotkeytype = "Cyborg"
client.hotkeyon = 1
winset(src, null, "mainwindow.macro=borghotkeymode hotkey_toggle.is-checked=true mapwindow.map.focus=true input.background-color=#F0F0F0")
/mob/living/silicon/robot/update_normal_mode()
client.hotkeytype = "Cyborg"
client.hotkeyon = 0
winset(src, null, "mainwindow.macro=borgmacro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")
@@ -377,6 +377,17 @@ var/list/robot_verbs_default = list(
updatename()
update_icons()
//for borg hotkeys, here module refers to borg inv slot, not core module
/mob/living/silicon/robot/verb/cmd_toggle_module(module as num)
set name = "Toggle Module"
set hidden = 1
toggle_module(module)
/mob/living/silicon/robot/verb/cmd_unequip_module()
set name = "Unequip Module"
set hidden = 1
uneq_active()
// this verb lets cyborgs see the stations manifest
/mob/living/silicon/robot/verb/cmd_station_manifest()
set category = "Robot Commands"
+21
View File
@@ -60,3 +60,24 @@
client.verbs |= H.species.abilities
CallHook("Login", list("client" = src.client, "mob" = src))
// 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()
/mob/proc/update_hotkey_mode()
var/hotkeys = client.hotkeylist[client.hotkeytype]
var/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")
/mob/proc/update_normal_mode()
var/hotkeys = client.hotkeylist[client.hotkeytype]//get the list containing the hotkey names
var/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")