mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added OutlineColorContainers/Corpses to the built-in item highlighting
Minor code refactor of the built-in item highlighting. Updated version number.
This commit is contained in:
+8
-2
@@ -1,5 +1,5 @@
|
|||||||
;sfall configuration settings
|
;sfall configuration settings
|
||||||
;v3.8.44
|
;v3.8.44.1
|
||||||
|
|
||||||
[Main]
|
[Main]
|
||||||
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
|
;Set to 1 if you want to use command line arguments to tell sfall to use another ini file
|
||||||
@@ -223,7 +223,7 @@ HighlightContainers=0
|
|||||||
;Set to 1 to also highlight lootable corpses
|
;Set to 1 to also highlight lootable corpses
|
||||||
HighlightCorpses=0
|
HighlightCorpses=0
|
||||||
|
|
||||||
;Set the color of outlines, available colors:
|
;Set the color of outlines for items, available colors:
|
||||||
;1 - glowing red
|
;1 - glowing red
|
||||||
;2 - red
|
;2 - red
|
||||||
;4 - grey
|
;4 - grey
|
||||||
@@ -234,6 +234,12 @@ HighlightCorpses=0
|
|||||||
;You can set a custom color from the game palette by multiplying the color index value by 256 (in 3.8.27 or later)
|
;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
|
OutlineColor=16
|
||||||
|
|
||||||
|
;Set the color of outlines for containers
|
||||||
|
OutlineColorContainers=4
|
||||||
|
|
||||||
|
;Set the color of outlines for corpses
|
||||||
|
OutlineColorCorpses=4
|
||||||
|
|
||||||
;A key to press to reload your currently equipped weapon or use the active item
|
;A key to press to reload your currently equipped weapon or use the active item
|
||||||
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
|
;Set to 0 if you don't want a reload key, or a DX scancode otherwise
|
||||||
ReloadWeaponKey=0
|
ReloadWeaponKey=0
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ static DWORD highlightContainers;
|
|||||||
static DWORD highlightCorpses;
|
static DWORD highlightCorpses;
|
||||||
static DWORD motionScanner;
|
static DWORD motionScanner;
|
||||||
static int outlineColor;
|
static int outlineColor;
|
||||||
|
static int outlineColorContainers;
|
||||||
|
static int outlineColorCorpses;
|
||||||
static char highlightFail1[128];
|
static char highlightFail1[128];
|
||||||
static char highlightFail2[128];
|
static char highlightFail2[128];
|
||||||
|
|
||||||
@@ -441,20 +443,33 @@ static __declspec(naked) void obj_outline_all_items_on() {
|
|||||||
pushadc;
|
pushadc;
|
||||||
mov eax, ds:[FO_VAR_map_elevation];
|
mov eax, ds:[FO_VAR_map_elevation];
|
||||||
call fo::funcoffs::obj_find_first_at_;
|
call fo::funcoffs::obj_find_first_at_;
|
||||||
loopObject:
|
jmp checkObject;
|
||||||
|
nextObject:
|
||||||
|
call fo::funcoffs::obj_find_next_at_;
|
||||||
|
checkObject:
|
||||||
test eax, eax;
|
test eax, eax;
|
||||||
jz end;
|
jz end;
|
||||||
cmp eax, ds:[FO_VAR_outlined_object];
|
cmp eax, ds:[FO_VAR_outlined_object];
|
||||||
je nextObject;
|
je nextObject;
|
||||||
xchg ecx, eax;
|
cmp dword ptr [eax + owner], 0; // Owned by someone?
|
||||||
mov eax, [ecx + artFid];
|
jne nextObject; // Yes
|
||||||
and eax, 0xF000000;
|
cmp dword ptr [eax + outline], 0; // Already outlined?
|
||||||
sar eax, 0x18;
|
jne nextObject; // Yes
|
||||||
test eax, eax; // Is this an item?
|
mov ecx, [eax + artFid];
|
||||||
jz skip; // Yes
|
and ecx, 0xF000000;
|
||||||
dec eax; // Is this a critter?
|
sar ecx, 0x18;
|
||||||
jnz nextObject; // No
|
cmp ecx, OBJ_TYPE_CRITTER; // Is this a critter?
|
||||||
cmp highlightCorpses, eax; // Highlight corpses?
|
mov ecx, eax;
|
||||||
|
je isCritter; // Yes
|
||||||
|
ja nextObject; // Neither an item nor a critter
|
||||||
|
test byte ptr [eax + flags + 1], 0x10; // Is NoHighlight_ flag set?
|
||||||
|
jz normalItem; // No
|
||||||
|
call fo::funcoffs::item_get_type_;
|
||||||
|
cmp eax, item_type_container; // Is this item a container?
|
||||||
|
je isContainer; // Yes
|
||||||
|
jmp nextObject;
|
||||||
|
isCritter:
|
||||||
|
cmp highlightCorpses, 0; // Highlight corpses?
|
||||||
je nextObject; // No
|
je nextObject; // No
|
||||||
test byte ptr [ecx + damageFlags], DAM_DEAD; // source.results & DAM_DEAD?
|
test byte ptr [ecx + damageFlags], DAM_DEAD; // source.results & DAM_DEAD?
|
||||||
jz nextObject; // No
|
jz nextObject; // No
|
||||||
@@ -463,25 +478,21 @@ loopObject:
|
|||||||
call fo::funcoffs::critter_flag_check_;
|
call fo::funcoffs::critter_flag_check_;
|
||||||
test eax, eax; // Can't be stolen from?
|
test eax, eax; // Can't be stolen from?
|
||||||
jnz nextObject; // Yes
|
jnz nextObject; // Yes
|
||||||
skip:
|
mov eax, outlineColorCorpses; // Set outline color for corpses
|
||||||
cmp [ecx + owner], eax; // Owned by someone?
|
jmp setOutline;
|
||||||
jnz nextObject; // Yes
|
isContainer:
|
||||||
test [ecx + outline], eax; // Already outlined?
|
cmp highlightContainers, 0; // Highlight containers?
|
||||||
jnz nextObject; // Yes
|
je nextObject;
|
||||||
test byte ptr [ecx + flags + 1], 0x10; // Is NoHighlight_ flag set (is this a container)?
|
mov eax, outlineColorContainers; // Set outline color for containers
|
||||||
jz NoHighlight; // No
|
jmp setOutline;
|
||||||
cmp highlightContainers, eax; // Highlight containers?
|
normalItem:
|
||||||
je nextObject; // No
|
mov eax, outlineColor; // Set outline color for items
|
||||||
NoHighlight:
|
setOutline:
|
||||||
mov edx, outlineColor;
|
mov [ecx + outline], eax;
|
||||||
mov [ecx + outline], edx;
|
jmp nextObject;
|
||||||
nextObject:
|
|
||||||
call fo::funcoffs::obj_find_next_at_;
|
|
||||||
jmp loopObject;
|
|
||||||
end:
|
end:
|
||||||
call fo::funcoffs::tile_refresh_display_;
|
|
||||||
popadc;
|
popadc;
|
||||||
retn;
|
jmp fo::funcoffs::tile_refresh_display_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -492,32 +503,31 @@ static __declspec(naked) void obj_outline_all_items_off() {
|
|||||||
pushadc;
|
pushadc;
|
||||||
mov eax, ds:[FO_VAR_map_elevation];
|
mov eax, ds:[FO_VAR_map_elevation];
|
||||||
call fo::funcoffs::obj_find_first_at_;
|
call fo::funcoffs::obj_find_first_at_;
|
||||||
loopObject:
|
jmp checkObject;
|
||||||
|
nextObject:
|
||||||
|
call fo::funcoffs::obj_find_next_at_;
|
||||||
|
checkObject:
|
||||||
test eax, eax;
|
test eax, eax;
|
||||||
jz end;
|
jz end;
|
||||||
cmp eax, ds:[FO_VAR_outlined_object];
|
cmp eax, ds:[FO_VAR_outlined_object];
|
||||||
je nextObject;
|
je nextObject;
|
||||||
xchg ecx, eax;
|
mov ecx, [eax + artFid];
|
||||||
mov eax, [ecx + artFid];
|
and ecx, 0xF000000;
|
||||||
and eax, 0xF000000;
|
sar ecx, 0x18;
|
||||||
sar eax, 0x18;
|
test ecx, ecx; // Is this an item?
|
||||||
test eax, eax; // Is this an item?
|
jz isItem; // Yes
|
||||||
jz skip; // Yes
|
dec ecx; // Is this a critter?
|
||||||
dec eax; // Is this a critter?
|
|
||||||
jnz nextObject; // No
|
jnz nextObject; // No
|
||||||
test byte ptr [ecx + damageFlags], DAM_DEAD; // source.results & DAM_DEAD?
|
test byte ptr [eax + damageFlags], DAM_DEAD; // source.results & DAM_DEAD?
|
||||||
jz nextObject; // No
|
jz nextObject; // No
|
||||||
skip:
|
isItem:
|
||||||
cmp [ecx + owner], eax; // Owned by someone?
|
cmp [eax + owner], ecx; // Owned by someone? (ecx = 0)
|
||||||
jnz nextObject; // Yes
|
jne nextObject; // Yes
|
||||||
mov [ecx + outline], eax;
|
mov [eax + outline], ecx; // Remove outline
|
||||||
nextObject:
|
jmp nextObject;
|
||||||
call fo::funcoffs::obj_find_next_at_;
|
|
||||||
jmp loopObject;
|
|
||||||
end:
|
end:
|
||||||
call fo::funcoffs::tile_refresh_display_;
|
|
||||||
popadc;
|
popadc;
|
||||||
retn;
|
jmp fo::funcoffs::tile_refresh_display_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1058,8 +1068,12 @@ void ScriptExtender::init() {
|
|||||||
if (toggleHighlightsKey) {
|
if (toggleHighlightsKey) {
|
||||||
highlightContainers = IniReader::GetConfigInt("Input", "HighlightContainers", 0);
|
highlightContainers = IniReader::GetConfigInt("Input", "HighlightContainers", 0);
|
||||||
highlightCorpses = IniReader::GetConfigInt("Input", "HighlightCorpses", 0);
|
highlightCorpses = IniReader::GetConfigInt("Input", "HighlightCorpses", 0);
|
||||||
outlineColor = IniReader::GetConfigInt("Input", "OutlineColor", 0x10);
|
outlineColor = IniReader::GetConfigInt("Input", "OutlineColor", 16);
|
||||||
if (outlineColor < 1) outlineColor = 0x40;
|
if (outlineColor < 1) outlineColor = 64;
|
||||||
|
outlineColorContainers = IniReader::GetConfigInt("Input", "OutlineColorContainers", 16);
|
||||||
|
if (outlineColorContainers < 1) outlineColorContainers = 64;
|
||||||
|
outlineColorCorpses = IniReader::GetConfigInt("Input", "OutlineColorCorpses", 16);
|
||||||
|
if (outlineColorCorpses < 1) outlineColorCorpses = 64;
|
||||||
motionScanner = IniReader::GetConfigInt("Misc", "MotionScannerFlags", 1);
|
motionScanner = IniReader::GetConfigInt("Misc", "MotionScannerFlags", 1);
|
||||||
Translate::Get("Sfall", "HighlightFail1", "You aren't carrying a motion sensor.", highlightFail1);
|
Translate::Get("Sfall", "HighlightFail1", "You aren't carrying a motion sensor.", highlightFail1);
|
||||||
Translate::Get("Sfall", "HighlightFail2", "Your motion sensor is out of charge.", highlightFail2);
|
Translate::Get("Sfall", "HighlightFail2", "Your motion sensor is out of charge.", highlightFail2);
|
||||||
|
|||||||
+2
-2
@@ -25,6 +25,6 @@
|
|||||||
#define VERSION_MAJOR 3
|
#define VERSION_MAJOR 3
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_BUILD 44
|
#define VERSION_BUILD 44
|
||||||
#define VERSION_REV 0
|
#define VERSION_REV 1
|
||||||
|
|
||||||
#define VERSION_STRING "3.8.44"
|
#define VERSION_STRING "3.8.44.1"
|
||||||
|
|||||||
Reference in New Issue
Block a user