WoWInterface SVN ChatProfiles

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 4 to Rev 5
    Reverse comparison

Rev 4 → Rev 5

ChatProfiles.lua
86,6 → 86,7
},
["auto"] = false,
["currentProfile"]="default",
["showChat"]=true,
["GlobalProfiles"] = {
["default"] = {
"default1", -- [1]
124,8 → 125,11
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()
172,12 → 176,12
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
230,12 → 234,12
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
243,6 → 247,10
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);
256,18 → 264,18
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
281,7 → 289,7
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