WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF 7.0 Upgrade Guide (https://www.wowinterface.com/forums/showthread.php?t=55422)

p3lim 05-30-17 08:45 AM

oUF 7.0 Upgrade Guide
 
Upgrade Guide

Element name changes

Elements have since its inception used various names with no set standard.
In the 7.0 release we've standardized all the names, with the following changes:
  • DruidMana > AdditionalPower
  • AltPowerBar > AlternativePower
  • Assistant > AssistantIndicator
  • ClassIcons > ClassPower
  • Combat > CombatIndicator
  • HealPrediction > HealthPrediction
  • Leader > LeaderIndicator
  • LFDRole > GroupRoleIndicator
  • MasterLooter > MasterLooterIndicator
  • PhaseIcon > PhaseIndicator
  • PvP > PvPIndicator
  • QuestIcon > QuestIndicator
  • RaidRole > RaidRoleIndicator
  • ReadyCheck > ReadyCheckIndicator
  • Resting > RestingIndicator
  • ResurrectIcon > ResurrectIndicator
  • RaidIcon > RaidTargetIndicator
  • Threat > ThreatIndicator
Basically, any element that represented an icon or some other form of indicator now has the suffix "Indicator".
All other elements are named after a fixed convention as well, and should be followed in the future.

Element changes

Aside from additions followed in the major changelog below, here are the breaking changes for the 7.0 update:
  • AdditionalPower:
    • ".displayPairs" option was removed
  • AlternativePower:
    • ".colorTexture" option was removed (it was useless, see UnitAlternatePowerTextureInfo)
    • PostUpdate parameters changed:
      • from: (min, cur, max)
      • to: (unit, cur, min, max)
  • Auras:
    • ".owner" attribute was renamed ".caster"
  • Castbar:
    • ".interrupt" attribute removed in favor of ".notInterruptible"
    • ".castid" attribute renamed to ".castID"
  • ClassPower:
    • PostUpdate parameters changed:
      • from: (cur, max, hasMaxChanged, powerType, event)
      • to: (cur, max, hasMaxChanged, powerType)
  • HealthPrediction:
    • PostUpdate parameters changed:
      • from: (unit, overAbsorb, overHealAbsorb)
      • to: (unit, myIncomingHeal, otherIncomingHeal, absorb, healAbsorb, hasOverAbsorb, hasOverHealAbsorb)
  • Power:
    • PostUpdate parameters changed:
      • from: (unit, cur, max, min)
      • to: (unit, cur, min, max)
  • Stagger:
    • PostUpdate parameters changed:
      • from: (max, cur, perc, r, g, b)
      • to: (cur, max)
    • Element no longer exists for non-Monk players
Element removals

The "CPoints" element is gone in 7.0, in favor of "ClassPower" (formerly "ClassIcons").
We saw no point in keeping an element that provided the same features as another, so it was dropped.

p3lim 05-30-17 06:54 PM

Major changelog
  • The whole project has received new documentation which will eventually be wiki-fied.
  • Nameplates!
  • Cleaned up and standardized the whole codebase after a set codestyle.
  • New versioning system.

Additions:
  • Core: exposed the header visibility
  • Core: oUF:SpawnNamePlates method
  • AdditionalPower: Added ".UpdateColor" override
  • AlternativePower: "OverrideVisibility" override
  • AlternativePower: Default texture
  • Auras: Added ".disableMouse" option
  • Auras: Added ".numTotal" option to Auras sub-widget
  • Castbar: Added ".timeToHold" option
  • Castbar: Added (, spellID) parameter to PostCastStart, PostCastFailed, PostCastInterrupted, PostCastDelayed, PostChannelStart, PostChannelUpdate, PostChannelStop
  • Health: Added ".UpdateColor" override
  • HealthPrediction: Added ".overAbsorb" subwidget texture
  • HealthPrediction: Added ".overHealAbsorb" subwidget texture
  • Power: Added ".atlas" option
  • Power: Added ".tapped" attribute
  • Power: Added ".UpdateColor" override
  • Power: Added ".useAtlas" option
  • Runes: Added ".colorSpec" option
  • Runes: Added ".UpdateColor" override
  • Stagger: Added ".UpdateColor" override
  • Tags: Added 'powercolor' tag
Fixes:
  • Core: Pet frame now updating properly after entering/exiting a vehicle
  • Core: Fixed disabling of default 5th boss and arena frame
  • Core: Forcing the requirement of an event in "object:UpdateAllElements(event)"
  • Core: Set default frameStrata to "LOW" to avoid any overlapping with other UI windows
  • ClassPower: Fixed issue with vehicles
  • Castbar: Setting colors on SafeZone errors
  • Tags: 'difficulty' tag now scales properly with timewalking dungeons
  • Tags: 'difficulty' tag now works properly for players past level ~90
  • Health: Fixed issues with nil units (event bug introduced in 7.1)
  • RaidRoleIndicator: Fixed PostUpdate parameters
  • Auras: Fixed "ghosting" icons after disabling then re-enabling the element
  • Auras: Fixed icons not showing after disabling then re-enabling the element
Changes:
  • Totems: No longer have priories (old totem mechanics)
  • Totems: Not limited by game maximum totems, rather by amount of widgets created
  • Runes: Account for energized rune state
  • Castbar: Sets Failed/Interrupted text to the .Text subwidget
  • Auras: Updated UnitAura parameters to CustomFilter
  • PvPIndicator: Only showing mercenary state changes for players
Removals:
  • CPoints: Whole element
For the full changelog, please see the commit log.

lightspark 05-31-17 11:41 AM

oUF Nameplates Guide

Basics

You need to modify your style function for it to handle nameplates.

Here's an example style function:
Lua Code:
  1. oUF:RegisterStyle("YourStyle", function(frame, unit)
  2.     if unit == "player" then
  3.         -- your player-specific code here
  4.     elseif unit == "boss1" then
  5.         -- your boss1-specific code here
  6.     elseif unit:match("nameplate") then
  7.         -- health bar
  8.         local health = CreateFrame("StatusBar", nil, frame)
  9.         health:SetAllPoints()
  10.         health:SetStatusBarTexture("Interface\\BUTTONS\\WHITE8X8")
  11.         health.colorHealth = true
  12.         health.colorTapping = true
  13.         health.colorDisconnected = true
  14.         frame.Health = health
  15.  
  16.         -- frame background
  17.         local bg = frame:CreateTexture(nil, "BACKGROUND")
  18.         bg:SetAllPoints()
  19.         bg:SetColorTexture(0.2, 0.2, 0.2)
  20.  
  21.         -- set size and points
  22.         frame:SetSize(128, 16)
  23.         frame:SetPoint("CENTER", 0, 0)
  24.     end
  25. end)

One important thing to note here is that these nameplates will be parented to the Blizzard nameplate points on WorldFrame.
You can adjust the anchor however you'd like, but you'll have to do it in the style function as seen above.

Spawning nameplates is done like this:
Lua Code:
  1. oUF:SpawnNamePlates()
This function behaves much like oUF:SpawnHeader(), in the way that you only need to call it once to spawn all the nameplates.

oUF:SpawnNamePlates() takes three (optional) arguements:
  1. Name prefix
    • The default name is "oUF_YourStyleNameplate1", this argument will replace the "oUF_YourStyle" part of it.
  2. Callback function
    • This function will be called after a nameplate unit or the player's target has changed.
  3. List of nameplate-related CVars.

If you use oUF:Factory() or use multiple styles, you may want to call oUF:SetActiveStyle("YourStyle") first.

For more info, see code and documentation.

Important: Scaling

These nameplates are anchored to the default Blizzard nameplates, which in turn are anchored to WorldFrame.
This means that all nameplates are not affected by the global UI scale.
To change the scale, use frame:SetScale(scale) in the style function.

One thing to note is that the scaling is influenced by CVars, and we recommend "resetting" these, like so:

Lua Code:
  1. local cvars = {
  2.     -- important, strongly recommend to set these to 1
  3.     nameplateGlobalScale = 1,
  4.     NamePlateHorizontalScale = 1,
  5.     NamePlateVerticalScale = 1,
  6.     -- optional, you may use any values
  7.     nameplateLargerScale = 1,
  8.     nameplateMaxScale = 1,
  9.     nameplateMinScale = 1,
  10.     nameplateSelectedScale = 1,
  11.     nameplateSelfScale = 1,
  12. }
  13.  
  14. oUF:SpawnNamePlates(nil, nil, cvars)

Important: Protected Nameplates

oUF does not interact with forbidden nameplates (friendly nameplates in instances), which means you don't need to worry about avoiding these in your layout.


All times are GMT -6. The time now is 01:54 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI