starlit  Diff

Differences From Artifact [c928629a64]:

To Artifact [aa3a95c242]:


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