Go to Page... |
|
Thread Tools | Display Modes |
|
01-29-12, 05:01 PM | #1 |
Six more or less quick questions!
Hey there,
thanks for trying to hopefully help me =) I have six questions! 1) hiding of ouf playerframe I want to have the playerframe of ouf hank hidden if i am a) a full health b) have no target c) are not in combat. That means that it should be shown if i am only in combat but have full health and no target etc. only if all three things are matched I want to have it hidden (idling would be best). 2) Hiding of Blizzardraidalerts As I have DBM covering everything helpful and blizzards messages get longer and longer as they describe what to do in detail i want to know how these messages can be hidden. 3) Chat-Fade-Out-Time decreasing As I hate how long the chat is displayed till it fades out I want to know how to do that. For your information my current chatmod: Code:
local f = CreateFrame("Frame"); local dummy = function() return; end; local players = {}; local colors = {}; local array = {}; -- config local fontSize = 12; -- chat font size. default blizz font size is 14 local highlightColor = "FF0000"; -- color zChat will be using when highlighting your name local timeColor = "8ACAFF"; -- color of the timestamps, in a typical RRGGBB format local timeFormat = "%H:%M"; -- format of the timestamp time. see http://www.php.net/strftime local timeStampFormat = "%s - "; -- format of the timestamps. %s is the time, using timeFormat as specified above local channelFormat = "%2%3:"; -- format of channel names. %2 is the channel number, if it exists. %3 is the channel name local rwFormat = "%1 - "; -- format of raid warnings. not a normal channel, so this is seperate. %1 is the raid warning pseudo channel name local playerPrefix = ""; -- player name prefix local playerSuffix = ""; -- player name suffix local plNoClass = "FFFFFF|r"; -- color to use for player names if the class is unknown, RRGGBB format -- true/false options local highlightSelf = false; -- highlights your own name using the highlight color specified above if set to true local editBoxOnTop = true; -- repositions the chat box above the chat frame if set to true local hideButtons = true; -- hides the chat buttons if set to true -- end of config -- raid warning locale local rw = RAID_WARNING; local _G = _G; local sub = string.sub; local gsub = string.gsub; local format = string.format; local find = string.find; local lower = string.lower; local function CacheColors() local c = CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS; for class, color in pairs(c) do colors[class] = format("%.2x%.2x%.2x", color.r * 255, color.g * 255, color.b * 255); end end function f:ADDON_LOADED(event, addon) if addon ~= "zChat" then return; end; local player = UnitName("player"); players[player] = select(2, UnitClass("player")); CacheColors(); if CUSTOM_CLASS_COLORS then CUSTOM_CLASS_COLORS:RegisterCallback(CacheColors); end -- edit box history zChatHistory = zChatHistory or {}; for _, v in ipairs(zChatHistory) do ChatFrame1EditBox:AddHistoryLine(v); end local EditBoxHook = function(self, line, ...) zChatHistory[#zChatHistory + 1] = line; --table.insert(zChatHistory, line); for i = 1, #zChatHistory - self:GetHistoryLines() do table.remove(zChatHistory, 1); end end; hooksecurefunc(ChatFrame1EditBox, "AddHistoryLine", EditBoxHook); -- edit box appearance ChatFrame1EditBoxLeft:SetAlpha(0) ChatFrame1EditBoxMid:SetAlpha(0) ChatFrame1EditBoxRight:SetAlpha(0) ChatFrame1EditBox.focusLeft:SetAlpha(0) ChatFrame1EditBox.focusMid:SetAlpha(0) ChatFrame1EditBox.focusRight:SetAlpha(0) array = { "Left", "Right", "Mid" }; for _, v in ipairs(array) do _G["ChatFrame1EditBox" .. v]:Hide(); end if editBoxOnTop then ChatFrame1EditBox:ClearAllPoints(); ChatFrame1EditBox:SetPoint("BOTTOMLEFT", ChatFrame1, "TOPLEFT", -2, 2); ChatFrame1EditBox:SetPoint("BOTTOMRIGHT", ChatFrame1, "TOPRIGHT", 5, 2); end local box = CreateFrame("Frame", nil); box:SetPoint("TOPLEFT", ChatFrame1EditBox, "TOPLEFT", 5, -5); box:SetPoint("BOTTOMRIGHT", ChatFrame1EditBox, "BOTTOMRIGHT", -5, 4); --ChatFrame1EditBox:SetFrameStrata("TOOLTIP"); box:SetFrameStrata("HIGH"); ChatFrame1EditBox:SetScript("OnShow", function() box:Show(); end); ChatFrame1EditBox:SetScript("OnHide", function() box:Hide(); end); -- resize/hide the "menu" button if hideButtons then ChatFrameMenuButton.Show = dummy; ChatFrameMenuButton:UnregisterAllEvents(); ChatFrameMenuButton:Hide(); else ChatFrameMenuButton:SetScale(0.9); end -- hide the "friends" button FriendsMicroButton.Show = dummy; FriendsMicroButton:UnregisterAllEvents(); FriendsMicroButton:Hide(); -- unsticky whispers ChatTypeInfo['WHISPER']['sticky'] = 0; ChatTypeInfo['BN_WHISPER']['sticky'] = 0; -- enable use of edit box scrolling without the alt key ChatFrame1EditBox:SetAltArrowKeyMode(false); -- loop through all the chat frames local cf; for i = 1, NUM_CHAT_WINDOWS do cf = _G["ChatFrame" .. i]; -- resize and reposition or hide the buttons array = { "Up", "Down", "Bottom", "Minimize" -- new in 3.3.5 }; local cb; for _, v in ipairs(array) do cb = _G["ChatFrame" .. i .. "ButtonFrame" .. v .. "Button"]; if hideButtons then cb.Show = dummy; cb:UnregisterAllEvents(); cb:Hide(); else cb:SetScale(0.9); if v == "Bottom" then if cb:IsVisible() then cb:ClearAllPoints(); cb:SetPoint("BOTTOMLEFT", cf, "BOTTOMLEFT", -34, -8); cb.SetPoint = dummy; cb.SetAllPoints = dummy; cb.ClearAllPoints = dummy; else cb:SetScript("OnShow", function(self) self:ClearAllPoints(); self:SetPoint("BOTTOMLEFT", cf, "BOTTOMLEFT", -34, -8); self.SetPoint = dummy; self.SetAllPoints = dummy; self.ClearAllPoints = dummy; self:SetScript("OnShow", nil); end); end end end end -- hide the button frame background array = { "Background", "TopLeftTexture", "BottomLeftTexture", "TopRightTexture", "BottomRightTexture", "TopTexture", "LeftTexture", "BottomTexture", "RightTexture" } local t; for _, v in ipairs(array) do t = _G["ChatFrame" .. i .. "ButtonFrame" .. v]; t.Show = dummy; t:Hide(); end -- change the font size local a, _, b = cf:GetFont(); cf:SetFont(a, fontSize, b); -- disable text fading cf:SetFading(nil); -- unclamp cf:SetClampedToScreen(false); -- enable mousewheel scrolling -- default functionality as of 3.3.5 --[[ cf:EnableMouseWheel(true); cf:SetScript("OnMouseWheel", function(self, delta) if delta > 0 then if IsShiftKeyDown() then self:PageUp(); else self:ScrollUp(); end elseif delta < 0 then if IsShiftKeyDown() then self:PageDown(); else self:ScrollDown(); end end end); ]] -- main part, hook the AddMessage function and add own code if cf ~= ChatFrame2 then -- don't modify combat log output cf.AddMessage_old = cf.AddMessage; cf.AddMessage = function(self, text, ...) local msg = text; -- channel replacement stuff msg = gsub(msg, "^|Hchannel:(%S+)|h%[([%d%.%s]*)([^%]]+)%]|h ", "|Hchannel:%1|h" .. channelFormat .. "|h "); msg = gsub(msg, "^%[(" .. rw .. ")%]", rwFormat); -- player name replacement stuff msg = gsub(msg, "|Hplayer:([^:|]+)([^|]*)|h%[[^%]]+%]|h", function(pl, add) local c = players[pl]; local col = c and colors[c] or plNoClass; return format("|Hplayer:%s%s|h%s|cff%s%s|r%s|h", pl, add, playerPrefix, col, pl, playerSuffix); end); -- highlight yourself if highlightSelf then local pStart, pEnd, capt; repeat pStart, pEnd, capt = find(lower(msg), "(%s+)" .. lower(player)); if pStart then msg = format("%s%s|cff%s%s|r%s", sub(msg, 0, pStart - 1), capt, highlightColor, player, sub(msg, pEnd + 1)); end until pStart == nil; end -- time stamps msg = format("|cff%s%s|r%s", timeColor, format(timeStampFormat, date(timeFormat)), msg); --msg = gsub(msg, "|", "||"); -- call the original function self:AddMessage_old(msg, ...); end; end end end -- class caching events local function AddPlayerClass(name, class) if not name or not class or players[name] then return; end players[name] = class; end function f:GUILD_ROSTER_UPDATE() for i = 1, GetNumGuildMembers(true) do local name, _, _, _, _, _, _, _, _, _, class = GetGuildRosterInfo(i); AddPlayerClass(name, class); end end function f:RAID_ROSTER_UPDATE() for i = 1, GetNumRaidMembers() do local name, _, _, _, _, class = GetRaidRosterInfo(i); AddPlayerClass(name, class); end end function f:PARTY_MEMBERS_CHANGED() for i = 1, GetNumPartyMembers() do local name, class = select(1, UnitName("party" .. i)), select(2, UnitClass("party" .. i)); AddPlayerClass(name, class); end end function f:PLAYER_TARGET_CHANGED() if not UnitIsPlayer("target") or not UnitIsFriend("player", "target") then return; end local name, class = select(1, UnitName("target")), select(2, UnitClass("target")); AddPlayerClass(name, class); end function f:UPDATE_MOUSEOVER_UNIT() if not UnitIsPlayer("mouseover") or not UnitIsFriend("player", "mouseover") then return; end local name, class = select(1, UnitName("mouseover")), select(2, UnitClass("mouseover")); AddPlayerClass(name, class); end function f:WHO_LIST_UPDATE() for i = 1, GetNumWhoResults() do local name, _, _, _, _, _, class = GetWhoInfo(i); AddPlayerClass(name, class); end end -- end class caching events -- tell target local function TellTarget(text) local name = UnitName("target"); if not name or not UnitIsPlayer("target") or not UnitIsFriend("player", "target") then return; end SendChatMessage(text, "WHISPER", nil, name); end f:RegisterEvent("ADDON_LOADED"); f:RegisterEvent("GUILD_ROSTER_UPDATE"); f:RegisterEvent("RAID_ROSTER_UPDATE"); f:RegisterEvent("PARTY_MEMBERS_CHANGED"); f:RegisterEvent("PLAYER_TARGET_CHANGED"); f:RegisterEvent("WHO_LIST_UPDATE"); f:RegisterEvent("UPDATE_MOUSEOVER_UNIT"); f:SetScript("OnEvent", function(self, event, ...) self[event](self, event, ...); end); -- tell target slash command SlashCmdList.TELLTARGET = TellTarget; SLASH_TELLTARGET1 = "/tt"; As i use calsscoloring provieded by the addon above "zChat" I have almost all the time the "unknown" color on the names, is there any possibility to add something to get the information so every name is classcolored? 5) lynstats font "monochrome" I use lynstats right now and I wonder how it is possible to change the font so it has a monochrome outline. Code:
--[[ VERSION 1.3 by Lyn modified by Saryel CREDITS: evl and his awesome evl_clock to get lynstats "ace-less" --]] local addon = CreateFrame("Button", "LynStats", UIParent) -- the x-files aka. configuration local frame_anchor = "BOTTOMRIGHT" local pos_x = 0 local pos_y = 2 local text_anchor = "BOTTOMRIGHT" local font = "Fonts\\ARIALN.ttf" local size = 10 --local color = { r=0.5, g=0.5, b=0.5 } local color = { r=0.5, g=0.6, b=0.8 } local shadow = false local time24 = true -- reinforcements! local mail, hasmail, ticktack, lag, fps, ep, xp_cur, xp_max, text, memory, entry, i, nr, xp_rest, ep, gold, silver, copper -- format memory stuff local memformat = function(number) if number > 1000 then return string.format("%.2f mb", (number / 1000)) else return string.format("%.1f kb", floor(number)) end end -- ordering local addoncompare = function(a, b) return a.memory > b.memory end -- the allmighty function addon:new() self:SetPoint(frame_anchor, UIParent, frame_anchor, pos_x, pos_y) self:SetWidth(130) self:SetHeight(13) text = self:CreateFontString(nil, "OVERLAY") text:SetFont(font, size,"OUTLINE") if shadow == true then text:SetShadowOffset(1,-1) else text:SetShadowOffset(0,0) end text:SetPoint(text_anchor, self) text:SetTextColor(color.r, color.g, color.b) self:SetScript("OnUpdate", self.update) self:SetScript("OnEnter", self.enter) self:SetScript("OnLeave", function() GameTooltip:Hide() end) end -- update local last = 0 function addon:update(elapsed) last = last + elapsed if last > 1 then -- mail stuff hasmail = (HasNewMail() or 0); if hasmail > 0 then mail = "new! " else mail = "" end -- date thingy if time24 == true then ticktack = date("%H'%M") else ticktack = date("%I'%M") end ticktack = "|c00ffffff"..ticktack.."|r " -- fps crap fps = GetFramerate() fps = "|c00ffffff"..floor(fps).."|rfps " -- right down downright + punch _, _, lag = GetNetStats() lag = "|c00ffffff"..lag.."|rms " -- xp stuff xp_cur = UnitXP("player") xp_max = UnitXPMax("player") xp_rest = GetXPExhaustion("player") or nil if UnitLevel("player") < MAX_PLAYER_LEVEL then ep = "|c00ffffff"..floor(xp_cur / (xp_max / 100)).."|r" if xp_rest ~= nil then ep = ep.."xp|c00ffffff(r)|r " else ep = ep.."xp " end else ep = "" end -- bags used = 0 maximum = 0 for bag=0,4 do if GetBagName(bag) and select(8, GetItemInfo(GetBagName(bag))) ~= "INVTYPE_QUIVER" then for slot=1,GetContainerNumSlots(bag) do if (GetContainerItemLink(bag,slot)) then used = used + 1 maximum = GetContainerNumSlots(0) + GetContainerNumSlots(1) + GetContainerNumSlots(2) + GetContainerNumSlots(3) + GetContainerNumSlots(4) bags = used.."|c00ffffff/|r"..maximum.." " end end end end --money if strlen(GetMoney()) > 4 then moneypool = GetMoney() gold = floor(moneypool/10000) moneypool = (moneypool-(gold*10000)) silver = floor(moneypool/100) moneypool = (moneypool-(silver*100)) copper = moneypool money = "|cFFFFB311"..gold.."|r |cFFE1D3CB"..silver.."|r |cFFE16B47"..copper.."|r " elseif strlen(GetMoney()) > 2 then moneypool = GetMoney() silver = floor(moneypool/100) moneypool = (moneypool-(silver*100)) copper = moneypool money = "|cFFE1D3CB"..silver.."|r |cFFE16B47"..copper.."|r " else copper=GetMoney() money = "|cFFE16B47"..copper.."|r " end -- reset timer last = 0 -- the magic! text:SetText(ticktack..lag..fps..bags..money..ep..mail) end end --[[ ADDON LIST --]] function addon:enter() GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -20, 20) addons = {} total = 0 UpdateAddOnMemoryUsage() for i=1, GetNumAddOns(), 1 do memory = GetAddOnMemoryUsage(i) entry = {name = GetAddOnInfo(i), memory = memory} table.insert(addons, entry) total = total + memory end table.sort(addons, addoncompare) for _, entry in pairs(addons) do GameTooltip:AddDoubleLine(entry.name, memformat(entry.memory), 1, 1, 1, 1, 1, 1) end GameTooltip:AddLine("----------------------------------------------------------------", 1, 1, 1) GameTooltip:AddDoubleLine("Total", memformat(total), color.r, color.g, color.b, color.r, color.g, color.b) GameTooltip:AddDoubleLine("-Blizzard", memformat((collectgarbage("count"))-total), color.r, color.g, color.b, color.r, color.g, color.b) GameTooltip:Show() end LynStats:SetScript("OnMouseDown", function() collectgarbage("collect") -- Force garbage collection DEFAULT_CHAT_FRAME:AddMessage("Totally |c00ff0000"..floor((collectgarbage("count"))+0.5).."|rKBs of Lua-Code in use.") end) -- and... go! addon:new() I have asked for help on this one a bit ago here: http://www.wowinterface.com/forums/s...123#post249123 Maybe someone can pick it up and help here or there. Thanks for everything love you guys =)
__________________
Balance is, when everyone is unhappy. |
|
01-29-12, 05:18 PM | #2 |
#5 - Replace where it says "OUTLINE" to be "MONOCHROME, OUTLINE"
http://wowprogramming.com/docs/widge...stance/SetFont |
|
01-29-12, 05:32 PM | #3 | |
But it's not "my taste". I would like to know how i have to use the shadow or how i set the font the way it is displayed in chat. comparison: I use no outline right now, and have shadow turned on with these values: Code:
if shadow == true then text:SetShadowOffset(-1,1) else text:SetShadowOffset(0,0) end
__________________
Balance is, when everyone is unhappy. |
||
01-29-12, 08:21 PM | #4 | |
|
||
01-29-12, 09:00 PM | #5 |
For number one download and install oUF_Barfader then open up the TOC file from oUF_Hank and add BarFader as an optional dependancy
should look like this: Lua Code:
Than at line 496 of hank_v3.lua file change this: LUA Code:
to this: LUA Code:
|
|
01-29-12, 09:15 PM | #6 |
Yup basically works.
How can i make it to check for "updates" more often. As it is now, both, the time till it shows and the time till it disappears is noteably behind the time of all other frames including dominos bars (they fade out or in at once while the playerframe comes in a bit later). Thanks for your help! =)
__________________
Balance is, when everyone is unhappy. |
|
01-29-12, 05:57 PM | #7 |
Keep in mind that UnitName returns name and their realm, if crossrealm. Also, if you want to make it properly reply to them make sure you strip spaces from the realmname and special characters, "Bob-Lightning's Blade" becomes "/w Bob-LightningsBlade <msg>" otherwise the game will try to whisper "Bob-Lightning's" with the message "Blade" and it's not correct.
|
|
01-29-12, 06:05 PM | #8 |
What do you refer to Vladinator?
__________________
Balance is, when everyone is unhappy. |
|
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Six more or less quick questions! |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Hybrid Mode |
Switch to Threaded Mode |
|
|