mirror of
https://github.com/Earu/EasyChat.git
synced 2025-03-04 03:13:20 -05:00
fullproof bad addons
This commit is contained in:
parent
893fc5d754
commit
ddd59791af
@ -883,6 +883,8 @@ local function create_default_settings()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function setup_rank(usergroup)
|
local function setup_rank(usergroup)
|
||||||
|
usergroup = usergroup or "user"
|
||||||
|
|
||||||
-- sanity check to see if wanted usergroup actually exists
|
-- sanity check to see if wanted usergroup actually exists
|
||||||
if usergroup and not EasyChat.Config.UserGroups[usergroup] then return end
|
if usergroup and not EasyChat.Config.UserGroups[usergroup] then return end
|
||||||
|
|
||||||
|
@ -1182,7 +1182,7 @@ if CLIENT then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function should_use_server_settings(ply)
|
local function should_use_server_settings(ply)
|
||||||
local usergroup_prefix = EasyChat.Config.UserGroups[ply:GetUserGroup()]
|
local usergroup_prefix = EasyChat.Config.UserGroups[ply:GetUserGroup() or "user"]
|
||||||
if EasyChat.Config.OverrideClientSettings and usergroup_prefix then return true end
|
if EasyChat.Config.OverrideClientSettings and usergroup_prefix then return true end
|
||||||
if not EasyChat.Config.OverrideClientSettings and EC_TEAMS:GetBool() and usergroup_prefix then return true end
|
if not EasyChat.Config.OverrideClientSettings and EC_TEAMS:GetBool() and usergroup_prefix then return true end
|
||||||
|
|
||||||
@ -1830,47 +1830,49 @@ if CLIENT then
|
|||||||
end
|
end
|
||||||
|
|
||||||
if should_use_server_settings(ply) then
|
if should_use_server_settings(ply) then
|
||||||
local usergroup_prefix = EasyChat.Config.UserGroups[ply:GetUserGroup()]
|
local usergroup_prefix = EasyChat.Config.UserGroups[ply:GetUserGroup() or "user"]
|
||||||
local tags_data = extract_tags_data(usergroup_prefix.Tag)
|
if usergroup_prefix then
|
||||||
for _, tag_data in ipairs(tags_data) do
|
local tags_data = extract_tags_data(usergroup_prefix.Tag)
|
||||||
if is_color(tag_data) then
|
for _, tag_data in ipairs(tags_data) do
|
||||||
EasyChat.GUI.RichText:InsertColorChange(tag_data.r, tag_data.g, tag_data.b, 255)
|
if is_color(tag_data) then
|
||||||
table.insert(data, tag_data)
|
EasyChat.GUI.RichText:InsertColorChange(tag_data.r, tag_data.g, tag_data.b, 255)
|
||||||
elseif isstring(tag_data) then
|
table.insert(data, tag_data)
|
||||||
append_text(EasyChat.GUI.RichText, tag_data)
|
elseif isstring(tag_data) then
|
||||||
table.insert(data, tag_data)
|
append_text(EasyChat.GUI.RichText, tag_data)
|
||||||
|
table.insert(data, tag_data)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
append_text(EasyChat.GUI.RichText, " ")
|
append_text(EasyChat.GUI.RichText, " ")
|
||||||
table.insert(data, " ")
|
table.insert(data, " ")
|
||||||
|
|
||||||
if EC_HUD_CUSTOM:GetBool() then
|
if EC_HUD_CUSTOM:GetBool() then
|
||||||
EasyChat.ChatHUD:PushPartComponent("stop")
|
|
||||||
|
|
||||||
if #usergroup_prefix.Tag > 0 then
|
|
||||||
EasyChat.ChatHUD:AppendText(usergroup_prefix.Tag .. " ")
|
|
||||||
EasyChat.ChatHUD:PushPartComponent("stop")
|
EasyChat.ChatHUD:PushPartComponent("stop")
|
||||||
end
|
|
||||||
|
|
||||||
if #usergroup_prefix.EmoteName > 0 then
|
if #usergroup_prefix.Tag > 0 then
|
||||||
local tag = ("<emote=%s"):format(usergroup_prefix.EmoteName)
|
EasyChat.ChatHUD:AppendText(usergroup_prefix.Tag .. " ")
|
||||||
|
EasyChat.ChatHUD:PushPartComponent("stop")
|
||||||
if usergroup_prefix.EmoteSize ~= -1 then
|
|
||||||
tag = ("%s,%s"):format(tag, usergroup_prefix.EmoteSize)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if #usergroup_prefix.EmoteProvider > 0 then
|
if #usergroup_prefix.EmoteName > 0 then
|
||||||
-- add a comma here for proper markup parsing
|
local tag = ("<emote=%s"):format(usergroup_prefix.EmoteName)
|
||||||
if usergroup_prefix.EmoteSize == -1 then
|
|
||||||
tag = ("%s,"):format(tag)
|
if usergroup_prefix.EmoteSize ~= -1 then
|
||||||
|
tag = ("%s,%s"):format(tag, usergroup_prefix.EmoteSize)
|
||||||
end
|
end
|
||||||
|
|
||||||
tag = ("%s,%s"):format(tag, usergroup_prefix.EmoteProvider)
|
if #usergroup_prefix.EmoteProvider > 0 then
|
||||||
end
|
-- add a comma here for proper markup parsing
|
||||||
|
if usergroup_prefix.EmoteSize == -1 then
|
||||||
|
tag = ("%s,"):format(tag)
|
||||||
|
end
|
||||||
|
|
||||||
tag = ("%s> "):format(tag)
|
tag = ("%s,%s"):format(tag, usergroup_prefix.EmoteProvider)
|
||||||
EasyChat.ChatHUD:AppendText(tag)
|
end
|
||||||
|
|
||||||
|
tag = ("%s> "):format(tag)
|
||||||
|
EasyChat.ChatHUD:AppendText(tag)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user