-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Interface: 11302 | ||
## Title: Compact Chat Frame | ||
## Author: coolmodi | ||
## Notes: Shortens channel names to the uppercase letters, removes zone name, puts editbox on top and unclamps chat frame. | ||
## Version: 1.0 | ||
|
||
main.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
# CompactChatFrame | ||
A super small addon that: | ||
|
||
* Shortens channel names down to their uppercase letters. | ||
* Removes zone names from general and local defense. | ||
* Positions editbox on top of chat frames. | ||
* Makes chat frame freely movable to position it right at the border of the screen | ||
|
||
>[1. General - The Barrens] [coolmodi]: I like turtles | ||
>[4. LookingForGroup] [coolmodi]: Need friends | ||
becomes | ||
|
||
>[1. G] [coolmodi]: I like turtles | ||
>[4. LFG] [coolmodi]: Need friends | ||
There's also the `/ccfreset` command to reset chat frame positions, in case you manage to put them off screen completely. By default resets the default chat frame, `/ccfreset 2` would reset the second chat frame. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- Unclamp chat frames and put editbox on top | ||
for i=1, NUM_CHAT_WINDOWS, 1 do | ||
local cf = _G["ChatFrame"..i]; | ||
cf:SetClampedToScreen(false); | ||
cf.editBox:ClearAllPoints(); | ||
cf.editBox:SetPoint("BOTTOMLEFT", cf, "TOPLEFT", -5, 5); | ||
cf.editBox:SetPoint("BOTTOMRIGHT", cf, "TOPRIGHT", 5, 5); | ||
end | ||
|
||
-- Shorten channel names. | ||
-- This particular function is only used for outputting names in chat, so it has no side effects. | ||
local origfunc = ChatFrame_ResolvePrefixedChannelName; | ||
function ChatFrame_ResolvePrefixedChannelName(communityChannel) | ||
local channelName = origfunc(communityChannel); | ||
|
||
if channelName:find("%u") then | ||
local start = channelName:find("-"); | ||
if start then | ||
channelName = channelName:sub(1, start-2); | ||
end | ||
return channelName:gsub("%l", ""); | ||
end | ||
|
||
return channelName; | ||
end | ||
|
||
-- Every command has it's history... | ||
SLASH_CCFSLASH1 = "/ccfreset"; | ||
SlashCmdList["CCFSLASH"] = function(arg) | ||
local argnum = tonumber(arg); | ||
if argnum == nil or argnum > NUM_CHAT_WINDOWS then | ||
argnum = 1; | ||
end | ||
_G["ChatFrame"..argnum]:ClearAllPoints(); | ||
_G["ChatFrame"..argnum]:SetPoint("BOTTOMLEFT", UIParent, 100, 100); | ||
end; |