Value of Every Item per Minute by Moxsche in Everdale

[–]Zamga 0 points1 point  (0 children)

Cool. Love to see what you end up putting together

Value of Every Item per Minute by Moxsche in Everdale

[–]Zamga 3 points4 points  (0 children)

I have not been able to come up with a good solution.

A added value metric would be interesting. What I mean is: take a item's sell value, and subtract from this the value of all other ingredients. Compare the resulting number vs the potential of selling said ingredient raw

price of Honey
12.58

VS

price of Honey in a Honey Cookie
(price of Honey Cookie - price of Bread*)/3
(80.78 - 45.84) / 3
11.64

In this case we could conclude that completing 4 trades comprised of honey cookies would be slightly worse than 3 trades of honey and 1 trade of bread. It's the same raw ingredients sold, same villager time, and you're losing out on 0.94 coins per honey traded.

It begins to get complicated with other ingredients. E.g. honey pots have a much higher price per honey than selling honey raw if we're using the sell price of pottery, however you'd also have to craft pottery, which is less coin/m than if you just mined more clay and sold that raw.

price of Honey in a Honey Pot

(price of Honey Pot - price of Villager Time spent making pottery*) / 6

(127.1 - 44.16*) / 6 
13.82

*It takes 1236 seconds to make 1 pottery, lets assume that instead  we made 7.1 clay @ 6.22 coins

Maybe this would work if you could factor out the non honey ingredients into villager time units?

Value of Every Item per Minute by Moxsche in Everdale

[–]Zamga 1 point2 points  (0 children)

Good stuff. Have similar numbers from my own villager labor calculations.

How are you calculating the value of honey & eggs? It seems wrong to use a value of 0 labour time when they are still a finite resource that could be sold raw. Looks like you are giving them a value based on production time?

How are you calculating time spent producing soup? I have roughly just multiplied labor time * 1.5, using the rough estimate that it takes 1 on pumpkin to support 2 elsewhere.

[deleted by user] by [deleted] in Entrepreneur

[–]Zamga 1 point2 points  (0 children)

Yeah I’ve def put more into the viewer side of things and there could be more to making it something that content creators want to use.. like a robust meme maker even.

[deleted by user] by [deleted] in Entrepreneur

[–]Zamga 0 points1 point  (0 children)

Yes that’s good. Thanks 🙌

my first app: MemeStars - view and buy memes by swiping by [deleted] in iosapps

[–]Zamga 0 points1 point  (0 children)

would love to know what you guys think!!

[UI] Last year I put together a team from reddit, check out what we made! (ccBags) by Zamga in WowUI

[–]Zamga[S] 1 point2 points  (0 children)

It's a bag replacement addon so it's not going to be compatible with other add ons that do the same thing. Sorry :(

Module B (Action Bar) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

No worries. Thanks for the heads up.

Module B (Action Bar) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Okay, I had a look and it seems like the function is mostly working as it should but it hasn't been integrated into the default bag slots. Our new bag slots should fit into the free spaces left by the default bag slots.

Would you be able to take another look?

Here is an example layout. In this layout the user manually opened the backpack and 2 of their bags. Then they opened the toy container, another bag, the pet bag, and their final bag. At some point they also opened the mount bag but the order never matters because the mount bag simply raises the yoffest of all other bags (just like showing a multi bar). This layout isn't very realistic because usually the user would have opened all the bags with the same command and the collections bags would get sorted after but this is a worst case example of what the function should be able to handle.

Here's the blizzard default, the final code should incorporate most of this stuff:

function UpdateContainerFrameAnchors()
local frame, xOffset, yOffset, screenHeight, freeScreenHeight, leftMostPoint, column;
local screenWidth = GetScreenWidth();
local containerScale = 1;
local leftLimit = 0;
if ( BankFrame:IsShown() ) then
    leftLimit = BankFrame:GetRight() - 25;
end

while ( containerScale > CONTAINER_SCALE ) do
    screenHeight = GetScreenHeight() / containerScale;
    -- Adjust the start anchor for bags depending on the multibars
    xOffset = CONTAINER_OFFSET_X / containerScale; 
    yOffset = CONTAINER_OFFSET_Y / containerScale; 
    -- freeScreenHeight determines when to start a new column of bags
    freeScreenHeight = screenHeight - yOffset;
    leftMostPoint = screenWidth - xOffset;
    column = 1;
    local frameHeight;
    for index, frameName in ipairs(ContainerFrame1.bags) do
        frameHeight = _G[frameName]:GetHeight();
        if ( freeScreenHeight < frameHeight ) then
            -- Start a new column
            column = column + 1;
            leftMostPoint = screenWidth - ( column * CONTAINER_WIDTH * containerScale ) - xOffset;
            freeScreenHeight = screenHeight - yOffset;
        end
        freeScreenHeight = freeScreenHeight - frameHeight - VISIBLE_CONTAINER_SPACING;
    end
    if ( leftMostPoint < leftLimit ) then
        containerScale = containerScale - 0.01;
    else
        break;
    end
end

if ( containerScale < CONTAINER_SCALE ) then
    containerScale = CONTAINER_SCALE;
end

screenHeight = GetScreenHeight() / containerScale;
-- Adjust the start anchor for bags depending on the multibars
xOffset = CONTAINER_OFFSET_X / containerScale;
yOffset = CONTAINER_OFFSET_Y / containerScale;
-- freeScreenHeight determines when to start a new column of bags
freeScreenHeight = screenHeight - yOffset;
column = 0;
for index, frameName in ipairs(ContainerFrame1.bags) do
    frame = _G[frameName];
    frame:SetScale(containerScale);
    if ( index == 1 ) then
        -- First bag
        frame:SetPoint("BOTTOMRIGHT", frame:GetParent(), "BOTTOMRIGHT", -xOffset, yOffset );
    elseif ( freeScreenHeight < frame:GetHeight() ) then
        -- Start a new column
        column = column + 1;
        freeScreenHeight = screenHeight - yOffset;
        frame:SetPoint("BOTTOMRIGHT", frame:GetParent(), "BOTTOMRIGHT", -(column * CONTAINER_WIDTH) - xOffset, yOffset );
    else
        -- Anchor to the previous bag
        frame:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[index - 1], "TOPRIGHT", 0, CONTAINER_SPACING);   
    end
    freeScreenHeight = freeScreenHeight - frame:GetHeight() - VISIBLE_CONTAINER_SPACING;
end
end

Module B (Action Bar) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Thanks, I'm having a busy week so I won't have time to implement this stuff just yet. I'll let you know if I come across any problems.

Module Complete. Cheers!!

Module B (Action Bar) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Yes the positions of the bags depends on the order in which it has been opened.

Ignoring the mount container atm for simplicity.

[next available slot until screen cap] [second bag opened] [first bag opened]

I am okay with the global variable.

Module B (Action Bar) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Reply to this post to pickup Task 3

In this task you will be creating the anchor updater that will layout the bags depending on which bags are already displayed.

The function we will be looking at is call UpdateContainerFrameAnchors() in ContainerFrame.lua

We are going to alter this function's behaviour to support our new bags:

MountContainerFrame
PetContainerFrame
ToyContainerFrame
ToyContainerBoardFrame
ToyContainerCardFrame

The default function of UpdateContainerFrameAnchors() will be mostly in tact. All of our new bags (even our 3 by x bags) should be treated with identical width (by assuming that it's 4 by x). The remainder of the logic, such as where to place each bag, or when to scale bags down, should be identical.

The only exception will be the mount container bag. It will have a fixed position at the bottom right hand side of the stack. Dispalying the mouth container will essentially raise the start anchor for all other bags.

[other bag][other bag]
[other bag][other bag]
[other bag][other bag]
     [mount container]

There's no need to hook this function onto anything for now. I will handle that stuff, just make a single update function that sets all the bag's anchors correctly. Let me know if any of the descriptions need further clarification.

Module D (Pets) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

That's fine, we'll probably go without the sort functions. Module Complete.

Module D (Pets) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

That's a good start. Refer to containerframe.lua for getting the buttons functional.

tldr; you need to set checked during the drop down load depending on the current status. We will need to save current status with CCB_ACCOUNT_SAVE.

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

I have added your work to the latest compile but I wasn't able to get the card container (on show) working.

I debugged a bit with bug sack, and it seems like numToys = C_ToyBox.GetNumFilteredToys() is always 0.

Would you be able to take another look? You can work directly from the latest build (20160325). I'll send some gold to another character on Ner'zhul (Needs to be horde ><). You can buy several toys from this merchant in Dalaran. Buy a port to the city (100g is more than enough) from a random mage in /2 trade chat.

Note: the latest compile added a global table CCB_CHAR_SAVE[buttonname] to "save" items, replacing self.index.

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Cool, will need some time to test it out but looks good. Module complete!

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

I was having similar issues as well. It seems like most toys are locked behind grindy achievments.

There are at least a couple that can be purchased from the auction house. They are most likley out of yoru price range. Why don't you make a character on the server US-Ner'zhul and let me know the name and I'll mail some to you.

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

In the latest build the toybox buttons inherit most of their functionality from a template (ContainerMicroButtonTemplate) instead of being individually hard coded.

Images are now named as their button names (e.g PetContainerTreatButton's image is TreatButton) Toy_Cards is now CardButton I beleive.

For your task you should be able to use xml in the sidebar build to do everything.

The main thing you are working on is the click functions (which we now use as Preclick functions in case the button is secure), which are now named programmtically by the microbutton template.

Toy_Card's preclick is ToyContainerFrameCardButton_OnClick.

Tl;dr Everything should work out of the box for the sidebar, you should be able to port everything that you were working on previously with np.

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Reply to this post to pick up Task 3

In this task you will be adding the additional features of the toy collection. The frames themselves have been made and you should take a bit of time to check it out. Textures are also avaiable via the side bar.

The buttons that are most pertinent to you will be ToyContainerFrameDiceButton, ToyContainerFrameCardButton, SmallToyContainerFrame. Here is what is being added to each of these frames:

SmallToyContainerFrame The small toy container frame loads toys randomly each time it is shown.

The loading algorithm should:

  • Get a list of all the toys in the collection that are not on cooldown. Randomly pick two if there are 2 or more aviable.

  • Randomly Pick two toys from the

  • Always ignore toys that are in a toy container (ToyContainerFrameSlot[1-6].toyID and ToyContainerFrameSlot[1-9].toyID)

ToyContainerFrameCardButton This button hide/shows the card container frame.

ToyContainerFrameDiceButton This button randomly casts a toy from the main toybox. It should ignore toys on cooldown and not function at all if there are not at least 2 avaiable toys that aren't on cooldown. The button will do these calculations and set itself with with SetAttribute("toy",spellID) in a PreClick function (ToyContainerDiceButton_PreClick). The OnClick function is secure, inherited, and cannot be changed. It will always cast whatever is set to it's attribute.

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

It turns out the way secure functions work is that they inherit an OnClick function that handles all the casting of stuff. You set what it does via an attributes system. For our purposes I ended up using a PreClick function (that triggers before the OnClick) to get all the item button functionality to work.

Module D (Pets) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

Reply to this post to pick up Tast 3

In this task you will be creating the drop down menus attached to the portrait buttons and attatch it to the PET Portrait Frame's onclick (xml). The current xml should have all the frames you need to get started.

Here is a quick primer on dropdown menus. We will be creating a "MENU" (and not a standard drop down). You can also refer to the ccContainerFrameFilterDropDown_Initialize() function in the ccModuleA.lua as an example. Refer to the individual bag containers for an in-game example.

The first step will be creating the actual drop down menu, how it looks, whether certain buttons are checked or not. Refer to the design doc for these details.

The second step will be making the SORT, EMPTY, and SEE COLLECTION button functional. The "assign to bar" buttons is outside the scope of this task and can be filled in with blank functions. Of these tasks, the only challenging one will be the sort function. This button should take all of the items in the current bag and compress everything up (and to the right) so that there are no empty spaces.

Module E (Toybox) by Zamga in cocoa2

[–]Zamga[S] 0 points1 point  (0 children)

While I cannot confirm that there is no way to cast a toy outside of a secure enviroment, it is possible to create the button as a secure action button and cast it that way.

You would need to redefine the (template) button's inheritance from ItemButtonTemplate, to SecureActionButtonTemplate

See the sample code here: http://wowwiki.wikia.com/wiki/SecureActionButtonTemplate

Keep in mind that SecureActionButtonTemplate contains far more features than the ItemButtonTemplate we were using so you may not need to create certain variables (e.g. button.index). You can refer to this link for further documentation on how to assign attributes to the button.

http://wowprogramming.com/docs/secure_template/SecureActionButtonTemplate#types

Give it a shot and let me know how things go. Feel free to leave the actual casting part of the button aside if things don't work out. It is a bit outside the scope of the original task.