mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
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:
@@ -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.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user