starlit  Check-in [d831add94c]

Overview
Comment:add beginnings of construction system, add cuprite, fix granite, tweak balance, add sane asset management system
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d831add94c87c5da2d49465d634be7c3e18b4d9fd756b5c0f8fc94bd2b0c5fde
User & Date: lexi on 2024-05-09 15:33:01
Other Links: manifest | tags
Context
2024-05-15
15:23
add basic architecture, rebalance minerals & recipes, fix dumb fab bug check-in: 99aefdbd9e user: lexi tags: trunk
2024-05-09
15:33
add beginnings of construction system, add cuprite, fix granite, tweak balance, add sane asset management system check-in: d831add94c user: lexi tags: trunk
2024-05-07
23:16
fix some bugs, start work on actually using the tier system, add usage docs check-in: e905f495dc user: lexi tags: trunk
Changes

Added asset.list version [a70ff394cb].



























































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
menu/background.png
menu/header.png
menu/icon.png
mods/starlit-building/textures/starlit-item-hinge.png
mods/starlit-building/textures/starlit-item-insulation.png
mods/starlit-building/textures/starlit-item-pipe.png
mods/starlit-building/textures/starlit-item-panel.png
mods/starlit-building/textures/starlit-item-concrete.png
mods/starlit-building/textures/starlit-node-concrete.png
mods/starlit-building/textures/starlit-node-floor-panel-side.png
mods/starlit-building/textures/starlit-node-floor-panel-side-conduit.png
mods/starlit-building/textures/starlit-node-floor-panel-top.png
mods/starlit-building/textures/starlit-node-floor-panel-top-vent.png
mods/starlit-building/textures/starlit-node-insulation-top.png
mods/starlit-building/textures/starlit-node-insulation-cable-top.png
mods/starlit-eco/textures/starlit-eco-plant-berry-bunch.png
mods/starlit-eco/textures/starlit-eco-plant-bloom-leaf.png
mods/starlit-eco/textures/starlit-eco-plant-bloom-petal.png
mods/starlit-eco/textures/starlit-eco-plant-bloom-stalk.png
mods/starlit-eco/textures/starlit-eco-plant-fiber.png
mods/starlit-eco/textures/starlit-eco-plant-grass-high.png
mods/starlit-eco/textures/starlit-eco-plant-grass-sprig.png
mods/starlit-eco/textures/starlit-eco-plant-grass-tall.png
mods/starlit-eco/textures/starlit-eco-plant-seeds.png
mods/starlit-eco/textures/starlit-eco-plant-stalk-berries.png
mods/starlit-eco/textures/starlit-eco-plant-stalk-grow-1.png
mods/starlit-eco/textures/starlit-eco-plant-stalk-grow-2.png
mods/starlit-eco/textures/starlit-eco-plant-stalk-grow-3.png
mods/starlit-eco/textures/starlit-eco-plant-stalk-petals.png
mods/starlit-eco/textures/starlit-eco-plant-stalk.png
mods/starlit-eco/textures/starlit-eco-tree-lambent-pine-bulb.png
mods/starlit-eco/textures/starlit-eco-tree-lambent-pine-needles.png
mods/starlit-eco/textures/starlit-eco-tree-lambent-pine-stem.png
mods/starlit-eco/textures/starlit-eco-tree-lambent-pine-trunk-top.png
mods/starlit-eco/textures/starlit-eco-tree-lambent-pine-trunk.png
mods/starlit-eco/textures/starlit-eco-tree-starblossom-leaves.png
mods/starlit-eco/textures/starlit-eco-tree-starblossom-shine.png
mods/starlit-eco/textures/starlit-eco-tree-starblossom-shine.png~
mods/starlit-eco/textures/starlit-eco-tree-starblossom-trunk-top.png
mods/starlit-eco/textures/starlit-eco-tree-starblossom-trunk-top.png~
mods/starlit-eco/textures/starlit-eco-tree-starblossom-trunk.png
mods/starlit-eco/textures/starlit-eco-tree-starblossom-trunk.png~
mods/starlit-electronics/textures/starlit-item-battery-box.png
mods/starlit-electronics/textures/starlit-item-battery.png
mods/starlit-electronics/textures/starlit-item-cable-electric.png
mods/starlit-electronics/textures/starlit-item-chip.png
mods/starlit-electronics/textures/starlit-item-electrode.png
mods/starlit-electronics/textures/starlit-item-heating-element.png
mods/starlit-electronics/textures/starlit-item-transformer.png
mods/starlit-electronics/textures/starlit-node-device-core-back.png
mods/starlit-electronics/textures/starlit-node-device-core-bottom.png
mods/starlit-electronics/textures/starlit-node-device-core-front.png
mods/starlit-electronics/textures/starlit-node-device-core-side.png
mods/starlit-electronics/textures/starlit-node-device-core-top.png
mods/starlit-material/textures/starlit-element-aluminum-powder.png
mods/starlit-material/textures/starlit-element-aluminum.png
mods/starlit-material/textures/starlit-element-argon.png
mods/starlit-material/textures/starlit-element-beryllium-powder.png
mods/starlit-material/textures/starlit-element-beryllium.png
mods/starlit-material/textures/starlit-element-brass-powder.png
mods/starlit-material/textures/starlit-element-bronze-powder.png
mods/starlit-material/textures/starlit-element-calcium.png
mods/starlit-material/textures/starlit-element-carbon-powder.png
mods/starlit-material/textures/starlit-element-carbon.png
mods/starlit-material/textures/starlit-element-cobalt-powder.png
mods/starlit-material/textures/starlit-element-copper-powder.png
mods/starlit-material/textures/starlit-element-copper.png
mods/starlit-material/textures/starlit-element-draconium-powder.png
mods/starlit-material/textures/starlit-element-duridium-powder.png
mods/starlit-material/textures/starlit-element-electrum-powder.png
mods/starlit-material/textures/starlit-element-gold-powder.png
mods/starlit-material/textures/starlit-element-gold.png
mods/starlit-material/textures/starlit-element-impervium-powder.png
mods/starlit-material/textures/starlit-element-iridium-powder.png
mods/starlit-material/textures/starlit-element-iridium.png
mods/starlit-material/textures/starlit-element-iron-powder.png
mods/starlit-material/textures/starlit-element-iron.png
mods/starlit-material/textures/starlit-element-lithium-powder.png
mods/starlit-material/textures/starlit-element-lithium.png
mods/starlit-material/textures/starlit-element-magnesium.png
mods/starlit-material/textures/starlit-element-nickel.png
mods/starlit-material/textures/starlit-element-osmium.png
mods/starlit-material/textures/starlit-element-oxygen.png
mods/starlit-material/textures/starlit-element-platinum-powder.png
mods/starlit-material/textures/starlit-element-potassium-powder.png
mods/starlit-material/textures/starlit-element-potassium.png
mods/starlit-material/textures/starlit-element-silicon.png
mods/starlit-material/textures/starlit-element-silver-powder.png
mods/starlit-material/textures/starlit-element-silver.png
mods/starlit-material/textures/starlit-element-steel-powder.png
mods/starlit-material/textures/starlit-element-technetium-powder.png
mods/starlit-material/textures/starlit-element-technetium.png
mods/starlit-material/textures/starlit-element-thorium-powder.png
mods/starlit-material/textures/starlit-element-thorium.png
mods/starlit-material/textures/starlit-element-tin-powder.png
mods/starlit-material/textures/starlit-element-titanium-powder.png
mods/starlit-material/textures/starlit-element-titanium.png
mods/starlit-material/textures/starlit-element-tyrannium-powder.png
mods/starlit-material/textures/starlit-element-uranium-powder.png
mods/starlit-material/textures/starlit-element-uranium.png
mods/starlit-material/textures/starlit-element-vanadium-powder.png
mods/starlit-material/textures/starlit-element-vanadium.png
mods/starlit-material/textures/starlit-element-vidrium-powder.png
mods/starlit-material/textures/starlit-element-xenon.png
mods/starlit-material/textures/starlit-item-brick.png
mods/starlit-material/textures/starlit-item-element-canister.png
mods/starlit-suit/textures/starlit-suit-survival-lining-human-female.png
mods/starlit-suit/textures/starlit-suit-survival-plate-human-female.png
mods/starlit-tech/textures/starlit-tech-crate-back.png
mods/starlit-tech/textures/starlit-tech-crate-bottom.png
mods/starlit-tech/textures/starlit-tech-crate-front.png
mods/starlit-tech/textures/starlit-tech-crate-side.png
mods/starlit-tech/textures/starlit-tech-crate-top.png
mods/starlit-tech/textures/starlit-tech-lamp-glow.png
mods/starlit-tech/textures/starlit-tech-lamp.png
mods/starlit/models/starlit-body-female.x
mods/starlit/models/starlit-body-female.x.nla
mods/starlit/sounds/default-dirt-footstep.1.ogg
mods/starlit/sounds/default-dirt-footstep.2.ogg
mods/starlit/sounds/default-dug-node.1.ogg
mods/starlit/sounds/default-dug-node.2.ogg
mods/starlit/sounds/default-grass-footstep.1.ogg
mods/starlit/sounds/default-grass-footstep.2.ogg
mods/starlit/sounds/default-grass-footstep.3.ogg
mods/starlit/sounds/default-hard-footstep.1.ogg
mods/starlit/sounds/default-hard-footstep.2.ogg
mods/starlit/sounds/default-hard-footstep.3.ogg
mods/starlit/sounds/default-ice-dig.1.ogg
mods/starlit/sounds/default-ice-dig.2.ogg
mods/starlit/sounds/default-ice-dig.3.ogg
mods/starlit/sounds/default-ice-dug.ogg
mods/starlit/sounds/default-ice-footstep.1.ogg
mods/starlit/sounds/default-ice-footstep.2.ogg
mods/starlit/sounds/default-ice-footstep.3.ogg
mods/starlit/sounds/default-metal-footstep.1.ogg
mods/starlit/sounds/default-metal-footstep.2.ogg
mods/starlit/sounds/default-metal-footstep.3.ogg
mods/starlit/sounds/default-sand-footstep.1.ogg
mods/starlit/sounds/default-sand-footstep.2.ogg
mods/starlit/sounds/default-sand-footstep.3.ogg
mods/starlit/sounds/default-snow-footstep.1.ogg
mods/starlit/sounds/default-snow-footstep.2.ogg
mods/starlit/sounds/default-snow-footstep.3.ogg
mods/starlit/sounds/default-snow-footstep.4.ogg
mods/starlit/sounds/default-snow-footstep.5.ogg
mods/starlit/sounds/default-water-footstep.1.ogg
mods/starlit/sounds/default-water-footstep.2.ogg
mods/starlit/sounds/default-water-footstep.3.ogg
mods/starlit/sounds/default-wood-footstep.1.ogg
mods/starlit/sounds/default-wood-footstep.2.ogg
mods/starlit/sounds/default_dig_grab.ogg
mods/starlit/sounds/default_dig_looseClump.ogg
mods/starlit/sounds/default_dig_pickup.ogg
mods/starlit/sounds/default_dig_plant.ogg
mods/starlit/sounds/starlit-alarm-urgent.ogg
mods/starlit/sounds/starlit-alarm.ogg
mods/starlit/sounds/starlit-configure.ogg
mods/starlit/sounds/starlit-error.ogg
mods/starlit/sounds/starlit-insert-snap.ogg
mods/starlit/sounds/starlit-mode-nano.ogg
mods/starlit/sounds/starlit-mode-off.ogg
mods/starlit/sounds/starlit-mode-psi.1.ogg
mods/starlit/sounds/starlit-mode-psi.2.ogg
mods/starlit/sounds/starlit-mode-psi.3.ogg
mods/starlit/sounds/starlit-mode-psi.4.ogg
mods/starlit/sounds/starlit-mode-weapon.ogg
mods/starlit/sounds/starlit-nano-heal.ogg
mods/starlit/sounds/starlit-nano-shred.1.ogg
mods/starlit/sounds/starlit-nano-shred.2.ogg
mods/starlit/sounds/starlit-nano-shred.3.ogg
mods/starlit/sounds/starlit-nano-shred.4.ogg
mods/starlit/sounds/starlit-nav.ogg
mods/starlit/sounds/starlit-power-down.ogg
mods/starlit/sounds/starlit-power-up.1.ogg
mods/starlit/sounds/starlit-power-up.2.ogg
mods/starlit/sounds/starlit-power-up.3.ogg
mods/starlit/sounds/starlit-power-up.4.ogg
mods/starlit/sounds/starlit-power-up.5.ogg
mods/starlit/sounds/starlit-power-up.6.ogg
mods/starlit/sounds/starlit-power-up.7.ogg
mods/starlit/sounds/starlit-quit.ogg
mods/starlit/sounds/starlit-success.ogg
mods/starlit/sounds/starlit-suit-battery-in.ogg
mods/starlit/sounds/starlit-suit-chip-in.ogg
mods/starlit/sounds/starlit-suit-don.ogg
mods/starlit/textures/starlit-body-eye.png
mods/starlit/textures/starlit-body-hair.png
mods/starlit/textures/starlit-body-skin.png
mods/starlit/textures/starlit-fx-nano-spark-big.png
mods/starlit/textures/starlit-fx-nano-spark-small.png
mods/starlit/textures/starlit-fx-nanocloud.png
mods/starlit/textures/starlit-fx-nanospark.png
mods/starlit/textures/starlit-item-chip.png
mods/starlit/textures/starlit-item-soil.png
mods/starlit/textures/starlit-item-suit.png
mods/starlit/textures/starlit-sun-tones.png
mods/starlit/textures/starlit-sun.png
mods/starlit/textures/starlit-terrain-feldspar.png
mods/starlit/textures/starlit-terrain-granite.png
mods/starlit/textures/starlit-terrain-greengraze-overlay.png
mods/starlit/textures/starlit-terrain-greengraze.png
mods/starlit/textures/starlit-terrain-greengraze.png~
mods/starlit/textures/starlit-terrain-lifesilt.png
mods/starlit/textures/starlit-terrain-sand.png
mods/starlit/textures/starlit-terrain-soil.png
mods/starlit/textures/starlit-terrain-undergloam-overlay.png
mods/starlit/textures/starlit-terrain-cuprite.png
mods/starlit/textures/starlit-terrain-undergloam.png
mods/starlit/textures/starlit-ui-alert-bg-hot.png
mods/starlit/textures/starlit-ui-alert-bg-hydration.png
mods/starlit/textures/starlit-ui-alert-bg-nutrition.png
mods/starlit/textures/starlit-ui-alert-bg-rad.png
mods/starlit/textures/starlit-ui-alert-bg-success.png
mods/starlit/textures/starlit-ui-alert-bg-temp-cold.png
mods/starlit/textures/starlit-ui-alert-bg-temp-rad.png
mods/starlit/textures/starlit-ui-alert-hydration.png
mods/starlit/textures/starlit-ui-alert-item.png
mods/starlit/textures/starlit-ui-alert-nutrition.png
mods/starlit/textures/starlit-ui-alert-rad.png
mods/starlit/textures/starlit-ui-alert-temp-cold.png
mods/starlit/textures/starlit-ui-alert-temp-hot.png
mods/starlit/textures/starlit-ui-alert.png
mods/starlit/textures/starlit-ui-bar.png
mods/starlit/textures/starlit-ui-bg-digital.png
mods/starlit/textures/starlit-ui-bg-panel.png
mods/starlit/textures/starlit-ui-button-hw-hover.png
mods/starlit/textures/starlit-ui-button-hw-press.png
mods/starlit/textures/starlit-ui-button-hw.png
mods/starlit/textures/starlit-ui-button-sw-hover.png
mods/starlit/textures/starlit-ui-button-sw-press.png
mods/starlit/textures/starlit-ui-button-sw.png
mods/starlit/textures/starlit-ui-crosshair-nano.png
mods/starlit/textures/starlit-ui-crosshair-psi.png
mods/starlit/textures/starlit-ui-crosshair-weapon.png
mods/starlit/textures/starlit-ui-crosshair.png
mods/starlit/textures/starlit-ui-hud-bg.png
mods/starlit/textures/starlit-ui-icon-ability-sprint.png
mods/starlit/textures/starlit-ui-icon-element.png
mods/starlit/textures/starlit-ui-icon-fabricate.png
mods/starlit/textures/starlit-ui-icon-nano.png
mods/starlit/textures/starlit-ui-icon-psi-cfg.png
mods/starlit/textures/starlit-ui-icon-psi.png
mods/starlit/textures/starlit-ui-icon-self.png
mods/starlit/textures/starlit-ui-icon-shred.png
mods/starlit/textures/starlit-ui-icon-stat-numina.png
mods/starlit/textures/starlit-ui-icon-stat-power.png
mods/starlit/textures/starlit-ui-icon-weapon.png
mods/starlit/textures/starlit-ui-meter-hl.png
mods/starlit/textures/starlit-ui-meter-readout.png
mods/starlit/textures/starlit-ui-meter.png
mods/starlit/textures/starlit-ui-slot-physical.png
mods/starlit/textures/starlit-ui-slot.png
mods/starlit/textures/starlit-water.png

Added makefile version [ebfb2ead99].



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
all: asset-sync doc-sync

starlit.html: starlit.ct
	cortav -y html:fossil-uv "$<" -o "$@"

.PHONY: doc-sync
doc-sync: starlit.html
	fossil uv add "$<"
	fossil uv sync

asset.cpxz: asset.list $(cat asset.list)
	cpio -o <"$<" | xz >"$@"

.PHONY: asset-sync
asset-sync: asset.cpxz
	fossil uv add "$<"
	fossil uv sync

Modified mods/starlit-building/init.lua from [35031ce713] to [76e0104e11].

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
..
92
93
94
95
96
97
98










































99
100
101
102
103
104
105
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181




































182

			allow = function(node, tool) ... end;
			handle = function(node, tool) ... end;
		};
	};
} ]]
-- it should only be written by special accessor functions!

B.stage = lib.registry.mk 'starlit_building:stage'
-- a stage consists of a list of pieces and maps from possible materials
-- / tool usages to succeeding stages in the build tree. note that all
-- used pieces must be defined before a stage is defined currently, due
-- to a lack of cross-registry dependency mechanisms. i will hopefully
-- improve vtlib to handle this condition eventually.
--[[
	starlit.mod.building.stage.link(id, {
		pieces = {
			'starlit_building:foundation';
			'starlit_building:insulation'; -- offset             ofsFac
			{'starlit_building:pipe',      vector.new(-.5, 0, 0), 0};--
			{'starlit_building:pipe',      vector.new(-.5, 0, 0), 1};
			'starlit_building:insulation';
			'starlit_building:panel';
		};
	})
]]

B.piece = lib.registry.mk 'starlit_building:piece'
-- a piece is used to produce stage definitions, by means of appending
-- nodeboxes with appropriate offsets. it also lists the recoverable
-- materials which can be obtained by destroying a stage containing
-- this piece using nano. part IDs should correspond with piece IDs
-- where possible
--[[
	starlit.mod.building.piece.link(id, {
		tex = 'myMod_part.png';
		height = 0.1; -- used for auto-offset
		fab = {
			element = {iron=10};
		};	
		shape = {
			type = "fixed";
			fixed = { ... };
		};
	})
]]

B.part = lib.registry.mk 'starlit_building:part'
-- a part is implemented as a special craftitem with the proper callbacks
-- to index the registries and place/replace nodes by reference to the
................................................................................
		short_description = e.name;
		description = starlit.ui.tooltip {
			title = e.name;
			desc = e.desc;
			props = props;
		};
		inventory_image = e.img;










































		_starlit = {
			mass = e.mass;
			reverseEngineer = rev;
			recover = e.recover or e.fab;
		};
	})
	if e.fab then
................................................................................
			};
			rarity = e.rarity or 0;
		})
	end

end)

B.stage.foreach('starlit:stageGen', {}, function(id, e)
	local box = {type = 'fixed', fixed = {}}
	local tex = {}
	local ofs = vector.new(0,0,0)
	for idx, p in ipairs(e.pieces) do
		local ho, pieceID, pos
		if type(p) == 'string' then
			pieceID, pos, ho = p, vector.zero(), 1.0
		else
			pieceID, pos, ho = pc[1],pc[2],pc[3]
		end
		local pc = B.piece.db[pieceID]
		pos = pos + ofs
		if ho ~= 0.0 then
			ofs = vector.offset(ofs, 0, pc.height)
		end
		local sh = lib.node.boxwarped(pc.shape, function(b)
			-- { -x, -y, -z;
			--   +x, +y, +z }
			b[1] = b[1] + ofs.x  b[4] = b[4] + ofs.x
			b[2] = b[2] + ofs.y  b[5] = b[5] + ofs.y
			b[3] = b[3] + ofs.z  b[6] = b[6] + ofs.z
		end)
		table.insert(box, sh)
		if type(pc.tex) == 'string' then
			table.insert(tex, pc.tex)
		else
			for i,t in ipairs(pc.tex) do
				table.insert(tex, t or '')
			end
		end
	end
	minetest.register_node(id, {
		description = 'Construction';
		drawtype = 'nodebox';
		paramtype  = 'light';
		paramtype2 = e.stateful or 'none';
		textures = tex;
		node_box = box;
		group = { stage = 1 };
		_starlit = {
			stage = id;
		};
	})
end)

function B.pathLink(from, kind, what, to)
	if not B.path[from] then
		B.path[from] = {part={}, tool={}}
	end
	local k = B.path[from][kind]
	assert(k[what] == nil)
	k[what] = to
end

function B.pathFind(from, kind, what)
	if not B.path[from] then return nil end
	return B.path[from][kind][what]
end





































starlit.include 'parts'








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<





|








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56



57
58
59
60
61
62
63
..
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
154
155
156
157
158
159
160














































161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
			allow = function(node, tool) ... end;
			handle = function(node, tool) ... end;
		};
	};
} ]]
-- it should only be written by special accessor functions!

B.begin = {part = {}, tool = {}}
-- this maps parts/tools to the new nodes they create
--[[
	part = {
		['starlit_building:concrete'] = 'starlit_building:stage_foundation';
		-- or function(...)
	};
	tool = {
		-- for consistency's sake -- can't quite imagine a valid use
		-- for this but im sure it'll bite me eventually if i leave it out
	};
]]

B.stage = lib.registry.mk 'starlit_building:stage'
-- a stage consists of a node definition and maps from possible materials
-- / tool usages to succeeding stages in the build tree
--[[
	starlit.mod.building.stage.link(id, {
		tex = { ... };
		box = { ... }; -- nodebox def, or
		mesh = '...'; -- mesh name
		begin = {
			part = {...};
			tool = {...};
		}
		build = {
			part = {
				['starlit_building:insulation'] = 'starlit_building:foundation_with_insulation';
			};
			tool = {
				['starlit_building:screwdriver'] = {id = 'air', drop = 'starlit_building:foundation'};
			};



		};
	})
]]

B.part = lib.registry.mk 'starlit_building:part'
-- a part is implemented as a special craftitem with the proper callbacks
-- to index the registries and place/replace nodes by reference to the
................................................................................
		short_description = e.name;
		description = starlit.ui.tooltip {
			title = e.name;
			desc = e.desc;
			props = props;
		};
		inventory_image = e.img;
		on_place = function(stack, luser, point)
			local node = minetest.get_node(point.under)
			local function tryBuild()
				local p = B.path[node.name]
				if not p then return nil end
				if (not p.part) or (not p.part[id]) then return nil end
				local n = p.part[id]
				local obj
				if type(n) == 'function' then
					obj = n(stack, node, point)
					if obj == nil then return nil end
				else
					obj = ItemStack(n)
					stack:take_item(1)
				end
				local pname = obj:get_name()
				local stg = B.stage.db[pname]
				node.name = pname
				minetest.swap_node(point.under, node)
				-- TODO make a noise
				if stg.onBuild then
					stg.onBuild(point.under, luser, stack)
				end
				return stack
			end

			local function tryBegin()
				local p = B.begin.part[stack:get_name()]
				if not p then return nil end
				if type(p) == 'function' then
					p = p(stack, node, point)
					if p == nil then return nil end
				else
					stack:take_item(1)
				end
				minetest.rotate_and_place(ItemStack(p), luser, point, true)
				-- TODO make a noise
				return stack
			end

			return tryBuild() or tryBegin() or stack
		end;
		_starlit = {
			mass = e.mass;
			reverseEngineer = rev;
			recover = e.recover or e.fab;
		};
	})
	if e.fab then
................................................................................
			};
			rarity = e.rarity or 0;
		})
	end

end)















































function B.pathLink(from, kind, what, to)
	if not B.path[from] then
		B.path[from] = {part={}, tool={}}
	end
	local k = B.path[from][kind]
	assert(k[what] == nil, 'attempted to overwrite an existing build path')
	k[what] = to
end

function B.pathFind(from, kind, what)
	if not B.path[from] then return nil end
	return B.path[from][kind][what]
end

B.stage.foreach('starlit:stageGen', {}, function(id, e)
	local grp = e.groups and table.copy(e.groups) or {}
	grp.stage = 1
	minetest.register_node(id, {
		description = 'Construction';
		drawtype = (e.box  and 'nodebox')
		        or (e.mesh and 'mesh')
		        or 'regular';
		paramtype  = (e.box or e.mesh or e.light) and 'light' or nil;
		paramtype2 = e.stateful or 'none';
		tiles = e.tex;
		node_box = e.box;
		mesh = e.mesh;
		groups = grp;
		_starlit = {
			stage = id;
		};
	})
	if e.begin then
		for _, kind in ipairs {'part', 'tool'} do
			for i, v in ipairs(e.begin[kind] or {}) do
				assert(B.begin[kind][v] == nil, 'attempted to overwrite buildpath beginning')
				B.begin[kind][v] = id
			end
		end
	end
	if e.build then
		for _, kind in ipairs {'part', 'tool'} do
			for what, to in pairs(e.build[kind] or {}) do
				B.pathLink(id, kind, what, to)
			end
		end
	end
end)


starlit.include 'parts'
starlit.include 'stages'

Modified mods/starlit-building/parts.lua from [01ffc64dd2] to [d434edb6db].

82
83
84
85
86
87
88

































































		cost = {power = 500};
		flag = {print=true};
		time = {print=20};
	};
	mass = 24;
	rarity = 1;
})








































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
		cost = {power = 500};
		flag = {print=true};
		time = {print=20};
	};
	mass = 24;
	rarity = 1;
})

B.part.link('starlit_building:concrete', {
	name = 'Concrete';
	desc = 'A sturdy base for modular construction units.';
	img = 'starlit-item-concrete.png';
	fab = starlit.type.fab {
		element = {
			calcium = 1;
			carbon = 4;
		};
		cost = {power = 200};
		flag = {print=true};
		time = {print=5};
	};
	mass = 5;
	rarity = 1;
})

B.part.link('starlit_building:insulation', {
	name = 'Insulation';
	desc = 'An aerogel that traps heat very effectively.';
	img = 'starlit-item-insulation.png';
	fab = starlit.type.fab {
		element = {
			silicon = 4;
		};
		cost = {power = 100};
		flag = {print=true};
		time = {print=5};
	};
	mass = 4;
	rarity = 1;
})

B.part.link('starlit_building:panel', {
	name = 'Panel';
	desc = 'A sheet of aluminum suitable for use as a wall or floor panel.';
	img = 'starlit-item-panel.png';
	fab = starlit.type.fab {
		element = {
			aluminum = 8;
		};
		cost = {power = 300};
		flag = {print=true};
		time = {print=15};
	};
	mass = 8;
	rarity = 1;
})

B.part.link('starlit_building:pipe', {
	name = 'Pipe';
	desc = 'A pipe suitable for conveying liquids or gasses.';
	img = 'starlit-item-pipe.png';
	fab = starlit.type.fab {
		element = {
			aluminum = 4;
		};
		cost = {power = 300};
		flag = {print=true};
		time = {print=15};
	};
	mass = 4;
	rarity = 1;
})

Added mods/starlit-building/stages.lua version [3af63c8d88].





































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
local lib = starlit.mod.lib
local B = starlit.mod.building
B.stage.link('starlit_building:stage_foundation', {
	tex = {
		'starlit-node-concrete.png';
	};
	begin = {
		part = {
			'starlit_building:concrete';
		};
	};
	build = {
		part = {
			['starlit_building:insulation'] = 'starlit_building:stage_foundation_insulation';
		};
	};
	box = {
		type = 'fixed';
		fixed = {
			-.5, -.5,         -.5;
			 .5, -.5 + (2/16), .5;
		};
	};
})

B.stage.link('starlit_building:stage_foundation_insulation', {
	tex = {
		'starlit-node-insulation-top.png';
		'starlit-node-concrete.png';
		'starlit-node-floor-panel-side.png';
	};
	build = {
		part = {
			['starlit_building:insulation'] = 'starlit_building:stage_foundation_insulation_x2';
			['starlit_building:cable_electric'] = 'starlit_building:stage_foundation_insulation_conduit';
		};
	};
	box = {
		type = 'fixed';
		fixed = {
			-.5, -.5,         -.5;
			 .5, -.5 + (6/16), .5;
		};
	};
})

B.stage.link('starlit_building:stage_foundation_insulation_x2', {
	tex = {
		'starlit-node-insulation-top.png';
		'starlit-node-concrete.png';
		'starlit-node-floor-panel-side.png';
	};
	build = {
		part = {
			['starlit_building:panel'] = 'starlit_building:floor';
		};
	};
	box = {
		type = 'fixed';
		fixed = {
			-.5, -.5,         -.5;
			 .5, -.5 + (14/16), .5;
		};
	};
})

B.stage.link('starlit_building:stage_foundation_insulation_conduit', {
	tex = {
		'starlit-node-insulation-cable-top.png';
		'starlit-node-concrete.png';
		'starlit-node-floor-panel-side-conduit.png';
	};
	groups = {
		conduit = 1;
	};
	build = {
		part = {
			['starlit_building:insulation'] = 'starlit_building:stage_foundation_insulated_conduit';
		};
	};
	box = {
		type = 'fixed';
		fixed = {
			-.5, -.5,         -.5;
			 .5, -.5 + (8/16), .5;
		};
	};
})

B.stage.link('starlit_building:stage_foundation_insulated_conduit', {
	tex = {
		'starlit-node-insulation-top.png';
		'starlit-node-concrete.png';
		'starlit-node-floor-panel-side-conduit.png';
	};
	build = {
		part = {
			['starlit_building:panel'] = 'starlit_building:conduit';
		};
	};
	groups = {
		conduit = 1;
	};
	box = {
		type = 'fixed';
		fixed = {
			-.5, -.5,         -.5;
			 .5, -.5 + (14/16), .5;
		};
	};
})

B.stage.link('starlit_building:conduit', {
	tex = {
		'starlit-node-floor-panel-top.png';
		'starlit-node-concrete.png';
		'starlit-node-floor-panel-side-conduit.png';
	};
	groups = {
		conduit = 1;
	};
})

B.stage.link('starlit_building:floor', {
	tex = {
		'starlit-node-floor-panel-top.png';
		'starlit-node-concrete.png';
		'starlit-node-floor-panel-side.png';
	};
})

Modified mods/starlit-electronics/init.lua from [edafa25ca2] to [668ccf7fa8].

302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
-- makeshift: cheap, weak, low quality
-- imperial ("da red wunz go fasta"): powerful, low quality
-- commune ("snooty sophisticates"): limited power, high quality, expensive
-- usukwinya ("value engineering"): high power, mid quality, affordable
-- eluthrai ("uncompromising"): high power, high quality, wildly expensive
-- firstborn ("god-tier"): exceptional

		print(dump(starlit.world.tier.fabsum('commune', 'battery')))
local batteryTiers = {
	makeshift = {
		name = 'Makeshift'; capacity = .5, decay = 3, leak = 2, dischargeRate = 1,
-- 		fab = starlit.type.fab {
-- 			element = {copper=10};
-- 			cost = {power = 0.3};
-- 			time = {print = .25};







<







302
303
304
305
306
307
308

309
310
311
312
313
314
315
-- makeshift: cheap, weak, low quality
-- imperial ("da red wunz go fasta"): powerful, low quality
-- commune ("snooty sophisticates"): limited power, high quality, expensive
-- usukwinya ("value engineering"): high power, mid quality, affordable
-- eluthrai ("uncompromising"): high power, high quality, wildly expensive
-- firstborn ("god-tier"): exceptional


local batteryTiers = {
	makeshift = {
		name = 'Makeshift'; capacity = .5, decay = 3, leak = 2, dischargeRate = 1,
-- 		fab = starlit.type.fab {
-- 			element = {copper=10};
-- 			cost = {power = 0.3};
-- 			time = {print = .25};

Modified mods/starlit-scenario/init.lua from [ad44a3c89f] to [d2f3af923b].

39
40
41
42
43
44
45



46
47
48
49
50
51
52
		{'starlit_tech:chem_lamp', 0};
		{'starlit_tech:crate', 0};
		{'starlit_building:battery_box', 0};
		{'starlit_building:heating_element', 0};
		{'starlit_building:electrode', 0};
		{'starlit_building:cable_electric', 0};
		{'starlit_building:transformer', 0};



}

local chipLibrary = {
	compendium = makeChip('The Gentleman Adventurer\'s Compleat Wilderness Compendium', lib.tbl.append(survivalBasics, {
		{'starlit_electronics:battery_chemical_imperial_small', 0};
	}), {
		{'starlit_electronics:shred', 0};







>
>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
		{'starlit_tech:chem_lamp', 0};
		{'starlit_tech:crate', 0};
		{'starlit_building:battery_box', 0};
		{'starlit_building:heating_element', 0};
		{'starlit_building:electrode', 0};
		{'starlit_building:cable_electric', 0};
		{'starlit_building:transformer', 0};
		{'starlit_building:concrete', 0};
		{'starlit_building:insulation', 0};
		{'starlit_building:panel', 0};
}

local chipLibrary = {
	compendium = makeChip('The Gentleman Adventurer\'s Compleat Wilderness Compendium', lib.tbl.append(survivalBasics, {
		{'starlit_electronics:battery_chemical_imperial_small', 0};
	}), {
		{'starlit_electronics:shred', 0};

Modified mods/starlit-tech/init.lua from [4840721039] to [de8d4eba0f].

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	local stages = maxBright
	local stageTimeout = burnTime / stages
	local function chemLampID(n)
		if n == stages then return 'starlit_tech:chem_lamp' end
		return string.format('starlit_tech:chem_lamp_%s',n)
	end
	local fab = starlit.type.fab {
		element = { carbon = 8, magnesium = 2 };
		cost = { power = 100 };
		flag = { print = true };
		time = { print = 5 };
	};
	for i = stages, 0, -1 do
		minetest.register_node(chemLampID(i), {
			short_description = 'Chem Lamp';







|







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	local stages = maxBright
	local stageTimeout = burnTime / stages
	local function chemLampID(n)
		if n == stages then return 'starlit_tech:chem_lamp' end
		return string.format('starlit_tech:chem_lamp_%s',n)
	end
	local fab = starlit.type.fab {
		element = { carbon = 4, magnesium = 1 };
		cost = { power = 100 };
		flag = { print = true };
		time = { print = 5 };
	};
	for i = stages, 0, -1 do
		minetest.register_node(chemLampID(i), {
			short_description = 'Chem Lamp';

Modified mods/starlit/interfaces.lua from [461714c4c0] to [42263b381c].

220
221
222
223
224
225
226



227
228
229
230
231
232
233
						pnan.primary = nil
					elseif pptrMatch(ptr, pnan.secondary) then
						pnan.secondary = nil
					else
						pnan.secondary = ptr
					end
					user:suitSound 'starlit-configure'



				elseif pgm.sw.powerKind == 'direct' then
					local ctx = suitCtx(pgm)
					if pgm.sw.ui then
						user:openUI(pgm.sw.ui, 'index', ctx)
						return false
					else
						pgm.sw.run(user, ctx)







>
>
>







220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
						pnan.primary = nil
					elseif pptrMatch(ptr, pnan.secondary) then
						pnan.secondary = nil
					else
						pnan.secondary = ptr
					end
					user:suitSound 'starlit-configure'
					if user.actMode == 'off' then
						user:actModeSet 'nano'
					end
				elseif pgm.sw.powerKind == 'direct' then
					local ctx = suitCtx(pgm)
					if pgm.sw.ui then
						user:openUI(pgm.sw.ui, 'index', ctx)
						return false
					else
						pgm.sw.run(user, ctx)

Modified mods/starlit/terrain.lua from [18098e5201] to [5c8125f149].

109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
...
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
219
220
221
222
223
224
225


226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281

























282
283
284
285
286
287
288
			def.img .. '.png';
			'starlit-terrain-soil.png';
			{
				name = 'starlit-terrain-soil.png^' .. def.img ..'-overlay.png';
				tileable_vertical = false;
			};
		};
		groups = {looseClump = 2, grass = 1, soil = 1, sub_walk = 1};
		drop = soilDrop;
		sounds = grassSounds;
		_starlit = {
			recover = def.recover;
			recover_vary = def.recover_vary;
		};
	})
................................................................................
		drowning = 40;
		post_effect_color = {a=103, r=10, g=40, b=70};
		groups = {water = 3, liquid = 3};
	});
end


starlit.world.mineral.foreach('starlit:mineral_generate', {}, function(name,m)
	local node = string.format('starlit:mineral_%s', name)
	local grp = {mineral = 1}
	minetest.register_node(node, {
		short_description = m.name;
		description = starlit.ui.tooltip {
			title = m.name;
			desc = m.desc;
			color = m.tone;
................................................................................
			seed = seed*50 + string.byte(m.name, i)
		end
		minetest.register_ore {
			ore = node;
			ore_type = m.dist.kind;
			wherein = m.dist.among;
			clust_scarcity = m.dist.rare;


			y_max = m.dist.height[1], y_min = m.dist.height[2];
			column_height_min = m.dist.sheetCols and m.dist.sheetCols[1] or nil;
			column_height_max = m.dist.sheetCols and m.dist.sheetCols[2] or nil;
			noise_params = m.dist.noise or {
				scale = 1;
				spread = vector.new(128,128,128);
				seed = seed;
				octaves = 2;
			};
		}
	end
end)

starlit.world.mineral.link('feldspar', {
	name = T 'Feldspar';
	tiles = {'starlit-terrain-feldspar.png'};
	excludeOre = true;
	recover = starlit.type.fab {
		time = { shred = 3; };
		cost = { shredPower = 3; };
	};
................................................................................
				potassium = rng:int(0,2);
				calcium   = rng:int(0,2);
			}
		};
	end;
})

starlit.world.mineral.link('granite', {
	name = T 'Granite';
	tiles = {'starlit-terrain-granite.png'};
	dist = {
		kind = 'sheet';
		among = 'starlit:feldspar';
		height = {-200,30};
		sheetCols = {1, 16};
	};
	recover = starlit.type.fab {
		time = { shred = 4; };
		cost = { shredPower = 8; };
	};
	recover_vary = function(rng, ctx)
		-- print('vary!', rng:int(), rng:int(0,10))
		return starlit.type.fab {
			element = {
				aluminum  = rng:int(0,4);
				potassium = rng:int(0,2);
				calcium   = rng:int(0,2);
			}
		};
	end;
})


























-- map generation

minetest.register_alias('mapgen_stone', 'starlit:mineral_feldspar')
minetest.register_alias('mapgen_water_source', 'starlit:liquid_water')
minetest.register_alias('mapgen_river_water_source', 'starlit:liquid_water')








|







 







|
<







 







>
>
|




|







|







 







|




|




|



<


|
|
|




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
...
183
184
185
186
187
188
189
190

191
192
193
194
195
196
197
...
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
			def.img .. '.png';
			'starlit-terrain-soil.png';
			{
				name = 'starlit-terrain-soil.png^' .. def.img ..'-overlay.png';
				tileable_vertical = false;
			};
		};
		groups = {looseClump = 2, grass = 1, soil = 1};
		drop = soilDrop;
		sounds = grassSounds;
		_starlit = {
			recover = def.recover;
			recover_vary = def.recover_vary;
		};
	})
................................................................................
		drowning = 40;
		post_effect_color = {a=103, r=10, g=40, b=70};
		groups = {water = 3, liquid = 3};
	});
end


starlit.world.mineral.foreach('starlit:mineral-generate', {}, function(node,m)

	local grp = {mineral = 1}
	minetest.register_node(node, {
		short_description = m.name;
		description = starlit.ui.tooltip {
			title = m.name;
			desc = m.desc;
			color = m.tone;
................................................................................
			seed = seed*50 + string.byte(m.name, i)
		end
		minetest.register_ore {
			ore = node;
			ore_type = m.dist.kind;
			wherein = m.dist.among;
			clust_scarcity = m.dist.rare;
			clust_num_ores = m.dist.ores;
			clust_size = m.dist.clust;
			y_min = m.dist.height[1], y_max = m.dist.height[2];
			column_height_min = m.dist.sheetCols and m.dist.sheetCols[1] or nil;
			column_height_max = m.dist.sheetCols and m.dist.sheetCols[2] or nil;
			noise_params = m.dist.noise or {
				scale = 1;
				spread = vector.new(16,16,16);
				seed = seed;
				octaves = 2;
			};
		}
	end
end)

starlit.world.mineral.link('starlit:mineral_feldspar', {
	name = T 'Feldspar';
	tiles = {'starlit-terrain-feldspar.png'};
	excludeOre = true;
	recover = starlit.type.fab {
		time = { shred = 3; };
		cost = { shredPower = 3; };
	};
................................................................................
				potassium = rng:int(0,2);
				calcium   = rng:int(0,2);
			}
		};
	end;
})

starlit.world.mineral.link('starlit:mineral_granite', {
	name = T 'Granite';
	tiles = {'starlit-terrain-granite.png'};
	dist = {
		kind = 'sheet';
		among = 'starlit:mineral_feldspar';
		height = {-200,30};
		sheetCols = {1, 16};
	};
	recover = starlit.type.fab {
		time = { shred = 3.5; };
		cost = { shredPower = 8; };
	};
	recover_vary = function(rng, ctx)

		return starlit.type.fab {
			element = {
				iron      = rng:int(0,4);
				magnesium = rng:int(0,2);
				titanium  = rng:int(0,1);
			}
		};
	end;
})

starlit.world.mineral.link('starlit:mineral_cuprite', {
	name = T 'Cuprite';
	dist = {
		kind = 'blob';
		among = 'starlit:mineral_feldspar';
		height = {-20,20};
		clust = 8;
		ores = 1;
		rare = 1000;
		color = lib.color(.5,.2,.1);
		noise = {
			scale = 1;
			spread = vector.new(5,5,5);
			seed = 0x1faf7e1;
			octaves = 1
		}
	};
	tiles = {'starlit-terrain-cuprite.png'};
	recover = starlit.type.fab {
		element = { copper = 10 };
		time = { shred = 3; };
		cost = { shredPower = 3; };
	};
})

-- map generation

minetest.register_alias('mapgen_stone', 'starlit:mineral_feldspar')
minetest.register_alias('mapgen_water_source', 'starlit:liquid_water')
minetest.register_alias('mapgen_river_water_source', 'starlit:liquid_water')

Modified mods/starlit/ui.lua from [a436d8c893] to [01dfc2a3de].

160
161
162
163
164
165
166
167
168
169
170

171
172
173

174
175
176
177
178

179
180
181
182
183
184
185
		local idx, rowH, totalH = 0,0,0
		local cols = def.cols or math.huge
		local startX = state.x
		local maxX = startX
		for _, w in ipairs(def) do idx = idx + 1
			local src, st = starlit.ui.build(w, state)
			-- TODO alignments
			rowH = math.max(rowH, st.h)
			if idx > cols or (def.w and (state.x + state.spacing + st.w > def.w)) then
				totalH = totalH + rowH
				state.x = startX

				rowH,idx = 0,0
				state.y = state.y + state.spacing + st.h
			end

			widget('container[%s,%s]%scontainer_end[]', state.x, state.y, src)
			state.x=state.x + state.spacing + st.w
			maxX = math.max(state.x, maxX)
		end
		totalH = totalH + rowH

		state.h = math.max(state.h, totalH) + state.padding
		state.w = state.x + state.padding/2
		state.x = maxX
	elseif def.kind == 'pane' then
		local top = state.y
		widget('scroll_container[%s,%s;%s,%s;%s;vertical]',
			state.x, state.y, state.w, state.h,







<



>

<

>





>







160
161
162
163
164
165
166

167
168
169
170
171

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
		local idx, rowH, totalH = 0,0,0
		local cols = def.cols or math.huge
		local startX = state.x
		local maxX = startX
		for _, w in ipairs(def) do idx = idx + 1
			local src, st = starlit.ui.build(w, state)
			-- TODO alignments

			if idx > cols or (def.w and (state.x + state.spacing + st.w > def.w)) then
				totalH = totalH + rowH
				state.x = startX
				state.y = state.y + state.spacing + rowH
				rowH,idx = 0,0

			end
			rowH = math.max(rowH, st.h)
			widget('container[%s,%s]%scontainer_end[]', state.x, state.y, src)
			state.x=state.x + state.spacing + st.w
			maxX = math.max(state.x, maxX)
		end
		totalH = totalH + rowH
		state.y = state.y + rowH
		state.h = math.max(state.h, totalH) + state.padding
		state.w = state.x + state.padding/2
		state.x = maxX
	elseif def.kind == 'pane' then
		local top = state.y
		widget('scroll_container[%s,%s;%s,%s;%s;vertical]',
			state.x, state.y, state.w, state.h,