mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Rearranged and simplified gl_highlighting.ssl from the previous commit a bit.
This commit is contained in:
@@ -5,17 +5,17 @@
|
|||||||
Key=42
|
Key=42
|
||||||
|
|
||||||
; Set to 1 to also highlight containers
|
; Set to 1 to also highlight containers
|
||||||
Containers=1
|
Containers=0
|
||||||
|
|
||||||
; Set to 1 to ignore NO_HIGHLIGHT flag on objects and highlight them regardless
|
|
||||||
IgnoreNoHighlight=0
|
|
||||||
|
|
||||||
; Set to 1 to also highlight lootable corpses
|
; Set to 1 to also highlight lootable corpses
|
||||||
Corpses=1
|
Corpses=0
|
||||||
|
|
||||||
; Set to 1 to also highlight alive critters
|
; Set to 1 to also highlight alive critters
|
||||||
Critters=0
|
Critters=0
|
||||||
|
|
||||||
|
; Set to 1 to ignore NO_HIGHLIGHT flag on objects and highlight them regardless
|
||||||
|
IgnoreNoHighlight=0
|
||||||
|
|
||||||
; Set to 1 to only highlight objects in the player's line-of-sight
|
; Set to 1 to only highlight objects in the player's line-of-sight
|
||||||
CheckLOS=0
|
CheckLOS=0
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Previously was part of sfall itself, now a separate mod.
|
Previously was part of sfall itself, now a separate mod.
|
||||||
Features:
|
Features:
|
||||||
- highlighting items, containers (optional), critters (optional) and dead bodies (optional) on the ground
|
- highlighting items on the ground, containers (optional), dead bodies (optional) and critters (optional)
|
||||||
- configurable hotkey is used to trigger highlight
|
- configurable hotkey is used to trigger highlight
|
||||||
- only objects in direct line-of-sight of player are highlighted (optional)
|
- only objects in direct line-of-sight of player are highlighted (optional)
|
||||||
- motion scanner is required to enable highlight (optional)
|
- motion scanner is required to enable highlight (optional)
|
||||||
@@ -28,9 +28,9 @@
|
|||||||
variable configSection := "Highlighting";
|
variable configSection := "Highlighting";
|
||||||
variable highlightKey;
|
variable highlightKey;
|
||||||
variable alsoContainer;
|
variable alsoContainer;
|
||||||
variable ignoreNoHighlight;
|
|
||||||
variable alsoCorpse;
|
variable alsoCorpse;
|
||||||
variable alsoCritter;
|
variable alsoCritter;
|
||||||
|
variable ignoreNoHighlight;
|
||||||
variable checkLOS;
|
variable checkLOS;
|
||||||
variable outlineColor;
|
variable outlineColor;
|
||||||
variable motionScanner;
|
variable motionScanner;
|
||||||
@@ -39,7 +39,7 @@ variable highlightFailMsg2;
|
|||||||
|
|
||||||
procedure ToggleHighlightObject(variable obj, variable enable) begin
|
procedure ToggleHighlightObject(variable obj, variable enable) begin
|
||||||
if obj and (not enable or not checkLOS or not obj_blocking_line(dude_obj, tile_num(obj), BLOCKING_TYPE_SHOOT)) then begin
|
if obj and (not enable or not checkLOS or not obj_blocking_line(dude_obj, tile_num(obj), BLOCKING_TYPE_SHOOT)) then begin
|
||||||
if (alsoContainer and obj_item_subtype(obj) == item_type_container) or (not (NO_HIGHLIGHT(obj) and not ignoreNoHighlight)) then begin
|
if (alsoContainer and obj_item_subtype(obj) == item_type_container) or (ignoreNoHighlight or not NO_HIGHLIGHT(obj)) then begin
|
||||||
if (enable) then set_outline(obj, outlineColor);
|
if (enable) then set_outline(obj, outlineColor);
|
||||||
else set_outline(obj, 0);
|
else set_outline(obj, 0);
|
||||||
end
|
end
|
||||||
@@ -53,15 +53,13 @@ procedure ToggleHighlight(variable enable) begin
|
|||||||
call ToggleHighlightObject(obj, enable);
|
call ToggleHighlightObject(obj, enable);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if (alsoCorpse) then begin
|
|
||||||
foreach obj in list_as_array(LIST_CRITTERS) begin
|
foreach obj in list_as_array(LIST_CRITTERS) begin
|
||||||
|
if (alsoCorpse) then begin
|
||||||
if critter_state(obj) == CRITTER_IS_DEAD and not NO_STEAL(obj) then begin
|
if critter_state(obj) == CRITTER_IS_DEAD and not NO_STEAL(obj) then begin
|
||||||
call ToggleHighlightObject(obj, enable);
|
call ToggleHighlightObject(obj, enable);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
if (alsoCritter) then begin
|
if (alsoCritter) then begin
|
||||||
foreach obj in list_as_array(LIST_CRITTERS) begin
|
|
||||||
if critter_state(obj) != CRITTER_IS_DEAD then begin
|
if critter_state(obj) != CRITTER_IS_DEAD then begin
|
||||||
call ToggleHighlightObject(obj, enable);
|
call ToggleHighlightObject(obj, enable);
|
||||||
end
|
end
|
||||||
@@ -110,9 +108,9 @@ procedure start begin
|
|||||||
|
|
||||||
highlightKey := GetConfig(configSection, "Key", 0);
|
highlightKey := GetConfig(configSection, "Key", 0);
|
||||||
alsoContainer := GetConfig(configSection, "Containers", 0);
|
alsoContainer := GetConfig(configSection, "Containers", 0);
|
||||||
ignoreNoHighlight := GetConfig(configSection, "IgnoreNoHighlight", 0);
|
|
||||||
alsoCorpse := GetConfig(configSection, "Corpses", 0);
|
alsoCorpse := GetConfig(configSection, "Corpses", 0);
|
||||||
alsoCritter := GetConfig(configSection, "Critters", 0);
|
alsoCritter := GetConfig(configSection, "Critters", 0);
|
||||||
|
ignoreNoHighlight := GetConfig(configSection, "IgnoreNoHighlight", 0);
|
||||||
checkLOS := GetConfig(configSection, "CheckLOS", 0);
|
checkLOS := GetConfig(configSection, "CheckLOS", 0);
|
||||||
outlineColor := GetConfig(configSection, "OutlineColor", 16);
|
outlineColor := GetConfig(configSection, "OutlineColor", 16);
|
||||||
if (outlineColor < 1) then outlineColor := 64;
|
if (outlineColor < 1) then outlineColor := 64;
|
||||||
|
|||||||
Reference in New Issue
Block a user