diff --git a/artifacts/config_files/sfall-mods.ini b/artifacts/config_files/sfall-mods.ini index 9b645c93..d9f47a23 100644 --- a/artifacts/config_files/sfall-mods.ini +++ b/artifacts/config_files/sfall-mods.ini @@ -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 diff --git a/artifacts/mods/gl_highlighting.int b/artifacts/mods/gl_highlighting.int index e5c487e0..078131e8 100644 Binary files a/artifacts/mods/gl_highlighting.int and b/artifacts/mods/gl_highlighting.int differ diff --git a/artifacts/mods/gl_highlighting.ssl b/artifacts/mods/gl_highlighting.ssl index 8804bd47..3c2a9023 100644 --- a/artifacts/mods/gl_highlighting.ssl +++ b/artifacts/mods/gl_highlighting.ssl @@ -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."); diff --git a/artifacts/scripting/functions.yml b/artifacts/scripting/functions.yml index 374d5eaa..edab1e0c 100644 --- a/artifacts/scripting/functions.yml +++ b/artifacts/scripting/functions.yml @@ -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 diff --git a/artifacts/scripting/sfall function notes.md b/artifacts/scripting/sfall function notes.md index 2087ab4c..56e96032 100644 --- a/artifacts/scripting/sfall function notes.md +++ b/artifacts/scripting/sfall function notes.md @@ -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 diff --git a/artifacts/sfall_dat/sfall.dat b/artifacts/sfall_dat/sfall.dat index 39930cd4..17372692 100644 Binary files a/artifacts/sfall_dat/sfall.dat and b/artifacts/sfall_dat/sfall.dat differ diff --git a/artifacts/sfall_dat/sfall_de.dat b/artifacts/sfall_dat/sfall_de.dat index b9a41c6d..c08a97b3 100644 Binary files a/artifacts/sfall_dat/sfall_de.dat and b/artifacts/sfall_dat/sfall_de.dat differ diff --git a/artifacts/sfall_dat/sfall_fr.dat b/artifacts/sfall_dat/sfall_fr.dat index 73b91ebb..70350618 100644 Binary files a/artifacts/sfall_dat/sfall_fr.dat and b/artifacts/sfall_dat/sfall_fr.dat differ diff --git a/artifacts/sfall_dat/sfall_ru.dat b/artifacts/sfall_dat/sfall_ru.dat index 85ae7a6c..3ad55a0e 100644 Binary files a/artifacts/sfall_dat/sfall_ru.dat and b/artifacts/sfall_dat/sfall_ru.dat differ diff --git a/artifacts/sfall_dat/sfall_zh.dat b/artifacts/sfall_dat/sfall_zh.dat index c0acef80..0d6af9b6 100644 Binary files a/artifacts/sfall_dat/sfall_zh.dat and b/artifacts/sfall_dat/sfall_zh.dat differ