Hello ORKnauts,
can someone please help me on how would be a C# script to change inventory items type? I don't want to use any input keys but simple buttons.
E.g. my inventory menu screen is ID:4 and I will put Item type IDs:1,2,3,4,5. I'll have unity toggle buttons to switch between them.
Cheers
MenuScreen screen = ORK.MenuScreens.Get(screenID);
screen.part[partIndex].SetOverrideType(null, new List<int>() { 1 }, true);
screenID is the ID/index of the menu screen.
partIndex is the index of the menu part you want to access (e.g. 0 if it's the first added menu part of the menu screen).
The available types are provided by an int list, containing the ID's of the item types.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
can this be used in ORK 3 to access also Menu Part -> Inventory -> Item Box Settings -> Sort By function?
I want to change 'sort by' during runtime between 'Added, Buy Price, Float Variable'.
Otherwise, yeah - the part field (array) of the MenuScreen class still holds the menu parts. You just need to check if it's the correct part and cast it to that type, e.g. InventoryMenuPart class.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
public void SortNow()
{
MenuScreen screen = ORK.MenuScreens.Get(7);
BaseMenuPart baseItem = screen.part[0];
InventoryMenuPart inventoryItem = (InventoryMenuPart) baseItem;
AdvancedContentSorter.Type sort = AdvancedContentSorter.Type.Name;
AdvancedContentSorter contentSorter = new AdvancedContentSorter(sort);
}
But I'm getting an error:
Assets\Sorting.cs(19,51): error CS1729: 'AdvancedContentSorter' does not contain a constructor that takes 1 arguments
What am I doing wrong?
Using ORK version 3.7.0 and Makinom 2.8.0
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!