mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 08:19:56 -04:00
Play the game's own cursor, select and back sounds in the launcher.
The launcher's sound effects were chimes made from sine tones. They are now the game's interface sounds, the ones its menus make for the cursor, a choice and going back: SE_Sys_Cursor00, SE_Sys_Do00 and SE_Sys_Cancel00, the files the in-game menu plays. The launcher decodes them from the player's built game or dump into data/cache/sounds (gamefiles.extract_sounds, a BWAV reader for PCM16 and DSP-ADPCM), beside the font it already reads that way, so no sound ships. The chimes stand in until the game has been read. The cursor's sound is a little under the others, as in the game's menu, and is left out for a quarter of a second after a choice, since one sound plays at a time and the pointer landing on a row of the next screen would cut the choice's sound short. Sounds stay off until the player picks a loudness. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -305,18 +305,29 @@ class App:
|
||||
return self.fcache[(family, max(7, int(px * smallest)), weight)]
|
||||
|
||||
def fonts_from_game(self, game_dir='', dump=''):
|
||||
"""Decode the game's fonts in the background and redraw with them."""
|
||||
if self.game_fonts:
|
||||
"""Decode the game's fonts and its interface sounds in the background, redraw with the fonts and take up
|
||||
the sounds."""
|
||||
fonts, sounds = not self.game_fonts, not self.sounds.game
|
||||
if not fonts and not sounds:
|
||||
return
|
||||
|
||||
def work():
|
||||
got = heard = {}
|
||||
try:
|
||||
got = gamefiles.extract_fonts(self.layout, game_dir, dump)
|
||||
if fonts:
|
||||
got = gamefiles.extract_fonts(self.layout, game_dir, dump)
|
||||
except Exception as e:
|
||||
self.ctx.log(f'fonts: {e}')
|
||||
got = {}
|
||||
try:
|
||||
if sounds:
|
||||
heard = gamefiles.extract_sounds(self.layout, game_dir, dump)
|
||||
self.ctx.log(f'sounds: {len(heard)} of {len(gamefiles.SOUNDS)} interface sounds from the game')
|
||||
except Exception as e:
|
||||
self.ctx.log(f'sounds: {e}')
|
||||
if got:
|
||||
self.root.after(0, self.reload_fonts)
|
||||
if heard:
|
||||
self.root.after(0, self.sounds.load_game)
|
||||
import threading
|
||||
threading.Thread(target=work, daemon=True).start()
|
||||
|
||||
@@ -940,7 +951,7 @@ class App:
|
||||
desc=('A gliding cursor, sliding screens and drifting sparks.',)),
|
||||
Row('enum', 'Sounds', get=lambda: dict(SOUND_LEVELS).get(self.settings.get('sounds'), 'Off'),
|
||||
left=lambda: sounds(-1), right=lambda: sounds(1),
|
||||
desc=('Short chimes when you move and choose. Off by default.',)),
|
||||
desc=('The game\'s cursor, select and back sounds. Off by default.',)),
|
||||
Row('divider'),
|
||||
Row('action', 'Back', on=lambda: self.show('home', self.home_row('Customize Launcher')), height=40,
|
||||
desc=('Back to the main menu.',)),
|
||||
|
||||
Reference in New Issue
Block a user