aboutsummaryrefslogtreecommitdiff
path: root/src/client/inputhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/inputhandler.h')
0 files changed, 0 insertions, 0 deletions
"cb_hide_mpcontent"]) then current.hide_modpackcontents = true this.data.hide_modpackcontents = true else current.hide_modpackcontents = false this.data.hide_modpackcontents = false end this.data.list:set_filtercriteria(current) return true end if fields["btn_config_world_save"] then local filename = this.data.worldspec.path .. DIR_DELIM .. "world.mt" local worldfile = Settings(filename) local mods = worldfile:to_table() local rawlist = this.data.list:get_raw_list() local i,mod for i,mod in ipairs(rawlist) do if not mod.is_modpack and mod.typ ~= "game_mod" then if mod.enabled then worldfile:set("load_mod_"..mod.name, "true") else worldfile:set("load_mod_"..mod.name, "false") end mods["load_mod_"..mod.name] = nil end end -- Remove mods that are not present anymore for key,value in pairs(mods) do if key:sub(1,9) == "load_mod_" then worldfile:remove(key) end end if not worldfile:write() then core.log("error", "Failed to write world config file") end this:delete() return true end if fields["btn_config_world_cancel"] then this:delete() return true end if fields["btn_all_mods"] then local list = this.data.list:get_raw_list() for i=1,#list,1 do if list[i].typ ~= "game_mod" and not list[i].is_modpack then list[i].enabled = true end end return true end return false end function create_configure_world_dlg(worldidx) local dlg = dialog_create("sp_config_world", get_formspec, handle_buttons, nil) --TODO read from settings dlg.data.hide_gamemods = false dlg.data.hide_modpackcontents = false dlg.data.selected_mod = 0 dlg.data.worldspec = core.get_worlds()[worldidx] if dlg.data.worldspec == nil then dlg:delete() return nil end dlg.data.worldconfig = modmgr.get_worldconfig(dlg.data.worldspec.path) if dlg.data.worldconfig == nil or dlg.data.worldconfig.id == nil or dlg.data.worldconfig.id == "" then dlg:delete() return nil end dlg.data.list = filterlist.create( modmgr.preparemodlist, --refresh modmgr.comparemod, --compare function(element,uid) --uid match if element.name == uid then return true end end, function(element,criteria) if criteria.hide_game and element.typ == "game_mod" then return false end if criteria.hide_modpackcontents and element.modpack ~= nil then return false end return true end, --filter { worldpath= dlg.data.worldspec.path, gameid = dlg.data.worldspec.gameid } ) dlg.data.list:set_filtercriteria( { hide_game=dlg.data.hide_gamemods, hide_modpackcontents= dlg.data.hide_modpackcontents }) dlg.data.list:add_sort_mechanism("alphabetic", sort_mod_list) dlg.data.list:set_sortmode("alphabetic") return dlg end