Changed the game mode check in gl_highlighting

* now opening other interfaces (inventory, options, etc.) will also
turn off highlight.
This commit is contained in:
NovaRain
2024-06-09 12:05:07 +08:00
parent f12f39bef0
commit 929be4f7b3
5 changed files with 5 additions and 3 deletions
Binary file not shown.
+5 -3
View File
@@ -104,7 +104,7 @@ procedure KeyPressHandler begin
scanCode := get_sfall_arg, scanCode := get_sfall_arg,
scanner, charges; scanner, charges;
if scanCode == highlightKey and not(get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin if scanCode == highlightKey and not(get_game_mode bwand bwnot(COMBAT bwor PCOMBAT)) then begin
if pressed then begin if pressed then begin
set_global_script_repeat(REPEAT_FRAMES); set_global_script_repeat(REPEAT_FRAMES);
if motionScanner then begin if motionScanner then begin
@@ -134,14 +134,16 @@ procedure KeyPressHandler begin
end end
end end
// visual glitch fix, turn off highlight when entering combat
procedure CombatTurnHandler begin procedure CombatTurnHandler begin
if isHighlight then begin if isHighlight then begin
call ToggleHighlight(false); call ToggleHighlight(false);
end end
end end
// visual glitch fix, turn off highlight when opening other interfaces
procedure GameModeChangeHandler begin procedure GameModeChangeHandler begin
if isHighlight and (get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin if isHighlight and (get_game_mode bwand bwnot(COMBAT bwor PCOMBAT)) then begin
call ToggleHighlight(false); call ToggleHighlight(false);
end end
end end
@@ -175,7 +177,7 @@ procedure start begin
register_hook_proc(HOOK_INVENTORYMOVE, InventoryMoveHandler); register_hook_proc(HOOK_INVENTORYMOVE, InventoryMoveHandler);
set_global_script_type(1); set_global_script_type(1);
end else begin end else begin
if isHighlight and not(get_game_mode bwand (INTFACELOOT bwor BARTER)) then begin if isHighlight and not(get_game_mode bwand bwnot(COMBAT bwor PCOMBAT)) then begin
call ToggleHighlight(true); call ToggleHighlight(true);
end end
end end
Binary file not shown.
Binary file not shown.
Binary file not shown.