/
## Interface: 70300 |
## Interface: 80000 |
## Title: ChipperChat |
## Author: Seerah |
## Notes: Make your chat experience a chipper one! |
## Version: 1.4.3 |
## Version: 1.5 |
cc_options.lua |
cc.lua |
local _, CC = ... |
-- Below are the available options for ChipperChat, if you wish to change them. |
-- If you make extensive changes, I recommend saving a backup of this file. |
-- When making changes while in-game, you will need to relog or reload your UI |
-- for changes to take effect. |
-- Editbox On Top |
CC.editboxTexture = false |
-- Enable Arrow Keys |
--------------------- |
-- available settings: true or false |
-- if true, you will not have to hold the Alt-key to navigate the editbox with the arrow keys |
CC.enableArrowKeys = false |
-- Hide Voice Chat Buttons --ADD KEYBIND FOR CHANNELS WINDOW? |
--------------------------- |
-- available settings: true or false |
-- if true, the Chat Channels, Deafen Voice Chat, and Mute buttons next to the chat frame |
-- will be hidden (deafen and mute are in the keybindings menu) |
CC.hideVoiceChat = true |
-- Control Time Stamps |
----------------------- |
-- available settings: true or false |
CC.timeStamps = true |
-- Enable Arrow Keys |
--------------------- |
-- available settings: true or false |
-- if true, you will not have to hold the Alt-key to navigate the editbox with the arrow keys |
CC.enableArrowKeys = false |
-- Time Stamp Format |
--------------------- |
-- if ChipperChat is in charge of time stamps, what format to use |
-- available settings: 1 or 0 |
-- if set to 1, the editbox will remember that channel the next time you go to send a message |
-- pre-3.3.5 behavior was that these were set to 0 - 3.3.5 made them sticky (1) |
-- turning off sticky (0) removes the chance for an accidental mistell |
CC.whisperSticky = 0 --normal whispers |
CC.channelSticky = 0 --numbered chat channels (trade, etc.) |
CC.BNwhisperSticky = 0 --battle.net RealID friends whispers |
CC.chatHistory = 200 |
-- Control Toaster Frame |
-- Control Toaster Frame --all different in 8.0, currently disabled |
-------------------------- |
-- available settings: true or false |
-- if true, ChipperChat will take over anchoring of the Battle.net popup frame |
--------------------- |
--Guild chat |
[CHAT_MSG_GUILD] = "[G]", |
--Officer chat |
[CHAT_MSG_OFFICER] = "[O]", |
--Party chat |
[CHAT_MSG_PARTY] = "[P]", |
--Party leader |
[CHAT_MSG_RAID_LEADER] = "[RL]", |
--Raid Warning |
[CHAT_MSG_RAID_WARNING] = "[RW]", |
--Officer chat |
[CHAT_MSG_OFFICER] = "[O]", |
--Battleground chat |
[CHAT_MSG_BATTLEGROUND] = "[BG]", |
--Battleground leader |
-- If you wish to shorten a custom channel, add it to the list below, following the others as a template |
-- If your locale is not English, substitute the channel names below (that aren't in CAPS) to those from your locale |
-- Any numbered channel that does not get matched to something on the left below, will just be [#.] (ex. "[3.]") |
--Trade chat |
["(%d+)%. "..TRADE] = "%[%1%.Tr%]", |
["%[(%d+)%. "..TRADE..".-%]"] = "%[%1%.Tr%]", |
--General chat |
["(%d+)%. "..GENERAL] = "%[%1%.Gen%]", |
["%[(%d+)%. "..GENERAL..".-%]"] = "%[%1%.Gen%]", |
--Looking for group |
["(%d+)%. "..LOOKING] = "%[%1%.LFG%]", |
["%[(%d+)%. "..LOOKING..".-%]"] = "%[%1%.LFG%]", |
--WorldDefense |
["(%d+)%. WorldDefense"] = "%[%1%.WD%]", |
["%[(%d+)%. WorldDefense%]"] = "%[%1%.WD%]", |
--LocalDefense |
["(%d+)%. LocalDefense"] = "%[%1%.LD%]", |
["%[(%d+)%. LocalDefense%]"] = "%[%1%.LD%]", |
--GuildRecruitment |
["(%d+)%. GuildRecruitment"] = "%[%1%.GR%]", |
["%[(%d+)%. GuildRecruitment%]"] = "%[%1%.GR%]", |
--All other numbered and custom channels |
["(%d+)%. .-"] = "%[%1%.%]", |
-- ["test"] = "123", |
["%[(%d+)%. .-%]"] = "%[%1%.%]", |
-- ["%[test%]"] = "123", |
} |
--HIDE VOICE CHAT BUTTONS (OR SKIN AND ADD OPTIONS FOR PLACEMENT/VISIBILITY --?--) |
local _, CC = ... --access to our personal global table |
CC.f = CreateFrame("Frame") |
local _G = _G |
local gsub = _G.gsub |
local strmatch = _G.strmatch |
local OldAddMessages = {} |
--UPVALUES-- |
local gsub = gsub |
local strmatch = strmatch |
local channelNicks = CC.channelNicks |
local globalChannelNicks = CC.globalChannelNicks |
local whisperfrom = strsub(CHAT_WHISPER_GET, 4) --isolate the localized bit from the %s |
--local whisperto = strsub(CHAT_WHISPER_INFORM_GET, 1, -5) |
local says = strsub(CHAT_SAY_GET, 4) |
local dummyfunc = function(self) self:Hide() end |
local timeFormat = CC.timeFormat |
local whisperfromText = strsub(CHAT_WHISPER_GET, 4) --isolate the localized bit from the %s |
local saysText = strsub(CHAT_SAY_GET, 4) |
local dummyfunc = function(self) self:Hide() end |
local OldAddMessages = {} |
--this is the prehook to :AddMessage() |
local function NewAddMessage(frame, msg, ...) |
msg = tostring(msg) or "" |
msg = format("%s %s", BetterDate(timeFormat, time()), msg) |
end |
--channels |
--channel nicknames |
if CC.shortChannels then |
if strmatch(msg, "%d+%. .-|h") then |
for k,v in pairs(globalChannelNicks) do |
msg = gsub(msg, "|h%["..k.."%]|h", "|h"..v.."|h", 1) |
msg = gsub(msg, "|h"..k.."|h", "|h"..v.."|h", 1) |
end |
else |
for k,v in pairs(channelNicks) do |
end |
--normal say messages |
msg = gsub(msg, "]|h "..says, "]|h: ", 1) |
msg = gsub(msg, "]|h "..saysText, "]|h: ", 1) |
--whispers |
msg = gsub(msg, "|h "..whisperfrom, "|h: ", 1) |
msg = gsub(msg, "|h "..whisperfromText, "|h: ", 1) |
end |
--player names (remove brackets) |
msg = msg:gsub("(|Hplayer.-|h)%[(.-)%](|h)", "%1%2%3", 1) |
msg = msg:gsub("(|HBNplayer.-|h)%[(.-)%](|h)", "%1%2%3", 1) |
--new Away and Busy tags - revert to AFK and DND |
--change Away and Busy tags - revert to AFK and DND |
if CC.DND_AFK then |
msg = gsub(msg, CHAT_FLAG_DND, "<DND>", 1) |
msg = gsub(msg, CHAT_FLAG_AFK, "<AFK>", 1) |
end |
--after editing the message, send on through |
return OldAddMessages[frame](frame, msg, ...) |
end |
-- |
--function to reference when controlling 'scroll to bottom' button |
local function btmbtnControl(self) |
self = self or SELECTED_DOCK_FRAME |
if self:GetScrollOffset() ~= 0 then |
--_G[self:GetName().."ButtonFrameBottomButton"]:Show() |
_G[self:GetName().."ButtonFrameBottomButton"]:SetAlpha(.5) |
--minimize buttons |
local function AdjustMinimizeButtons(chatFrame, minB) |
minB:SetParent(chatFrame) |
minB.parent = chatFrame |
minB:ClearAllPoints() |
if chatFrame == ChatFrame2 then |
minB:SetPoint("BOTTOMRIGHT", CombatLogQuickButtonFrame_Custom, "TOPRIGHT", 0, 1) |
else |
--_G[self:GetName().."ButtonFrameBottomButton"]:Hide() |
_G[self:GetName().."ButtonFrameBottomButton"]:SetAlpha(0) |
minB:SetPoint("BOTTOMRIGHT", chatFrame, "TOPRIGHT", 23, 1) |
end |
minB:SetSize(24, 24) |
minB:SetScript("OnClick", function(self) |
local cf = self.parent |
FCF_MinimizeFrame(cf, strupper(cf.buttonSide)) |
end) |
minB.hooked = true |
end |
local CCskinned = {} |
--skin each chat frame |
local CFskinned = {} |
local function SetUpWindow(frame) |
if _G[frame] and not CCskinned[frame] then |
local eb, btmbtn = _G[frame.."EditBox"] |
local chatFrame = _G[frame] |
if chatFrame and not CFskinned[frame] then |
local eb = _G[frame.."EditBox"] |
--allow for use of the arrow keys |
--allow for use of the arrow keys in the editbox without holding alt |
if CC.enableArrowKeys then |
eb:SetAltArrowKeyMode(false) |
end |
--again here for newly created ones |
_G[frame]:SetClampRectInsets(0,0,0,0) |
chatFrame:SetClampRectInsets(0,0,0,0) |
--move editboxes to top |
--move editbox to top |
if CC.editboxTop then |
eb:ClearAllPoints() |
eb:SetPoint("BOTTOMLEFT", _G[frame], "TOPLEFT", -6, .5) |
eb:SetPoint("BOTTOMRIGHT", _G[frame], "TOPRIGHT", 6, .5) |
--eb:SetHeight(ebheight) |
eb:SetPoint("BOTTOMLEFT", chatFrame, "TOPLEFT", -6, .5) |
eb:SetPoint("BOTTOMRIGHT", chatFrame, "TOPRIGHT", 29, .5) |
end |
--change editbox textures |
--change tab textures for being on bottom |
if CC.tabsBottom then |
local frame = _G[frame.."Tab"] |
frame.leftTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-BGLeft") |
frame.middleTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-BGMid") |
frame.rightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-BGRight") |
frame.leftSelectedTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-SelectedLeft") |
frame.middleSelectedTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-SelectedMid") |
frame.rightSelectedTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-SelectedRight") |
frame.leftHighlightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-HighlightLeft") |
frame.middleHighlightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-HighlightMid") |
frame.rightHighlightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-HighlightRight") |
local tabs = _G[frame.."Tab"] |
tabs.leftTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-BGLeft") |
tabs.middleTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-BGMid") |
tabs.rightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-BGRight") |
tabs.leftSelectedTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-SelectedLeft") |
tabs.middleSelectedTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-SelectedMid") |
tabs.rightSelectedTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-SelectedRight") |
tabs.leftHighlightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-HighlightLeft") |
tabs.middleHighlightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-HighlightMid") |
tabs.rightHighlightTexture:SetTexture("Interface\\AddOns\\ChipperChat\\CHATFRAME\\ChatFrameTab-HighlightRight") |
end |
--hide frame-specific buttons |
_G[frame.."ButtonFrameUpButton"]:Hide() |
_G[frame.."ButtonFrameUpButton"]:SetScript("OnShow", dummyfunc) |
_G[frame.."ButtonFrameDownButton"]:Hide() |
_G[frame.."ButtonFrameDownButton"]:SetScript("OnShow", dummyfunc) |
-- _G[frame.."ButtonFrame"]:Hide() |
-- _G[frame.."ButtonFrame"]:SetScript("OnShow", dummyfunc) |
for i = 1, 9 do select(i, _G[frame.."ButtonFrame"]:GetRegions()):Hide() end |
--move 'scroll to bottom' button |
local btmbtn = _G[frame.."ButtonFrameBottomButton"] |
-- btmbtn:SetParent(_G[frame]) |
-- btmbtn:Hide() |
-- btmbtn:SetAlpha(.65) --so it doesn't cover the text too much |
btmbtn:SetAlpha(0) --instead of hiding & showing, we'll do alpha |
btmbtn:ClearAllPoints() |
btmbtn:SetPoint("BOTTOMRIGHT", _G[frame], "BOTTOMRIGHT", -2, 2) |
--make sure the 'scroll to bottom' button still works and will show/hide when necessary |
btmbtn:SetScript("OnClick", function(self) --this is basically a rewrite of the default "OnClick" script, but it needed rewritten since the parent was changed. |
PlaySound(828) |
ChatFrame_ScrollToBottom() |
--self:Hide() |
self:SetAlpha(0) |
--move minimize button & hide button frame |
if not chatFrame.isDocked then |
AdjustMinimizeButtons(chatFrame, chatFrame.buttonFrame.minimizeButton) |
end |
hooksecurefunc("FCFDock_RemoveChatFrame", function(dock, chatFrame) --hook for those still docked |
local minB = chatFrame.buttonFrame.minimizeButton |
if not minB.hooked then |
AdjustMinimizeButtons(chatFrame, minB) |
end |
end) |
_G[frame]:HookScript("OnShow", btmbtnControl) |
_G[frame]:HookScript("OnMouseWheel", function(self, delta) --add ability to hold shift to jump to top/bottom when scrolling |
chatFrame.buttonFrame:Hide() |
chatFrame.buttonFrame:HookScript("OnShow", chatFrame.buttonFrame.Hide) |
--add ability to hold shift to jump to top/bottom when scrolling |
chatFrame:HookScript("OnMouseWheel", function(self, delta) |
if IsShiftKeyDown() then |
if delta > 0 then |
self:ScrollToTop() |
self:ScrollToBottom() |
end |
end |
btmbtnControl(self) |
end) |
OldAddMessages[_G[frame]] = _G[frame].AddMessage |
_G[frame].AddMessage = NewAddMessage |
--add prehook to edit messages as they come through |
OldAddMessages[chatFrame] = chatFrame.AddMessage |
chatFrame.AddMessage = NewAddMessage |
--mark this frame off as being skinned already |
--if this code block gets run for the same chat frame twice, bad things happen... |
CCskinned[frame] = true |
--if this function gets run for the same chat frame twice, bad things happen... |
CFskinned[frame] = true |
end |
end |
local function ChatTweaks() |
--remove sticky chat from these channels (back to old way) |
--remove sticky chat from these channels (back to old way - no more mistells) |
ChatTypeInfo["WHISPER"].sticky = CC.whisperSticky |
ChatTypeInfo["CHANNEL"].sticky = CC.channelSticky |
ChatTypeInfo["BN_WHISPER"].sticky = CC.BNwhisperSticky |
--hide general buttons |
ChatFrameMenuButton:Hide() |
ChatFrameMenuButton:SetScript("OnShow", dummyfunc) |
QuickJoinToastButton:Hide() |
QuickJoinToastButton:SetScript("OnShow", dummyfunc) |
if CC.hideVoiceChat then |
ChatFrameChannelButton:Hide() |
ChatFrameToggleVoiceDeafenButton:Hide() |
ChatFrameToggleVoiceMuteButton:Hide() |
end |
--10 chat frames possible, according to NUM_CHAT_WINDOWS |
for i=1, NUM_CHAT_WINDOWS do |
SetUpWindow(frame) |
end |
--hook generic functions to make 'scroll to bottom' button show/hide when necessary |
hooksecurefunc("ChatFrame_ScrollUp", btmbtnControl) |
hooksecurefunc("ChatFrame_ScrollDown", btmbtnControl) |
hooksecurefunc("ChatFrame_ChatPageUp", btmbtnControl) |
hooksecurefunc("ChatFrame_ChatPageDown", btmbtnControl) |
hooksecurefunc("ChatFrame_ScrollToBottom", btmbtnControl) |
--hook this to skin/alter temporary whisper/conversation windows |
hooksecurefunc("FCF_SetTemporaryWindowType", function(chatFrame) SetUpWindow(chatFrame:GetName()) end) |
--timestamps control |
if CC.timeStamps then |
--this takes care of setting the CVar and everything else |
InterfaceOptionsSocialPanelTimestamps:SetValue("none") |
end |
-----ALL DIFFERENT IN 8.0----- |
--keep b.net toast frame on screen (it's aligned with the button frame, which we hide, not the chat frame) |
if CC.moveToaster then |
--[[if CC.moveToaster then |
local xoffset |
local BNToastFrame = BNToastFrame |
hooksecurefunc("BNToastFrame_UpdateAnchor", function() |
BNToastFrame:SetPoint("TOP"..BNToastFrame.buttonSide, ChatFrame1, "BOTTOM"..BNToastFrame.buttonSide, xoffset, BN_TOAST_BOTTOM_OFFSET) |
end |
end) |
end |
end]] |
--clean up (wipe registered event and put functions on garbage heap) |
--clean up (unregistered event and put function on garbage heap) |
CC.f:UnregisterEvent("PLAYER_ENTERING_WORLD") |
ChatTweaks = nil |
end |
do |
for i=1, NUM_CHAT_WINDOWS do |
local f = _G["ChatFrame"..i] |
f:SetClampRectInsets(0,0,0,0) |
f:SetClampRectInsets(0,23,0,0) |
f:SetMaxLines(CC.chatHistory) |
end |
end |
--move chat tabs to the bottom |
--in main chunk to catch chat frames that are undocked at load |
--(in main chunk to catch chat frames that are undocked at load) |
if CC.tabsBottom then |
GeneralDockManager:ClearAllPoints() |
GeneralDockManager:SetPoint("TOPLEFT",ChatFrame1,"BOTTOMLEFT",0,2) |
end) |
end |
CC.f:RegisterEvent("PLAYER_ENTERING_WORLD") |
CC.f:SetScript("OnEvent", ChatTweaks) |
Features: |
--------- |
- Hide chat buttons (jump to bottom button moved to lower-right corner, only shows when you are scrolled up) |
- Hide extra buttons around the chat frame |
- Move edit box to the top of the chat frame |
- New editbox textures |
- Move chat frames to edges of screen |
1. place ChipperChat folder inside Interface\AddOns |
2. open cc_options.lua in any text editor if you wish to change some settings |
3. log into the game and open up Interface Options > Social |
-> select "Classic Style" in the Chat Style dropdown (this will let the edit box hide when not in use, |
and give you access to your chat tabs when both the edit box and tabs are on top) |
-> select "Classic Style" in the Chat Style dropdown (this will give you access to your chat tabs when |
both the edit box and tabs are on top) |
Want more features? |
------------------- |
(Note: These addons are by no means "the best" or "the only" options. They are merely an example of what is available.) |
(Note: These addons are by no means "the best" or "the only" options. They are merely an example |
of what is available. No guarantees that these are currently up-to-date.) |
- Timestamps? |
Interface Options > Social > "Chat Timestamps" (dropdown menu - select the style you prefer) |
**NEW: ChipperChat now has an option to add timestamps - this allows them to be added to *every* message, including the combat log |
- Mousewheel scrolling? |
Interface Options > Social > "Enable Mouse Wheel Scrolling" |
- Class colored names? |
Right-click a chat tab and select "Settings". Mark the box under "Show Class Color" for each channel you want colored |
- Customize class colors? |
Download and install ClassColors by Phanx. |
- Customize channel colors? |
Right-click a chat tab and select "Setttings". Click the color box for the channel you wish to customize. |
- Pretty/Sleek/Minimalisitic chat tabs? |
Download and install the addon Fane by Haste. (or nibChatTabs) |
Download and install nibHideBlackBar by Nibelheim |
- Minimize chat window? |
Download and install Chicchai by Lolzen |
Download and install Chicchai by Lolzen (note: all undocked chat frames have a minimize button) |
- Move Battle.net Toaster popup window anywhere on screen? |
- Move Battle.net Toaster popup window anywhere on screen? --NOTE: this is currently disabled on beta |
Download and install Toastmaster by morkesh or TinyToastMover by ameyaselene |
(be sure to disable ChipperChat's handling of this in cc_options.lua so you don't get conflicts) |