Fixed a bug in item highlighting that caused items to be kept highlighted when entering combat while holding the highlight key.

This commit is contained in:
NovaRain
2018-04-22 11:06:36 +08:00
parent e474ba1660
commit 0eeab768bd
3 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -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
Binary file not shown.
+11
View File
@@ -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