diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index c38c140e6..d7712b371 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -2138,15 +2138,25 @@ void C_DefineSound(int32_t sndidx, const char *fn, int32_t args[5]) void C_DefineMusic(int32_t vol, int32_t lev, const char *fn) { - Bassert((unsigned)vol < MAXVOLUMES+1); - Bassert((unsigned)lev < MAXLEVELS); - + if (vol==-1) { - map_t *const map = &MapInfo[(MAXLEVELS*vol)+lev]; + Bassert((unsigned)lev < MAXVOLUMES); - Bfree(map->musicfn); - map->musicfn = dup_filename(fn); - check_filename_case(map->musicfn); + Bstrncpyz(EnvMusicFilename[lev], fn, BMAX_PATH); + check_filename_case(EnvMusicFilename[lev]); + } + else + { + Bassert((unsigned)vol < MAXVOLUMES+1); + Bassert((unsigned)lev < MAXLEVELS); + + { + map_t *const map = &MapInfo[(MAXLEVELS*vol)+lev]; + + Bfree(map->musicfn); + map->musicfn = dup_filename(fn); + check_filename_case(map->musicfn); + } } } diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index 2cd9169f9..462b4286a 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -821,7 +821,9 @@ local UserdefLabels = { screen_tilting = UD".screen_tilting", showallmap = UDRO".showallmap", showweapons = UDRO".showweapons", + statusbarscale = UDRO".statusbarscale", volume_number = { UD".volume_number", UD":set_volume_number(%%s)" }, + weaponscale = UDRO".weaponscale", weaponswitch = UD".weaponswitch", } diff --git a/polymer/eduke32/source/lunatic/lunacon.lua b/polymer/eduke32/source/lunatic/lunacon.lua index f8a428348..cd6c59762 100644 --- a/polymer/eduke32/source/lunatic/lunacon.lua +++ b/polymer/eduke32/source/lunatic/lunacon.lua @@ -955,22 +955,20 @@ function Cmd.definesound(sndnum, fn, ...) end function Cmd.music(volnum, ...) - if (volnum==0) then - warnprintf("`music' for volume 0 not yet implemented") - return - end + local envmusicp = (volnum==0) - if (not (volnum >= 1 and volnum <= conl.MAXVOLUMES)) then + if (not (volnum >= 0 and volnum <= conl.MAXVOLUMES)) then -- NOTE: Don't allow MAXVOLUMES+1 for now. - errprintf("volume number must be between 1 and MAXVOLUMES=%d", conl.MAXVOLUMES) + errprintf("volume number must be between 0 and MAXVOLUMES=%d", conl.MAXVOLUMES) return end local filenames = {...} + local MAXFNS = envmusicp and conl.MAXVOLUMES or conl.MAXLEVELS - if (#filenames > conl.MAXLEVELS) then - warnprintf("ignoring extraneous %d music file names", #filenames-conl.MAXLEVELS) - for i=conl.MAXLEVELS+1,#filenames do + if (#filenames > MAXFNS) then + warnprintf("ignoring extraneous %d music file names", #filenames-MAXFNS) + for i=MAXFNS+1,#filenames do filenames[i] = nil end end