macOS: load lang/ + sound/aac/, dress up Set username dialog - #6
Merged
Merged
Conversation
- readAssetFile: keep the subdirectory part of the requested path
(only the extension is stripped) so I18n can load lang/en_US.lang
from Contents/Resources/lang/. Previously the directory was thrown
away and findBundleResource only looked under images/, so every
translated string in the in-game Options screen fell back to the
raw key + '<' suffix.
- SoundEngine::_pp: look inside Contents/Resources/sound/aac/{damage,
mob,random,step}/ subdirectories. NSBundle's pathForResource:ofType:
only scans the top of Resources/ and *.lproj children, so previously
every clip lookup returned nil and the game was completely silent.
- DIALOG_SET_USERNAME: give the alert its own informative line, a
dedicated 'Username:' caption, a Username placeholder, and pre-fill
the field from the saved mp_username so it's obvious there's an
editable text field there. The generic dialog accessory now lays
out rows as <label> | <control> so single-row dialogs no longer
render as a thin unlabelled strip.
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three macOS-only fixes for the bugs reported in the last test pass (broken Options text, silent game, near-invisible username dialog). All on top of
7f3f64f.1. Options/Game settings text was rendering as raw keys —
AppPlatform_macOS::readAssetFilewas modeled on the iOS port and stripped both the directory and the extension from the requested asset path. The iOS bundle is flat; ours mirrors the sourcedata/tree, solang/en_US.langwas being looked up asen_US.langonly underResources/images/and the bundle root. The lookup failed →I18n::loadLanguageloaded zero strings → everyI18n::get(id)fell back toreturn id + '<';(literal<suffix), so the in-game Options screen showed labels likeoptions.group.mojang<instead ofAccount. Hard-coded ASCII strings (Armor,Survival,Creative) kept working, which matches what the user saw on-device. Fix: keep the subdirectory infilename, only strip the extension —findBundleResourcealready searches the raw subdir (lang/, etc.) as a fallback.2. The game was completely silent —
SoundEngine::_ppcalled[NSBundle pathForResource:fn ofType:@"m4a"]with noinDirectory:. Apple'spathForResource:ofType:only scans the top ofResources/and*.lprojchildren. The Makefile copieshandheld/data/sound/aac/<category>/<file>.m4ainto the bundle, so every lookup returnedniland no clip ever loaded. Fix: try the four categories that actually exist on disk (damage,mob,random,step) plussound/aac/andsound/as fallbacks, and only as a last ditch the flat bundle root that iOS uses.3. The Set username dialog read as "there's no window at all" —
DIALOG_SET_USERNAMEwas using the generic accessory path withrows == 1, no label, no informative text, a"Name"placeholder and a thin 32-tall accessory frame. Visually it collapsed to a thin unlabelled strip under theSet usernametitle. Fix: lay out rows as<label> | <control>(so even a one-row dialog has a clearly captioned field), give the username dialog its ownUsername:caption +Usernameplaceholder + an informative-text sentence, and pre-fill the field from the savedmp_usernameso it's obvious the field is editable.Review & Testing Checklist for Human
This is yellow risk — the changes are scoped to three small areas but I could not run a real macOS build on this box; CI is the first integration test. Please double-check:
.app— the tab labels (Account,Game,Controls,Graphics) and per-row captions should now be real English text instead ofoptions.group.mojang<style keys.MyGetOpenALAudioData:errors if a lookup still fails.Set usernameNSAlert should now show a labelledUsername:field pre-filled with the current name, with an informative line under the title.Name:,Seed:,Game mode:).Notes
I deliberately did not touch the player-preview rendering in
ArmorScreen(reported as "the player is not shown"). The relevant code (ArmorScreen::renderPlayer,MobRenderer::render,PlayerRenderer) hasn't changed since the initial commit, and I couldn't reproduce or debug it without a Mac — I'd rather not start poking at GL state blindly. If after this PR the Options text + sound look right but the armor-preview player is still missing, I'll do a focused follow-up for that one specifically (likely a GL state issue around alpha test / texture binding when entering the inventory screen).The
<name> wow\line in the screenshots is not a bug — the local player's default name is the literal string"name"(seePlayer.cpp), and<name>is the chat prefix wrapped around it.Link to Devin session: https://app.devin.ai/sessions/5a7050a439284734a4b5702cd21fd2b7
Requested by: @j92580498-max