Skip to content

Commit

Permalink
Intents can be cycled forward and backwards with hotkeys again (tgsta…
Browse files Browse the repository at this point in the history
…tion#22201)

* intents can be cycled foward and backwards with hotkeys again

* fix
  • Loading branch information
Mervill authored and optimumtact committed Dec 15, 2016
1 parent b70c93d commit 9d7af47
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 25 deletions.
7 changes: 4 additions & 3 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
#define INTENT_GRAB "grab"
#define INTENT_DISARM "disarm"
#define INTENT_HARM "harm"
// NOTE: This is not a real intent! It's used to allow
// the alternate intent selection stlye (clockwise)
#define INTENT_NEXT "next"
// NOTE: INTENT_HOTKEY_* defines are not actual intents!
// they are here to support hotkeys
#define INTENT_HOTKEY_LEFT "left"
#define INTENT_HOTKEY_RIGHT "right"
2 changes: 1 addition & 1 deletion code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
usr.a_intent_change(INTENT_DISARM)

else
usr.a_intent_change(INTENT_NEXT)
usr.a_intent_change(INTENT_HOTKEY_RIGHT)

/obj/screen/act_intent/alien
icon = 'icons/mob/screen_alien.dmi'
Expand Down
14 changes: 12 additions & 2 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
switch(input)
if(INTENT_HELP, INTENT_DISARM, INTENT_GRAB, INTENT_HARM)
a_intent = input
if(INTENT_NEXT)
if(INTENT_HOTKEY_RIGHT)
switch (a_intent)
if(INTENT_HELP)
a_intent = INTENT_DISARM
Expand All @@ -299,6 +299,16 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
a_intent = INTENT_HARM
if(INTENT_HARM)
a_intent = INTENT_HELP
if(INTENT_HOTKEY_LEFT)
switch (a_intent)
if(INTENT_HELP)
a_intent = INTENT_HARM
if(INTENT_DISARM)
a_intent = INTENT_HELP
if(INTENT_GRAB)
a_intent = INTENT_DISARM
if(INTENT_HARM)
a_intent = INTENT_GRAB

if(hud_used && hud_used.action_intent)
hud_used.action_intent.icon_state = "[a_intent]"
Expand All @@ -309,7 +319,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
a_intent = INTENT_HELP
if(INTENT_HARM)
a_intent = INTENT_HARM
if(INTENT_NEXT)
if(INTENT_HOTKEY_RIGHT, INTENT_HOTKEY_LEFT)
switch (a_intent)
if(INTENT_HELP)
a_intent = INTENT_HARM
Expand Down
38 changes: 19 additions & 19 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ macro "default"
is-disabled = false
elem
name = "INSERT"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "DELETE"
Expand Down Expand Up @@ -97,11 +97,11 @@ macro "default"
is-disabled = false
elem
name = "CTRL+F"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "CTRL+G"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "CTRL+H"
Expand Down Expand Up @@ -263,7 +263,7 @@ macro "hotkeys"
is-disabled = false
elem
name = "INSERT"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "DELETE"
Expand Down Expand Up @@ -335,19 +335,19 @@ macro "hotkeys"
is-disabled = false
elem
name = "F"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "CTRL+F"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "G"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "CTRL+G"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "H"
Expand Down Expand Up @@ -549,7 +549,7 @@ macro "robot-default"
is-disabled = false
elem
name = "INSERT"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "DELETE"
Expand All @@ -569,7 +569,7 @@ macro "robot-default"
is-disabled = false
elem
name = "CTRL+4"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "CTRL+A+REP"
Expand All @@ -589,11 +589,11 @@ macro "robot-default"
is-disabled = false
elem
name = "CTRL+F"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "CTRL+G"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "CTRL+Q"
Expand Down Expand Up @@ -739,7 +739,7 @@ macro "robot-hotkeys"
is-disabled = false
elem
name = "INSERT"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "DELETE"
Expand Down Expand Up @@ -771,11 +771,11 @@ macro "robot-hotkeys"
is-disabled = false
elem
name = "4"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "CTRL+4"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "A+REP"
Expand Down Expand Up @@ -811,19 +811,19 @@ macro "robot-hotkeys"
is-disabled = false
elem
name = "F"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "CTRL+F"
command = "a-intent next"
command = "a-intent left"
is-disabled = false
elem
name = "G"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "CTRL+G"
command = "a-intent next"
command = "a-intent right"
is-disabled = false
elem
name = "Q"
Expand Down

0 comments on commit 9d7af47

Please sign in to comment.