Commit f2517090 authored by Grayswandir's avatar Grayswandir
Browse files

Adds an options menu to the birther dialog.

This lets addons specify extra options on a player's birth. These are
treated as normal options, so they are saved in the player's
profile. However, the value of this option at the player's birth is
stored on the player itself.

This is to prevent needing to switch options if you switch between save
files that are using different options.

Adds the ToME:extraBirthOptions hook, as well as a generic OptionTree
dialog.

Example addon:

function hook(self, data)
	local options = {
		{type = "group", path = {"basic"}, name = "Basic", desc = "DESC"},
		{type = "group", path = {"basic", "basic2"}, name = "Basic 2", desc = "DESC 2"},
		{type = "boolean", path = {"basic", "basic2", "test"}, id = "test_boolean", name = "Boolean", desc = "Test Option"},
		{type = "cycling", path = {"basic", "basic2", "test8"}, id = "test_cycle", name = "Cycle", desc = "A cycling test option.", values = {"hello", "goodbye", "???"}},
		{type = "group", path = {"advanced"}, name = "Advancded", desc = "GROUP DESC"},
		{type = "numeric", path = {"advanced", "something"}, id = "test_numeric",
		 name = "Numeric", desc = "A numeric test option.", min = 0, default = 7, max = 10}}
	for _, option in ipairs(options) do
		table.insert(data.options, option)
	end
end
self:bindHook("ToME:extraBirthOptions", hook)
parent fce1e752
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment