1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
....
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
....
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
|
local ul = self.hud.led.map[kind]
if ul then
if time - ul.origin > minFreq then
ul.origin = time
else return end
end
if urgency > 0 then
local urgencies = {
[1] = {sound = 'starlit-alarm'};
[2] = {sound = 'starlit-alarm-urgent'};
}
local urg = urgencies[urgency] or urgencies[#urgencies]
if time - self.cooldownTimes.alarm > 1.5 then
self.cooldownTimes.alarm = time
................................................................................
return true; -- TODO
end;
---------------
-- inventory --
---------------
give = function(self, item)
local inv = self.entity:get_inventory()
local function is(grp)
return minetest.get_item_group(item:get_name(), grp) ~= 0
end
-- TODO notif popups
if is 'specialInventory' then
--[[
................................................................................
}
local clockInterval = 1.0
starlit.startJob('starlit:clock', clockInterval, function(delta)
for id, u in pairs(starlit.activeUsers) do
u.hud.elt.time:update()
u:updateLEDs()
end
end)
-- performs a general HUD refresh, mainly to update the HUD backlight brightness
local hudInterval = 10
starlit.startJob('starlit:hud-refresh', hudInterval, function(delta)
for id, u in pairs(starlit.activeUsers) do
|
|
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
....
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
....
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
|
local ul = self.hud.led.map[kind]
if ul then
if time - ul.origin > minFreq then
ul.origin = time
else return end
end
if urgency ~= 0 then
local urgencies = {
[-2] = {sound = 'starlit-success'};
[-1] = {sound = 'starlit-nav'};
[1] = {sound = 'starlit-alarm'};
[2] = {sound = 'starlit-alarm-urgent'};
}
local urg = urgencies[urgency] or urgencies[#urgencies]
if time - self.cooldownTimes.alarm > 1.5 then
self.cooldownTimes.alarm = time
................................................................................
return true; -- TODO
end;
---------------
-- inventory --
---------------
give = function(self, item)
item = ItemStack(item)
local inv = self.entity:get_inventory()
local function is(grp)
return minetest.get_item_group(item:get_name(), grp) ~= 0
end
-- TODO notif popups
if is 'specialInventory' then
--[[
................................................................................
}
local clockInterval = 1.0
starlit.startJob('starlit:clock', clockInterval, function(delta)
for id, u in pairs(starlit.activeUsers) do
u.hud.elt.time:update()
u:updateLEDs()
local ui = starlit.activeUI[u.name]
if ui and (ui.self.refresh or ui.self.pages[ui.page].refresh) then
ui.self:show(u)
end
end
end)
-- performs a general HUD refresh, mainly to update the HUD backlight brightness
local hudInterval = 10
starlit.startJob('starlit:hud-refresh', hudInterval, function(delta)
for id, u in pairs(starlit.activeUsers) do
|