ps-wow / Adibags_ByExpansion

Groups items by their expansion.
The Unlicense
5 stars 8 forks source link

[Feature] Korthia support 9.1 #20

Closed psykzz closed 3 years ago

psykzz commented 3 years ago

Would be great to add 9.1 support for things like riftkeys, the mount egg (razorwing) etc.

davidcraig commented 3 years ago

Hi, I have cancelled my wow subscription, if you know how to raise a Pull Request I am happy to merge any incoming changes

psykzz commented 3 years ago

I'm happy to add a file, but would likely need some help with creating a category out of it.

I would take the approach of creating a new zone file (zone/korthia.lua), and adding the item in there. Similar to how you have your raid/castlenathia.lua file.

Outside of ensuring its imported though, is there anything else i'd need to do, or would that be all?

davidcraig commented 3 years ago

So essentially the way this addon works is all expansions have some predefined categories, then each expansion can add additional categories as required (legion legos, azerite, etc)

so to make a new expansion category would be similar to the process I done here for anima and conduits: https://github.com/ps-wow/Adibags_ByExpansion/commit/2b9b0583476b31fd547448b7d2eb846900700742

note in src/AdiBags_ByExpansion_Shadowlands/main.lua the

local categories = core:GetDefaultCategories()

-- Create new legion specific categories
categories['Anima'] = "Anima"
categories['Conduits'] = "Conduits"
categories['Legendaries'] = "Legendary"

so add eg categories['Korthia'] = "Korthia"

at the top of the file, this essentially registers the new category, then at the bottom of the same file it adds all items from the AddonTable's into them categories

core:AddCategoryItems(AddonTable.korthia, "Korthia", module)

and in korthia.lua you would have eg.

local AddonName, AddonTable = ...

-- Korthia (Shadowlands)
AddonTable.korthia = {
    -- list of items in same format as the rest
}

I know that's a lot, hope it all makes sense, let me know how you get on, I can always log in to a starter account to verify the code on my own machine if you get stuck :)

In terms of local development, what I've done is symlinked the folder from build, eg

repo_path/build/AdiBags_ByExpansion_Shadowlands inside my wow addons folder. then I run the build.php script which takes the changes added in src and puts them into build, a quick reload UI inside of wow and I see if the changes produced any errors etc.

You could symlink the same folder from src and not have to deal with the build step, all that does really is removes some comments etc to make the file sizes very slightly smaller :)

psykzz commented 3 years ago

Thanks for all your help @davidcraig, you're right, it was really easy to add support! Well done on the framework!

davidcraig commented 3 years ago

Thanks! Glad my guide worked out for you :) I've merged PR, feel free to open any more issues/pr's if you need anything further just let me know :D

psykzz commented 3 years ago

@davidcraig would you mind doing a release for this so it pushes to wowup / curse etc?

davidcraig commented 3 years ago

Done :)