Skip to content

Commit 88fb9ba

Browse files
committed
Release v4.3: README hero image
1 parent d42a5f1 commit 88fb9ba

8 files changed

Lines changed: 150 additions & 47 deletions

File tree

.cursor/commands/menu-know-how.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Notice:
119119
* plain words are flow text; `<text ...>` is interactive/clickable area text.
120120
* CAUTION: `<center>` layout treats each space separated word as a new line, then if you use double quote around your space separated text, if the length is longer than the remaining space in the frame, it will not be rendered.
121121
* Seems wise to try to use 2 giant blank borders either side of the content, but they must be injected with resolution dependent pixels as: ((width_of_inner_frame_px - centered_content_size_px) / 2) . Then you have a fixed size area across resolutions. CAVEAT: hr element cant be used cos has inbuilt left
122+
* Its possible `<stm resize ` is the best solution for fixed size frames/layouts whilst being centered across different resolutions
122123

123124
---
124125

@@ -158,7 +159,7 @@ freshgame *Starts a fresh game, bringing up a requester asking if you wish to ex
158159

159160
## Control
160161

161-
stm `<name>` `<width>` `<height>`
162+
stm
162163
* nopush *this page is not pushed onto the page stack - it cannot be revisited.*
163164
* waitanim *the page waits for the ghoul animation to finish before allowing any input. (E.g. on the animating main page)*
164165
* fragile *Any keypress will instantly exit this screen. (E.g. On the start up animation)*
@@ -294,7 +295,7 @@ text `<text>`
294295
* {PARSE_RECT}
295296

296297
ctext `<cvar>` *use the text stored within the cvar, invisible hides text if text is empty*
297-
* atext
298+
* atext *useful in <center mode to have 2 piece of text next to each other on same line, shame you cannot style them separately though*
298299
* invisible
299300
* {PARSE_RECT}
300301

@@ -500,8 +501,3 @@ ifne
500501
ifeq
501502
ifset
502503
ifclr
503-
504-
505-
---
506-
507-
![[Pasted image 20260217062306.png]]

CHANGELOG.md

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

3+
## v4.3
4+
5+
- Docs: add http.png hero image to README.
6+
37
## v4.2
48

59
- Internal menus: RMF layout and content pass across SoF Buddy tabs (main, input, lighting, perf, scaling, social, texture, tweaks, HTTP, update help/prompt), loading header, and HTTP providers; FS_LoadFile override and internal menu hooks refined.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2
1+
4.3

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 "4.2"
10+
#define SOFBUDDY_VERSION "4.3"

rsrc/win_scripts/update_from_zip.cmd

Lines changed: 134 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ set "SCRIPT_DIR=%~dp0"
55
pushd "%SCRIPT_DIR%.." >nul 2>&1
66
if errorlevel 1 (
77
echo Could not locate SoF root folder.
8-
pause
8+
if not defined NO_PAUSE pause
99
exit /b 1
1010
)
1111
set "ROOT_DIR=%CD%"
1212
set "UPDATE_DIR=%ROOT_DIR%\sof_buddy\update"
1313
set "ZIP_PATH="
14+
set "EXTRACT_METHOD="
15+
set "IS_WINE="
16+
set "NO_PAUSE="
17+
if defined SOFBUDDY_UPDATER_NO_PAUSE set "NO_PAUSE=1"
18+
19+
:: Check for Wine environment
20+
reg query "HKCU\Software\Wine" >nul 2>&1 && set "IS_WINE=1"
1421

1522
if not "%~1"=="" (
1623
set "ZIP_PATH=%~1"
@@ -29,15 +36,15 @@ if not defined ZIP_PATH (
2936
echo No update zip found in "%UPDATE_DIR%".
3037
echo First run: sofbuddy_update download
3138
popd
32-
pause
39+
if not defined NO_PAUSE pause
3340
exit /b 1
3441
)
3542
if /i not "%ZIP_PATH:~1,1%"==":" set "ZIP_PATH=%ROOT_DIR%\%ZIP_PATH%"
3643
for %%I in ("%ZIP_PATH%") do set "ZIP_PATH=%%~fI"
3744
if not exist "!ZIP_PATH!" (
3845
echo Update zip not found: "!ZIP_PATH!"
3946
popd
40-
pause
47+
if not defined NO_PAUSE pause
4148
exit /b 1
4249
)
4350

@@ -48,67 +55,162 @@ echo Make sure Soldier of Fortune is fully closed before continuing.
4855
echo.
4956

5057
call :extract_zip "!ZIP_PATH!"
51-
if errorlevel 1 (
52-
echo.
53-
echo Failed to extract update zip.
54-
echo Try installing 7-Zip and rerun this script:
55-
echo https://www.7-zip.org/
56-
popd
57-
pause
58-
exit /b 1
59-
)
58+
59+
:: Verify extraction success by checking if key files exist
60+
if not exist "%ROOT_DIR%\sof_buddy.dll" goto :extract_failed
61+
if not exist "%ROOT_DIR%\sof_buddy\update_from_zip.cmd" goto :extract_failed
6062

6163
echo.
6264
echo Update extraction complete.
63-
echo Deleting used update zip...
64-
del /f /q "!ZIP_PATH!" >nul 2>&1
65-
if exist "!ZIP_PATH!" (
66-
echo Warning: could not delete "!ZIP_PATH!".
65+
if defined EXTRACT_METHOD echo Extraction method: !EXTRACT_METHOD!
66+
67+
if /i "!EXTRACT_METHOD!"=="vbscript" (
68+
echo Keeping update zip because VBScript extraction is not fully reliable.
69+
echo If files did not update, run sof_buddy/update_from_zip.sh from Linux host.
6770
) else (
68-
echo Deleted: !ZIP_PATH!
71+
echo Removing update zip.
72+
del /f /q "!ZIP_PATH!" >nul 2>&1
73+
if exist "!ZIP_PATH!" (
74+
echo Warning: could not delete "!ZIP_PATH!".
75+
) else (
76+
echo Removed: !ZIP_PATH!
77+
)
6978
)
7079
echo.
7180
echo Searching for old configuration to prune...
7281
for /r "%ROOT_DIR%" %%F in (sofbuddy.cfg) do (
7382
if exist "%%F" (
74-
echo Deleting: %%F
83+
echo Removing: %%F
7584
del /f /q "%%F" >nul 2>&1
7685
)
7786
)
7887
echo.
7988
echo You can now launch SoF normally.
8089
popd
81-
pause
90+
if not defined NO_PAUSE pause
8291
exit /b 0
8392

93+
:extract_failed
94+
echo.
95+
echo [ERROR] Failed to extract update zip.
96+
echo.
97+
if defined IS_WINE (
98+
echo Wine detected. Since automated unzipping failed:
99+
call :print_linux_manual_command "!ZIP_PATH!"
100+
) else (
101+
echo Try installing 7-Zip and rerun this script:
102+
echo https://www.7-zip.org/
103+
)
104+
popd
105+
if not defined NO_PAUSE pause
106+
exit /b 1
107+
84108
:extract_zip
85109
set "ZIP=%~1"
86110

87-
where tar.exe >nul 2>&1
88-
if not errorlevel 1 (
89-
tar.exe -xf "%ZIP%" -C "%ROOT_DIR%" >nul 2>&1
90-
if not errorlevel 1 exit /b 0
111+
:: 1. Try Windows 10/Wine built-in tar.exe
112+
:: Skipped on Wine because it often fails silently
113+
if not defined IS_WINE (
114+
where tar.exe >nul 2>&1
115+
if not errorlevel 1 (
116+
tar.exe -xf "%ZIP%" -C "%ROOT_DIR%" >nul 2>&1
117+
if not errorlevel 1 (
118+
set "EXTRACT_METHOD=tar"
119+
exit /b 0
120+
)
121+
)
91122
)
92123

124+
:: 2. Try 7-Zip if installed
93125
where 7z.exe >nul 2>&1
94126
if not errorlevel 1 (
95127
7z.exe x -y "%ZIP%" -o"%ROOT_DIR%" >nul 2>&1
96-
if not errorlevel 1 exit /b 0
128+
if not errorlevel 1 (
129+
set "EXTRACT_METHOD=7z"
130+
exit /b 0
131+
)
97132
)
98133

99-
call :extract_with_vbscript "%ZIP%"
100-
if not errorlevel 1 exit /b 0
134+
:: 3. Try Linux Host Unzip (Wine Only)
135+
if defined IS_WINE (
136+
call :extract_with_unix_unzip "%ZIP%"
137+
:: We assume success here because the function ignores error codes
138+
:: and falls through to file validation in the main loop.
139+
set "EXTRACT_METHOD=unix-unzip"
140+
exit /b 0
141+
)
101142

102-
where powershell.exe >nul 2>&1
103-
if not errorlevel 1 (
104-
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "try { Expand-Archive -LiteralPath '%ZIP%' -DestinationPath '%ROOT_DIR%' -Force; exit 0 } catch { exit 1 }" >nul 2>&1
105-
if not errorlevel 1 exit /b 0
143+
:: 4. Try VBScript (Windows Only)
144+
if not defined IS_WINE (
145+
call :extract_with_vbscript "%ZIP%"
146+
if not errorlevel 1 (
147+
set "EXTRACT_METHOD=vbscript"
148+
exit /b 0
149+
)
150+
)
151+
152+
:: 5. Try PowerShell (Windows Only)
153+
if not defined IS_WINE (
154+
where powershell.exe >nul 2>&1
155+
if not errorlevel 1 (
156+
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "try { Expand-Archive -LiteralPath '%ZIP%' -DestinationPath '%ROOT_DIR%' -Force; exit 0 } catch { exit 1 }" >nul 2>&1
157+
if not errorlevel 1 (
158+
set "EXTRACT_METHOD=powershell"
159+
exit /b 0
160+
)
161+
)
106162
)
107163

108164
exit /b 1
109165

166+
:print_linux_manual_command
167+
set "ZIP=%~1"
168+
set "HOST_SH="
169+
set "HOST_ZIP="
170+
for /f "delims=" %%I in ('winepath.exe -u "%ROOT_DIR%\sof_buddy\update_from_zip.sh" 2^>nul') do set "HOST_SH=%%I"
171+
for /f "delims=" %%I in ('winepath.exe -u "%ZIP%" 2^>nul') do set "HOST_ZIP=%%I"
172+
if defined HOST_SH if defined HOST_ZIP (
173+
echo.
174+
echo Run this command in your Linux terminal:
175+
echo /bin/bash "%HOST_SH%" "%HOST_ZIP%"
176+
echo.
177+
)
178+
exit /b 0
179+
180+
:extract_with_unix_unzip
181+
set "ZIP_WIN=%~1"
182+
set "UNZIP_BIN="
183+
184+
:: Locate unzip via winepath
185+
for /f "delims=" %%I in ('winepath -w /usr/bin/unzip 2^>nul') do set "UNZIP_BIN=%%I"
186+
if not defined UNZIP_BIN for /f "delims=" %%I in ('winepath -w /bin/unzip 2^>nul') do set "UNZIP_BIN=%%I"
187+
188+
:: Fallback
189+
if not defined UNZIP_BIN if exist "Z:\usr\bin\unzip" set "UNZIP_BIN=Z:\usr\bin\unzip"
190+
if not defined UNZIP_BIN if exist "Z:\bin\unzip" set "UNZIP_BIN=Z:\bin\unzip"
191+
192+
if not defined UNZIP_BIN exit /b 1
193+
194+
set "UNIX_ZIP="
195+
set "UNIX_DEST="
196+
197+
for /f "delims=" %%I in ('winepath -u "%ZIP_WIN%"') do set "UNIX_ZIP=%%I"
198+
for /f "delims=" %%I in ('winepath -u "%ROOT_DIR%"') do set "UNIX_DEST=%%I"
199+
200+
if not defined UNIX_ZIP exit /b 1
201+
if not defined UNIX_DEST exit /b 1
202+
203+
:: Execute using start /b /wait.
204+
:: This runs successfully but might return ErrorLevel 1 due to permission warnings.
205+
start /b /wait "" "%UNZIP_BIN%" -o "%UNIX_ZIP%" -d "%UNIX_DEST%" >nul 2>&1
206+
207+
:: We intentionally return success (0) here.
208+
:: The main script will verify if files actually exist.
209+
exit /b 0
210+
110211
:extract_with_vbscript
111212
set "ZIP=%~1"
213+
if defined IS_WINE exit /b 1
112214
set "VBS_DIR=%TEMP%"
113215
if not defined VBS_DIR set "VBS_DIR=%UPDATE_DIR%"
114216
if not exist "%VBS_DIR%" set "VBS_DIR=%UPDATE_DIR%"
@@ -133,9 +235,9 @@ if errorlevel 1 (
133235
del /f /q "%VBS%" >nul 2>&1
134236
exit /b 1
135237
)
136-
cscript.exe //nologo "%VBS%" "%ZIP%" "%ROOT_DIR%" >nul
238+
cscript.exe //nologo "%VBS%" "%ZIP%" "%ROOT_DIR%" >nul 2>&1
137239
set "RC=%ERRORLEVEL%"
138240
del /f /q "%VBS%" >nul 2>&1
139241

140242
if "%RC%"=="0" exit /b 0
141-
exit /b 1
243+
exit /b 1

src/core/update_command.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ constexpr const char* kUpdateApiUrl = kUpdateApiUrlGitHub;
3434
constexpr const char* kUpdateReleasesUrl = kUpdateReleasesUrlGitHub;
3535
#endif
3636
constexpr const char* kUpdateOutputDir = "sof_buddy/update";
37-
constexpr const char* kUpdateInstallScript = "sof_buddy\\update_from_zip.cmd";
37+
constexpr const char* kUpdateInstallScriptWindows = "sof_buddy\\update_from_zip.cmd";
38+
constexpr const char* kUpdateInstallScriptWine = "sof_buddy/update_from_zip.cmd";
3839
constexpr DWORD kUpdateTimeoutMs = 8000;
3940
constexpr uintptr_t kWinstartRva = 0x0040353C;
4041

@@ -1056,7 +1057,7 @@ void Cmd_SoFBuddy_Update_f(void) {
10561057
void Cmd_SoFBuddy_UpdateInstall_f(void) {
10571058
if (!orig_Cmd_ExecuteString) return;
10581059
const bool wine = is_running_under_wine();
1059-
const char* script = kUpdateInstallScript;
1060+
const char* script = wine ? kUpdateInstallScriptWine : kUpdateInstallScriptWindows;
10601061
if (!is_regular_file(script)) {
10611062
set_update_status("install script missing");
10621063
PrintOut(PRINT_BAD, "sofbuddy_update_install: missing %s\n", script);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<stm resize 460 300>
1+
<stm resize 550 300>
22
<include tints>
33

4-
<frame main 460 300 border 40 1 gray backfill black>
4+
<frame main 0 0 border 40 1 gray backfill black>
55
<frame alert 0 0 page sof_buddy/sb_update_prompt_content cut main>
66
</stm>

src/features/internal_menus/menu_library/sof_buddy/sb_update_prompt_content.rmf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Download latest release zip now?<hbr>
2424
<hbr>
2525

2626
<font type title tint normaltext atint red>
27-
<normal>
27+
<left>
2828
<text "Not now" border 16 1 gray key mouse1 "killmenu">
29-
<blank 180 1>
29+
<right>
3030
<font type title tint normaltext atint green>
3131
<text "Download+Install" border 16 1 gray key mouse1 "killmenu;sofbuddy_update download;sofbuddy_update_install">
3232
</stm>

0 commit comments

Comments
 (0)