starlit  Diff

Differences From Artifact [f0333e36f4]:

To Artifact [79d7647b1a]:


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
...
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
			indsz, indsz,
			indsz, indsz,
			indicator);
	end
end

M.element.foreach('starlit:gen-forms', {}, function(id, m)
	local eltID = F('%s:element_%s', minetest.get_current_modname(), id)
-- 	local eltName = F('Elemental %s', lib.str.capitalize(m.name))
	local tt = function(t, d, g)
		return starlit.ui.tooltip {
			title = t, desc = d;
			color = lib.color(0.1,0.2,0.1);
			props = {
				{title = 'Mass', desc = lib.math.si('g', g), affinity='info'}
................................................................................
	m.form = m.form or {}


	if not (m.gas or m.liquid) then
		local brickID = eltID .. '_brick'
		local brickName = F('%s Brick', lib.str.capitalize(m.name))
		m.form.brick = brickID
		minetest.register_craftitem(brickID, {
			short_description = brickName;
			description = tt(brickName, F('A small brick of %s, ready to be worked by a matter compiler', m.name), 1);
			inventory_image = img(lib.image 'starlit-item-brick.png');
			wield_image = lib.image 'starlit-item-brick.png':colorize(m.color):render();
			stack_max = 500;
			groups = {element=1, brick=1};
			_starlit = {
................................................................................
				};
			};
		});
	end

	--[[
	local chunk = F('starlit-element-%s-powder.png', id);
	minetest.register_craftitem(eltID, {
		short_description = eltName;
		description = tt(eltName, F('A 1g chunk of elemental %s, ready to be worked by a cold matter compiler', m.name), 1);
		inventory_image = iblit(chunk);
		wield_image = powder;
		stack_max = 1000; -- 1kg
		groups = {element = 1, chunk = 1};
		_starlit = {
................................................................................
end)


M.metal.foreach('starlit:gen-forms', {}, function(id, m)
	if m.elemental then -- avoid multiple forms for same material
		m.form = M.element.db[m.elemental].form;
	else
		local baseID = F('%s:metal_%s_', minetest.get_current_modname(), id)
		local brickID = baseID .. 'brick'
		local brickName = F('%s Brick', lib.str.capitalize(m.name))
		m.form = m.form or {}
		m.form.brick = brickID
		local tt = function(t, d, g)
			return starlit.ui.tooltip {
				title = t, desc = d;
................................................................................
		end
		local iblit = mkEltIndicator(mcomp)
		local function img(s)
			return iblit(s:colorize(m.color):render())
		end

		local mass = 1
		minetest.register_craftitem(brickID, {
			short_description = brickName;
			description = tt(brickName, F('A small brick of %s, ready to be worked by a matter compiler', m.name), mass);
			inventory_image = img(lib.image('starlit-item-brick.png'));
			wield_image = lib.image 'starlit-item-brick.png':colorize(m.color):render();
			groups = {metal = 1, brick = 1};
			stack_max = 500;
			_starlit = {
................................................................................
		color = lib.color(0.2,0.1,0.1);
		props = props;
	};	
end

starlit.item.canister = lib.registry.mk 'starlit:canister';
starlit.item.canister.foreach('starlit:item-gen', {}, function(id, c)
	minetest.register_craftitem(id, {
		short_description = c.name;
		description = canisterDesc(nil, c);
		inventory_image = c.image or 'starlit-item-element-canister.png';
		groups = {canister = 1};
		stack_max = 1;
		_starlit = {
			canister = c;







|







 







|







 







|







 







|







 







|







 







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
...
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
...
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
			indsz, indsz,
			indsz, indsz,
			indicator);
	end
end

M.element.foreach('starlit:gen-forms', {}, function(id, m)
	local eltID = F('%s:element_%s', core.get_current_modname(), id)
-- 	local eltName = F('Elemental %s', lib.str.capitalize(m.name))
	local tt = function(t, d, g)
		return starlit.ui.tooltip {
			title = t, desc = d;
			color = lib.color(0.1,0.2,0.1);
			props = {
				{title = 'Mass', desc = lib.math.si('g', g), affinity='info'}
................................................................................
	m.form = m.form or {}


	if not (m.gas or m.liquid) then
		local brickID = eltID .. '_brick'
		local brickName = F('%s Brick', lib.str.capitalize(m.name))
		m.form.brick = brickID
		core.register_craftitem(brickID, {
			short_description = brickName;
			description = tt(brickName, F('A small brick of %s, ready to be worked by a matter compiler', m.name), 1);
			inventory_image = img(lib.image 'starlit-item-brick.png');
			wield_image = lib.image 'starlit-item-brick.png':colorize(m.color):render();
			stack_max = 500;
			groups = {element=1, brick=1};
			_starlit = {
................................................................................
				};
			};
		});
	end

	--[[
	local chunk = F('starlit-element-%s-powder.png', id);
	core.register_craftitem(eltID, {
		short_description = eltName;
		description = tt(eltName, F('A 1g chunk of elemental %s, ready to be worked by a cold matter compiler', m.name), 1);
		inventory_image = iblit(chunk);
		wield_image = powder;
		stack_max = 1000; -- 1kg
		groups = {element = 1, chunk = 1};
		_starlit = {
................................................................................
end)


M.metal.foreach('starlit:gen-forms', {}, function(id, m)
	if m.elemental then -- avoid multiple forms for same material
		m.form = M.element.db[m.elemental].form;
	else
		local baseID = F('%s:metal_%s_', core.get_current_modname(), id)
		local brickID = baseID .. 'brick'
		local brickName = F('%s Brick', lib.str.capitalize(m.name))
		m.form = m.form or {}
		m.form.brick = brickID
		local tt = function(t, d, g)
			return starlit.ui.tooltip {
				title = t, desc = d;
................................................................................
		end
		local iblit = mkEltIndicator(mcomp)
		local function img(s)
			return iblit(s:colorize(m.color):render())
		end

		local mass = 1
		core.register_craftitem(brickID, {
			short_description = brickName;
			description = tt(brickName, F('A small brick of %s, ready to be worked by a matter compiler', m.name), mass);
			inventory_image = img(lib.image('starlit-item-brick.png'));
			wield_image = lib.image 'starlit-item-brick.png':colorize(m.color):render();
			groups = {metal = 1, brick = 1};
			stack_max = 500;
			_starlit = {
................................................................................
		color = lib.color(0.2,0.1,0.1);
		props = props;
	};	
end

starlit.item.canister = lib.registry.mk 'starlit:canister';
starlit.item.canister.foreach('starlit:item-gen', {}, function(id, c)
	core.register_craftitem(id, {
		short_description = c.name;
		description = canisterDesc(nil, c);
		inventory_image = c.image or 'starlit-item-element-canister.png';
		groups = {canister = 1};
		stack_max = 1;
		_starlit = {
			canister = c;