--[[---------------------------------------------------------------------------- Slash shortcuts ------------------------------------------------------------------------------]] -- Adding a /rl alias for /console reloadui. SlashCmdList['RELOAD'] = ReloadUI SLASH_RELOAD1 = '/rl' --[[---------------------------------------------------------------------------- Unitframes ------------------------------------------------------------------------------]] -- Moving and scaling the Player, Target and Focus unit frame. PlayerFrame:ClearAllPoints(); PlayerFrame:SetScale(1.1); PlayerFrame:SetPoint("RIGHT", UIParent, "CENTER", -100, -100); TargetFrame:ClearAllPoints(); TargetFrame:SetScale(1.1); TargetFrame:SetPoint("LEFT", UIParent, "CENTER", 100, -100); FocusFrame:ClearAllPoints(); FocusFrame:SetScale(1.1); FocusFrame:SetPoint("LEFT", UIParent, "LEFT", 5, -100); -- Moving and scaling party frames. Growing up instead of down. PartyMemberFrame1:ClearAllPoints(); PartyMemberFrame1:SetScale(1.3); PartyMemberFrame1:SetPoint("LEFT", UIParent, "LEFT", 5, 0); PartyMemberFrame1.ClearAllPoints = function() end PartyMemberFrame1.SetScale = function() end PartyMemberFrame1.SetPoint = function () end PartyMemberFrame2:ClearAllPoints(); PartyMemberFrame2:SetScale(1.3); PartyMemberFrame2:SetPoint("LEFT", UIParent, "LEFT", 5, 70); PartyMemberFrame2.ClearAllPoints = function() end PartyMemberFrame2.SetScale = function() end PartyMemberFrame2.SetPoint = function () end PartyMemberFrame3:ClearAllPoints(); PartyMemberFrame3:SetScale(1.3); PartyMemberFrame3:SetPoint("LEFT", UIParent, "LEFT", 5, 140); PartyMemberFrame3.ClearAllPoints = function() end PartyMemberFrame3.SetScale = function() end PartyMemberFrame3.SetPoint = function () end PartyMemberFrame4:ClearAllPoints(); PartyMemberFrame4:SetScale(1.3); PartyMemberFrame4:SetPoint("LEFT", UIParent, "LEFT", 5, 210); PartyMemberFrame4.ClearAllPoints = function() end PartyMemberFrame4.SetScale = function() end PartyMemberFrame4.SetPoint = function () end --[[---------------------------------------------------------------------------- Minimap ------------------------------------------------------------------------------]] --Scaling the minimap. Hiding unnecessary things from the minimap frame and moving the tracking menu button up. --Changing the standard blips(!, ?, etc) with smaller ones. Thanks for the .tga Steve. MinimapCluster:SetScale(1.1); MinimapZoomIn:Hide(); MinimapZoomOut:Hide(); MiniMapWorldMapButton:Hide(); MiniMapTracking:ClearAllPoints(); MiniMapTracking:SetPoint("TOPRIGHT", MinimapCluster, "TOP", -32, -22); Minimap:SetBlipTexture("Interface\\AddOns\\krammeUI\\Textures\\Smallblips.tga"); -- Adding minimap zoom with the mousewheel. Minimap:EnableMouseWheel(true) Minimap:SetScript("OnMouseWheel", function(zoom, arg) if arg > 0 and zoom:GetZoom() < 5 then zoom:SetZoom(zoom:GetZoom() + 1) elseif arg < 0 and zoom:GetZoom() > 0 then zoom:SetZoom(zoom:GetZoom() - 1) end end) -- Parenting the buff frame to the minimap instead of UIParent. TemporaryEnchantFrame:ClearAllPoints(); TemporaryEnchantFrame:SetPoint("TOPRIGHT", MinimapCluster, "TOPLEFT", 10, -10); TemporaryEnchantFrame.ClearAllPoints = function() end TemporaryEnchantFrame.SetPoint = function() end --[[---------------------------------------------------------------------------- Chat Simple URL catching would be awesome :) ------------------------------------------------------------------------------]] -- Adding chat mousewheel scroll. ChatScroll = {} local _G = getfenv(0) function ChatScroll:OnEnable() for i=1,7 do local frame = _G['ChatFrame'..i] frame:EnableMouseWheel(true) frame:SetScript('OnMouseWheel', self.ScrollChat) end end function ChatScroll:ScrollChat() if arg1 > 0 then if IsShiftKeyDown() then this:ScrollToTop() else this:ScrollUp() end elseif arg1 < 0 then if IsShiftKeyDown() then this:ScrollToBottom() else this:ScrollDown() end end end ChatScroll:OnEnable() -- Adding timestamps to all chat windows. local chathook = {} local function AddMessage(frame, text, red, green, blue, id) text = tostring(text) or '' text = date('%H:%M') .. '|r ' .. text return chathook[frame](frame, text, red, green, blue, id) end local v for i=1,7 do v = _G['ChatFrame'..i] chathook[v] = v.AddMessage v.AddMessage = AddMessage end -- Removing the need to use the ALT key, when using the keyboard arrows in the editbox. ChatFrameEditBox:SetAltArrowKeyMode(nil) -- sticky'ing party, guild, raid and battleground chat. ChatTypeInfo.PARTY.sticky = 1 ChatTypeInfo.GUILD.sticky = 1 ChatTypeInfo.RAID.sticky = 1 ChatTypeInfo.BATTLEGROUND.sticky = 1 --[[---------------------------------------------------------------------------- Actionbar If you want out-of-range coloring on the actionbars use http://www.wowinterface.com/downloads/info4166-RedRange.html I know this goes against policy, but I have no clue how to do the out-of-range coloring on buttons and with the progress of the hunter in shot range, I doubt I ever will. The text is at the wrong location at login, but a /rl fixes this. Got a report that keybindtext aren't visible on some bars if you play a class that has stances. Go figure. ------------------------------------------------------------------------------]] -- Making the hotkey text more clear. hooksecurefunc("ActionButton_Update", function(self) local name = self:GetName() local button = _G[name] local hotkey = _G[name.."HotKey"] hotkey:SetFont("Interface\\AddOns\\krammeUI\\Fonts\\font.ttf", 18, "OUTLINE") hotkey:SetDrawLayer("OVERLAY") hotkey:ClearAllPoints() hotkey:SetPoint("TOPRIGHT", button, -2, -3) hotkey:SetVertexColor(0.6, 0.7, 0.8) hotkey.SetPoint = function() end hotkey.SetVertexColor = function() end end) --[[---------------------------------------------------------------------------- Hunter specific functions. Trying to make some visual indication at the unitframe that the target is within shooting range. Need to find a way to only do the below part when actually playing a hunter. A melee part would be cool, but not necessary at the moment. ------------------------------------------------------------------------------]] --[[ disabled while playing -- Create the frame. local Rangeframe = CreateFrame("Frame", nil, TargetFrame) Rangeframe:SetFrameStrata("BACKGROUND") Rangeframe:SetWidth(24) Rangeframe:SetHeight(24) -- Create the texture to go in the frame. -- Temporary texture, just trying to get it to work. local RangeframeTexture = Rangeframe:CreateTexture(nil,"BACKGROUND") RangeframeTexture:SetTexture("Interface\\AddOns\\krammeUI\\Textures\\Ability_Hunter_SniperShot.blp") RangeframeTexture:SetAllPoints(Rangeframe) Rangeframe.texture = RangeframeTexture Rangeframe:SetPoint("TOPLEFT", 9, 3) -- Trying to get the whole appear-when-in-range thing to work. -- Using http://www.wowwiki.com/API_IsSpellInRange, but I can't get it working. local inRange = 0 if UnitExists("target") and IsVisible("target") and UnitCanAttack("player", "target") and not UnitIsDead("target") then inRange = IsSpellInRange("Auto Shot", "target") end if inRange==1 then Rangeframe:Show() else Rangeframe:Hide() end --]]