Welcome back.
So we now have the ability to show the map name.
And we're only setting that if we click on new slot we're setting it on our load slot here.
But we're not actually saving it to disk.
Which means if we close the game and come back in, the map name is blank.
So we need to actually load that in just like we're loading in our player name.
And that means we need to save it to disk.
So we're going to do that in this video.
Now when are we saving to disk.
Well we're doing it in new slot button pressed.
When we save slot data we're passing in that slot.
But save slot data doesn't save the map name.
Let's go into our game mode base and see we see save slot data here.
It creates our save game object.
It's cast to a load screen save game and we're saving in that load screen save game, the player name
and the save slot status, but not the map name.
We need to add the map name to our load screen save game.
So let's go to Load Screen Save game and add a map name.
Let's go ahead and just copy Player name.
Paste it here and call this map name.
And for the default value, we'll call it default map name, which we should never see because.
We're always going to save the map name now, and we'll do that in our game mode base right here where
we're saving our other properties.
So we'll take load screen save game, get that map name and we'll save it to the load slot map name.
So we can call get map name from the load slot.
So now we're saving it.
But what about when we're loading up from disk?
We need to do that too.
We're doing that and get save slot data, which just returns our load screen save game.
We have to harvest that data in our mVVM load screen.
So where are we calling that?
Right here in load data.
We're doing it.
So when we load data we need to get our load slot dot value because we're in a map here load slot dot
value.
And we need to set the map name with our setter we call the setter.
It's going to broadcast the field notify which is what we want.
Now we can get the map name from our save object, which is of course of type load screen save game.
So we can take save object and get the map name from it.
And that way we'll set our field notify as we're loading in from disk.
So with that we can test this out.
We can run in debug mode and make sure that we're loading in that map name that we're now saving to
disk.
Okay, so we can get things open here.
We know that our map already has its text map value here bound to the field notify.
Now that we're saving to disk and loading, let's see how this works.
We can press play.
Now we're just going to get default map name because we never actually saved these names to disk yet.
So we need to go ahead and just delete these slots.
And if we create a new slot now we see first dungeon.
We're setting that, and if we close and come back, first dungeon has been saved to disk and we're
loading it from disk.
So we see it here.
So we can do that with any of these as soon as we've done this.
Now first dungeon is saved to disk and we load it back.
And if we save over this, then we can update that dungeon to whatever map that we travel to and save.
And we'll see that here.
So now that we're saving the map name to disk, it's time to be able to select the slot, press play
and travel to that map.
Now we can identify the map and our game mode should have a map with that default map inside of it.
And that's going to allow us to travel to it.
So let's do that.
We'll do that next.
I'll see you soon.