local defaults = { } local flist = {} function get_config(key) if ui_mcm then return ui_mcm.get("SMR/smr_spawns/"..key) else return defaults[key] end end local function get_flist() if next(flist) == nil then local files = getFS():file_list_open('$game_config$', "plugins\\zcp\\spawn_templates\\", bit_or(FS.FS_ListFiles, FS.FS_RootOnly)) for i=0,files:Size()-1 do local file_name = files:GetAt(i) table.insert(flist, {"plugins\\zcp\\spawn_templates\\" .. file_name, file_name }) end end return flist end function on_mcm_load() local templates = get_flist() return { id="smr_spawns", sh=true, gr={ { id="title_header", type="slide", link="ui_options_slider_warfare", text="ui_mcm_menu_smr_spawns", size= {512,50}, spacing=20 }, { id="preset_desc", type="desc", clr={200, 125, 125, 125}, text="ui_mcm_SMR_smr_spawns_preset_desc"}, { id="preset_file", type="list", val=0, no_str=true, content=templates}, { id="preset_file_desc", type="desc", clr={200, 125, 125, 125}, text="ui_mcm_SMR_smr_spawns_preset_file_desc"}, { id="preset_apply_random", type="check", val=1, def=false }, { id="preset_apply_replaced", type="check", val=1, def=false }, -- week 1 { id="preset_week0_title", type="title", text="ui_mcm_smr_spawns_preset_week0_title", align="c" }, { id="preset_week0_tier1", type="track", val=2, min=1, max=100, step=1, def=70 }, { id="preset_week0_tier2", type="track", val=2, min=1, max=100, step=1, def=25 }, { id="preset_week0_tier3", type="track", val=2, min=1, max=100, step=1, def=5 }, -- week 2 { id="preset_week1_title", type="title", text="ui_mcm_smr_spawns_preset_week1_title", align="c" }, { id="preset_week1_tier1", type="track", val=2, min=1, max=100, step=1, def=50 }, { id="preset_week1_tier2", type="track", val=2, min=1, max=100, step=1, def=40 }, { id="preset_week1_tier3", type="track", val=2, min=1, max=100, step=1, def=10 }, -- week 3 { id="preset_week2_title", type="title", text="ui_mcm_smr_spawns_preset_week2_title", align="c" }, { id="preset_week2_tier1", type="track", val=2, min=1, max=100, step=1, def=35 }, { id="preset_week2_tier2", type="track", val=2, min=1, max=100, step=1, def=50 }, { id="preset_week2_tier3", type="track", val=2, min=1, max=100, step=1, def=15 }, -- week 4 { id="preset_week3_title", type="title", text="ui_mcm_smr_spawns_preset_week3_title", align="c" }, { id="preset_week3_tier1", type="track", val=2, min=1, max=100, step=1, def=30 }, { id="preset_week3_tier2", type="track", val=2, min=1, max=100, step=1, def=45 }, { id="preset_week3_tier3", type="track", val=2, min=1, max=100, step=1, def=25 }, }}, "SMR" end