From a6f2d385f252e6157579c985e4a2d1161cdb7759 Mon Sep 17 00:00:00 2001 From: Krausus Date: Wed, 6 May 2015 00:40:34 -0400 Subject: [PATCH 1/3] Adds cyborg deselect/unequip module hotkeys Drop Item will now deselect, and Toggle Throw will now unequip and cycle to the next module; previously, these hotkeys did nothing for cyborgs. Also, unequipping a module while the module list is open will now update it like it should. --- code/modules/mob/living/silicon/robot/inventory.dm | 13 +++++++++++++ code/modules/mob/mob_movement.dm | 14 ++++++++++++++ interface/interface.dm | 12 ++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 0b481630513..eadef1b98c1 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -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 diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index a50d948dc3b..cc40497b37c 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -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 diff --git a/interface/interface.dm b/interface/interface.dm index cc370f2d626..f1148629515 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -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 "} var/admin = {" From d3e8f2d52e1b4c60bcb4eb8c7d48a3d03bfb408b Mon Sep 17 00:00:00 2001 From: Krausus Date: Wed, 6 May 2015 01:01:52 -0400 Subject: [PATCH 2/3] Adds pointing to cyborgs Cyborgs can now point with ctrl+middle click (plain middle clicks still cycle modules). Drones cannot point. --- code/_onclick/cyborg.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 6d497cff462..145ab7b0452 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -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,6 +101,14 @@ return return +//Ctrl+Middle click points. +/mob/living/silicon/robot/proc/CtrlMiddleClickOn(var/atom/A) + if(istype(src, /mob/living/silicon/robot/drone)) + // Drones cannot point. + return + A.point() + return + //Middle click cycles through selected modules. /mob/living/silicon/robot/MiddleClickOn(var/atom/A) cycle_modules() From 644edad770f57fd4f6fd0b872a12ccb53eef1a47 Mon Sep 17 00:00:00 2001 From: Krausus Date: Wed, 6 May 2015 11:55:19 -0400 Subject: [PATCH 3/3] Swaps cyborg pointing and module cycling Cyborgs now point the same way real people do, and cycle modules with ctrl+middle click --- code/_onclick/cyborg.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 145ab7b0452..70e5be37934 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -101,19 +101,19 @@ return return -//Ctrl+Middle click points. +//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 -//Middle click cycles through selected modules. -/mob/living/silicon/robot/MiddleClickOn(var/atom/A) - 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)