Close
Showing results 1 to 10 of 22

Threaded View

  1. #1

    Default Pitbull4 + custom group

    Code & Download UPDATED (23.02.2011)
    In search for a nice addon which support custom group (if your group splitted up in bgs or raids) i modified my pitbull4 (i dont like grid).
    I am a newbie @ lua, but this modifications work for me
    Pitbull-Version: v4.0.0-beta25

    -----------------------------

    You can download the code from here: http://tinyurl.com/y4xspgl (tinyurl, cuz i dont like to be existent for thousand years in searchengines)
    You only have to replace the names of your toons in PitBull4\GroupHeader.lua on line 311

    -----------------------------

    ... Or you can edit the pitbull code for yourself:


    File: PitBull4\Options\Units.lua
    search for:
    Code:
    MAINTANK = L["Main tanks"],


    add a line below:

    Code:
    MULTIBOX = L["Multibox"],
    -----------------------------

    search for:
    Code:
    if start == 'MAINTANK' or start == 'MAINASSIST' then
    replace with:
    Code:
    if start == 'MAINTANK' or start == 'MULTIBOX' or start == 'MAINASSIST' then
    -----------------------------



    File: PitBull4\GroupHeader.lua:

    search for:
    Code:
    local tank_list = {}
    local function get_main_tank_name_list()
        local main_tanks
        if oRA3 then
            main_tanks = oRA3:GetSortedTanks()
        elseif oRA then
            main_tanks = oRA.maintanktable
        else
            main_tanks = CT_RA_MainTanks
        end
        if main_tanks then
            wipe(tank_list)
            for i = 1, 10 do
                local v = main_tanks[i]
                if v then
                    tank_list[#tank_list+1] = v
                end
            end
            local s = table.concat(tank_list, ',')
            if s ~= "" then
                return s, #tank_list
            end
        end
        if PitBull4.leaving_world or not UnitInRaid("player") or not UnitInParty("player") then
            -- Not in a raid or a party, so no main tank list.  We have
            -- to bail out here becuase WoW whines with a You are not in a party
            -- message to the user now.  /sigh
            return nil, 0
        else
            return nil, count_returns(GetPartyAssignment("MAINTANK"))
        end
    end
    add this code below:
    Code:
    -- multibox group
    local multibox_list = {}
    local function get_multibox_name_list()
    local multibox_units = { UnitName("Reyleniken"),UnitName("Reyvilan"),UnitName("Reynohen"),UnitName("Reyjouzyn"),UnitName("Reyrazchak")}
    
    
    if multibox_units then
        wipe(multibox_list)
            for i = 1, 5 do
                local v = multibox_units[i]
                if v then
                    multibox_list[#multibox_list+1] = v
                end
            end
            local s = table.concat(multibox_list, ',')
            if s ~= "" then
                return s, #multibox_list
            end
        end
        if PitBull4.leaving_world or not UnitInRaid("player") or not UnitInParty("player") then
            -- Not in a raid or a party, so no main tank list. We have
            -- to bail out here becuase WoW whines with a You are not in a party
            -- message to the user now. /sigh
            return nil, 0
        else
            return nil, count_returns(GetPartyAssignment("MULTIBOX"))
        end
    end


    -----------------------------

    Search for:
    Code:
        if group_filter == "MAINTANK" then
            name_list = get_main_tank_name_list()
        end


    add this code below:

    Code:
        if group_filter == "MULTIBOX" then
            name_list = get_multibox_name_list()
        end


    -----------------------------

    search for:
    Code:
    if start == "MAINTANK" or start == "MAINASSIST" then
    replace with:
    Code:
    if start == "MAINTANK" or start == "MULTIBOX" or start == "MAINASSIST" then
    -----------------------------



    File: PitBull4\Options\Units.lua

    search for:
    Code:
                    disabled = disabled,
            hidden = function(info)
                local db = get_group_db()
                
                local unit_group = db.unit_group
                local party_based = unit_group:sub(1, 5) == "party"
                
                 return party_based -- only show in raid
            end
    replace with:
    Code:
            disabled = disabled,
            hidden = function(info)
                local db = get_group_db()
                
                local unit_group = db.unit_group
                local party_based = unit_group:sub(1, 5) == "party"
                
                 return -- only show in raid
            end
    -----------------------------

    File: PitBull4\GroupHeader.lua:
    search for:
    Code:
    local group_filter = not party_based and group_db.group_filter or nil


    replace with:
    Code:
    local group_filter = group_db.group_filter or nil
    -----------------------------




    File: PitBull4\Main.lua

    add somewhere in the code (maybe line 1149):
    Code:
    function refreshMultiboxingList_OnEvent()
            for header in PitBull4:IterateHeadersForSuperUnitGroup("raid") do
                local group_db = header.group_db
                if group_db and group_db.group_filter == "MULTIBOX" then
                    header:RefreshGroup()
                end
            end    
            for header in PitBull4:IterateHeadersForSuperUnitGroup("party") do
                local group_db = header.group_db
                if group_db and group_db.group_filter == "MULTIBOX" then
                    header:RefreshGroup()
                end
            end            
    end
    
    local MB_frame_party = CreateFrame("Frame","refreshMultiboxingList",UIParent)
    MB_frame_party:SetScript("OnEvent", refreshMultiboxingList_OnEvent)
    MB_frame_party:RegisterEvent("PARTY_MEMBERS_CHANGED")
    
    local MB_frame_raid = CreateFrame("Frame","refreshMultiboxingList",UIParent)
    MB_frame_raid:SetScript("OnEvent", refreshMultiboxingList_OnEvent)
    MB_frame_raid:RegisterEvent("RAID_ROSTER_UPDATE")
    ------------------------------

    File: PitBull4\GroupHeader.lua:
    search for:
    Code:
            if party_based then
                self.super_unit_group = "party"
                self.unitsuffix = unit_group:sub(6)
                self:SetAttribute("showRaid", nil)
                self:SetAttribute("showParty", true)
                self:SetAttribute("showPlayer", include_player and true or nil)
                self:SetAttribute("showSolo", show_solo and true or nil)
                self:SetAttribute("groupFilter", nil)
            else
    replace with:
    Code:
            if party_based then
                self.super_unit_group = "party"
                self.unitsuffix = unit_group:sub(6)
                self:SetAttribute("showRaid", nil)
                self:SetAttribute("showParty", true)
                self:SetAttribute("showPlayer", include_player and true or nil)
                self:SetAttribute("showSolo", show_solo and true or nil)
                if name_list then
                print ("Namelist"..name_list)
                    self:SetAttribute("groupFilter", nil) 
                    self:SetAttribute("nameList", name_list)
                else
                    self:SetAttribute("groupFilter", group_filter)
                    self:SetAttribute("nameList", nil)
                end            
            else
    search for:
    Code:
    self:SetAttribute("sortMethod", sort_method)
    replace with:
    Code:
    sort_method = "NAMELIST"
    self:SetAttribute("sortMethod", sort_method)
    for Raid:
    1. in pitbull you choose on the left side "groups"
    2. create a new group and activate it, call it "multiboxing_raid" or smt
    3. set dropdown to "Raid"
    4. Choose Tab "Filter" turn on all raid types and set the dropdownbox to "Multibox"


    for party only(if you delete the code in options\units.lua i shown above)
    1. in pitbull you choose on the left side "groups", call it "multiboxing_party" or smt
    2. create a new group and activate it (and: i prefer to disable the playerframe under the menue single units and turn on the playerframe in partymode)
    3. set dropdown to "Group"
    4. Choose Tab "Filter" turn on group and turn off all raidtypes and set the dropdownbox to "Multibox"


    There is 1 problem:
    If you form a raid, you wont get an update on multibox filtered raidframe until a player leave, join, switch to another group or you type /reloadui.
    But when the raidframes appears no further issues are present.
    Last edited by Feehza : 02-23-2011 at 06:54 PM

Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •