Ports /tg/'s borg hotkeys. They work similarly to the AI's hotkeys.

This commit is contained in:
Neerti
2015-03-13 21:41:23 -04:00
parent 9c30024ca0
commit dc4d149832
8 changed files with 628 additions and 26 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -44,3 +44,6 @@
else
client.eye = src
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")

View File

@@ -35,6 +35,14 @@
set name = "hotkeys-help"
set category = "OOC"
var/admin = {"<font color='purple'>
Admin:
\tF5 = Aghost (admin-ghost)
\tF6 = player-panel-new
\tF7 = admin-pm
\tF8 = Invisimin
</font>"}
var/hotkey_mode = {"<font color='purple'>
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
</font>"}
var/other = {"<font color='purple'>
@@ -86,14 +96,57 @@ Any-Mode: (hotkey doesn't need to be on)
\tEND = throw
</font>"}
var/admin = {"<font color='purple'>
Admin:
\tF5 = Aghost (admin-ghost)
\tF6 = player-panel-new
\tF7 = admin-pm
\tF8 = Invisimin
var/robot_hotkey_mode = {"<font color='purple'>
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
</font>"}
var/robot_other = {"<font color='purple'>
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
</font>"}
if(isrobot(src.mob))
src << robot_hotkey_mode
src << robot_other
else
src << hotkey_mode
src << other
if(holder)

View File

@@ -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