Merge pull request #3273 from LorenLuke/Numpad

Allows usage of ctrl+numpad for target zone selecting.
This commit is contained in:
Neerti
2017-04-16 00:40:15 -04:00
committed by GitHub
3 changed files with 162 additions and 0 deletions

View File

@@ -162,6 +162,12 @@
update_icon() update_icon()
return 1 return 1
/obj/screen/zone_sel/proc/set_selected_zone(bodypart)
var/old_selecting = selecting
selecting = bodypart
if(old_selecting != selecting)
update_icon()
/obj/screen/zone_sel/update_icon() /obj/screen/zone_sel/update_icon()
overlays.Cut() overlays.Cut()
overlays += image('icons/mob/zone_sel.dmi', "[selecting]") overlays += image('icons/mob/zone_sel.dmi', "[selecting]")

View File

@@ -1017,3 +1017,47 @@ mob/proc/yank_out_object()
/mob/proc/is_muzzled() /mob/proc/is_muzzled()
return 0 return 0
/client/proc/check_has_body_select()
return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel)
/client/verb/body_toggle_head()
set name = "body-toggle-head"
set hidden = 1
toggle_zone_sel(list(BP_HEAD, O_EYES, O_MOUTH))
/client/verb/body_r_arm()
set name = "body-r-arm"
set hidden = 1
toggle_zone_sel(list(BP_R_ARM,BP_R_HAND))
/client/verb/body_l_arm()
set name = "body-l-arm"
set hidden = 1
toggle_zone_sel(list(BP_L_ARM,BP_L_HAND))
/client/verb/body_chest()
set name = "body-chest"
set hidden = 1
toggle_zone_sel(list(BP_TORSO))
/client/verb/body_groin()
set name = "body-groin"
set hidden = 1
toggle_zone_sel(list(BP_GROIN))
/client/verb/body_r_leg()
set name = "body-r-leg"
set hidden = 1
toggle_zone_sel(list(BP_R_LEG,BP_R_FOOT))
/client/verb/body_l_leg()
set name = "body-l-leg"
set hidden = 1
toggle_zone_sel(list(BP_L_LEG,BP_L_FOOT))
/client/proc/toggle_zone_sel(list/zones)
if(!check_has_body_select())
return
var/obj/screen/zone_sel/selector = mob.zone_sel
selector.set_selected_zone(next_in_list(mob.zone_sel.selecting,zones))

View File

@@ -215,6 +215,34 @@ macro "borghotkeymode"
name = "CTRL+Z" name = "CTRL+Z"
command = "Activate-Held-Object" command = "Activate-Held-Object"
is-disabled = false is-disabled = false
elem
name = "NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "NUMPAD3"
command = "body-l-leg"
is-disabled = false
elem
name = "NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem elem
name = "F1" name = "F1"
command = "adminhelp" command = "adminhelp"
@@ -409,6 +437,34 @@ macro "macro"
name = "CTRL+Z" name = "CTRL+Z"
command = "Activate-Held-Object" command = "Activate-Held-Object"
is-disabled = false is-disabled = false
elem
name = "CTRL+NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "CTRL+NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "CTRL+NUMPAD3"
command = "body-l-leg"
is-disabled = false
elem
name = "CTRL+NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "CTRL+NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem elem
name = "F1" name = "F1"
command = "adminhelp" command = "adminhelp"
@@ -691,6 +747,34 @@ macro "hotkeymode"
name = "CTRL+Z" name = "CTRL+Z"
command = "Activate-Held-Object" command = "Activate-Held-Object"
is-disabled = false is-disabled = false
elem
name = "NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "NUMPAD3"
command = "body-l-leg"
is-disabled = false
elem
name = "NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "NUMPAD8"
command = "body-toggle-head"
is-disabled = false
elem elem
name = "F1" name = "F1"
command = "adminhelp" command = "adminhelp"
@@ -881,6 +965,34 @@ macro "borgmacro"
name = "CTRL+Z" name = "CTRL+Z"
command = "Activate-Held-Object" command = "Activate-Held-Object"
is-disabled = false is-disabled = false
elem
name = "CTRL+NUMPAD1"
command = "body-r-leg"
is-disabled = false
elem
name = "CTRL+NUMPAD2"
command = "body-groin"
is-disabled = false
elem
name = "CTRL+NUMPAD3"
command = "body-l-leg"
is-disabled = false
elem
name = "CTRL+NUMPAD4"
command = "body-r-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD5"
command = "body-chest"
is-disabled = false
elem
name = "CTRL+NUMPAD6"
command = "body-l-arm"
is-disabled = false
elem
name = "CTRL+NUMPAD8"
command = "body-head-toggle"
is-disabled = false
elem elem
name = "F1" name = "F1"
command = "adminhelp" command = "adminhelp"