WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Developer Chat (https://www.wowinterface.com/forums/forumdisplay.php?f=96)
-   -   Aura Buttons Repositioning (https://www.wowinterface.com/forums/showthread.php?t=31971)

wolvereness 04-19-10 12:30 AM

Aura Buttons Repositioning
 
Okay, so I've been tweaking nUI for the past week. I think I'm almost where I want, but I have still have a bit of a problem.

I'm using nUI_AuraButtons, because screen real estate > buff names. I know all the icons, and it's quicker if it's smaller anyway. Using this addon, the buffs / debuffs seem to be ordered the opposite direction that I think they need to be in, so I reversed the parameters on SortAuras, along with changing the orientation to start from the bottom left (right for debuffs) and work to the center + up.

I can't figure out how to get the pet / vehicle auras to sit on top of the player auras, in the same fashion that the current nUI release does.

I tried (in the pet section of AuraButtons.lua):
relative_to = "$parent_Aura2",

but that just throws an error, saying it's anchoring to itself. Aura1 is the player frame, so I'm not sure how to approach this. I'm getting the naming scheme / frame names and whatnot kinda slow (I'm not used to lua at all).

spiel2001 04-19-10 04:16 AM

No... Aura1 and Aura2 are not the player and pet aura frames. Aura1 and Aura2 are the help and harm auras for either the player or the pet depending on which set of auras you're looking at.

If you want to anchor the pet to the player, then you would have to set the "anchor_pt" value to nUI_UNITFRAME_{panel mode}.."_Aura2"

i.e. nUI_UNITFRAME_SOLO.."_Aura2" or nUI_UNITFRAME_PARTY.."_Aura2", etc

if you are going to treat all of your unit frames the same way, then you can get away with using the same anchor for all of the aura buttons.

wolvereness 05-03-10 01:03 PM

Here's what I got, and it seems to float above the friendly buffs. I'd like to know if there's a way to make the pet/vehicle buffs sit right on top of the highest friendly buff currently active, like the default implementation. In the default implementation, it's a "$parent_Aura2", but that throws an anchoring to self error when plugged into the AuraButtons addon.
Code:

local unit_skins =
{
        [nUI_UNITSKIN_SOLOPET]    = "PetAuras",
        [nUI_UNITSKIN_SOLOPLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_SOLOTARGET]  = "TargetAuras",
        [nUI_UNITSKIN_SOLOVEHICLE] = "VehicleAuras",
       
        [nUI_UNITSKIN_PARTYPET]    = "PetAuras",
        [nUI_UNITSKIN_PARTYPLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_PARTYTARGET]  = "TargetAuras",
        [nUI_UNITSKIN_PARTYVEHICLE] = "VehicleAuras",
       
        [nUI_UNITSKIN_RAID10PET]    = "PetAuras",
        [nUI_UNITSKIN_RAID10PLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_RAID10TARGET]  = "TargetAuras",
        [nUI_UNITSKIN_RAID10VEHICLE] = "VehicleAuras",
       
        [nUI_UNITSKIN_RAID15PET]    = "PetAuras",
        [nUI_UNITSKIN_RAID15PLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_RAID15TARGET]  = "TargetAuras",
        [nUI_UNITSKIN_RAID15VEHICLE] = "VehicleAuras",
       
        [nUI_UNITSKIN_RAID20PET]    = "PetAuras",
        [nUI_UNITSKIN_RAID20PLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_RAID20TARGET]  = "TargetAuras",
        [nUI_UNITSKIN_RAID20VEHICLE] = "VehicleAuras",
       
        [nUI_UNITSKIN_RAID25PET]    = "PetAuras",
        [nUI_UNITSKIN_RAID25PLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_RAID25TARGET]  = "TargetAuras",
        [nUI_UNITSKIN_RAID25VEHICLE] = "VehicleAuras",
       
        [nUI_UNITSKIN_RAID40PET]    = "PetAuras",
        [nUI_UNITSKIN_RAID40PLAYER]  = "PlayerAuras",
        [nUI_UNITSKIN_RAID40TARGET]  = "TargetAuras",
        [nUI_UNITSKIN_RAID40VEHICLE] = "VehicleAuras",       
};

local aura_layouts =
{
        ["PetAuras"] =
        {
                anchor =
                {
                        anchor_pt  = "BOTTOMLEFT",
                        relative_to = "nUI_SoloUnit_Player_Aura2",
                        relative_pt = "TOPLEFT",
                        xOfs        = 0,
                        yOfs        = 0,
                        [[--
                        anchor_pt        = "BOTTOMLEFT",
                        relative_to      = "nUI_Dashboard",
                        relative_pt      = "CENTER",
                        xOfs            = -1270,
                        yOfs            = 170,
                        --]]
                },               
                options =
                {
                        enabled          = true,
                        size            = 45,
                        strata          = nil,
                        level            = 1,
                       
                        aura_type        = "help",
                        origin          = "BOTTOMLEFT",
                        player_auras    = false,
                        dispellable      = false,
                        horizontal      = true,
                        highlight_player = true,
                        aura_types      = false,
                        cooldown_anim    = false,
                        flash_expire    = true,
                        clickable        = true,
                        rows            = 4,
                        cols            = 5,
                        expire_time      = 10,
                        hGap            = 5,
                        vGap            = 25,

                        count =
                        {
                                enabled    = true,
                                justifyH    = "CENTER",
                                justifyV    = "MIDDLE",
                                anchor_pt  = "CENTER",
                                relative_pt = "CENTER",
                                xOfs        = 0,
                                yOfs        = 1,
                        },

                        timer =
                        {
                                enabled    = true,
                                fontsize    = 10.5,
                                justifyH    = "CENTER",
                                justifyV    = "BOTTOM",
                                anchor_pt  = "TOP",
                                relative_pt = "BOTTOM",
                                xOfs        = 0,
                                yOfs        = -1,
                        },
                },       
        },
        ["PlayerAuras"] =
        {
                anchor =
                {
                        anchor_pt        = "BOTTOMLEFT",
                        relative_to      = "nUI_Dashboard",
                        relative_pt      = "LEFT",
                        xOfs            = 0,
                        yOfs            = 170,
                        [[--
                        anchor_pt        = "BOTTOMRIGHT",
                        relative_to      = "nUI_Dashboard",
                        relative_pt      = "CENTER",
                        xOfs            = -420,
                        yOfs            = 170,
                        --]]
                },               
                options =
                {
                        enabled          = true,
                        size            = 45,
                        strata          = nil,
                        level            = 1,
                       
                        aura_type        = "help",
                        origin          = "BOTTOMLEFT",
                        player_auras    = false,
                        dispellable      = false,
                        horizontal      = true,
                        highlight_player = true,
                        aura_types      = false,
                        cooldown_anim    = false,
                        flash_expire    = true,
                        clickable        = true,
                        rows            = 4,
                        cols            = 10,
                        expire_time      = 10,
                        hGap            = 5,
                        vGap            = 25,

                        count =
                        {
                                enabled    = true,
                                justifyH    = "CENTER",
                                justifyV    = "MIDDLE",
                                anchor_pt  = "CENTER",
                                relative_pt = "CENTER",
                                xOfs        = 0,
                                yOfs        = 0,
                        },

                        timer =
                        {
                                enabled    = true,
                                fontsize    = 10.5,
                                justifyH    = "CENTER",
                                justifyV    = "BOTTOM",
                                anchor_pt  = "TOP",
                                relative_pt = "BOTTOM",
                                xOfs        = 0,
                                yOfs        = 0,
                        },
                },       
        },
        ["TargetAuras"] =
        {
                anchor =
                {
                        anchor_pt        = "BOTTOMRIGHT",
                        relative_to      = "nUI_Dashboard",
                        relative_pt      = "RIGHT",
                        xOfs            = 0,
                        yOfs            = 170,
                        [[--
                        anchor_pt        = "BOTTOMLEFT",
                        relative_to      = "nUI_Dashboard",
                        relative_pt      = "CENTER",
                        xOfs            = 420,
                        yOfs            = 170,--]]
                },               
                options =
                {
                        enabled          = true,
                        size            = 45,
                        strata          = nil,
                        level            = 1,
                       
                        aura_type        = "help",
                        origin          = "BOTTOMRIGHT",
                        player_auras    = false,
                        dispellable      = false,
                        horizontal      = true,
                        highlight_player = true,
                        aura_types      = false,
                        cooldown_anim    = false,
                        flash_expire    = true,
                        clickable        = true,
                        rows            = 4,
                        cols            = 10,
                        expire_time      = 10,
                        hGap            = 5,
                        vGap            = 25,

                        count =
                        {
                                enabled    = true,
                                justifyH    = "CENTER",
                                justifyV    = "MIDDLE",
                                anchor_pt  = "CENTER",
                                relative_pt = "CENTER",
                                xOfs        = 0,
                                yOfs        = 0,
                        },

                        timer =
                        {
                                enabled    = true,
                                fontsize    = 10.5,
                                justifyH    = "CENTER",
                                justifyV    = "BOTTOM",
                                anchor_pt  = "TOP",
                                relative_pt = "BOTTOM",
                                xOfs        = 0,
                                yOfs        = 0,
                        },
                },       
        },
        ["VehicleAuras"] =
        {
                anchor =
                {
                        anchor_pt  = "BOTTOMLEFT",
                        relative_to = "nUI_SoloUnit_Player_Aura2",
                        relative_pt = "TOPLEFT",
                        xOfs        = 0,
                        yOfs        = 0,
                        [[--
                        anchor_pt        = "BOTTOMLEFT",
                        relative_to      = "nUI_Dashboard",
                        relative_pt      = "CENTER",
                        xOfs            = -1270,
                        yOfs            = 170,
                        --]]
                },               
                options =
                {
                        enabled          = true,
                        size            = 45,
                        strata          = nil,
                        level            = 1,
                       
                        aura_type        = "help",
                        origin          = "BOTTOMLEFT",
                        player_auras    = false,
                        dispellable      = false,
                        horizontal      = true,
                        highlight_player = true,
                        aura_types      = false,
                        cooldown_anim    = false,
                        flash_expire    = true,
                        clickable        = true,
                        rows            = 4,
                        cols            = 5,
                        expire_time      = 10,
                        hGap            = 5,
                        vGap            = 25,

                        count =
                        {
                                enabled    = true,
                                justifyH    = "CENTER",
                                justifyV    = "MIDDLE",
                                anchor_pt  = "CENTER",
                                relative_pt = "CENTER",
                                xOfs        = 0,
                                yOfs        = 1,
                        },

                        timer =
                        {
                                enabled    = true,
                                fontsize    = 10.5,
                                justifyH    = "CENTER",
                                justifyV    = "BOTTOM",
                                anchor_pt  = "TOP",
                                relative_pt = "BOTTOM",
                                xOfs        = 0,
                                yOfs        = -1,
                        },
                },       
        },
};

local frame = CreateFrame( "Frame", "nUI_AuraButtons", UIParent );

local function onEvent()

        for skin in pairs( unit_skins ) do
                if nUI_UnitSkins[skin] then
                        nUI_UnitSkins[skin].elements["Aura"][2] = aura_layouts[unit_skins[skin]];
                        nUI_UnitSkins[skin].elements["Label"][2] = nil;
                end
        end
       
end

frame:SetScript( "OnEvent", onEvent );
frame:RegisterEvent( "VARIABLES_LOADED" );

On another note, you gonna make an announcement when one of the releases is 'stable' (or stable until patch)?


All times are GMT -6. The time now is 10:30 PM.

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