Forum rules - please read before posting.

Unity UI SavesList slots out of order?

edited February 2017 in Technical Q&A
Unity: 5.5.0f3
AC: 1.55c
----

Okay, I can't tell if this is a bug on my part, or somewhere else.

I'm using Unity UI "Menu" for Save slots hooked into the AC Menu Save menu, I have a Grid with 3 Slot Elements in it positioned horizontally, with 5 max save games allowable in the Settings, and Left/Right offset arrows. I've also properly set up a parameter on my SavesListSlotClick ActionList for Slot ID.

When I click on a save slot, I'm checking if there's a save already in that slot, if so, show a confirmation dialog.

Thing is, the Slot ID being passed is always an integer of 0, 1, or 2. It doesn't matter if I'm at the beginning of the slot list, or at the end. It's like the Slot Offset isn't being passed to the ActionList parameter properly.

------
\Menu\Menu classes\MenuSavesList.cs  Line: 590
AdvGame.RunActionListAsset (actionListOnSave, parameterID, _slot);
----
I think it should be:
AdvGame.RunActionListAsset (actionListOnSave, parameterID, _slot + offset);
----

This seems to fix my first issue.  Also worth noting, is the line 594 is identical, so it might need the "+ offset" as well.


And secondly... The saved games are always saved with an ID # starting with 1, so even if I clicked on the first slot (Slot 0), a game will be saved as "MyGame_1". But, when I click on the first slot (Slot 0) again, so I can overwrite that save, I'm being told there is no save game in that slot, so it makes a new save. Moreover, when I click on the third slot (Slot 2), it's telling me there is a saved game in Slot 1.

I believe it might be something to do with the AutoSaves, as Int 0 is the AutoSave slot. Since I'm not using autosaves, Slot 0 is essentially always open, thus my clicking on that "Slot 0" will always create a new game.

Should I offset the slot amount myself somehow? I'm not sure how to go about possibly fixing this one...

Comments

  • First issue: good spot.  I will need to look at it more thoroughly, but on first glance it appears this is indeed a bug.

    Second issue: you're doing this with the Save: Check Action?  Though the function itself is correct, it seems there should be an additional option there to check by element slot ID rather than save slot ID (confusingly, these are different due to the AutoSave slot you mentioned).  Again, I will look into it - thanks for posting.
  • Ahh, I see now!  Thank you very much for informing me of this!  ^_^  I love learning how things work.
  • No problem, expect both addressed in the next update.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.