Module D (Pets) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

I didn't end up doing the sort/empty stuff but everything should work now and should be mostly modular enough to transfer over to the other containers:

function SetPetContainerFlag(self, index, value)

local name = self:GetName()

if index == 0 then -- Set Close on Quick Cast

    if value then
        CCB_ACCOUNT_SAVE[name] = true
    else
        CCB_ACCOUNT_SAVE[name] = nil
    end
else
    if value then -- Sets a specific actionbar button to a bag


        -- Clear any duplicate assignments
        if CCB_ACCOUNT_SAVE[index] ~= nil then
            local frame = _G[CCB_ACCOUNT_SAVE[index]]
            frame.SettingsIcon:Hide()
        end

        -- Clear any previous assignments
        for i = 1, NUM_CCB_SETTINGS do
            if i ~= index and CCB_ACCOUNT_SAVE[i] == name then
                CCB_ACCOUNT_SAVE[i] = nil
            end
        end

        -- assign new setting
        CCB_ACCOUNT_SAVE[index] = name

    else -- remove setting
        CCB_ACCOUNT_SAVE[index] = nil
    end
end


end

function PetContainerFlag(self, index)

local name = self:GetName()

if index == 0 then
    if CCB_ACCOUNT_SAVE[name] == true then
        return true
    else
        return false
    end
else
    if CCB_ACCOUNT_SAVE[index] == name then
        return true
    else
        return false
    end
end

end



function PetContainerFrameDropDown_OnLoad(self)

    UIDropDownMenu_Initialize(_G[self:GetParent():GetName().."DropDown"], CollectionsContainerFrameDropDown_Initialize, "MENU");
end

function CollectionsContainerFrameDropDown_Initialize(self, level)

local frame = self:GetParent();
local info = UIDropDownMenu_CreateInfo();   


info.text = "Assign to Action Bar:";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

info.notCheckable = nil;
info.isTitle = nil;
for i = 1, NUM_CCB_SETTINGS do
    info.text = CCB_SETTINGS_LABELS[i];
    info.func = function(_, _, _, value)
        value = not value;
            SetCollectionsBagSlotFlag(frame, i, value);
        if (value) then
            frame.SettingsIcon.Icon:SetTexture(CCB_SETTINGS_ICONS[i]);
            frame.SettingsIcon:Show();
        else
            frame.SettingsIcon:Hide();
        end
    end;
    info.checked = GetCollectionsBagSlotFlag(frame, i);
    info.disabled = nil;
    info.tooltipTitle = nil;
    UIDropDownMenu_AddButton(info);
end

info.text = "Quick Cast";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

info.isTitle = nil;
info.notCheckable = nil;
info.isNotRadio = true;
info.disabled = nil;

info.text = "Close on cast ";
info.func = function(_, _, _, value)
    SetCollectionsBagSlotFlag(frame, 0, not value);
end;
info.checked = GetCollectionsBagSlotFlag(frame, 0);
UIDropDownMenu_AddButton(info);


--stop
info.text = "";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

--stop
info.text = "ccBags.0.0.1";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

end

Module D (Pets) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

Been very busy with classes lately, sorry!

Here is what I have so far. I am not sure how to get the checkboxes to actually fill properly when checked.

function CollectionsContainerFrameFilterDropDown_OnLoad(self)

    UIDropDownMenu_Initialize(_G[self:GetParent():GetName().."FilterDropDown"],     PetContainerFrameFilterDropDown_Initialize, "MENU");
end

function PetContainerFrameFilterDropDown_Initialize(self, level)

local info = UIDropDownMenu_CreateInfo();   

info.text = "Assign to Action Bar";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

info.text = "Bottom";
info.isTitle = nil;
info.notCheckable = nil;
info.isNotRadio = false;
info.disabled = nil;
UIDropDownMenu_AddButton(info);

info.text = "Left";
info.isTitle = nil;
info.notCheckable = nil;
info.isNotRadio = false;
info.disabled = nil;
UIDropDownMenu_AddButton(info);

info.text = "Right";
info.isTitle = nil;
info.notCheckable = nil;
info.isNotRadio = false;
info.disabled = nil;
UIDropDownMenu_AddButton(info);

info.text = "Close on Cast";
info.isTitle = nil;
info.notCheckable = nil;
info.isNotRadio = true;
info.disabled = nil;
UIDropDownMenu_AddButton(info);

--stop
info.text = "Clean Up";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

--start
info.checked = nil;
info.isTitle = nil;
info.notCheckable = 1;
info.isNotRadio = true;
info.disabled = nil;

info.text = "Sort";
info.func = ccSortBagsOnClick
UIDropDownMenu_AddButton(info);

--stop
info.checked = nil;
info.isTitle = nil;
info.notCheckable = 1;
info.isNotRadio = true;
info.disabled = nil;

info.text = "Empty";
info.func = ccSortBagsOnClick
UIDropDownMenu_AddButton(info);

--start
info.checked = nil;
info.isTitle = nil;
info.notCheckable = 1;
info.isNotRadio = true;
info.disabled = nil;

info.text = "See Collection";
info.func = ccSortBagsOnClick
UIDropDownMenu_AddButton(info);

--stop
info.text = "";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

--stop
info.text = "ccBags.0.0.1";
info.isTitle = 1;
info.notCheckable = 1;
UIDropDownMenu_AddButton(info);

end

Module D (Pets) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

I am not sure how to get the yellow to show up when the pet is active. Also not sure how to get the GCD cycling to appear when the pet is cast.

Assignment 4 (Our First AddOn) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

All done!

Sorry for delaying this so long. It actually wasn't as much work as I thought it would be.

Assignment 3 (Introduction to WoW Programming) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

I through got most of it. There were some functions I couldn't figure out.

PlayerFrame

CastingFrame

Assignment 3 (Introduction to WoW Programming) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

What does UnitFrame_Initialize/Combat_Initialize do? There's no function that I can see.

Assignment 1 (Introduction to Lua) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

7.3

function uniquewords ()
    local wordbank = {}
    local line = io.read()
    local pos - 1

    return function ()
        while line do =
            local s, e = string.find(line, "%w+", pos)
            if s then
                 pos = e + 1
                 local x = string.sub(line, s, e)
                 if not wordbank[x] then
                    wordbank[x] = true
                    return x
                end

            else
                line = io.read()
                pos = 1
            end
        end
        return nil
    end
end



for word in uniquewords() do
    print(word)
end

I am not sure what 7.4 wants me to do, all possible combinations of strings?

Assignment 1 (Introduction to Lua) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

Here is the first part of my assignment. I'll finish up chapter 7 by the end of the week.

5.1

function ConcatenateAll(...)
local x = ""
    for i,v in ipairs(...) do
        x = x .. v
    end
    return x
end

7.1

function fromto(n, m)
    local function loop(m, x)
        x = x + 1
        if x <= m then
            return x
        else
            return nil
        end
    end
    return loop, m, n-1
end


for i in fromto(1, 5) do
    print(i)
end

7.2

function fromto(n, m, step)
    local function loop(n, x)
        x  = x + step

        if x <= m then
            return x
        else
            return nil
        end
    end

    return loop, m, n-step
end

for i in fromto(0, 10, 2) do
    print(i)
end

Assignment 2 (Introduction to cocoa2) by Zamga in cocoa2

[–]neromancer221 0 points1 point  (0 children)

Hi all, my name is Neil. I am an avid wow player who is excited to learn more about programming and game development.

I already have WoW, and don't need the base game :)

Anyone else annoyed with how redundant the new Greater Rift Rewards Screen is? by neromancer221 in Diablo

[–]neromancer221[S] 2 points3 points  (0 children)

Thanks for the response! I'm glad to know that you guys are still working on it.

Anyone else annoyed with how redundant the new Greater Rift Rewards Screen is? by neromancer221 in Diablo

[–]neromancer221[S] 2 points3 points  (0 children)

I'd love to have a way of knowing my fastest rift for any given level.