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

@ -163,8 +163,11 @@ function minetest.is_protected(pos, name, info, ...)
local flag, distSQ = ctf_flag.get_nearest(pos)
if flag and pos.y >= flag.y - 1 and distSQ < rs then
minetest.chat_send_player(name,
"You can't shoot blocks within "..r.." nodes of a flag!")
hud_event.new(name, {
name = "sniper_rifles:hit_base",
color = "warning",
value = "You can't shoot blocks within " .. r .. " nodes of a flag!",
})
return true
else
return old_is_protected(pos, name, info, ...)