Skip to content

Commit 2430fd1

Browse files
committed
Release v6.0: scoreboard hybrid scaling, cinematic and mission status text
1 parent 3c1e517 commit 2430fd1

19 files changed

Lines changed: 186 additions & 62 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## v6.0
4+
5+
- **Scaled UI / scoreboard:** Scoreboard text now scales with `_sofbuddy_font_scale` and images with `_sofbuddy_hud_scale` (hybrid path in `hkglVertex2f` instead of applying HUD scale to all vertices).
6+
- **Scaled UI / cinematic text:** Hook `SCR_DrawCinematicString` and scale cinematic string vertices with `fontScale`.
7+
- **Scaled UI / mission status:** Add `FontCaller::MissionStatus` and shared `scaleCenterAnchoredText` helper for mission-status / center-anchored on-screen text.
8+
- **Linux scripts:** Fix `enable_*.sh` patch scripts to resolve paths relative to script location (works when run from any cwd).
9+
310
## v5.9
411

512
- **Scaled HUD:** Restored scoreboard scaling in `hkglVertex2f` — v5.8 had limited `SCR_ExecuteLayoutString` scaling to image quads only, which left scoreboard text tiny/unscaled; scoreboard mode again scales all layout vertices.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.9
1+
6.0

build/generated_detours.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ namespace detour_SCR_CenterPrint {
145145
tSCR_CenterPrint oSCR_CenterPrint = nullptr;
146146
}
147147

148+
namespace detour_SCR_DrawCinematicString {
149+
tSCR_DrawCinematicString oSCR_DrawCinematicString = nullptr;
150+
}
151+
148152
namespace detour_cInventory2_And_cGunAmmo2_Draw {
149153
tcInventory2_And_cGunAmmo2_Draw ocInventory2_And_cGunAmmo2_Draw = nullptr;
150154
}
@@ -473,6 +477,17 @@ namespace detour_SCR_CenterPrint {
473477
}
474478
}
475479

480+
namespace detour_SCR_DrawCinematicString {
481+
ManagerType& GetManager() {
482+
static ManagerType* instance = nullptr;
483+
if (!instance) {
484+
static char storage[sizeof(ManagerType)];
485+
instance = new(storage) ManagerType();
486+
}
487+
return *instance;
488+
}
489+
}
490+
476491
namespace detour_cInventory2_And_cGunAmmo2_Draw {
477492
ManagerType& GetManager() {
478493
static ManagerType* instance = nullptr;
@@ -925,6 +940,12 @@ namespace detour_SCR_CenterPrint {
925940
}
926941
}
927942

943+
namespace detour_SCR_DrawCinematicString {
944+
void __cdecl hkSCR_DrawCinematicString(int speed, int x, int y) {
945+
::hkSCR_DrawCinematicString(speed, x, y, oSCR_DrawCinematicString);
946+
}
947+
}
948+
928949
namespace detour_SCR_DrawPlayerInfo {
929950
void __cdecl hkSCR_DrawPlayerInfo() {
930951
::hkSCR_DrawPlayerInfo(oSCR_DrawPlayerInfo);

build/generated_detours.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,33 @@ namespace {
623623
static AutoDetour_SCR_CenterPrint g_AutoDetour_SCR_CenterPrint;
624624
}
625625

626+
namespace detour_SCR_DrawCinematicString {
627+
using tSCR_DrawCinematicString = void(__cdecl*)(int speed, int x, int y);
628+
extern tSCR_DrawCinematicString oSCR_DrawCinematicString;
629+
using ManagerType = TypedSharedHookManager<void, int, int, int>;
630+
ManagerType& GetManager();
631+
632+
void __cdecl hkSCR_DrawCinematicString(int speed, int x, int y);
633+
}
634+
635+
namespace {
636+
struct AutoDetour_SCR_DrawCinematicString {
637+
AutoDetour_SCR_DrawCinematicString() {
638+
using namespace detour_SCR_DrawCinematicString;
639+
if (!GetDetourSystem().IsDetourRegistered("SCR_DrawCinematicString")) {
640+
GetDetourSystem().RegisterDetour(
641+
reinterpret_cast<void*>(0x00013B70),
642+
reinterpret_cast<void*>(detour_SCR_DrawCinematicString::hkSCR_DrawCinematicString),
643+
reinterpret_cast<void**>(&detour_SCR_DrawCinematicString::oSCR_DrawCinematicString),
644+
"SCR_DrawCinematicString",
645+
DetourModule::SofExe,
646+
static_cast<size_t>(0));
647+
}
648+
}
649+
};
650+
static AutoDetour_SCR_DrawCinematicString g_AutoDetour_SCR_DrawCinematicString;
651+
}
652+
626653
namespace detour_cInventory2_And_cGunAmmo2_Draw {
627654
using tcInventory2_And_cGunAmmo2_Draw = void(__thiscall*)(void* self);
628655
extern tcInventory2_And_cGunAmmo2_Draw ocInventory2_And_cGunAmmo2_Draw;

build/generated_registrations.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ extern void hkDraw_PicOptions(int x, int y, float w_scale, float h_scale, int pa
2929
extern void hkDraw_StretchPic(int x, int y, int w, int h, int palette, char* name, int flags, detour_Draw_StretchPic::tDraw_StretchPic original);
3030
extern void hkR_DrawFont(int screenX, int screenY, char* text, int colorPalette, char* font, bool rememberLastColor, detour_R_DrawFont::tR_DrawFont original);
3131
extern void hkSCR_CenterPrint(char* str, detour_SCR_CenterPrint::tSCR_CenterPrint original);
32+
extern void hkSCR_DrawCinematicString(int speed, int x, int y, detour_SCR_DrawCinematicString::tSCR_DrawCinematicString original);
3233
extern void hkSCR_DrawPlayerInfo(detour_SCR_DrawPlayerInfo::tSCR_DrawPlayerInfo original);
3334
extern void hkSCR_ExecuteLayoutString(char* text, detour_SCR_ExecuteLayoutString::tSCR_ExecuteLayoutString original);
3435
extern void hkcCtfFlag_Draw(void* self, detour_cCtfFlag_Draw::tcCtfFlag_Draw original);

detours.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,20 @@ functions:
355355
- type: char*
356356
name: str
357357

358+
- name: SCR_DrawCinematicString
359+
module: SofExe
360+
identifier: "0x00013B70"
361+
return_type: void
362+
calling_convention: __cdecl
363+
detour_len: 0
364+
params:
365+
- type: int
366+
name: speed
367+
- type: int
368+
name: x
369+
- type: int
370+
name: y
371+
358372
- name: cInventory2_And_cGunAmmo2_Draw
359373
module: SofExe
360374
identifier: "0x00008430"

hdr/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
Increment version using: ./increment_version.sh
88
*/
99

10-
#define SOFBUDDY_VERSION "5.9"
10+
#define SOFBUDDY_VERSION "6.0"

rsrc/lin_scripts/enable_sofplus.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#!/bin/bash
2-
bash patch_sof_binary.sh ../SoF.exe spcl.dll
2+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3+
bash "$DIR/patch_sof_binary.sh" "$DIR/../SoF.exe" spcl.dll
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#!/bin/bash
2-
bash patch_sof_binary.sh ../SoF.exe sof_buddy.dll
2+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3+
bash "$DIR/patch_sof_binary.sh" "$DIR/../SoF.exe" sof_buddy.dll

rsrc/lin_scripts/enable_vanilla.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
#!/bin/bash
2-
bash patch_sof_binary.sh ../SoF.exe WSOCK32.dll
2+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3+
bash "$DIR/patch_sof_binary.sh" "$DIR/../SoF.exe" WSOCK32.dll

0 commit comments

Comments
 (0)