Replace chat with HUD events, add BS 5 palette (#848)

* Replace chat with HUD events, add BS 5 palette

* Use HUD events for paxel too

* Move paxel_stop function up
This commit is contained in:
Lars Müller 2021-03-29 23:00:46 +02:00 committed by GitHub
parent e40d1e666a
commit 87f7212f43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 106 additions and 34 deletions

View file

@ -5,6 +5,18 @@ local players = {}
local duration = 7
local max = 3
local next_check = 10000000
-- Bootstrap 5 palette
local colors = {
primary = 0x0D6EFD,
secondary = 0x6C757D,
success = 0x198754,
info = 0x0DCAF0,
warning = 0xFFC107,
danger = 0xDC3545,
light = 0xF8F9FA,
dark = 0x212529,
}
hud_event.colors = colors
local function update(name)
local player = minetest.get_player_by_name(name)
@ -52,6 +64,8 @@ function hud_event.new(name, def)
error("hud_event: Invalid HUD event element definition", 2)
end
def.color = colors[def.color] or def.color
local player = minetest.get_player_by_name(name)
if not player then
return