Synced item highlighting mod with 4.x

This commit is contained in:
NovaRain
2024-06-28 21:14:46 +08:00
parent e2dcb3e0b2
commit 81f4af927b
3 changed files with 20 additions and 2 deletions
@@ -17,7 +17,7 @@
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
version 1.2
version 1.3
**/
@@ -38,6 +38,8 @@ variable alsoCorpse;
variable alsoCritter;
variable checkLOS;
variable outlineColor;
variable outlineColorContainers;
variable outlineColorCorpses;
variable motionScanner;
variable highlightFailMsg1;
variable highlightFailMsg2;
@@ -67,6 +69,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
@@ -168,6 +176,10 @@ procedure start begin
checkLOS := GetConfig(configSection, "CheckLOS", 0);
outlineColor := GetConfig(configSection, "OutlineColor", 16);
if (outlineColor < 1) then outlineColor := 64;
outlineColorContainers := GetConfig(configSection, "OutlineColorContainers", 16);
if (outlineColorContainers < 1) then outlineColorContainers := 64;
outlineColorCorpses := GetConfig(configSection, "OutlineColorCorpses", 16);
if (outlineColorCorpses < 1) then outlineColorCorpses := 64;
motionScanner := GetConfig(configSection, "MotionScanner", 0);
highlightFailMsg1 := Translate("HighlightFail1", "You aren't carrying a motion sensor.");
@@ -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
@@ -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 3.8.27 or later)
OutlineColor=16
; Set the color of outlines for containers
OutlineColorContainers=4
; Set the color of outlines for corpses
OutlineColorCorpses=4
; Motion Scanner mode:
; 0 - ignored
; 1 - requires Motion Sensor to be present in the player's inventory to activate highlighting