Skip to content

Commit

Permalink
gl_highlighting: separate colors for containers and corpses
Browse files Browse the repository at this point in the history
- Items and corpses blending together can be an issue
  • Loading branch information
phobos2077 committed Jun 27, 2024
1 parent a8163b6 commit abd62dd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion artifacts/config_files/sfall-mods.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Critters=0
; Set to 1 to only highlight objects in the player's line-of-sight
CheckLOS=1

; Set the color of outlines for items, corpses, and containers; available colors:
; Set the color of outlines for items; available colors:
; 1 - glowing red
; 2 - red
; 4 - grey
Expand All @@ -26,6 +26,12 @@ CheckLOS=1
; You can set a custom color from the game palette by multiplying the color index value by 256 (in 4.2.7 or later)
OutlineColor=16

; Set the color of outlines for corpses
OutlineColorCorpses=4

; Set the color of outlines for containers
OutlineColorContainers=4

; Motion Scanner mode:
; 0 - ignored
; 1 - requires Motion Sensor to be present in the player's inventory to activate highlighting
Expand Down
Binary file modified artifacts/mods/gl_highlighting.int
Binary file not shown.
13 changes: 12 additions & 1 deletion artifacts/mods/gl_highlighting.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)

version 1.2
version 1.3

**/

Expand All @@ -36,6 +36,8 @@ variable alsoCorpse;
variable alsoCritter;
variable checkLOS;
variable outlineColor;
variable outlineColorCorpses;
variable outlineColorContainers;
variable motionScanner;
variable highlightFailMsg1;
variable highlightFailMsg2;
Expand Down Expand Up @@ -65,6 +67,12 @@ procedure GetOutlineColor(variable obj, variable isCritter) begin
if checkLOS and not DudeCanSee(obj) then
return 0;

if obj_type(obj) == OBJ_TYPE_CRITTER then
return outlineColorCorpses;

if obj_item_subtype(obj) == item_type_container then
return outlineColorContainers;

return outlineColor;
end

Expand Down Expand Up @@ -165,6 +173,9 @@ procedure start begin
alsoCritter := GetConfig(configSection, "Critters", 0);
checkLOS := GetConfig(configSection, "CheckLOS", 0);
outlineColor := GetConfig(configSection, "OutlineColor", 16);
outlineColorCorpses := GetConfig(configSection, "OutlineColorCorpses", 16);
outlineColorContainers := GetConfig(configSection, "OutlineColorContainers", 16);

if (outlineColor < 1) then outlineColor := 64;
motionScanner := GetConfig(configSection, "MotionScanner", 0);

Expand Down

0 comments on commit abd62dd

Please sign in to comment.