mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed the max text width of player name in inventory.
Added an 8 lines limit to the underline position fix. Some minor ASM code edits. Minor edit to document.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
---------- GLOBAL SCRIPTS -----------
|
---------- GLOBAL SCRIPTS -----------
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
As well as the new functions, sfall also adds global scripts. These run independent of any loaded maps, but do not have an attached object. (i.e. using self_obj without using set_self first will crash the script.) To use a global script, the script must have a name which begins with 'gl' and contains a procedure called 'start', 'map_enter_p_proc', 'map_exit_p_proc', or 'map_update_p_proc'. The start procedure will be executed once when the player loads a saved game or starts a new game. The map_*_p_proc procedures will be executed once when the player enters/leaves a map via exit grids or the world map, or rests/waits on a map. If you wish the script to be executed repeatedly, call set_global_script_repeat on this first run using the number of frames between each run as the argument. (0 disables the script, 1 runs it every frame, 2 runs it every other frame etc.)
|
As well as the new functions, sfall also adds global scripts. These run independent of any loaded maps, but do not have an attached object. (i.e. using self_obj without using set_self first will crash the script.) To use a global script, the script must have a name which begins with 'gl' and contains a procedure called 'start', 'map_enter_p_proc', 'map_exit_p_proc', or 'map_update_p_proc'. The start procedure will be executed once when the player loads a saved game or starts a new game. The map_*_p_proc procedures will be executed once when a map is being entered/left/updated. If you wish the script to be executed repeatedly, call set_global_script_repeat on the first run of the start procedure using the number of frames between each run as the argument. (0 disables the script, 1 runs it every frame, 2 runs it every other frame etc.)
|
||||||
|
|
||||||
Global scripts have multiple modes, which can be set using the set_global_script_type function. In the default mode (i.e. mode 0) their execution is linked to the local map game loop, so the script will not run in dialogs or on the world map. In mode 1 their execution is linked to the player input, and so they will run whenever the mouse cursor is visible on screen, including the world map, character dialogs etc. In mode 2, execution is linked to the world map loop, so the script will only be executed on the world map and not on the local map or in any dialog windows. Mode 3 is a combination of modes 0 and 2, so scripts will be executed on both local maps and the world map, but not in dialog windows. Using mode 1 requires the input wrapper to be enabled. Use available_global_script_types to check what is available.
|
Global scripts have multiple modes, which can be set using the set_global_script_type function. In the default mode (i.e. mode 0) their execution is linked to the local map game loop, so the script will not run in dialogs or on the world map. In mode 1 their execution is linked to the player input, and so they will run whenever the mouse cursor is visible on screen, including the world map, character dialogs etc. In mode 2, execution is linked to the world map loop, so the script will only be executed on the world map and not on the local map or in any dialog windows. Mode 3 is a combination of modes 0 and 2, so scripts will be executed on both local maps and the world map, but not in dialog windows. Using mode 1 requires the input wrapper to be enabled. Use available_global_script_types to check what is available.
|
||||||
|
|
||||||
|
|||||||
+17
-9
@@ -345,7 +345,7 @@ static void __declspec(naked) is_supper_bonus_hack() {
|
|||||||
cmp eax, 10
|
cmp eax, 10
|
||||||
jle end
|
jle end
|
||||||
skip:
|
skip:
|
||||||
pop eax // Destroy the return address
|
add esp, 4 // Destroy the return address
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
inc eax
|
inc eax
|
||||||
pop edx
|
pop edx
|
||||||
@@ -362,7 +362,7 @@ static void __declspec(naked) PrintBasicStat_hack() {
|
|||||||
jle skip
|
jle skip
|
||||||
cmp eax, 10
|
cmp eax, 10
|
||||||
jg end
|
jg end
|
||||||
pop ebx // Destroy the return address
|
add esp, 4 // Destroy the return address
|
||||||
push 0x434C21
|
push 0x434C21
|
||||||
retn
|
retn
|
||||||
skip:
|
skip:
|
||||||
@@ -392,7 +392,7 @@ static void __declspec(naked) StatButtonDown_hook() {
|
|||||||
call stat_level_
|
call stat_level_
|
||||||
cmp eax, 1
|
cmp eax, 1
|
||||||
jg end
|
jg end
|
||||||
pop eax // Destroy the return address
|
add esp, 4 // Destroy the return address
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
inc eax
|
inc eax
|
||||||
mov [esp+0xC], eax
|
mov [esp+0xC], eax
|
||||||
@@ -768,7 +768,7 @@ static void __declspec(naked) set_new_results_hack() {
|
|||||||
inc edx // type = knockout
|
inc edx // type = knockout
|
||||||
jmp queue_remove_this_ // Remove knockout from queue (if there is one)
|
jmp queue_remove_this_ // Remove knockout from queue (if there is one)
|
||||||
end:
|
end:
|
||||||
pop eax // Destroy the return address
|
add esp, 4 // Destroy the return address
|
||||||
push 0x424FC6
|
push 0x424FC6
|
||||||
retn
|
retn
|
||||||
}
|
}
|
||||||
@@ -1111,7 +1111,7 @@ end:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int __stdcall ItemCountFixStdcall(TGameObj* who, TGameObj* item) {
|
static int __stdcall ItemCountFixStdcall(TGameObj* who, TGameObj* item) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (int i = 0; i < who->invenCount; i++) {
|
for (int i = 0; i < who->invenCount; i++) {
|
||||||
TInvenRec* tableItem = &who->invenTablePtr[i];
|
TInvenRec* tableItem = &who->invenTablePtr[i];
|
||||||
@@ -1124,7 +1124,7 @@ int __stdcall ItemCountFixStdcall(TGameObj* who, TGameObj* item) {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __declspec(naked) ItemCountFix() {
|
static void __declspec(naked) ItemCountFix() {
|
||||||
__asm {
|
__asm {
|
||||||
push ebx;
|
push ebx;
|
||||||
push ecx;
|
push ecx;
|
||||||
@@ -1304,11 +1304,16 @@ static void __declspec(naked) inven_obj_examine_func_hack() {
|
|||||||
ja fix;
|
ja fix;
|
||||||
retn;
|
retn;
|
||||||
fix:
|
fix:
|
||||||
|
cmp edx, 9; // 8 lines (half of the display window)
|
||||||
|
ja limit;
|
||||||
dec edx;
|
dec edx;
|
||||||
sub eax, 3;
|
sub eax, 3;
|
||||||
mul edx;
|
mul edx;
|
||||||
add eax, 3;
|
add eax, 3;
|
||||||
retn;
|
retn;
|
||||||
|
limit:
|
||||||
|
mov eax, 57;
|
||||||
|
retn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1452,9 +1457,12 @@ void BugsInit()
|
|||||||
dlogr(" Done", DL_INIT);
|
dlogr(" Done", DL_INIT);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// Corrects "Weight of items" text element width to be 64 (and not 80), which matches container element width
|
// Corrects the max text width of the item weight in trading interface to be 64 (was 80), which matches the table width
|
||||||
SafeWrite8(0x475541, 64);
|
SafeWrite32(0x475541, 64);
|
||||||
SafeWrite8(0x475789, 64);
|
SafeWrite32(0x475789, 64);
|
||||||
|
|
||||||
|
// Corrects the max text width of the player name in inventory to be 140 (was 80), which matches the width for item name
|
||||||
|
SafeWrite32(0x471E48, 140);
|
||||||
|
|
||||||
//if (GetPrivateProfileIntA("Misc", "InventoryDragIssuesFix", 1, ini)) {
|
//if (GetPrivateProfileIntA("Misc", "InventoryDragIssuesFix", 1, ini)) {
|
||||||
dlog("Applying inventory reverse order issues fix.", DL_INIT);
|
dlog("Applying inventory reverse order issues fix.", DL_INIT);
|
||||||
|
|||||||
+3
-5
@@ -190,8 +190,7 @@ static __declspec(naked) void PathfinderFix() {
|
|||||||
call perk_level_;
|
call perk_level_;
|
||||||
push eax;
|
push eax;
|
||||||
call PathfinderFix2;
|
call PathfinderFix2;
|
||||||
call inc_game_time_;
|
jmp inc_game_time_;
|
||||||
retn;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -724,7 +723,7 @@ static void __declspec(naked) wmTownMapFunc_hack() {
|
|||||||
je end
|
je end
|
||||||
retn
|
retn
|
||||||
end:
|
end:
|
||||||
pop eax // destroy the return address
|
add esp, 4 // Destroy the return address
|
||||||
push 0x4C4976
|
push 0x4C4976
|
||||||
retn
|
retn
|
||||||
}
|
}
|
||||||
@@ -793,8 +792,7 @@ static void __declspec(naked) display_stats_hook() {
|
|||||||
static void __declspec(naked) wmInterfaceInit_text_font_hook() {
|
static void __declspec(naked) wmInterfaceInit_text_font_hook() {
|
||||||
__asm {
|
__asm {
|
||||||
mov eax, 0x65; // normal text font
|
mov eax, 0x65; // normal text font
|
||||||
call text_font_;
|
jmp text_font_;
|
||||||
retn;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user