From dc4d149832cf8c8b23abf16402a41e1ccd74f05f Mon Sep 17 00:00:00 2001 From: Neerti Date: Fri, 13 Mar 2015 21:41:23 -0400 Subject: [PATCH] Ports /tg/'s borg hotkeys. They work similarly to the AI's hotkeys. --- code/_onclick/ai.dm | 11 + code/_onclick/click.dm | 14 + code/_onclick/cyborg.dm | 52 ++ .../mob/living/silicon/robot/inventory.dm | 11 + .../modules/mob/living/silicon/robot/login.dm | 3 + code/modules/mob/login.dm | 5 +- interface/interface.dm | 69 ++- interface/skin.dmf | 489 +++++++++++++++++- 8 files changed, 628 insertions(+), 26 deletions(-) diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 0bedcfa588..e05cbeb9ba 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -36,6 +36,9 @@ return var/list/modifiers = params2list(params) + if(modifiers["shift"] && modifiers["ctrl"]) + CtrlShiftClickOn(A) + return if(modifiers["middle"]) MiddleClickOn(A) return @@ -101,6 +104,14 @@ I have no idea why it was in atoms.dm instead of respective files. */ +/atom/proc/AICtrlShiftClick() + return + +/obj/machinery/door/airlock/AICtrlShiftClick() + if(emagged) + return + return + /atom/proc/AIShiftClick() return diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 6ce3ffad46..abd7542d6c 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -45,6 +45,9 @@ return var/list/modifiers = params2list(params) + if(modifiers["shift"] && modifiers["ctrl"]) + CtrlShiftClickOn(A) + return if(modifiers["middle"]) MiddleClickOn(A) return @@ -292,6 +295,17 @@ /mob/proc/TurfAdjacent(var/turf/T) return T.AdjacentQuick(src) +/* + Control+Shift click + Unused except for AI +*/ +/mob/proc/CtrlShiftClickOn(var/atom/A) + A.CtrlShiftClick(src) + return + +/atom/proc/CtrlShiftClick(var/mob/user) + return + /* Misc helpers diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 04682c76ad..5986011688 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -16,6 +16,9 @@ return var/list/modifiers = params2list(params) + if(modifiers["shift"] && modifiers["ctrl"]) + CtrlShiftClickOn(A) + return if(modifiers["middle"]) MiddleClickOn(A) return @@ -109,6 +112,55 @@ cycle_modules() return +//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks +// for non-doors/apcs +/mob/living/silicon/robot/CtrlShiftClickOn(var/atom/A) + A.BorgCtrlShiftClick(src) + +/mob/living/silicon/robot/ShiftClickOn(var/atom/A) + A.BorgShiftClick(src) + +/mob/living/silicon/robot/CtrlClickOn(var/atom/A) + A.BorgCtrlClick(src) + +/mob/living/silicon/robot/AltClickOn(var/atom/A) + A.BorgAltClick(src) + +/atom/proc/BorgCtrlShiftClick(var/mob/living/silicon/robot/user) //forward to human click if not overriden + CtrlShiftClick(user) + +/obj/machinery/door/airlock/BorgCtrlShiftClick() + AICtrlShiftClick() + +/atom/proc/BorgShiftClick(var/mob/living/silicon/robot/user) //forward to human click if not overriden + ShiftClick(user) + +/obj/machinery/door/airlock/BorgShiftClick() // Opens and closes doors! Forwards to AI code. + AIShiftClick() + + +/atom/proc/BorgCtrlClick(var/mob/living/silicon/robot/user) //forward to human click if not overriden + CtrlClick(user) + +/obj/machinery/door/airlock/BorgCtrlClick() // Bolts doors. Forwards to AI code. + AICtrlClick() + +/obj/machinery/power/apc/BorgCtrlClick() // turns off/on APCs. Forwards to AI code. + AICtrlClick() + +/obj/machinery/turretid/BorgCtrlClick() //turret control on/off. Forwards to AI code. + AICtrlClick() + +/atom/proc/BorgAltClick(var/mob/living/silicon/robot/user) + AltClick(user) + return + +/obj/machinery/door/airlock/BorgAltClick() // Eletrifies doors. Forwards to AI code. + AIAltClick() + +/obj/machinery/turretid/BorgAltClick() //turret lethal on/off. Forwards to AI code. + AIAltClick() + /* As with AI, these are not used in click code, because the code for robots is specific, not generic. diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 794b983f66..7d14d3c437 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -7,6 +7,17 @@ /*-------TODOOOOOOOOOO--------*/ +//Verbs used by hotkeys. +/mob/living/silicon/robot/verb/cmd_unequip_module() + set name = "unequip-module" + set hidden = 1 + uneq_active() + +/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/proc/uneq_active() if(isnull(module_active)) return diff --git a/code/modules/mob/living/silicon/robot/login.dm b/code/modules/mob/living/silicon/robot/login.dm index 3aef61fb3d..4299fc730f 100644 --- a/code/modules/mob/living/silicon/robot/login.dm +++ b/code/modules/mob/living/silicon/robot/login.dm @@ -3,4 +3,7 @@ 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") + return \ No newline at end of file diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index c888218605..d34a309ee3 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -43,4 +43,7 @@ client.perspective = EYE_PERSPECTIVE else client.eye = src - client.perspective = MOB_PERSPECTIVE \ No newline at end of file + client.perspective = MOB_PERSPECTIVE + + //set macro to normal incase it was overriden (like cyborg currently does) + winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5") diff --git a/interface/interface.dm b/interface/interface.dm index e788afb7c1..31312c277b 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -35,6 +35,14 @@ set name = "hotkeys-help" set category = "OOC" + var/admin = {" +Admin: +\tF5 = Aghost (admin-ghost) +\tF6 = player-panel-new +\tF7 = admin-pm +\tF8 = Invisimin +"} + var/hotkey_mode = {" Hotkey-Mode: (hotkey-mode must be on) \tTAB = toggle hotkey-mode @@ -55,6 +63,8 @@ Hotkey-Mode: (hotkey-mode must be on) \t2 = disarm-intent \t3 = grab-intent \t4 = harm-intent +\tCtrl = drag +\tShift = examine "} var/other = {" @@ -86,15 +96,58 @@ Any-Mode: (hotkey doesn't need to be on) \tEND = throw "} - var/admin = {" -Admin: -\tF5 = Aghost (admin-ghost) -\tF6 = player-panel-new -\tF7 = admin-pm -\tF8 = Invisimin + var/robot_hotkey_mode = {" +Hotkey-Mode: (hotkey-mode must be on) +\tTAB = toggle hotkey-mode +\ta = left +\ts = down +\td = right +\tw = up +\tq = unequip active module +\tt = say +\tx = cycle active modules +\tz = activate held object (or y) +\tf = cycle-intents-left +\tg = cycle-intents-right +\t1 = activate module 1 +\t2 = activate module 2 +\t3 = activate module 3 +\t4 = toggle intents +\t5 = emote +\tCtrl = drag +\tShift = examine "} - src << hotkey_mode - src << other + var/robot_other = {" +Any-Mode: (hotkey doesn't need to be on) +\tCtrl+a = left +\tCtrl+s = down +\tCtrl+d = right +\tCtrl+w = up +\tCtrl+q = unequip active module +\tCtrl+x = cycle active modules +\tCtrl+z = activate held object (or Ctrl+y) +\tCtrl+f = cycle-intents-left +\tCtrl+g = cycle-intents-right +\tCtrl+1 = activate module 1 +\tCtrl+2 = activate module 2 +\tCtrl+3 = activate module 3 +\tCtrl+4 = toggle intents +\tF1 = adminhelp +\tF2 = ooc +\tF3 = say +\tF4 = emote +\tDEL = pull +\tINS = toggle intents +\tPGUP = cycle active modules +\tPGDN = activate held object +"} + + if(isrobot(src.mob)) + src << robot_hotkey_mode + src << robot_other + else + src << hotkey_mode + src << other if(holder) src << admin diff --git a/interface/skin.dmf b/interface/skin.dmf index d068054731..68acfba607 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -1,3 +1,269 @@ +macro "borghotkeymode" + elem + name = "TAB" + command = ".winset \"mainwindow.macro=borgmacro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5\"" + is-disabled = false + elem + name = "CENTER+REP" + command = ".center" + is-disabled = false + elem + name = "NORTHEAST" + command = ".northeast" + is-disabled = false + elem + name = "SOUTHEAST" + command = ".southeast" + is-disabled = false + elem + name = "SOUTHWEST" + command = ".southwest" + is-disabled = false + elem + name = "NORTHWEST" + command = ".northwest" + is-disabled = false + elem + name = "ALT+WEST" + command = "westfaceperm" + is-disabled = false + elem + name = "CTRL+WEST" + command = "westface" + is-disabled = false + elem + name = "WEST+REP" + command = ".west" + is-disabled = false + elem + name = "ALT+NORTH" + command = "northfaceperm" + is-disabled = false + elem + name = "CTRL+NORTH" + command = "northface" + is-disabled = false + elem + name = "NORTH+REP" + command = ".north" + is-disabled = false + elem + name = "ALT+EAST" + command = "eastfaceperm" + is-disabled = false + elem + name = "CTRL+EAST" + command = "eastface" + is-disabled = false + elem + name = "EAST+REP" + command = ".east" + is-disabled = false + elem + name = "ALT+SOUTH" + command = "southfaceperm" + is-disabled = false + elem + name = "CTRL+SOUTH" + command = "southface" + is-disabled = false + elem + name = "SOUTH+REP" + command = ".south" + is-disabled = false + elem + name = "1" + command = "toggle-module 1" + is-disabled = false + elem + name = "CTRL+1" + command = "toggle-module 1" + is-disabled = false + elem + name = "2" + command = "toggle-module 2" + is-disabled = false + elem + name = "CTRL+2" + command = "toggle-module 2" + is-disabled = false + elem + name = "3" + command = "toggle-module 3" + is-disabled = false + elem + name = "CTRL+3" + command = "toggle-module 3" + is-disabled = false + elem + name = "4" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+4" + command = "a-intent left" + is-disabled = false + elem + name = "INSERT" + command = "a-intent right" + is-disabled = false + elem + name = "DELETE" + command = "delete-key-pressed" + is-disabled = false + elem + name = "5" + command = ".me" + is-disabled = false + elem + name = "A+REP" + command = ".west" + is-disabled = false + elem + name = "CTRL+A+REP" + command = ".west" + is-disabled = false + elem + name = "D+REP" + command = ".east" + is-disabled = false + elem + name = "CTRL+D+REP" + command = ".east" + is-disabled = false + elem + name = "F" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+F" + command = "a-intent left" + is-disabled = false + elem + name = "G" + command = "a-intent right" + is-disabled = false + elem + name = "CTRL+G" + command = "a-intent right" + is-disabled = false + elem + name = "J" + command = "toggle-gun-mode" + is-disabled = false + elem + name = "CTRL+J" + command = "toggle-gun-mode" + is-disabled = false + elem + name = "Q" + command = "unequip-module" + is-disabled = false + elem + name = "CTRL+Q" + command = "unequip-module" + is-disabled = false + elem + name = "R" + command = ".southwest" + is-disabled = false + elem + name = "CTRL+R" + command = ".southwest" + is-disabled = false + elem "s_key" + name = "S+REP" + command = ".south" + is-disabled = false + elem + name = "CTRL+S+REP" + command = ".south" + is-disabled = false + elem + name = "T" + command = ".say" + is-disabled = false + elem "w_key" + name = "W+REP" + command = ".north" + is-disabled = false + elem + name = "CTRL+W+REP" + command = ".north" + is-disabled = false + elem + name = "X" + command = ".northeast" + is-disabled = false + elem + name = "CTRL+X" + command = ".northeast" + is-disabled = false + elem + name = "Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "F1" + command = "adminhelp" + is-disabled = false + elem + name = "CTRL+SHIFT+F1+REP" + command = ".options" + is-disabled = false + elem + name = "F2" + command = "ooc" + is-disabled = false + elem + name = "F2+REP" + command = ".screenshot auto" + is-disabled = false + elem + name = "SHIFT+F2+REP" + command = ".screenshot" + is-disabled = false + elem + name = "F3" + command = ".say" + is-disabled = false + elem + name = "F4" + command = ".me" + is-disabled = false + elem + name = "F5" + command = "asay" + is-disabled = false + elem + name = "F6" + command = "Player-Panel-New" + is-disabled = false + elem + name = "F7" + command = "Admin-PM" + is-disabled = false + elem + name = "F8" + command = "Invisimin" + is-disabled = false + elem + name = "F12" + command = "F12" + is-disabled = false + macro "macro" elem name = "TAB" @@ -217,6 +483,10 @@ macro "hotkeymode" name = "NORTHWEST" command = ".northwest" is-disabled = false + elem + name = "ALT+WEST" + command = "westfaceperm" + is-disabled = false elem name = "CTRL+WEST" command = "westface" @@ -225,6 +495,10 @@ macro "hotkeymode" name = "WEST+REP" command = ".west" is-disabled = false + elem + name = "ALT+NORTH" + command = "northfaceperm" + is-disabled = false elem name = "CTRL+NORTH" command = "northface" @@ -233,6 +507,10 @@ macro "hotkeymode" name = "NORTH+REP" command = ".north" is-disabled = false + elem + name = "ALT+EAST" + command = "eastfaceperm" + is-disabled = false elem name = "CTRL+EAST" command = "eastface" @@ -241,6 +519,10 @@ macro "hotkeymode" name = "EAST+REP" command = ".east" is-disabled = false + elem + name = "ALT+SOUTH" + command = "southfaceperm" + is-disabled = false elem name = "CTRL+SOUTH" command = "southface" @@ -249,23 +531,6 @@ macro "hotkeymode" name = "SOUTH+REP" command = ".south" is-disabled = false - elem - name = "ALT+WEST" - command = "westfaceperm" - is-disabled = false - is-disabled = false - elem - name = "ALT+NORTH" - command = "northfaceperm" - is-disabled = false - elem - name = "ALT+EAST" - command = "eastfaceperm" - is-disabled = false - elem - name = "ALT+SOUTH" - command = "southfaceperm" - is-disabled = false elem name = "INSERT" command = "a-intent right" @@ -475,6 +740,196 @@ macro "hotkeymode" command = "F12" is-disabled = false +macro "borgmacro" + elem + name = "TAB" + command = ".winset \"mainwindow.macro=borghotkeymode hotkey_toggle.is-checked=true mapwindow.map.focus=true input.background-color=#F0F0F0\"" + is-disabled = false + elem + name = "CENTER+REP" + command = ".center" + is-disabled = false + elem + name = "NORTHEAST" + command = ".northeast" + is-disabled = false + elem + name = "SOUTHEAST" + command = ".southeast" + is-disabled = false + elem + name = "SOUTHWEST" + command = ".southwest" + is-disabled = false + elem + name = "NORTHWEST" + command = ".northwest" + is-disabled = false + elem + name = "ALT+WEST" + command = "westfaceperm" + is-disabled = false + elem + name = "CTRL+WEST" + command = "westface" + is-disabled = false + elem + name = "WEST+REP" + command = ".west" + is-disabled = false + elem + name = "ALT+NORTH" + command = "northfaceperm" + is-disabled = false + elem + name = "CTRL+NORTH" + command = "northface" + is-disabled = false + elem + name = "NORTH+REP" + command = ".north" + is-disabled = false + elem + name = "ALT+EAST" + command = "eastfaceperm" + is-disabled = false + elem + name = "CTRL+EAST" + command = "eastface" + is-disabled = false + elem + name = "EAST+REP" + command = ".east" + is-disabled = false + elem + name = "ALT+SOUTH" + command = "southfaceperm" + is-disabled = false + elem + name = "CTRL+SOUTH" + command = "southface" + is-disabled = false + elem + name = "SOUTH+REP" + command = ".south" + is-disabled = false + elem + name = "INSERT" + command = "a-intent right" + is-disabled = false + elem + name = "DELETE" + command = "delete-key-pressed" + is-disabled = false + elem + name = "CTRL+1" + command = "toggle-module 1" + is-disabled = false + elem + name = "CTRL+2" + command = "toggle-module 2" + is-disabled = false + elem + name = "CTRL+3" + command = "toggle-module 3" + is-disabled = false + elem + name = "CTRL+4" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+A+REP" + command = ".west" + is-disabled = false + elem + name = "CTRL+D+REP" + command = ".east" + is-disabled = false + elem + name = "CTRL+F" + command = "a-intent left" + is-disabled = false + elem + name = "CTRL+G" + command = "a-intent right" + is-disabled = false + elem + name = "CTRL+Q" + command = ".northwest" + is-disabled = false + elem + name = "CTRL+R" + command = ".southwest" + is-disabled = false + elem + name = "CTRL+S+REP" + command = ".south" + is-disabled = false + elem + name = "CTRL+W+REP" + command = ".north" + is-disabled = false + elem + name = "CTRL+X" + command = ".northeast" + is-disabled = false + elem + name = "CTRL+Y" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "CTRL+Z" + command = "Activate-Held-Object" + is-disabled = false + elem + name = "F1" + command = "adminhelp" + is-disabled = false + elem + name = "CTRL+SHIFT+F1+REP" + command = ".options" + is-disabled = false + elem + name = "F2" + command = "ooc" + is-disabled = false + elem + name = "F2+REP" + command = ".screenshot auto" + is-disabled = false + elem + name = "SHIFT+F2+REP" + command = ".screenshot" + is-disabled = false + elem + name = "F3" + command = ".say" + is-disabled = false + elem + name = "F4" + command = ".me" + is-disabled = false + elem + name = "F5" + command = "asay" + is-disabled = false + elem + name = "F6" + command = "Player-Panel-New" + is-disabled = false + elem + name = "F7" + command = "Admin-PM" + is-disabled = false + elem + name = "F8" + command = "Invisimin" + is-disabled = false + elem + name = "F12" + command = "F12" + is-disabled = false + menu "menu" elem