set nametag color in config.lua

This commit is contained in:
Sokomine 2023-01-25 21:14:53 +01:00
parent 5445e20160
commit d6a439b666
2 changed files with 8 additions and 3 deletions

View File

@ -20,6 +20,9 @@ yl_speak_up.enable_yl_mobs = true
-- Do the NPCs talk right after they spawned?
yl_speak_up.talk_after_spawn = true
yl_speak_up.nametag_color_when_not_muted = "#00DDDD"
yl_speak_up.nametag_color_when_muted = "#FF00FF"
-- diffrent NPC may use diffrent models
-- IMPORTANT: If you want to support an NPC with a diffrent model, provide

View File

@ -444,12 +444,14 @@ end
yl_speak_up.update_nametag = function(self)
if self.yl_speak_up.npc_name then
-- the nametag is normal (green)
-- the nametag is normal (cyan by default)
if(self.yl_speak_up.talk) then
self.object:set_nametag_attributes({color="#00ff00", text=self.yl_speak_up.npc_name})
self.force_nametag_color = yl_speak_up.nametag_color_when_not_muted
self.object:set_nametag_attributes({color=self.force_nametag_color, text=self.yl_speak_up.npc_name})
-- the nametag has the addition "[muted]" and is magenta when muted
else
self.object:set_nametag_attributes({color="#ff00ff", text=self.yl_speak_up.npc_name.." [muted]"})
self.force_nametag_color = yl_speak_up.nametag_color_when_muted
self.object:set_nametag_attributes({color=self.force_nametag_color, text=self.yl_speak_up.npc_name.." [muted]"})
end
end
end