From f9bb15f7a026aeaafb03b69a48d7987d9dee1209 Mon Sep 17 00:00:00 2001 From: Bauumm Date: Sun, 27 Oct 2024 16:01:04 +0100 Subject: [PATCH] fix wrong level property names --- compat/game20/init.lua | 4 ++-- compat/game20/level.lua | 18 +++++++++--------- compat/game21/init.lua | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compat/game20/init.lua b/compat/game20/init.lua index cffc45e..34fbc2f 100644 --- a/compat/game20/init.lua +++ b/compat/game20/init.lua @@ -53,10 +53,10 @@ public.start = async(function(pack_id, level_id, level_options) game.pack = async.await(assets.get_pack(pack_id)) level.set(game.pack.levels[level_id]) level_status.reset() - style.set(game.pack.styles[level.styleId]) + style.set(game.pack.styles[level.style_id]) music.stop() local pitch = config.get("sync_music_to_dm") and math.pow(game.difficulty_mult, 0.12) or 1 - music.play(game.pack.music[level.musicId], not public.first_play, nil, pitch) + music.play(game.pack.music[level.music_id], not public.first_play, nil, pitch) if not args.headless then go_sound:play() end diff --git a/compat/game20/level.lua b/compat/game20/level.lua index 90c41ae..d54379c 100644 --- a/compat/game20/level.lua +++ b/compat/game20/level.lua @@ -5,12 +5,12 @@ local defaults = { name = "nullName", description = "", author = "", - menuPriority = 0, + menu_priority = 0, selectable = true, - musicId = "nullMusicId", - styleId = "nullStyleId", - luaFile = "nullLuaPath", - difficultyMults = {}, + music_id = "nullMusicId", + style_id = "nullStyleId", + lua_file = "nullLuaPath", + difficulty_multipliers = {}, } function level.set(level_json) @@ -18,16 +18,16 @@ function level.set(level_json) level[key] = level_json[key] or value end local has1 = false - for i = 1, #level.difficultyMults do - if level.difficultyMults[i] == 1 then + for i = 1, #level.difficulty_multipliers do + if level.difficulty_multipliers[i] == 1 then has1 = true break end end if not has1 then - level.difficultyMults[#level.difficultyMults + 1] = 1 + level.difficulty_multipliers[#level.difficulty_multipliers + 1] = 1 end - table.sort(level.difficultyMults) + table.sort(level.difficulty_multipliers) end return level diff --git a/compat/game21/init.lua b/compat/game21/init.lua index dabc0bc..5c65c3f 100644 --- a/compat/game21/init.lua +++ b/compat/game21/init.lua @@ -90,9 +90,9 @@ public.start = async(function(pack_id, level_id, level_options) error("Error: level with id '" .. level_id .. "' not found") end level_status.reset(config.get("sync_music_to_dm")) - local style_data = game.pack_data.styles[game.level_data.styleId] + local style_data = game.pack_data.styles[game.level_data.style_id] if style_data == nil then - log("Warn: style with id '" .. game.level_data.styleId .. "' not found") + log("Warn: style with id '" .. game.level_data.style_id .. "' not found") -- still continue with default style values end style.select(style_data or {}) @@ -100,9 +100,9 @@ public.start = async(function(pack_id, level_id, level_options) game.difficulty_mult = difficulty_mult status.reset_all_data() music.stop() - local new_music = game.pack_data.music[game.level_data.musicId] + local new_music = game.pack_data.music[game.level_data.music_id] if new_music == nil then - error("Music with id '" .. game.level_data.musicId .. "' doesn't exist!") + error("Music with id '" .. game.level_data.music_id .. "' doesn't exist!") end music.play(new_music, not public.first_play, nil, public.refresh_music_pitch()) status.beat_pulse_delay = status.beat_pulse_delay + (music.segment.beat_pulse_delay_offset or 0)