• 0

    posted a message on Unofficial oUF - methods used for layouts

    EDIT: @ 8izips: This works - but I need to ReloadUI to get it to change - is this the expected behavior or should it turn them on/off instantly?


    if you add event, it will work instantly.
    This event is called when blizzard basic ui option (HIDE_PARTY_INTERFACE) is changed.

    partyToggle:RegisterEvent("CVAR_UPDATE")

    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Flarin //
    My layout includes a function that hides party pets and party targets. (2 pages ago)

    Party targets and pets are created by 'UnitWatch' function, so 'UnregisterUnitWatch' function should be used.


    local PartyTargetsCreated = false;
    local pts = {}
    local pets = {}
    function CreatePartyTargets()
    if not PartyTargetsCreated then
    --party targets position-------------------------------------------------------
    pts[1] = oUF:Spawn("party1target", "oUF_Party1Target")
    pts[1]:SetPoint("TOPRIGHT", party, "TOPLEFT", -42, 0) --party target start position
    for i =2, 4 do
    pts[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    pts[i]:SetPoint("TOP", pts[i-1], "BOTTOM", 0, -59) ----gap between party targets
    end
    pets[1] = oUF:Spawn("partypet1", "oUF_PartyPet1")
    pets[1]:SetPoint("TOPRIGHT", party, "TOPLEFT", -42, -35) --party pets start position
    for i =2, 4 do
    pets[i] = oUF:Spawn("partypet"..i, "oUF_PartyPet"..i)
    pets[i]:SetPoint("TOP", pets[i-1], "BOTTOM", 0, -59) --gap between party pets
    end
    PartyTargetsCreated = true;
    end
    end

    function DeletePartyTargets()
    if PartyTargetsCreated then
    for i = 1, 4 do
    UnregisterUnitWatch(pts[i]);
    pts[i]:Hide();
    UnregisterUnitWatch(pets[i]);
    pets[i]:Hide();
    end
    PartyTargetsCreated = false;
    end
    end

    local partyToggle = CreateFrame("Frame")
    partyToggle:SetScript("OnEvent", function(self)
    if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED")
    else self:UnregisterEvent("PLAYER_REGEN_ENABLED")
    if(HIDE_PARTY_INTERFACE=="1" and GetNumRaidMembers() > 5) then
    party:Hide()
    DeletePartyTargets()
    elseif (GetNumPartyMembers() > 0) then
    party:Show()
    CreatePartyTargets()
    end
    end
    end)

    partyToggle:RegisterEvent("PARTY_MEMBERS_CHANGED")
    partyToggle:RegisterEvent("PARTY_LEADER_CHANGED")
    partyToggle:RegisterEvent("RAID_ROSTER_UPDATE")
    partyToggle:RegisterEvent("PLAYER_LOGIN")
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Moon Witch //
    I downloaded your code and tested it.

    The cause of not showing was ppp. (maybe)
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Moon Witch //
    hmm
    How about moving 'SetWidth's into 'func' function?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I think that it's based on oUF_Ammo code.

    units: Player, Target, Tot, Totot, Pet, Pet target, Focus, Focus Target, Party, Party pet, Party target
    lib: mobhealth 4.0 included
    supporting module: oUF_Banzai, oUF_PowerSpark, oUF_DruidMana(not tested)
    supports 'hide party in raid?' basic ui option (UnregisterUnitWatch api function used for not disappearing problem of partys target and party pets)

    I'm using OmniCC for cooldown text.
    Posted in: Unit Frames
  • To post a comment, please or register a new account.