diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-24 17:33:29 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-24 17:33:29 -0300 |
commit | 25a043d7a824046521bcfe576a19c260524603a6 (patch) | |
tree | 29d9c52422f65553d52217bdf12465a30aae64c5 /game | |
parent | 9381141fd1bfecc35ca2160b734d5bf320f3785e (diff) | |
download | client-25a043d7a824046521bcfe576a19c260524603a6.tar.gz client-25a043d7a824046521bcfe576a19c260524603a6.tar.bz2 client-25a043d7a824046521bcfe576a19c260524603a6.tar.xz client-25a043d7a824046521bcfe576a19c260524603a6.zip |
Register SFX assets as well
Diffstat (limited to 'game')
-rw-r--r-- | game/03_init.rpy | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/game/03_init.rpy b/game/03_init.rpy index 0740c27..0a55ac7 100644 --- a/game/03_init.rpy +++ b/game/03_init.rpy @@ -139,7 +139,7 @@ init python: return name # Loads a sound called VAL - def get_sfx(val, ext): + def get_sfx(val, ext=".mp3"): # Search for the sound show_img(val, False, ext=ext) @@ -149,9 +149,22 @@ init python: return "sfx/regnum.mp3" # FIXME return valb + + # Load sfx (or rather, register the path) + for file in renpy.list_files(): + fn=file.replace('sfx/','').replace('/', ' ').replace('.mp3','').replace('.ogg','') + if file.startswith('sfx/'): + if file.endswith('.mp3') or file.endswith('.ogg'): + if not fn in persistent.allfiles: + persistent.allfiles.append((fn, file)) + allfiles.append(fn) + continue + continue + + # Load sprite images: "unit" for file in renpy.list_files(): - fn=file.replace('gfx/units/','').replace('/', ' ').replace('.png','') + fn=file.replace('gfx/units/','').replace('/', ' ').replace('.png','').replace('.webp','') if file.startswith('gfx/units/'): if file.endswith('.png') or file.endswith('.webp'): name = "unit_"+fn @@ -167,7 +180,7 @@ init python: # Load sprite images: "mob" for file in renpy.list_files(): - fn=file.replace('gfx/mobs/','').replace('/', ' ').replace('.png','') + fn=file.replace('gfx/mobs/','').replace('/', ' ').replace('.png','').replace('.webp','') if file.startswith('gfx/mobs/'): if file.endswith('.png') or file.endswith('.webp'): name = "mob_"+fn @@ -366,10 +379,12 @@ init python: ########################################################## # Other Music + #MUSIC_OPENING => Init Block -3 + #MUSIC_TOWN => Init Block -3 MUSIC_BATTLE=RetString("sfx/bgm03.mp3") MUSIC_BOSS=RetString("sfx/bgm04.mp3") MUSIC_PARTY=RetString("sfx/bgm02.mp3") - MUSIC_PARTY=ExecuteOnCall(get_sfx, "sfx_bgm05", ".mp3")#"sfx/bgm05.mp3" + MUSIC_PARTY=ExecuteOnCall(get_sfx, "sfx_bgm05", ".mp3") MUSIC_VICTORY=RetString("sfx/bgm06.mp3") MUSIC_WORLDMAP=RetString("sfx/bgm02.mp3") MUSIC_WORLDMAP=ExecuteOnCall(get_sfx, "sfx_bgm07", ".mp3")#"sfx/bgm07.mp3" |