Add a language option to the VR menu, and fix a crash switching to it
build / build (push) Successful in 2m22s
build / build (push) Successful in 2m22s
- New "Language" row on the Main Menu tab (English/French/German), backed by a new "general" group in questshock.config.json - Fixes a device-reproduced crash: switching language used to call language_dealfunc(), whose render_run()/opanel_redraw() repaint assumes the game's own in-game options panel is on screen - crashes (SIGSEGV) when triggered from our independent VR overlay instead. Now calls language_change() directly, which is all that's actually needed to reload resources and refresh the inventory/MFD/side-icon UI - Fixes a second crash: this data set ships frnstrng.res/gerstrng.res but not mfdfrn.res/mfdger.res, and language_change() closes the current resource files before discovering the new ones don't exist - leaving no valid resource file open and crashing on the next lookup. Now checks both files exist before ever switching, refusing the change (with an in-headset popup) instead of corrupting resource state - extract_assets.sh can now also pull mfdfrn.res/mfdger.res out of a System Shock: Classic installer (which includes them, unlike Enhanced Edition) if one is present in res/assets/ - entirely optional - Documented all of the above in README.md/CONFIG.md
This commit is contained in:
@@ -49,13 +49,20 @@ void qs_config_request_load(void);
|
||||
void qs_config_request_set_renderer(bool opengl);
|
||||
void qs_config_request_set_resolution(int resolution_index);
|
||||
|
||||
// Returns true and handles the event if it's one of the four custom events
|
||||
// qs_config_request_save()/_load()/_set_renderer()/_set_resolution()
|
||||
// enqueue - called from pump_events() (sdl_events.c, see
|
||||
// Same cross-thread-dispatch reasoning as the two above - called from the
|
||||
// Main Menu tab's Language row (MenuOverlay.java). language_index is 0
|
||||
// English/1 French/2 German (gShockPrefs.goLanguage's own numbering,
|
||||
// Prefs.h). Applies live immediately, the same way the game's own options
|
||||
// menu applies a language change (see qs_config.c's qs_apply_language()).
|
||||
void qs_config_request_set_language(int language_index);
|
||||
|
||||
// Returns true and handles the event if it's one of the five custom events
|
||||
// qs_config_request_save()/_load()/_set_renderer()/_set_resolution()/
|
||||
// _set_language() enqueue - called from pump_events() (sdl_events.c, see
|
||||
// android/engine-patches/21-android-config.patch) on the engine's own
|
||||
// thread, once per polled event, before its normal switch on well-known
|
||||
// SDL_* event types. Returns false (no-op) for any other event type,
|
||||
// including before the four custom types have even been registered.
|
||||
// including before the five custom types have even been registered.
|
||||
bool qs_config_handle_event(const SDL_Event *event);
|
||||
|
||||
// Read-only queries for the Video Options tab's own selection highlight
|
||||
@@ -73,9 +80,12 @@ int qs_config_current_resolution_index(void);
|
||||
// gShockPrefs.goLanguage (0 English/1 French/2 German, Prefs.h) - read by
|
||||
// MenuOverlay.java's/KeyboardOverlay.java's periodic header-refresh timer
|
||||
// to pick which language's chrome text (Strings.java) to display, so a
|
||||
// language change made mid-session via the game's own options menu is
|
||||
// picked up without needing to reopen either panel. Same
|
||||
// off-thread-scalar-read reasoning as the two getters above.
|
||||
// language change made mid-session via the game's own options menu (or our
|
||||
// own Language row, or Load Configuration) is picked up without needing to
|
||||
// reopen either panel; also doubles as the Main Menu tab's Language row's
|
||||
// own selection highlight, same as qs_config_current_renderer_is_opengl()/
|
||||
// qs_config_current_resolution_index() above. Same off-thread-scalar-read
|
||||
// reasoning as those two getters.
|
||||
int qs_config_current_language(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user