/trunk
}, |
["auto"] = false, |
["currentProfile"]="default", |
["showChat"]=true, |
["GlobalProfiles"] = { |
["default"] = { |
"default1", -- [1] |
end |
local function ChatMessage(msg) |
DEFAULT_CHAT_FRAME:AddMessage("|cff99BBEEChatProfiles:|r "..msg); |
local function ChatMessage(msg, show) |
show = show or false |
if ChatProfiles.showChat or show then |
DEFAULT_CHAT_FRAME:AddMessage("|cff99BBEEChatProfiles:|r "..msg) |
end |
end |
local function LDBAutoChanged() |
ChatProfiles.ChatWindowProfiles[profileName..i]={["messages"]=messages,["channels"]=channels2}; |
ChatProfiles.GlobalProfiles[profileName][i] = profileName..i; |
end |
if profileName ~= "lastprofile" then ChatMessage("A profile named '"..profileName.."' has been created") end |
if profileName ~= "lastprofile" then ChatMessage("A profile named '"..profileName.."' has been created",true) end |
end |
local function LoadGlobalProfile(profileName) |
if ChatProfiles.GlobalProfiles[profileName]==nil then |
ChatMessage("No profile named '"..profileName.."' loading 'default' instead"); |
ChatMessage("No profile named '"..profileName.."' loading 'default' instead",true); |
LoadGlobalProfile("default"); |
DisableAuto(); |
else |
end |
local function ToggleAuto() |
if ChatProfiles.auto then SetAuto(false) else SetAuto(true) end |
SetAuto(not ChatProfiles.auto) |
end |
local function ChatProfiles_SlashCommandHandler(msg) |
if msg == "auto" then |
ChatMessage("Auto is "..(ChatProfiles.auto and "|cff339911on|r" or "|cffAA0033off|r")) |
ChatMessage("Auto is "..(ChatProfiles.auto and "|cff339911on|r" or "|cffAA0033off|r"),true) |
elseif msg == "auto on" then |
SetAuto(true); |
elseif msg == "auto off" then |
elseif msg == "auto toggle" then |
ToggleAuto(); |
elseif msg == "auto chat" then |
ChatProfiles.showChat = not ChatProfiles.showChat |
ChatMessage(ChatProfiles.showChat and "Now sending text to chat" or "No longer sending text to chat, type '/cp auto chat' to revert",true) |
elseif msg == "last" then |
LoadGlobalProfile("lastprofile"); |
SetAuto(false); |
text=text..v.."\n" |
end |
end |
ChatMessage(text); |
ChatMessage(text,true); |
elseif msg == "current" then |
ChatMessage("Current profile is '"..ChatProfiles.currentProfile.."'"); |
ChatMessage("Current profile is '"..ChatProfiles.currentProfile.."'",true); |
elseif msg == "frames" then |
local text ="Frame Name : #\n"; |
for i=1,7 do text=text..GetChatWindowInfo(i)..": "..i.."\n" end |
ChatMessage(text); |
ChatMessage(text,true); |
elseif msg == "store" then |
ChatMessage("/cp store profileName"); |
ChatMessage("/cp store profileName",true); |
elseif msg == "load" then |
ChatMessage("/cp load profileName"); |
ChatMessage("/cp load profileName",true); |
else |
msg = MsgToTable(msg); |
if #msg==2 then |
end |
else |
--No match found, return standard phrase |
ChatMessage("/cp <command>\n<command>: auto [/on/off/toggle], last, current, profiles, frames, store, load"); |
ChatMessage("/cp <command>\n<command>: auto [/on/off/toggle/chat], last, current, profiles, frames, store, load",true); |
end |
end |
end |