starlit  Diff

Differences From Artifact [d40c92ebbb]:

To Artifact [0ecf5e03a5]:


82
83
84
85
86
87
88

89
90
91
92
93
94
95
...
284
285
286
287
288
289
290



291
292
293
294
295
296
297
...
375
376
377
378
379
380
381

382
383
384
385
386
387
388
389
390
391
392

393
394
395
396
397
398
399
					user:suitSound('starlit-insert-snap')
				elseif list == 'starlit_suit_chips' then
					--user:suitSound('starlit-suit-chip-out')
				elseif list == 'starlit_suit_canisters' then
					user:suitSound('starlit-insert-snap')
				end
			end

		end;
		def = function(self)
			return self.item:get_definition()._starlit.suit
		end;
		--[[
		pullCanisters = function(self, inv)
			starlit.item.container.dropPrefix(inv, 'starlit_canister')
................................................................................
			};
			suit = def;
		};
	});
end)

local slotProps = {



	starlit_cfg = {
		itemClass = 'inv';
	};
	starlit_suit_bat = {
		suitSlot = true;
		powerLock = true;
		itemClass = 'dynamo';
................................................................................
	return true
end)

core.register_on_player_inventory_action(function(luser, act, inv, p)
	local user = starlit.activeUsers[luser:get_player_name()]
	local function slotChange(slot,a,item)
		local s = slotProps[slot]

		if slot == 'starlit_suit' then
			user:updateSuit()
			if user:naked() then
				starlit.type.suit.purgeInventories(user.entity)
				user.power.nano = {}
			end
		elseif s and s.suitSlot then
			local s = user:getSuit()
			s:onItemMove(user, slot, a, item)
			s:onReconfigure(user.entity:get_inventory())
			user:setSuit(s)

		else return end
		user:updateHUD()
	end

	if act == 'put' or act == 'take' then
		local item = p.stack
		slotChange(p.listname, act, item)







>







 







>
>
>







 







>








|
|
|
>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
...
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
					user:suitSound('starlit-insert-snap')
				elseif list == 'starlit_suit_chips' then
					--user:suitSound('starlit-suit-chip-out')
				elseif list == 'starlit_suit_canisters' then
					user:suitSound('starlit-insert-snap')
				end
			end
			return true -- move allowed
		end;
		def = function(self)
			return self.item:get_definition()._starlit.suit
		end;
		--[[
		pullCanisters = function(self, inv)
			starlit.item.container.dropPrefix(inv, 'starlit_canister')
................................................................................
			};
			suit = def;
		};
	});
end)

local slotProps = {
-- 	main = {
-- 		free = true;
-- 	};
	starlit_cfg = {
		itemClass = 'inv';
	};
	starlit_suit_bat = {
		suitSlot = true;
		powerLock = true;
		itemClass = 'dynamo';
................................................................................
	return true
end)

core.register_on_player_inventory_action(function(luser, act, inv, p)
	local user = starlit.activeUsers[luser:get_player_name()]
	local function slotChange(slot,a,item)
		local s = slotProps[slot]
		local allow = true
		if slot == 'starlit_suit' then
			user:updateSuit()
			if user:naked() then
				starlit.type.suit.purgeInventories(user.entity)
				user.power.nano = {}
			end
		elseif s and s.suitSlot then
			local s = user:getSuit()
			if s:onItemMove(user, slot, a, item) then
				s:onReconfigure(user.entity:get_inventory())
				user:setSuit(s)
			else return end
		else return end
		user:updateHUD()
	end

	if act == 'put' or act == 'take' then
		local item = p.stack
		slotChange(p.listname, act, item)