Hotbar saving

siendel

New member
I could have sworn I posted this over the weekend, but I don't see it anywhere...

But, I was wondering if there was a built-in way to save the items in the hotbar or whether I need to make my own saver for that? Seems like it would be simple enough to make myself, but just want to make sure I'm not missing anything. The Demo scene doesn't seem to save the hotbar selections on load and I didn't see anything in the documentation on it (since the hotbar doesn't have a separate inventory, neither the normal saver nor the UCC bridge saver seem to be options).

Thanks
 
No unfortunately we do not have a hotbar saver yet.... it's been sitting in the TODO list for a while, but there always seems to be other features with a higher priority.

You can try to implement it yourself for now. It should be somewhat straight forward by using the other Savers as example, especially the Grid Saver.

If enough people request it, I'll bump up the priority to implement this feature
 
It took me a couple of hours but it looks like I got it to work. Certainly not optimal, but so far this seems to mostly work - at least my equipped weapon in the hot bar stays equipped when I restart from an application quit and my other hot bar items show up correctly. Saving/reloading from the save menu isn't quite working for me (some items get saved/loaded but not everything); but, I think that is more of an issue with my implementation of that function than an issue with this saver specifically.

Attach the HotbarSaver.cs script to your Item Hotbar (and check the save options as you would normally). Also need to add the following code somewhere accessible (I added it to IDAmountSaveData.cs because that is where the other save structure I was referencing was located):

[Serializable]
public struct IDAmountIndexSaveData
{
public uint ID;
public int Amount;
public int Index;
public string Collection;

public IDAmountIndexSaveData(uint id, int amount, int index, string collection)
{
ID = id;
Amount = amount;
Index = index;
Collection = collection;
}
}
 

Attachments

  • HotbarSaver.cs
    4.3 KB · Views: 26
Top