--local KEEP = newproxy(true) -- Crashes when GC'd, see reference in metaclass
local DEFAULT = newproxy(true)

-- new_player, simple, decent, advanced, (everything?)

-- I guess I don't necessarily need a keep, ignoring it in the preset list should act the same.

local ORDER = {"new_player", "simple", "decent", "advanced"}
local ORDER_REVERSE = table.invert(ORDER)

local CONFIG_PRESETS = {
	new_player = {
		--language = KEEP,
		info_style = DEFAULT,
		text_coloring = DEFAULT,
		hoverer_insight_font_size = DEFAULT,
		inventorybar_insight_font_size = DEFAULT,
		followtext_insight_font_size = DEFAULT,
		alt_only_information = DEFAULT,
		itemtile_display = "percentages",
		time_style = "realtime_short",
		-- Indicators
		display_attack_range = true,
		attack_range_type = DEFAULT,
		hover_range_indicator = false,
		boss_indicator = false,
		miniboss_indicator = false,
		notable_indicator = false,
		pipspook_indicator = false,
		bottle_indicator = false,
		death_indicator = true,
		hunt_indicator = false,
		orchestrina_indicator = false,
		lightningrod_range = DEFAULT,
		blink_range = false,
		wortox_soul_range = false,
		battlesong_range = "attach",
		klaus_sack_markers = false,
		sinkhole_marks = DEFAULT,
		-- Food Related
		display_food = DEFAULT,
		food_style = DEFAULT,
		food_order = DEFAULT,
		food_units = false,
		food_effects = DEFAULT,
		food_memory = DEFAULT,
		display_perishable = DEFAULT,
		-- Information Control
		display_cawnival = false,
		display_yotb_winners = false,
		display_yotb_appraisal = false,
		display_shared_stats = true,
		display_worldmigrator = false,
		display_unwrappable = DEFAULT,
		display_simplefishing = false,
		display_oceanfishing = false,
		display_tackle_information = false,
		display_spawner_information = false,
		display_itemmimic_information = 0,
		weapon_damage = true,
		repair_values = false,
		klaus_sack_info = false,
		soil_moisture = DEFAULT,
		soil_nutrients = DEFAULT,
		soil_nutrients_needs_hat = "hatonly",
		display_plant_stressors = DEFAULT,
		display_fertilizer = false,
		display_compostvalue = false,
		display_weighable = false,
		display_gyminfo = false,
		display_world_events = false,
		display_weather = false,
		nightmareclock_display = false,
		display_health = true,
		display_hunger = 0,
		display_sanity = false,
		display_sanityaura = true,
		display_sanity_interactions = false,
		display_mob_attack_damage = true,
		growth_verbosity = DEFAULT,
		display_pickable = true,
		display_harvestable = true,
		display_finiteuses = true,
		display_timers = false,
		display_upgradeable = false,
		naughtiness_verbosity = 0,
		follower_info = true,
		herd_information = false,
		domestication_information = false,
		display_pollination = false,
		item_worth = false,
		appeasement_value = false,
		fuel_verbosity = 1,
		display_shelter_info = false,
		--unique_info = true,
		-- Miscellaneous
		--display_crafting_lookup_button = DEFAULT,
		--display_insight_menu_button = DEFAULT,
	},
	simple = {
		--language = KEEP,
		--info_style = DEFAULT,
		--text_coloring = DEFAULT,
		--hoverer_insight_font_size = DEFAULT,
		--inventorybar_insight_font_size = DEFAULT,
		--followtext_insight_font_size = DEFAULT,
		--alt_only_information = DEFAULT,
		-- Indicators
		display_attack_range = false,
		--attack_range_type = DEFAULT,
		hover_range_indicator = false,
		boss_indicator = false,
		miniboss_indicator = false,
		notable_indicator = false,
		pipspook_indicator = false,
		bottle_indicator = false,
		death_indicator = false,
		hunt_indicator = false,
		orchestrina_indicator = false,
		lightningrod_range = DEFAULT,
		blink_range = false,
		wortox_soul_range = false,
		battlesong_range = "attach",
		klaus_sack_markers = false,
		sinkhole_marks = DEFAULT,
		-- Food Related
		display_food = DEFAULT,
		food_style = DEFAULT,
		food_order = DEFAULT,
		food_units = DEFAULT,
		food_effects = DEFAULT, -- Should this be false?
		food_memory = DEFAULT,
		display_perishable = DEFAULT,
		-- Information Control
		display_cawnival = false,
		display_yotb_winners = false,
		display_yotb_appraisal = false,
		display_shared_stats = true,
		display_worldmigrator = false,
		display_unwrappable = DEFAULT,
		display_simplefishing = true,
		display_oceanfishing = false,
		display_tackle_information = false,
		display_spawner_information = true,
		display_itemmimic_information = 0,
		weapon_damage = true,
		repair_values = false,
		klaus_sack_info = false,
		soil_moisture = DEFAULT,
		soil_nutrients = DEFAULT,
		soil_nutrients_needs_hat = "hatonly",
		display_plant_stressors = DEFAULT,
		display_fertilizer = false,
		display_compostvalue = false,
		display_weighable = false,
		display_gyminfo = false,
		display_world_events = false,
		display_weather = false,
		nightmareclock_display = true,
		display_health = true,
		display_hunger = 0,
		display_sanity = false,
		display_sanityaura = true,
		display_sanity_interactions = DEFAULT,
		display_mob_attack_damage = true,
		growth_verbosity = DEFAULT,
		display_pickable = DEFAULT,
		display_harvestable = DEFAULT,
		display_finiteuses = DEFAULT,
		display_timers = DEFAULT,
		display_upgradeable = false,
		naughtiness_verbosity = DEFAULT,
		follower_info = DEFAULT,
		herd_information = DEFAULT,
		domestication_information = DEFAULT,
		display_pollination = false,
		item_worth = DEFAULT,
		appeasement_value = false,
		fuel_verbosity = 1,
		display_shelter_info = false,
		--unique_info = DEFAULT,
		-- Miscellaneous
		--display_crafting_lookup_button = DEFAULT,
		--display_insight_menu_button = DEFAULT,
	},
	decent = { -- Mostly defaults?
		--language = KEEP,
		--info_style = DEFAULT,
		--text_coloring = DEFAULT,
		--hoverer_insight_font_size = DEFAULT,
		--inventorybar_insight_font_size = DEFAULT,
		--followtext_insight_font_size = DEFAULT,
		--alt_only_information = DEFAULT,
		-- Indicators
		display_attack_range = DEFAULT,
		attack_range_type = "both",
		hover_range_indicator = DEFAULT,
		boss_indicator = DEFAULT,
		miniboss_indicator = DEFAULT,
		notable_indicator = DEFAULT,
		pipspook_indicator = DEFAULT,
		bottle_indicator = DEFAULT,
		death_indicator = DEFAULT,
		hunt_indicator = DEFAULT,
		orchestrina_indicator = DEFAULT,
		lightningrod_range = DEFAULT,
		blink_range = DEFAULT,
		wortox_soul_range = DEFAULT,
		battlesong_range = DEFAULT,
		klaus_sack_markers = false,
		sinkhole_marks = DEFAULT,
		-- Food Related
		display_food = DEFAULT,
		food_style = DEFAULT,
		food_order = DEFAULT,
		food_units = DEFAULT,
		food_effects = DEFAULT, -- Should this be false?
		food_memory = DEFAULT,
		display_perishable = DEFAULT,
		-- Information Control
		display_cawnival = DEFAULT,
		display_yotb_winners = false,
		display_yotb_appraisal = false,
		display_shared_stats = DEFAULT,
		display_worldmigrator = false,
		display_unwrappable = DEFAULT,
		display_simplefishing = DEFAULT,
		display_oceanfishing = DEFAULT,
		display_tackle_information = DEFAULT,
		display_spawner_information = DEFAULT,
		display_itemmimic_information = 1,
		weapon_damage = DEFAULT,
		repair_values = DEFAULT,
		klaus_sack_info = DEFAULT,
		soil_moisture = DEFAULT,
		soil_nutrients = DEFAULT,
		soil_nutrients_needs_hat = DEFAULT,
		display_plant_stressors = DEFAULT,
		display_fertilizer = DEFAULT,
		display_compostvalue = DEFAULT,
		display_weighable = DEFAULT,
		display_gyminfo = DEFAULT,
		display_world_events = DEFAULT,
		display_weather = DEFAULT,
		nightmareclock_display = DEFAULT,
		display_health = DEFAULT,
		display_hunger = DEFAULT,
		display_sanity = DEFAULT,
		display_sanityaura = DEFAULT,
		display_sanity_interactions = DEFAULT,
		display_mob_attack_damage = DEFAULT,
		growth_verbosity = 2,
		display_pickable = DEFAULT,
		display_harvestable = DEFAULT,
		display_finiteuses = DEFAULT,
		display_timers = DEFAULT,
		display_upgradeable = DEFAULT,
		naughtiness_verbosity = DEFAULT,
		follower_info = DEFAULT,
		herd_information = DEFAULT,
		domestication_information = DEFAULT,
		display_pollination = DEFAULT,
		item_worth = DEFAULT,
		appeasement_value = DEFAULT,
		fuel_verbosity = DEFAULT,
		display_shelter_info = DEFAULT,
		--unique_info = DEFAULT,
		-- Miscellaneous
		--display_crafting_lookup_button = DEFAULT,
		--display_insight_menu_button = DEFAULT,
	},
	advanced = { -- My kind of info.
		--language = KEEP,
		--info_style = DEFAULT,
		--text_coloring = DEFAULT,
		--hoverer_insight_font_size = DEFAULT,
		--inventorybar_insight_font_size = DEFAULT,
		--followtext_insight_font_size = DEFAULT,
		--alt_only_information = DEFAULT,
		-- Indicators
		display_attack_range = DEFAULT,
		attack_range_type = "both",
		hover_range_indicator = DEFAULT,
		boss_indicator = DEFAULT,
		miniboss_indicator = DEFAULT,
		notable_indicator = DEFAULT,
		pipspook_indicator = DEFAULT,
		bottle_indicator = DEFAULT,
		death_indicator = DEFAULT,
		hunt_indicator = DEFAULT,
		orchestrina_indicator = DEFAULT,
		lightningrod_range = DEFAULT,
		blink_range = true,
		wortox_soul_range = true,
		battlesong_range = DEFAULT,
		klaus_sack_markers = true,
		sinkhole_marks = DEFAULT,
		-- Food Related
		display_food = DEFAULT,
		food_style = DEFAULT,
		food_order = DEFAULT,
		food_units = DEFAULT,
		food_effects = DEFAULT, -- Should this be false?
		food_memory = DEFAULT,
		display_perishable = DEFAULT,
		-- Information Control
		display_cawnival = DEFAULT,
		display_yotb_winners = false,
		display_yotb_appraisal = false,
		display_shared_stats = DEFAULT,
		display_worldmigrator = true,
		display_unwrappable = DEFAULT,
		display_simplefishing = DEFAULT,
		display_oceanfishing = DEFAULT,
		display_tackle_information = DEFAULT,
		display_spawner_information = DEFAULT,
		display_itemmimic_information = 2,
		weapon_damage = DEFAULT,
		repair_values = DEFAULT,
		klaus_sack_info = true,
		soil_moisture = 4,
		soil_nutrients = DEFAULT,
		soil_nutrients_needs_hat = "always",
		display_plant_stressors = 2,
		display_fertilizer = DEFAULT,
		display_compostvalue = DEFAULT,
		display_weighable = true,
		display_gyminfo = true,
		display_world_events = DEFAULT,
		display_weather = DEFAULT,
		nightmareclock_display = DEFAULT,
		display_health = true,
		display_hunger = DEFAULT,
		display_sanity = true,
		display_sanityaura = DEFAULT,
		display_sanity_interactions = true,
		display_mob_attack_damage = DEFAULT,
		growth_verbosity = 2,
		display_pickable = DEFAULT,
		display_harvestable = DEFAULT,
		display_finiteuses = DEFAULT,
		display_timers = DEFAULT,
		display_upgradeable = DEFAULT,
		naughtiness_verbosity = DEFAULT,
		follower_info = DEFAULT,
		herd_information = true,
		domestication_information = DEFAULT,
		display_pollination = DEFAULT,
		item_worth = DEFAULT,
		appeasement_value = true,
		fuel_verbosity = 2,
		display_shelter_info = DEFAULT,
		--unique_info = DEFAULT,
		-- Miscellaneous
		--display_crafting_lookup_button = DEFAULT,
		--display_insight_menu_button = DEFAULT,
		-- Debugging
		DEBUG_SHOW_PREFAB = true,
	},
}

local function iterator(self, key)
	local index = key ~= nil and (ORDER_REVERSE[key] + 1) or 1
	return ORDER[index]
end

setmetatable(CONFIG_PRESETS, {
	__pairs = function(self, ...)
		return iterator, self, nil
	end
})

--[[
for category, data in pairs(CONFIG_PRESETS) do
	for name, selected in pairs(data) do
		if not IsDataValidForConfigOptions(modinfo)
end
--]]

return {
	PRESETS = CONFIG_PRESETS,
	DEFAULT = DEFAULT
}