Differences From
Artifact [aa3a95c242]:
52 52 side = 'right';
53 53 };
54 54 fatigue = {
55 55 icon = lib.image('starlit-ui-alert-fatigue.png');
56 56 bg = lib.image('starlit-ui-alert-bg-fatigue.png');
57 57 side = 'right';
58 58 };
59 + item = {
60 + icon = lib.image('starlit-ui-alert-item.png');
61 + bg = lib.image('starlit-ui-alert-bg-success.png');
62 + side = 'right';
63 + };
59 64 }
60 65
61 66 starlit.type.user = lib.class {
62 67 name = 'starlit:user';
63 68 leds = leds;
64 69 construct = function(ident)
65 70 local name, luser
................................................................................
289 294 local v,txt,color,txtcolor,hl,hlcolor = def.measure(luser,def)
290 295 v = math.max(0, math.min(1, v))
291 296 local n = math.floor(v*16) + 1
292 297 local function adjust(img)
293 298 return hudAdjustBacklight(lib.image(img)):shift(color or def.color)
294 299 end
295 300 local img = adjust 'starlit-ui-meter.png'
296 - if def.flipX then
297 - img = img:transform 'FX'
298 - end
299 301 img = img:render()
300 302 img = img .. '^[verticalframe:17:' .. tostring(17 - n)
301 303 if hl then
302 304 hl = math.floor(hl*16) + 1
303 305 local hi = hudAdjustBacklight(lib.image 'starlit-ui-meter-hl.png')
304 306 :shift(hlcolor or def.color)
305 307 :render()
306 308 hi = hi .. '^[verticalframe:17:' .. tostring(17 - hl)
307 309 img = string.format('%s^(%s)', img, hi)
308 310 end
309 311 img = string.format('%s^(%s)', img, adjust 'starlit-ui-meter-readout.png':render())
312 + if def.flipX then
313 + img = img .. '^[transformFX'
314 + end
310 315 luser:hud_change(m.meter, 'text', img)
311 316 if txt then
312 317 luser:hud_change(m.readout, 'text', txt)
313 318 end
314 319 if txtcolor then
315 320 luser:hud_change(m.readout, 'number', txtcolor:hex())
316 321 end