Skip to content

Fix duplicate mod checkboxes, add i18n (ru, de)#21

Merged
MisterGatto merged 2 commits intoskyprotocol:osp-masterfrom
HugeFrog24:osp-master
Apr 8, 2026
Merged

Fix duplicate mod checkboxes, add i18n (ru, de)#21
MisterGatto merged 2 commits intoskyprotocol:osp-masterfrom
HugeFrog24:osp-master

Conversation

@HugeFrog24
Copy link
Copy Markdown
Contributor

1. Bug fix: Duplicate mod checkboxes in Canvas Menu

Problem

Launching the game multiple times without the process dying causes duplicate checkboxes for the same mod in the ImGui Canvas Menu:

Canvas-duplicate-mod-issue

How it happens

When the user swipes Canvas from recents, Android may keep the process alive, particularly if the LogcatMonitorService foreground service is running, or due to normal process caching. The native library and its static state survive. If the user then reopens Canvas, manages mods (delete/re-add), and launches the game again, onModLibrary pushes new entries into the userLibs vector alongside stale ones from the previous session.

The /proc/self/maps deduplication in ElfLoader is also bypassed in this scenario, because a deleted-then-re-added .so file appears as "mod.so (deleted)" in the maps, which doesn't match the new filename.

Steps to reproduce (deterministic, via adb)

  1. Install a mod
  2. Launch the game
  3. While the game is running, bring ModManagerActivity to the front:
    adb shell am start -n git.artdeell.skymodloader/.elfmod.ModManagerActivity
  4. Delete the mod
  5. Re-add it
  6. Launch the game again
  7. Each launch adds another duplicate entry

Fix

Added Canvas::userLibs.clear() at the top of settle(), which runs once per game launch before any mods are registered. This ensures a clean slate regardless of prior process state.


2. Feature: i18n support (Russian, German)

What changed

  • Migrated ~50 hardcoded strings from layout XML and Java code to strings.xml
  • Marked non-translatable strings (file paths, format strings, brand names) with translatable="false"
  • Added Russian (values-ru) and German (values-de) translations (native speaker of both)
  • Added locales_config.xml for per-app language switching on Android 13+
  • Fixed typos: "Annulla" → "Cancel", "NATRUAL" → "NATURAL"

Testing

  • Verified duplicate checkbox bug no longer reproduces
  • Build passes (./gradlew assembleDebug)
  • Test Russian/German translations on device with per-app language switching

Clear the userLibs vector in settle() before mods are re-registered,
preventing stale entries from accumulating across game launches.
- Migrate hardcoded strings from layouts and Java code to string resources
- Mark non-translatable strings (paths, format strings, brand names)
- Add Russian (values-ru) and German (values-de) translations
- Add locales_config.xml for per-app language switching on Android 13+
- Fix typos: "Annulla" -> "Cancel", "NATRUAL" -> "NATURAL"
@MisterGatto MisterGatto merged commit a15fe90 into skyprotocol:osp-master Apr 8, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants