starlit  Diff

Differences From Artifact [01dfc2a3de]:

To Artifact [3ce8488360]:


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
			return state, created
		end;
		render = function(self, state, user)
			return self.pages[state.page].render(state, user)
		end;
		show = function(self, user)
			local state = self:begin(user)
			minetest.show_formspec(user.name, self.id,self:render(state, user))
		end;
		open = function(self, user, page, ...)
			user:suitSound 'starlit-nav'
			self:begin(user, page, ...)
			self:show(user)
		end;
		close = function(self, user)
			local state = starlit.activeUI[user.name]
			if state and state.form == self.id then
				self:cb('onClose', user)
				starlit.activeUI[user.name] = nil
				minetest.close_formspec(user.name, self.id)
			end
		end;
	};
	construct = function(p)
		if not p.id then error('UI missing id') end
		p.pages = p.pages or {}
		return p
................................................................................
			hue = 260, sat = 0, lum = 0
		};
	}
	local lines = state.lines
	local cmod = string.format('^[hsl:%s:%s:%s',
		state.color.hue, state.color.sat*0xff, state.color.lum*0xff)

	local E = minetest.formspec_escape
	if state.padding/2 > state.x then state.x = state.padding/2 end
	if state.padding/2 > state.y then state.y = state.padding/2 end

	local function btnColorDef(sel)
		local function climg(state,img)
			local selstr
			if sel == nil then







|











|







 







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
			return state, created
		end;
		render = function(self, state, user)
			return self.pages[state.page].render(state, user)
		end;
		show = function(self, user)
			local state = self:begin(user)
			core.show_formspec(user.name, self.id,self:render(state, user))
		end;
		open = function(self, user, page, ...)
			user:suitSound 'starlit-nav'
			self:begin(user, page, ...)
			self:show(user)
		end;
		close = function(self, user)
			local state = starlit.activeUI[user.name]
			if state and state.form == self.id then
				self:cb('onClose', user)
				starlit.activeUI[user.name] = nil
				core.close_formspec(user.name, self.id)
			end
		end;
	};
	construct = function(p)
		if not p.id then error('UI missing id') end
		p.pages = p.pages or {}
		return p
................................................................................
			hue = 260, sat = 0, lum = 0
		};
	}
	local lines = state.lines
	local cmod = string.format('^[hsl:%s:%s:%s',
		state.color.hue, state.color.sat*0xff, state.color.lum*0xff)

	local E = core.formspec_escape
	if state.padding/2 > state.x then state.x = state.padding/2 end
	if state.padding/2 > state.y then state.y = state.padding/2 end

	local function btnColorDef(sel)
		local function climg(state,img)
			local selstr
			if sel == nil then