Merge pull request #957 from Krausus/CyborgHotkeys

Cyborg Pointing and Deselect/Unequip Module Hotkeys
This commit is contained in:
ZomgPonies
2015-05-07 02:03:43 -04:00
4 changed files with 46 additions and 8 deletions
+13 -2
View File
@@ -22,6 +22,9 @@
if(modifiers["shift"] && modifiers["alt"])
AltShiftClickOn(A)
return
if(modifiers["middle"] && modifiers["ctrl"])
CtrlMiddleClickOn(A)
return
if(modifiers["middle"])
MiddleClickOn(A)
return
@@ -98,11 +101,19 @@
return
return
//Middle click cycles through selected modules.
/mob/living/silicon/robot/MiddleClickOn(var/atom/A)
//Ctrl+Middle click cycles through modules
/mob/living/silicon/robot/proc/CtrlMiddleClickOn(var/atom/A)
cycle_modules()
return
//Middle click points
/mob/living/silicon/robot/MiddleClickOn(var/atom/A)
if(istype(src, /mob/living/silicon/robot/drone))
// Drones cannot point.
return
A.point()
return
//Give cyborgs hotkey clicks without breaking existing uses of hotkey clicks
// for non-doors/apcs
/mob/living/silicon/robot/CtrlShiftClickOn(var/atom/A)
@@ -37,6 +37,8 @@
else if(module_state_3 == O)
module_state_3 = null
inv3.icon_state = "inv3"
if(hud_used)
hud_used.update_robot_modules_display()
return 1
/mob/living/silicon/robot/proc/activate_module(var/obj/item/O)
@@ -77,6 +79,17 @@
uneq_module(module_state_2)
uneq_module(module_state_3)
/mob/living/silicon/robot/proc/uneq_numbered(var/module)
if(module < 1 || module > 3) return
switch(module)
if(1)
uneq_module(module_state_1)
if(2)
uneq_module(module_state_2)
if(3)
uneq_module(module_state_3)
/mob/living/silicon/robot/proc/activated(obj/item/O)
if(module_state_1 == O)
return 1
+14
View File
@@ -43,6 +43,14 @@
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.toggle_throw_mode()
else if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
var/module = R.get_selected_module()
if(!module)
usr << "\red You have no module selected."
return
R.cycle_modules()
R.uneq_numbered(module)
else
usr << "\red This mob type cannot throw items."
return
@@ -55,6 +63,12 @@
usr << "\red You have nothing to drop in your hand."
return
drop_item()
else if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
if(!R.get_selected_module())
usr << "\red You have no module selected."
return
R.deselect_module(R.get_selected_module())
else
usr << "\red This mob type cannot drop items."
return
+6 -6
View File
@@ -68,9 +68,9 @@ Hotkey-Mode: (hotkey-mode must be on)
\ts = down
\td = right
\tw = up
\tq = drop
\tq = drop item / deselect cyborg module
\te = equip
\tr = throw
\tr = toggle throw / unequip cyborg module
\tt = say
\tx = swap-hand
\tz = activate held object (or y)
@@ -88,9 +88,9 @@ Any-Mode: (hotkey doesn't need to be on)
\tCtrl+s = down
\tCtrl+d = right
\tCtrl+w = up
\tCtrl+q = drop
\tCtrl+q = drop item / deselect cyborg module
\tCtrl+e = equip
\tCtrl+r = throw
\tCtrl+r = toggle throw / unequip cyborg module
\tCtrl+x = swap-hand
\tCtrl+z = activate held object (or Ctrl+y)
\tCtrl+f = cycle-intents-left
@@ -101,10 +101,10 @@ Any-Mode: (hotkey doesn't need to be on)
\tCtrl+4 = harm-intent
\tDEL = pull
\tINS = cycle-intents-right
\tHOME = drop
\tHOME = drop item / deselect cyborg module
\tPGUP = swap-hand
\tPGDN = activate held object
\tEND = throw
\tEND = toggle throw / unequip cyborg module
</font>"}
var/admin = {"<font color='purple'>