Fix for the name setting, and timing fix for load

Wobin [05-23-14 - 17:21]
Fix for the name setting, and timing fix for load
Filename
GuildChat.lua
diff --git a/GuildChat.lua b/GuildChat.lua
index c8c215a..850bba3 100644
--- a/GuildChat.lua
+++ b/GuildChat.lua
@@ -24,7 +24,7 @@ function GuildChat:GetAtColour(name)
 end

 function GuildChat:GetPrintName(name)
-	if GuildChat.settings.characterName then
+	if GuildChat.settings.characterName == "character" then
 		local guildmember = LGI:GetGuildMemberByMemberName("@" ..name)
 		return guildmember and guildmember.characterName or name
 	end
@@ -49,7 +49,7 @@ function GuildChat:GetName(channelId, fromName, text)

 	local  colour, display, charname, name = nameLink:match("^|H([^:]-):([^\[]-)%[([^@]-)@([^\]]-)%]|h")
 		if colour then
-			formattedName = "[" .. GuildChat:GetLevelColour("@" .. name) .. GuildChat:GetLevel("@" .. name) .. "|c" .. baseColour:ToHex() .. "]" ..
+			formattedName = "|c" .. baseColour:ToHex() .."[" .. GuildChat:GetLevelColour("@" .. name) .. GuildChat:GetLevel("@" .. name) .. "|c" .. baseColour:ToHex() .. "]" ..
 							"[" .. (charname or "") .. GuildChat:GetAtColour("@" .. name) .."@" ..
 							"|H" .. GuildChat:GetClassColour("@" .. name) .. ":" .. display .. GuildChat:GetPrintName(name) .. "|h" ..
 							"|c" .. baseColour:ToHex() .. "]"
@@ -85,9 +85,9 @@ function GuildChat:Loaded(...)
 			["guildRank"] = false,
 	}

-	GuildChat.settings = ZO_SavedVars:NewAccountWide('GuildChat_Settings', 2, nil, defaults)
-
-	zo_callLater(GuildChat.Register, 5000)
+	GuildChat.settings = ZO_SavedVars:NewAccountWide('GuildChat_Settings', 2, nil, defaults)
 end

 EVENT_MANAGER:RegisterForEvent("GuildChatLoaded", EVENT_ADD_ON_LOADED, function(...) GuildChat:Loaded(...) end)
+EVENT_MANAGER:RegisterForEvent("GuildChatLoaded", EVENT_PLAYER_ACTIVATED, function(...) zo_callLater(GuildChat.Register, 5000) end)
+