From 0eeab768bd54a6a6a4b6370ddd116681039ca356 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Sun, 22 Apr 2018 11:06:36 +0800 Subject: [PATCH] Fixed a bug in item highlighting that caused items to be kept highlighted when entering combat while holding the highlight key. --- artifacts/config_files/sfall-mods.ini | 2 +- artifacts/mods/gl_highlighting.int | Bin 3428 -> 3620 bytes artifacts/mods/gl_highlighting.ssl | 11 +++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/artifacts/config_files/sfall-mods.ini b/artifacts/config_files/sfall-mods.ini index deeb425e..90e051a4 100644 --- a/artifacts/config_files/sfall-mods.ini +++ b/artifacts/config_files/sfall-mods.ini @@ -1,6 +1,6 @@ [Highlighting] -; DX scandode of a key to press to highlight items on the ground +; DX scancode of a key to press to highlight items on the ground ; 42 - SHIFT key Key=42 diff --git a/artifacts/mods/gl_highlighting.int b/artifacts/mods/gl_highlighting.int index 31771aeafff59aec52f0ffa310ca08366b8d5d2e..db8e061be033b1c00bfb1324950aedd1e81ee8a5 100644 GIT binary patch delta 1047 zcmaDNwM0gsf$0Dv0|SFl122eXahfO~ThGP7z`(|U0$3(Mxmr*fN`b|h85kJMpaM{e zm5+ge0VM7Q6@XH#YZw?9m>3usf}jFWiVdd!0|P@nR18e9H9#~la)7yTf_)hS0|O%i z1EUmN2+ZJo1Ev@lbs#j1P6nn1qXyRoX%L%@Yw`wGU&e&V|5!bp`#>TL3=Kw5xfcx*4f+jIU{OXSJ%<`3 z8eHKrtPMhN(_T#OVpA1_n8Vy41TlwQV)6ktc}Azn57;yr%O-QN%kr`{2sKqeOlI$! zY{EW~al_%B2AB!{NmdTe` zY8itj2e67WI!w-BEfHb81CnN7YA|YWZIA}BSx-&=!0OAWFxigH)7cLs!objA1d(G~ z(IC;F-yj7RWkl#_TV z5SOzHL^3c>-os(Z*fseZhp%)NSOnzC-%yq@#CA@H$#I;Tj2V;jIMgSv=agXFHu(f+ zIAg$M1ujW(Bd}VKkHOY(^MLtmljFFgB)EQoIiSD-OLAQS^Vud(;8J4ZIy89;mlYG& zj>#XmWMsI`K-|T^(IC{Y1Eh@W6GVjT!{iTKveGON9s@f}o?8nd!mR<4=L~@I{3gHR zHnZXNX-t7Qp1TVY1x*4VLm5~a%pl>xy$F)R85p4AtdP*;J~KInM~{j7&*UB+bxx)R zVURSB&g4Bj>YU6_Ud-e-JnEb*P+reu8D4dLRw!>5NIe5`h6N``9G_ D+G@KM diff --git a/artifacts/mods/gl_highlighting.ssl b/artifacts/mods/gl_highlighting.ssl index bc394ca2..a96e0fbd 100644 --- a/artifacts/mods/gl_highlighting.ssl +++ b/artifacts/mods/gl_highlighting.ssl @@ -27,6 +27,7 @@ variable configSection := "Highlighting"; variable highlightKey; +variable isHighlight; variable alsoContainer; variable alsoCorpse; variable checkLOS; @@ -68,6 +69,7 @@ procedure KeyPressHandler begin if scanCode == highlightKey then begin if pressed then begin + isHighlight := true; if motionScanner then begin scanner := obj_carrying_pid_obj(dude_obj, PID_MOTION_SENSOR); if scanner then begin @@ -90,11 +92,19 @@ procedure KeyPressHandler begin call ToggleHighlight(true); end end else begin + isHighlight := false; call ToggleHighlight(false); end end end +procedure CombatTurnHandler begin + if isHighlight then begin + isHighlight := false; + call ToggleHighlight(false); + end +end + procedure start begin if game_loaded and (sfall_ver_major >= 4) then begin call InitConfigs; @@ -111,5 +121,6 @@ procedure start begin highlightFailMsg2 := Translate("HighlightFail2", "Your motion sensor is out of charge."); register_hook_proc(HOOK_KEYPRESS, KeyPressHandler); + register_hook_proc(HOOK_COMBATTURN, CombatTurnHandler); end end