Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Arena Frame Mods
- LoadAddOn("Blizzard_ArenaUI")
- ArenaPrepFrames:SetAlpha(0)
- ArenaEnemyFrames:SetAlpha(0)
- -- Framerate
- ToggleFramerate()
- FramerateText:ClearAllPoints()
- FramerateText:SetPoint("BottomLeft")
- -- Portrait Text Hides
- PlayerHitIndicator:SetText(nil)
- PlayerHitIndicator.SetText = function() end
- PetHitIndicator:SetText(nil)
- PetHitIndicator.SetText = function() end
- -- Hide Player Combo Point Frame
- -- (For Combo Point Location 1 + Easy Frames)
- ComboPointPlayerFrame.Show=function() return end
- -- Hide Blizzard Art Bar
- for i,v in pairs({
- FramerateLabel,
- StanceBarLeft,
- StanceBarMiddle,
- StanceBarRight,
- SlidingActionBarTexture0,
- SlidingActionBarTexture1,
- MainMenuBarArtFrameBackground,
- MicroButtonAndBagsBar.MicroBagBar,
- MainMenuBarArtFrame.LeftEndCap,
- MainMenuBarArtFrame.RightEndCap,
- }) do
- v:SetAlpha(0)
- end
- -- Darken Textures
- for i,v in pairs({
- MirrorTimer1Border,
- MirrorTimer2Border,
- MirrorTimer3Border,
- TargetFrameTextureFrameTexture,
- FocusFrameTextureFrameTexture,
- StatusTrackingBarManager.SingleBarLarge,
- StatusTrackingBarManager.SingleBarLargeUpper,
- StatusTrackingBarManager.SingleBarSmall,
- StatusTrackingBarManager.SingleBarSmallUpper,
- }) do
- v:SetVertexColor(.05, .05, .05)
- v.SetVertexColor = function() return end
- end
- -- MacroName + HotKey Hide
- local r={"Action", "MultiBarBottomLeft",
- "MultiBarBottomRight", "MultiBarRight", "MultiBarLeft"}
- for b=1,#r do
- for i=1,12 do
- _G[r[b].."Button"..i.."Name"]:SetAlpha(0)
- _G[r[b].."Button"..i.."HotKey"]:SetAlpha(0)
- end
- end
- for i=1,10 do
- _G["PetAction".."Button"..i.."HotKey"]:SetAlpha(0)
- end
- -- Casting Bar
- SBF={CastingBarFrame,TargetFrameSpellBar,FocusFrameSpellBar}
- for i,v in pairs(SBF) do
- v.Border:Hide()
- v.Text:ClearAllPoints()
- v.Text:SetPoint("Left",v)
- v.Text:SetFont(STANDARD_TEXT_FONT,10,"OUTLINE")
- v:SetSize(208,21)
- v.Icon:Show()
- v.Icon:SetSize(25,25)
- v.Icon:SetPoint("RIGHT",v,30,0)
- v:HookScript("OnShow",function (self)
- if self.BorderShield then
- self.BorderShield:SetSize(273,65)
- self.BorderShield:ClearAllPoints()
- self.BorderShield:SetPoint("CENTER",self,5,0)
- end
- end)
- v.Flash.Show=function() return end
- v.timer=v:CreateFontString(nil)
- v.timer:SetFont(STANDARD_TEXT_FONT,10,"OUTLINE")
- v.timer:SetPoint("Right", v)
- v:HookScript("OnUpdate",function(self)
- self.timer:SetText(format("%.1f/%.1f", max(self.value, 0), self.maxValue))
- end)
- end
- CBF={CastingBarFrame}
- for i,v in pairs(CBF) do
- v:SetSize(230,28)
- v.Icon:SetSize(33,33)
- v.Icon:SetPoint("RIGHT",v,40,0)
- v.Text:SetPoint("Left",v)
- v.Text:SetFont(STANDARD_TEXT_FONT,12,"OUTLINE")
- v.timer:SetFont(STANDARD_TEXT_FONT,12,"OUTLINE")
- end
- TFSB={TargetFrameSpellBar,FocusFrameSpellBar}
- for i,v in pairs(TFSB) do
- v:HookScript("OnShow",function (self)
- Target_Spellbar_AdjustPosition(self)
- end)
- end
- function Target_Spellbar_AdjustPosition(self)
- local parentFrame = self:GetParent();
- if ( self.boss ) then
- self:SetPoint("TOPLEFT", parentFrame, "BOTTOMLEFT", 5, 10 );
- elseif ( parentFrame.haveToT ) then
- if ( parentFrame.buffsOnTop or parentFrame.auraRows <= 1 ) then
- self:SetPoint("TOPLEFT", parentFrame, "BOTTOMLEFT", 5, -21 );
- else
- self:SetPoint("TOPLEFT", parentFrame.spellbarAnchor, "BOTTOMLEFT", 0, -15);
- end
- elseif ( parentFrame.haveElite ) then
- if ( parentFrame.buffsOnTop or parentFrame.auraRows <= 1 ) then
- self:SetPoint("TOPLEFT", parentFrame, "BOTTOMLEFT", 5, -5 );
- else
- self:SetPoint("TOPLEFT", parentFrame.spellbarAnchor, "BOTTOMLEFT", 0, -15);
- end
- else
- if ( (not parentFrame.buffsOnTop) and parentFrame.auraRows > 0 ) then
- self:SetPoint("TOPLEFT", parentFrame.spellbarAnchor, "BOTTOMLEFT", 0, -15);
- else
- self:SetPoint("TOPLEFT", parentFrame, "BOTTOMLEFT", 5, 7 );
- end
- end
- end
- -- Range Indicator
- hooksecurefunc("ActionButton_OnEvent",function(self, event, ...)
- if ( event == "PLAYER_TARGET_CHANGED" ) then
- self.newTimer = self.rangeTimer
- end
- end)
- hooksecurefunc("ActionButton_UpdateUsable",function(self)
- local icon = _G[self:GetName().."Icon"]
- local valid = IsActionInRange(self.action)
- if ( valid == false ) then
- icon:SetVertexColor(1, 0, 0)
- end
- end)
- hooksecurefunc("ActionButton_OnUpdate",function(self, elapsed)
- local rangeTimer = self.newTimer
- if ( rangeTimer ) then
- rangeTimer = rangeTimer - elapsed
- if ( rangeTimer <= 0 ) then
- ActionButton_UpdateUsable(self)
- rangeTimer = TOOLTIP_UPDATE_TIME
- end
- self.newTimer = rangeTimer
- end
- end)
- -- Frame Class Colors
- local function check(self)
- local unit = self.unit
- if not (unit == "target" or unit == "focus") then return end
- if UnitIsPlayer(unit) then
- local _, class = UnitClass(unit)
- local c = RAID_CLASS_COLORS[class]
- _G[(unit=="target" and "Target" or "Focus").."FrameNameBackground"]:SetVertexColor(c.r, c.g, c.b)
- end
- end
- hooksecurefunc("TargetFrame_CheckFaction", check)
- hooksecurefunc("TargetFrame_CheckClassification", check)
- TargetFrameNameBackground:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
- FocusFrameNameBackground:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
- -- Spellsteal Border
- hooksecurefunc("TargetFrame_UpdateAuras", function(s)
- for i = 1, MAX_TARGET_BUFFS do
- _, _, ic, _, dT = UnitBuff(s.unit, i)
- if(ic and (not s.maxBuffs or i<=s.maxBuffs)) then
- fS=_G[s:GetName()..'Buff'..i..'Stealable']
- if(UnitIsEnemy(PlayerFrame.unit, s.unit) and dT=='Magic') then
- fS:Show()
- else
- fS:Hide()
- end
- end
- end
- end)
- -- Health Bar Text
- local FrameList = {"Player", "Target", "Focus"}
- local function UpdateHealthValues(statusFrame, textString, value, valueMin, valueMax)
- for _, unit in pairs(FrameList) do
- if unit.."FrameHealthBar" == statusFrame:GetName() then
- textString:SetText((textString:GetText() or "")..format(" (%.0f%%)", value/valueMax*100))
- end
- end
- end
- hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UpdateHealthValues)
- -- Combat Indicator
- CTT=CreateFrame("Frame")
- CTT:SetParent(TargetFrame)
- CTT:SetPoint("Bottom",TargetFrame,40,24)
- CTT:SetSize(18,18)
- CTT.t=CTT:CreateTexture(nil,BORDER)
- CTT.t:SetAllPoints()
- CTT.t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")
- CTT:Hide()
- local function FrameOnUpdate(self) if UnitAffectingCombat("target") then self:Show() else self:Hide() end end
- local g = CreateFrame("Frame")
- g:SetScript("OnUpdate", function(self) FrameOnUpdate(CTT) end)
- CFT=CreateFrame("Frame")
- CFT:SetParent(FocusFrame)
- CFT:SetPoint("Bottom",FocusFrame,40,24)
- CFT:SetSize(18,18)
- CFT.t=CFT:CreateTexture(nil,BORDER)
- CFT.t:SetAllPoints()
- CFT.t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")
- CFT:Hide()
- local function FrameOnUpdate(self) if UnitAffectingCombat("focus") then self:Show() else self:Hide() end end
- local g = CreateFrame("Frame")
- g:SetScript("OnUpdate", function(self) FrameOnUpdate(CFT) end)
- -- Autosell and Repair
- local g = CreateFrame("Frame")
- g:RegisterEvent("MERCHANT_SHOW")
- g:SetScript("OnEvent", function()
- local bag, slot
- for bag = 0, 4 do
- for slot = 0, GetContainerNumSlots(bag) do
- local link = GetContainerItemLink(bag, slot)
- if link and (select(3, GetItemInfo(link)) == 0) then
- UseContainerItem(bag, slot)
- end
- end
- end
- if(CanMerchantRepair()) then
- local cost = GetRepairAllCost()
- if cost > 0 then
- local money = GetMoney()
- if IsInGuild() then
- local guildMoney = GetGuildBankWithdrawMoney()
- if guildMoney > GetGuildBankMoney() then
- guildMoney = GetGuildBankMoney()
- end
- if guildMoney > cost and CanGuildBankRepair() then
- RepairAllItems(1)
- print(format("|cfff07100Repair cost covered by G-Bank: %.1fg|r", cost * 0.0001))
- return
- end
- end
- if money > cost then
- RepairAllItems()
- print(format("|cffead000Repair cost: %.1fg|r", cost * 0.0001))
- else
- print("Not enough gold to cover the repair cost.")
- end
- end
- end
- end)
- -- Raid Profiles Auto-Activate
- local ARENA_PROFILE = "Primary";
- local BG_PROFILE = "Secondary";
- local PARTY_PROFILE = "Primary"
- local RAID_25_PROFILE = "Tertiary";
- local RAID_40_PROFILE = "Quaternary";
- function switchProfile()
- if InCombatLockdown() == false then --This should fix in-combat issues.
- isArena, _ = IsActiveBattlefieldArena();
- if isArena == true then --**IN ARENA**.
- if GetActiveRaidProfile() ~= ARENA_PROFILE then --if arena profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(ARENA_PROFILE); --...set arena profile.
- print("Activated RaidProfile: "..ARENA_PROFILE)
- end
- elseif InActiveBattlefield() then --**IN BG**.
- if GetActiveRaidProfile() ~= BG_PROFILE then --if battleground profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(BG_PROFILE); --...set battleground profile.
- print("Activated RaidProfile: "..BG_PROFILE)
- end
- elseif GetNumGroupMembers(LE_PARTY_CATEGORY_INSTANCE) > 0 then --**IN INSTANCE GROUP**
- if GetNumGroupMembers(LE_PARTY_CATEGORY_INSTANCE) > 25 then
- if GetActiveRaidProfile() ~= RAID_40_PROFILE then -- if Raid40 profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(RAID_40_PROFILE); --...set raid40 profile.
- print("Activated RaidProfile: "..RAID_40_PROFILE)
- end
- elseif GetNumGroupMembers(LE_PARTY_CATEGORY_INSTANCE) > 5 then
- if GetActiveRaidProfile() ~= RAID_25_PROFILE then --if Raid25 profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(RAID_25_PROFILE); --...set raid25 profile.
- print("Activated RaidProfile: "..RAID_25_PROFILE)
- end
- else
- if GetActiveRaidProfile() ~= PARTY_PROFILE then --if Party profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(PARTY_PROFILE); --...set Party profile.
- print("Activated RaidProfile: "..PARTY_PROFILE)
- end
- end
- elseif GetNumGroupMembers(LE_PARTY_CATEGORY_HOME) > 0 then --**IN MANUAL GROUP**
- if GetNumGroupMembers(LE_PARTY_CATEGORY_HOME) > 25 then
- if GetActiveRaidProfile() ~= RAID_40_PROFILE then -- if Raid40 profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(RAID_40_PROFILE); --...set raid40 profile.
- print("Activated RaidProfile: "..RAID_40_PROFILE)
- end
- elseif GetNumGroupMembers(LE_PARTY_CATEGORY_HOME) > 5 then
- if GetActiveRaidProfile() ~= RAID_25_PROFILE then --if Raid25 profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(RAID_25_PROFILE); --...set raid25 profile.
- print("Activated RaidProfile: "..RAID_25_PROFILE)
- end
- else
- if GetActiveRaidProfile() ~= PARTY_PROFILE then --if Party profile is not active
- CompactUnitFrameProfiles_ActivateRaidProfile(PARTY_PROFILE); --...set Party profile.
- print("Activated RaidProfile: "..PARTY_PROFILE)
- end
- end
- end
- end
- end
- local f = CreateFrame("Frame")
- f:RegisterEvent("GROUP_ROSTER_UPDATE") --fires when player joins or leaves group
- f:RegisterEvent("PLAYER_REGEN_ENABLED") --fires when leaving combat
- f:SetScript("OnEvent",switchProfile);
- -- Snowfall KeyPress Visial
- local animationsCount, animations = 5, {}
- local animationNum = 1
- local frame, texture, alpha1, scale1, scale2, rotation2
- for i = 1, animationsCount do
- frame = CreateFrame("Frame")
- texture = frame:CreateTexture() texture:SetTexture('Interface\\Cooldown\\star4') texture:SetAlpha(0) texture:SetAllPoints() texture:SetBlendMode("ADD")
- animationGroup = texture:CreateAnimationGroup()
- alpha1 = animationGroup:CreateAnimation("Alpha") alpha1:SetFromAlpha(0) alpha1:SetToAlpha(1) alpha1:SetDuration(0) alpha1:SetOrder(1)
- scale1 = animationGroup:CreateAnimation("Scale") scale1:SetScale(1.0, 1.0) scale1:SetDuration(0) scale1:SetOrder(1)
- scale2 = animationGroup:CreateAnimation("Scale") scale2:SetScale(1.5, 1.5) scale2:SetDuration(0.3) scale2:SetOrder(2)
- rotation2 = animationGroup:CreateAnimation("Rotation") rotation2:SetDegrees(90) rotation2:SetDuration(0.3) rotation2:SetOrder(2)
- animations[i] = {frame = frame, animationGroup = animationGroup}
- end
- local AnimateButton = function(self)
- if not self:IsVisible() then return true end
- local animation = animations[animationNum]
- local frame = animation.frame
- local animationGroup = animation.animationGroup
- frame:SetFrameStrata("HIGH")
- frame:SetFrameLevel(20)
- frame:SetAllPoints(self)
- animationGroup:Stop()
- animationGroup:Play()
- animationNum = (animationNum % animationsCount) + 1
- return true
- end
- hooksecurefunc('MultiActionButtonDown', function(bname, id)
- AnimateButton(_G[bname..'Button'..id])
- end)
- hooksecurefunc('PetActionButtonDown', function(id)
- local button
- if PetActionBarFrame then
- if id > NUM_PET_ACTION_SLOTS then return end
- button = _G["PetActionButton"..id]
- if not button then return end
- end
- return
- AnimateButton(button)
- end)
- hooksecurefunc('ActionButtonDown', function(id)
- local button
- if C_PetBattles.IsInBattle() then
- if PetBattleFrame then
- if id > NUM_BATTLE_PET_HOTKEYS then return end
- button = PetBattleFrame.BottomFrame.abilityButtons[id]
- if id == BATTLE_PET_ABILITY_SWITCH then
- button = PetBattleFrame.BottomFrame.SwitchPetButton
- elseif id == BATTLE_PET_ABILITY_CATCH then
- button = PetBattleFrame.BottomFrame.CatchButton
- end
- if not button then return end
- end
- return
- end
- if OverrideActionBar and OverrideActionBar:IsShown() then
- if id > NUM_OVERRIDE_BUTTONS then return end
- button = _G["OverrideActionBarButton"..id]
- else
- button = _G["ActionButton"..id]
- end
- if not button then return end
- AnimateButton(button)
- end)
- -- Old AlternateManaBar Trigger
- local _, class = UnitClass("player")
- if class == "DRUID" then
- ADDITIONAL_POWER_BAR_NAME = "MANA";
- ADDITIONAL_POWER_BAR_INDEX = 0;
- function AlternatePowerBar_OnLoad(self)
- self.textLockable = 1;
- self.cvar = "playerStatusText";
- self.cvarLabel = "STATUS_TEXT_PLAYER";
- AlternatePowerBar_Initialize(self);
- TextStatusBar_Initialize(self);
- end
- function AlternatePowerBar_Initialize(self)
- if ( not self.powerName ) then
- self.powerName = ADDITIONAL_POWER_BAR_NAME;
- self.powerIndex = ADDITIONAL_POWER_BAR_INDEX;
- end
- self:RegisterEvent("UNIT_POWER");
- self:RegisterEvent("UNIT_MAXPOWER");
- self:RegisterEvent("PLAYER_ENTERING_WORLD");
- self:RegisterEvent("UNIT_DISPLAYPOWER");
- SetTextStatusBarText(self, _G[self:GetName().."Text"])
- local info = PowerBarColor[self.powerName];
- self:SetStatusBarColor(info.r, info.g, info.b);
- end
- function AlternatePowerBar_OnEvent(self, event, arg1)
- local parent = self:GetParent();
- if ( event == "UNIT_DISPLAYPOWER" ) then
- AlternatePowerBar_UpdatePowerType(self);
- elseif ( event=="PLAYER_ENTERING_WORLD" ) then
- AlternatePowerBar_UpdateMaxValues(self);
- AlternatePowerBar_UpdateValue(self);
- AlternatePowerBar_UpdatePowerType(self);
- elseif( (event == "UNIT_MAXPOWER") and (arg1 == parent.unit) ) then
- AlternatePowerBar_UpdateMaxValues(self);
- elseif ( self:IsShown() ) then
- if ( (event == "UNIT_POWER") and (arg1 == parent.unit) ) then
- AlternatePowerBar_UpdateValue(self);
- end
- end
- end
- function AlternatePowerBar_OnUpdate(self, elapsed)
- AlternatePowerBar_UpdateValue(self);
- end
- function AlternatePowerBar_UpdateValue(self)
- local currmana = UnitPower(self:GetParent().unit,self.powerIndex);
- self:SetValue(currmana);
- self.value = currmana
- end
- function AlternatePowerBar_UpdateMaxValues(self)
- local maxmana = UnitPowerMax(self:GetParent().unit,self.powerIndex);
- self:SetMinMaxValues(0,maxmana);
- end
- function AlternatePowerBar_UpdatePowerType(self)
- if ( (UnitPowerType(self:GetParent().unit) ~= self.powerIndex) and (UnitPowerMax(self:GetParent().unit,self.powerIndex) ~= 0) ) then
- self.pauseUpdates = false;
- self:Show();
- else
- self.pauseUpdates = true;
- self:Hide();
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement