gl_highlighting: separate colors for empty containers/corpses

Clarified the description of the get_current_inven_size function.
Updated resource files.
This commit is contained in:
NovaRain
2026-06-23 23:03:13 +08:00
parent d8d881c0c9
commit 9fa6792932
10 changed files with 39 additions and 24 deletions
+9 -5
View File
@@ -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; available colors:
; Set the outline color for items; available colors:
; 1 - glowing red
; 2 - red
; 4 - grey
@@ -26,11 +26,15 @@ 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 containers
OutlineColorContainers=4
; Set the outline color for containers
; For empty containers, set the color to 0 to disable highlighting
OutlineColorContainers=32
OutlineColorContainersEmpty=4
; Set the color of outlines for corpses
OutlineColorCorpses=4
; Set the outline color for corpses
; For empty corpses, set the color to 0 to disable highlighting
OutlineColorCorpses=32
OutlineColorCorpsesEmpty=4
; Motion Scanner mode:
; 0 - ignored
Binary file not shown.
+28 -17
View File
@@ -29,20 +29,25 @@
#define REPEAT_FRAMES (10)
#define NO_HIGHLIGHT(obj) (get_flags(obj) bwand FLAG_NOHIGHLIGHT)
#define NO_STEAL(obj) (get_proto_data(obj_pid(obj), PROTO_CR_FLAGS) bwand CFLG_NOSTEAL)
#define IS_EMPTY(obj) (inven_ptr(obj, 0) == 0)
variable configSection := "Highlighting";
variable highlightKey;
variable isHighlight;
variable alsoContainer;
variable alsoCorpse;
variable alsoCritter;
variable checkLOS;
variable outlineColor;
variable outlineColorContainers;
variable outlineColorCorpses;
variable motionScanner;
variable highlightFailMsg1;
variable highlightFailMsg2;
variable begin
configSection := "Highlighting";
highlightKey;
isHighlight;
alsoContainer;
alsoCorpse;
alsoCritter;
checkLOS;
outlineColor;
outlineColorContainers;
outlineColorContainersEmpty;
outlineColorCorpses;
outlineColorCorpsesEmpty;
motionScanner;
highlightFailMsg1;
highlightFailMsg2;
end
procedure DudeCanSee(variable obj) begin
variable block := obj_blocking_line(dude_obj, tile_num(obj), BLOCKING_TYPE_SHOOT);
@@ -70,10 +75,10 @@ procedure GetOutlineColor(variable obj, variable isCritter) begin
return 0;
if obj_type(obj) == OBJ_TYPE_CRITTER then
return outlineColorCorpses;
return outlineColorCorpsesEmpty if IS_EMPTY(obj) else outlineColorCorpses;
if obj_item_subtype(obj) == item_type_container then
return outlineColorContainers;
return outlineColorContainersEmpty if IS_EMPTY(obj) else outlineColorContainers;
return outlineColor;
end
@@ -174,12 +179,18 @@ procedure start begin
alsoCorpse := GetConfig(configSection, "Corpses", 0);
alsoCritter := GetConfig(configSection, "Critters", 0);
checkLOS := GetConfig(configSection, "CheckLOS", 0);
outlineColor := GetConfig(configSection, "OutlineColor", 16);
if (outlineColor < 1) then outlineColor := 64;
outlineColorContainers := GetConfig(configSection, "OutlineColorContainers", 16);
outlineColorContainers := GetConfig(configSection, "OutlineColorContainers", 32);
if (outlineColorContainers < 1) then outlineColorContainers := 64;
outlineColorCorpses := GetConfig(configSection, "OutlineColorCorpses", 16);
outlineColorContainersEmpty := GetConfig(configSection, "OutlineColorContainersEmpty", 4);
if (outlineColorContainersEmpty < 0) then outlineColorContainersEmpty := 64; // allow 0
outlineColorCorpses := GetConfig(configSection, "OutlineColorCorpses", 32);
if (outlineColorCorpses < 1) then outlineColorCorpses := 64;
outlineColorCorpsesEmpty := GetConfig(configSection, "OutlineColorCorpsesEmpty", 4);
if (outlineColorCorpsesEmpty < 0) then outlineColorCorpsesEmpty := 64; // allow 0
motionScanner := GetConfig(configSection, "MotionScanner", 0);
highlightFailMsg1 := Translate("HighlightFail1", "You aren't carrying a motion sensor.");
+1 -1
View File
@@ -1472,7 +1472,7 @@
- name: get_current_inven_size
detail: get_current_inven_size(ObjectPtr object)
doc: Returns the current inventory size of the container or the critter.
doc: Returns the total size of items in a container or a critter's inventory.
macro: sfall.h
- name: get_object_ai_data
+1 -1
View File
@@ -744,7 +744,7 @@ sfall_funcX metarule functions
----
#### get_current_inven_size
`int sfall_func1("get_current_inven_size", object obj)`
- Returns the current inventory size of the container or the critter
- Returns the total size of items in a container or a critter's inventory
----
#### create_win
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.