WoWInterface SVN ChatProfiles

Compare Revisions

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

Rev 5 → Rev 4

trunk/ChatProfiles.lua
86,7 → 86,6
},
["auto"] = false,
["currentProfile"]="default",
["showChat"]=true,
["GlobalProfiles"] = {
["default"] = {
"default1", -- [1]
125,11 → 124,8
end
 
 
local function ChatMessage(msg, show)
show = show or false
if ChatProfiles.showChat or show then
DEFAULT_CHAT_FRAME:AddMessage("|cff99BBEEChatProfiles:|r "..msg)
end
local function ChatMessage(msg)
DEFAULT_CHAT_FRAME:AddMessage("|cff99BBEEChatProfiles:|r "..msg);
end
 
local function LDBAutoChanged()
176,12 → 172,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",true) end
if profileName ~= "lastprofile" then ChatMessage("A profile named '"..profileName.."' has been created") end
end
 
local function LoadGlobalProfile(profileName)
if ChatProfiles.GlobalProfiles[profileName]==nil then
ChatMessage("No profile named '"..profileName.."' loading 'default' instead",true);
ChatMessage("No profile named '"..profileName.."' loading 'default' instead");
LoadGlobalProfile("default");
DisableAuto();
else
234,12 → 230,12
end
 
local function ToggleAuto()
SetAuto(not ChatProfiles.auto)
if ChatProfiles.auto then SetAuto(false) else SetAuto(true) end
end
 
local function ChatProfiles_SlashCommandHandler(msg)
if msg == "auto" then
ChatMessage("Auto is "..(ChatProfiles.auto and "|cff339911on|r" or "|cffAA0033off|r"),true)
ChatMessage("Auto is "..(ChatProfiles.auto and "|cff339911on|r" or "|cffAA0033off|r"))
elseif msg == "auto on" then
SetAuto(true);
elseif msg == "auto off" then
247,10 → 243,6
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);
264,18 → 256,18
text=text..v.."\n"
end
end
ChatMessage(text,true);
ChatMessage(text);
elseif msg == "current" then
ChatMessage("Current profile is '"..ChatProfiles.currentProfile.."'",true);
ChatMessage("Current profile is '"..ChatProfiles.currentProfile.."'");
 
elseif msg == "frames" then
local text ="Frame Name : #\n";
for i=1,7 do text=text..GetChatWindowInfo(i)..": "..i.."\n" end
ChatMessage(text,true);
ChatMessage(text);
elseif msg == "store" then
ChatMessage("/cp store profileName",true);
ChatMessage("/cp store profileName");
elseif msg == "load" then
ChatMessage("/cp load profileName",true);
ChatMessage("/cp load profileName");
else
msg = MsgToTable(msg);
if #msg==2 then
289,7 → 281,7
end
else
--No match found, return standard phrase
ChatMessage("/cp <command>\n<command>: auto [/on/off/toggle/chat], last, current, profiles, frames, store, load",true);
ChatMessage("/cp <command>\n<command>: auto [/on/off/toggle], last, current, profiles, frames, store, load");
end
end
end