From d6a439b666908dc0468ec067e342277849c2dd26 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 25 Jan 2023 21:14:53 +0100 Subject: [PATCH] set nametag color in config.lua --- config.lua | 3 +++ fs_fashion.lua | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.lua b/config.lua index 484cc55..96f7df9 100644 --- a/config.lua +++ b/config.lua @@ -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 diff --git a/fs_fashion.lua b/fs_fashion.lua index b818901..814c4ce 100644 --- a/fs_fashion.lua +++ b/fs_fashion.lua @@ -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