starlit  Diff

Differences From Artifact [db0300e682]:

To Artifact [6c49562563]:


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
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
	flush()

	for _, i in ipairs(l) do
		local bw = w/max
		if i.cfg then w = w - rh end

		table.insert(bar, {
			kind = 'button', close = i.close;
			color = i.color;
			fg = i.fg;
			label = i.label;
			icon = i.img;
			id = i.id;
			w = bw, h = rh;
		})
		if i.cfg then 
			table.insert(bar, {
				kind = 'button';
				color = i.color;
				fg = i.fg;
				label = "CFG";
				icon = i.img;
				id = i.id .. '_cfg';
				w = rh, h = rh;
			})
		end

		if bar[max] then flush() end
	end
................................................................................
				local statBars = {'nutrition', 'hydration', 'fatigue', 'morale', 'irradiation', 'illness'}
				for idx, id in ipairs(statBars) do
					local s = starlit.world.stats[id]
					local amt, sv = user:effectiveStat(id)
					local min, max = starlit.world.species.statRange(user.persona.species, user.persona.speciesVariant, id)
					local st = string.format('%s / %s', s.desc(amt, true), s.desc(max))
					table.insert(tb, {kind = 'hztl', padding = 0.25;
						{kind = 'label', w=2, h=barh, text = s.name};
						{kind = 'hbar',  w=4, h=barh, fac = sv, text = st, color=s.color};
					})
				end
				local abilities = {
					maneuver = {};
					direct = {};
					passive = {};
................................................................................
				for i, a in pairs(user:species().abilities) do
					local id = 'abl_'..a.id;
					state.abilityMap[id] = a;
					table.insert(abilities[a.powerKind], {
						id = id;
						label = a.name;
						desc = a.desc;
						img = a.img;

						-- HACK
						color = pptrMatch(user.power.maneuver, {ref=a}) and
							{hue = 150, sat = 0, lum = .3} or nil;
					});
				end
				for i, n in ipairs {'maneuver', 'direct', 'passive'} do







|



|









|







 







|







 







|







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
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
	flush()

	for _, i in ipairs(l) do
		local bw = w/max
		if i.cfg then w = w - rh end

		table.insert(bar, {
			kind = i.img and 'contact' or 'button', close = i.close;
			color = i.color;
			fg = i.fg;
			label = i.label;
			img = i.img;
			id = i.id;
			w = bw, h = rh;
		})
		if i.cfg then 
			table.insert(bar, {
				kind = 'button';
				color = i.color;
				fg = i.fg;
				label = "CFG";
				img = i.img;
				id = i.id .. '_cfg';
				w = rh, h = rh;
			})
		end

		if bar[max] then flush() end
	end
................................................................................
				local statBars = {'nutrition', 'hydration', 'fatigue', 'morale', 'irradiation', 'illness'}
				for idx, id in ipairs(statBars) do
					local s = starlit.world.stats[id]
					local amt, sv = user:effectiveStat(id)
					local min, max = starlit.world.species.statRange(user.persona.species, user.persona.speciesVariant, id)
					local st = string.format('%s / %s', s.desc(amt, true), s.desc(max))
					table.insert(tb, {kind = 'hztl', padding = 0.25;
						{kind = 'label', w=2, h=barh, text = lib.str.capitalize(s.name)};
						{kind = 'hbar',  w=4, h=barh, fac = sv, text = st, color=s.color};
					})
				end
				local abilities = {
					maneuver = {};
					direct = {};
					passive = {};
................................................................................
				for i, a in pairs(user:species().abilities) do
					local id = 'abl_'..a.id;
					state.abilityMap[id] = a;
					table.insert(abilities[a.powerKind], {
						id = id;
						label = a.name;
						desc = a.desc;
-- 						img = a.img;

						-- HACK
						color = pptrMatch(user.power.maneuver, {ref=a}) and
							{hue = 150, sat = 0, lum = .3} or nil;
					});
				end
				for i, n in ipairs {'maneuver', 'direct', 'passive'} do