WEBVTT

00:07.630 --> 00:08.620
Welcome back.

00:08.620 --> 00:15.310
Now we have a view model that we know is assigned to this widget, our load screen widget.

00:15.310 --> 00:15.850
Right.

00:15.850 --> 00:20.800
But we also want view models assigned to these three widgets.

00:20.800 --> 00:21.160
Why.

00:21.190 --> 00:25.450
Because that way they can be closely linked to these three widgets.

00:25.450 --> 00:28.000
Now really each of these is three widgets.

00:28.000 --> 00:28.900
In one.

00:28.900 --> 00:34.180
We created a single widget switcher that contains three widgets.

00:34.750 --> 00:41.770
But for all intents and purposes, we're going to treat it like a single widget, even though it does

00:41.770 --> 00:43.870
contain three widgets inside.

00:44.290 --> 00:48.580
Now, each of these, I'd like to assign a separate view model to.

00:48.580 --> 00:52.900
And this separate view model is going to be for each of our load slots.

00:52.900 --> 00:55.480
It's going to be associated with a slot.

00:55.480 --> 01:02.680
Now when I say slot in a sense of loading and saving the game, I mean this square right here, this

01:02.680 --> 01:06.250
rectangle is associated with a slot.

01:06.250 --> 01:14.350
If I click plus, I want it to be able to enter my name and create a new player, a new character with

01:14.350 --> 01:19.270
that name, we're going to say that that name is assigned to that slot.

01:19.270 --> 01:25.240
And when we save and load data, we save and load according to names and slots.

01:25.330 --> 01:28.630
So each of these is going to get its own view model.

01:28.630 --> 01:31.750
And we're going to need a new class for that view model.

01:31.750 --> 01:35.440
So we're going to go to C plus plus classes Aura Public.

01:35.440 --> 01:40.330
And we'll go into UI view model and make a new view model class.

01:40.330 --> 01:43.180
And this one is going to be for each slot.

01:43.180 --> 01:47.350
So we're going to select all classes search for mVVM.

01:48.120 --> 01:52.590
View model base and select that class.

01:52.590 --> 01:56.700
And this one is going to be for our load slots.

01:56.700 --> 02:03.810
So I'm going to call this one mVVM underscore load slot.

02:03.810 --> 02:06.960
So this is our load slot view model.

02:06.960 --> 02:09.960
Let's create the class and close the engine.

02:10.320 --> 02:14.010
So we have a new class load slot the view model.

02:14.040 --> 02:18.870
The question is when are we going to create these load slots.

02:18.870 --> 02:20.010
We need three of them.

02:20.010 --> 02:24.630
Well we can call a function as soon as we've created our load screen view model.

02:24.630 --> 02:29.430
We can call a function on it and tell it hey create three load slots.

02:29.610 --> 02:34.950
And then our load screen view model can keep track of the three load slots that are associated with

02:34.950 --> 02:36.120
those three widgets.

02:36.660 --> 02:39.090
So I'm going to go back to mVVM load screen.

02:39.090 --> 02:41.250
And we're going to add some stuff to this.

02:41.250 --> 02:44.160
We're going to have a class to spawn.

02:44.160 --> 02:45.960
So we'll need a T sub class of.

02:45.960 --> 02:48.720
Let's go ahead and get a public section going.

02:49.650 --> 02:58.440
So we'll say T sub class of and this will be of our new you mVVM underscore load slot.

02:58.890 --> 03:04.890
We'll add a forward declaration for it and we'll say load slot ViewModel class.

03:06.320 --> 03:13.100
This can be set in our view models blueprint edit defaults only for that and we can make a function

03:13.100 --> 03:14.660
to construct these.

03:14.660 --> 03:16.940
We'll call it initialize load slots.

03:16.940 --> 03:20.180
So void initialize load slots.

03:21.610 --> 03:23.620
That'll be a public function.

03:23.920 --> 03:28.810
We'll go ahead and generate its definition and we'll create those load slots here.

03:29.230 --> 03:35.980
So in our HUD after we've constructed a load screen view model, we can take that load screen view model

03:35.980 --> 03:41.530
and call our new function initialize load slots.

03:43.810 --> 03:45.820
Now it says inaccessible.

03:45.820 --> 03:47.020
So let's go back.

03:47.020 --> 03:49.510
Oh and I put it above the public section.

03:49.510 --> 03:53.350
That's that would explain why it's inaccessible wouldn't it.

03:54.070 --> 03:54.820
There we go.

03:54.820 --> 03:56.710
So now we should be able to call it.

03:56.710 --> 04:01.330
And we can construct some new load slot view models.

04:01.330 --> 04:03.880
But we need a way to keep track of them.

04:04.240 --> 04:10.210
And I think a good way to keep track of them is with a map, so that we can associate an index, an

04:10.210 --> 04:13.390
integer index, with each of our load slots.

04:13.390 --> 04:19.990
And on top of that, I'd like a pointer for each individual load slot so it doesn't get garbage collected.

04:19.990 --> 04:21.940
So we can give it a U property.

04:22.690 --> 04:27.250
So let's add a private section because I'd like to keep track of these privately.

04:27.640 --> 04:29.890
So I'm going to have a T map first and foremost.

04:29.890 --> 04:37.150
And this t map is going to map int32 s to u MVM underscore load slots.

04:37.150 --> 04:38.230
Those are pointers.

04:38.230 --> 04:41.320
And we're going to have this map called load slots.

04:41.590 --> 04:44.380
This will be just an easy way to keep track of these.

04:44.380 --> 04:46.480
We'll make it a U property as well.

04:49.640 --> 04:51.380
And that needs a comma there.

04:51.680 --> 04:54.560
But we'll also have a pointer to each one.

04:54.560 --> 04:57.170
And we'll make sure that each one is not garbage collected.

04:57.170 --> 05:01.700
So we'll have a t object pointer of type um VM load slot.

05:01.700 --> 05:05.630
And we'll call this one load slot underscore zero.

05:06.440 --> 05:08.210
We'll give it its U property.

05:08.780 --> 05:11.960
And we'll have two more load slots one and two.

05:13.160 --> 05:14.540
So this will be one.

05:14.900 --> 05:16.160
This will be two.

05:17.020 --> 05:21.070
So now we can just construct these in initialize load slots.

05:21.100 --> 05:24.610
Now we know how to create a new view model.

05:24.610 --> 05:26.200
We use new object.

05:26.320 --> 05:31.510
So we're going to say load slot zero equals new object.

05:33.030 --> 05:35.670
And it's, um, VM load slots.

05:35.670 --> 05:37.470
We'll get that include.

05:38.470 --> 05:44.050
User object will be this and load slot ViewModel class is the class.

05:44.050 --> 05:51.820
So we're going to construct all three of them load slot zero, load slot one, and load slot two.

05:52.630 --> 05:59.260
And now our ViewModel mVVM load screen has three pointers, one for each ViewModel.

05:59.260 --> 06:05.410
And we're going to add these each to our map as well to make it easy to retrieve them by index.

06:05.410 --> 06:10.540
So I'm going to say load slots dot add.

06:10.780 --> 06:16.510
And we'll associate our first load slot load slot zero with the integer zero.

06:16.510 --> 06:18.700
So we'll add load slot zero.

06:20.270 --> 06:22.490
And now we have a key value pair.

06:22.700 --> 06:25.520
We'll do the same thing for load slot one.

06:25.520 --> 06:28.640
It's going to be mapped to key integer one.

06:28.640 --> 06:30.380
So there's load slot one.

06:30.380 --> 06:35.420
And then we have load slot two which will be mapped to the integer two.

06:35.690 --> 06:39.740
So with that we're now constructing new load slots.

06:39.740 --> 06:43.700
But we have to set that load slot ViewModel class.

06:43.700 --> 06:48.020
Which means we should create a blueprint based on our new mVVM load slot.

06:48.020 --> 06:50.780
So let's compile and launch the editor and do that.

06:51.910 --> 06:58.660
Okay, we're back in the editor, and we need a load slot view model blueprint.

06:58.870 --> 07:04.690
And we know that our load screen view model blueprint is going to create these three load slot view

07:04.690 --> 07:05.050
models.

07:05.050 --> 07:06.400
We're going to need to set it there.

07:06.400 --> 07:08.530
So let's make a blueprint for it.

07:08.860 --> 07:15.910
We can take our mVVM load slot, create a blueprint based on it, and select blueprints UI.

07:16.620 --> 07:18.060
ViewModel.

07:18.510 --> 07:25.920
We'll stick it in that folder and we'll call this BP Load slot ViewModel.

07:27.130 --> 07:30.220
So creating that blueprint class, there it is.

07:30.220 --> 07:37.480
And we can go back to our BP load screen view model and set load slot view model class to the blueprint.

07:38.450 --> 07:43.310
So now we know that our load screen view model is going to construct three of these.

07:43.310 --> 07:49.910
But we're not setting those view models on those three widgets that exist in our load screen.

07:49.910 --> 07:50.840
We're not doing that.

07:50.840 --> 07:52.400
So how do we do that.

07:53.010 --> 07:54.720
Well, timing is important here.

07:54.720 --> 07:55.620
We have to do it.

07:55.620 --> 07:59.970
As soon as our load screen view model has been constructed.

08:00.090 --> 08:03.450
It must already be constructed for that to happen.

08:03.810 --> 08:07.950
Well, I'm going to close the editor and go back and look at where that's happening.

08:07.950 --> 08:12.870
It's in load screen HUD where calling new object here we're creating it.

08:12.870 --> 08:14.790
We're initializing the load slots.

08:14.790 --> 08:17.370
This is where those load slots have been created.

08:17.610 --> 08:22.860
We need to assign Viewmodels to those three widgets in our load screen.

08:22.860 --> 08:24.780
After all this has happened.

08:25.260 --> 08:27.360
Well, we have the load screen right here.

08:27.360 --> 08:34.050
We could call a function on it and tell it to initialize its three widgets with those viewmodels from

08:34.050 --> 08:35.820
our load screen view model.

08:36.150 --> 08:41.190
But if it's going to do that, it needs a way to access those load slots.

08:41.190 --> 08:42.300
They're private.

08:42.300 --> 08:44.370
Remember we made them private.

08:44.370 --> 08:46.170
They're not even exposed to blueprint.

08:46.170 --> 08:48.420
There needs to be a way to get those.

08:48.420 --> 08:56.460
So our load screen view model needs to have a function to get a load slot based on its index.

08:56.460 --> 08:59.370
Well, we can make a public function.

08:59.370 --> 09:05.670
We can expose it to blueprint that returns a new mVVM load slot pointer.

09:05.670 --> 09:12.120
We can call this get load slot view model by index.

09:12.120 --> 09:15.330
Because these are all identified by indices.

09:15.330 --> 09:16.500
We have a map right.

09:16.500 --> 09:20.100
So we'll have an index to pass in int 32.

09:20.100 --> 09:22.080
And we'll give this a you function macro.

09:22.080 --> 09:24.690
With blueprint we can make it blueprint pure.

09:24.690 --> 09:26.940
And we can even make it a const function.

09:26.940 --> 09:31.590
And all it's going to do is retrieve the view model from our map.

09:31.590 --> 09:39.240
All we have to do is take our load slots, map load slots, and we can find one of the indices in it.

09:39.240 --> 09:46.650
We can even use find checked if we want to do an assert here, and we can return what we get from this

09:46.650 --> 09:49.650
return load slots dot find checked.

09:49.650 --> 09:55.470
And now we've exposed a way in blueprint to get our private contents here by index.

09:55.470 --> 09:57.510
That's why that map is so important.

09:57.810 --> 09:58.320
Okay.

09:58.320 --> 10:05.490
So well how is our HUD going to tell our load screen widget to set those three widgets view models.

10:05.490 --> 10:11.460
Well it's going to need a function to call and something we can potentially implement in blueprint.

10:11.460 --> 10:14.520
Well we can go to our load screen widget C plus plus class.

10:14.520 --> 10:18.930
Now we're starting to see why we needed a C plus plus class backing these widgets.

10:18.930 --> 10:20.820
And we can make a public section.

10:20.820 --> 10:25.560
And we can create a nice function that we can call from here in C plus.

10:25.560 --> 10:33.060
Plus that we can implement in blueprint in order to initialize the widget with all of its important

10:33.060 --> 10:37.650
stuff, we can call this void blueprint initialize widget.

10:38.190 --> 10:41.670
And this can be a blueprint implementable event.

10:41.670 --> 10:45.600
So you function blueprint implementable event.

10:45.600 --> 10:49.260
And while we're at it, we can make it blueprint callable just in case.

10:49.260 --> 10:51.330
We need to call it in blueprint as well.

10:52.090 --> 10:58.120
So we'll call this as soon as we've constructed our load screen widget, because at that point the load

10:58.120 --> 11:00.220
screen view model has been constructed.

11:00.220 --> 11:02.170
It's three load slot.

11:02.170 --> 11:03.760
View models have been constructed.

11:03.760 --> 11:08.740
So the load screen widget can safely say that its own load screen view model, which is already been

11:08.740 --> 11:12.850
set, can give it access to those load slot view models.

11:12.850 --> 11:18.400
So let's call load screen widgets blueprint initialize widget.

11:18.850 --> 11:25.060
And in that is where we're going to access those load slot widgets and set the view models on its own

11:25.060 --> 11:25.750
three widgets.

11:25.750 --> 11:26.440
Let's do this.

11:26.440 --> 11:29.110
Let's go ahead and compile and launch the editor.

11:30.170 --> 11:33.770
So we can go ahead and just open up what we had.

11:34.310 --> 11:36.740
Here's our load slot view model.

11:36.890 --> 11:41.060
Nothing special really, just a blueprint based on the view model.

11:41.300 --> 11:43.070
We'll close that for now.

11:43.370 --> 11:45.620
We have our load screen widget base.

11:46.040 --> 11:49.370
We just implemented that function to find the view model.

11:49.370 --> 11:51.350
We'll close that for now as well.

11:51.920 --> 11:57.410
But here in our load screen widget we're going to implement something that we've just called from our

11:57.410 --> 11:58.010
HUD.

11:58.040 --> 12:02.960
These two up here those events I'm going to remove them and get them out of the way.

12:02.960 --> 12:06.680
And I'm going to implement blueprint initialize widget.

12:07.520 --> 12:12.290
We know by this point the view model has been set and we can get it.

12:12.290 --> 12:13.700
It's BP.

12:13.880 --> 12:18.020
I'll just search for view model and we get load screen view model here.

12:18.970 --> 12:24.400
And if we wanted to, we can take load screen, view model and call.

12:24.400 --> 12:28.030
It's called get load slot, view model by index.

12:29.800 --> 12:34.030
Get load slot view model by index.

12:34.570 --> 12:36.610
So what are we going to do with this?

12:37.660 --> 12:44.350
Well, we need to set those viewmodels for our widget switchers, our custom ones that we created.

12:44.350 --> 12:48.790
Well, we don't see them here because, well, they're not set to be variables.

12:48.790 --> 12:52.480
We can select all three and check is variable to do that.

12:52.870 --> 12:57.820
And now we need to decide what each of these switchers is going to do.

12:58.510 --> 13:05.170
Well, if each of these is associated with a slot, then we need an index associated with each of them.

13:05.440 --> 13:09.370
And on top of that, each of these is really three widgets wrapped in one.

13:09.400 --> 13:14.500
Well, the three of those internal widgets should have the same slot, which means we could take use

13:14.500 --> 13:20.740
of a whole bunch of inheritance by having a slot variable on, say, the base widget blueprint for all

13:20.740 --> 13:21.490
of these.

13:21.820 --> 13:30.940
We can go into blueprints UI load menu and get that base class load screen widget base, and we can

13:30.940 --> 13:32.560
add a variable to this.

13:32.560 --> 13:35.680
We can add an integer simply a slot index.

13:35.830 --> 13:41.710
So we can add new variable slot index and change its type to integer.

13:41.710 --> 13:46.090
And we can check the eye icon, open it up, make it instance editable.

13:46.360 --> 13:51.940
And as soon as we've done that now all of these widgets have this slot index thanks to inheritance.

13:52.270 --> 13:59.920
So what I want to do in my load screen widget is as soon as Event Blueprint initializes, widget has

13:59.920 --> 14:00.850
been executed.

14:00.850 --> 14:06.430
I don't want to get my ViewModel just yet, but I want to get each of my switchers and tell them what

14:06.430 --> 14:12.310
their index is so they can get the ViewModel by index and set it themselves.

14:12.730 --> 14:16.150
So I'm going to go ahead and take each switcher.

14:17.310 --> 14:23.670
And I'm going to initialize their slot, but I want to do so by calling a function rather than just

14:23.670 --> 14:25.440
setting their slot directly.

14:25.440 --> 14:31.380
So that function can be responsible for accessing the correct view model by index.

14:32.000 --> 14:41.300
So that means my switcher class WPP load slot widget switcher needs to have a function I can call to

14:41.300 --> 14:42.680
pass in a widget.

14:43.250 --> 14:48.590
So I'm going to add a function and I'm going to call this initialize slot.

14:49.070 --> 14:55.160
It's going to take an input of integer type called in slot.

14:56.560 --> 15:01.300
And it's going to set its own slot based on that, its own slot index.

15:01.780 --> 15:03.400
So we can set that there.

15:03.910 --> 15:09.100
And then it can go and find the correct view model and do its thing from there.

15:09.100 --> 15:12.910
But before we do that we'll go back to our load screen widget.

15:13.500 --> 15:16.140
And an event blueprint initialize widget.

15:16.140 --> 15:20.370
We're going to call that initialize slot function we just created.

15:21.780 --> 15:23.910
And we'll give each of these their own slot.

15:23.940 --> 15:25.320
We'll give switcher zero.

15:25.320 --> 15:26.520
Slot zero.

15:26.820 --> 15:28.290
We'll give switcher one.

15:28.290 --> 15:30.720
Slot one with initialize slot.

15:33.500 --> 15:41.750
So passing a one in for that one, and we'll give switcher two slot two by calling initialize slot passing

15:41.750 --> 15:42.800
in two.

15:43.860 --> 15:51.870
And now each of them will have their slot index set, but they can also search for a ViewModel and set

15:51.870 --> 15:58.290
the ViewModel on their own trio of internal widgets that they have.

15:58.860 --> 16:04.980
Now, we can't set those view models if we haven't assigned a view model to each of them.

16:06.400 --> 16:13.210
So let's save all and go into each of the three key widgets and give them a view model.

16:13.850 --> 16:16.130
And I'm going to clean up my tabs before I do.

16:16.130 --> 16:18.590
So I'm going to close load screen widget base.

16:19.420 --> 16:27.520
I'm going to close load screen view model and load screen HUD and just open these three widgets load

16:27.520 --> 16:32.320
slot vacant load slot taken and load slot.

16:32.320 --> 16:33.190
Enter name.

16:33.190 --> 16:35.530
Each of these needs a view model.

16:35.860 --> 16:38.140
So in the designer tab can't be.

16:38.140 --> 16:43.990
In the graph tab we go to window and go to View Models, which of course we've docked right here.

16:43.990 --> 16:45.820
At least I docked it right here.

16:45.820 --> 16:48.490
So I don't actually need to go to that.

16:48.610 --> 16:49.840
It's right here.

16:49.840 --> 16:58.540
And we can click Plus View model and the vacant taken and enter name widgets are going to get their

16:58.540 --> 17:01.600
own load slot view model.

17:01.600 --> 17:03.550
We're going to choose the blueprint version.

17:03.550 --> 17:04.660
We'll select that.

17:04.660 --> 17:06.580
So there's one for the vacant.

17:06.580 --> 17:10.630
And we can select it and choose its creation type.

17:10.630 --> 17:14.020
And we can choose manual because we're going to be setting these manually.

17:14.020 --> 17:17.680
So now we get to see how the manual creation type works.

17:18.010 --> 17:22.000
Now I'm going to save that and go to the taken widget.

17:22.000 --> 17:27.040
Plus add a view model and choose the Blueprint Load slot view model.

17:27.040 --> 17:30.010
Select it and choose a creation type.

17:30.010 --> 17:32.260
It's going to be manual just like the other.

17:32.260 --> 17:34.540
And then our load slot enter name.

17:34.540 --> 17:41.020
We'll add a view model, choosing the Load Slot blueprint version, and we're going to set it to have

17:41.020 --> 17:43.030
a creation type of manual.

17:43.030 --> 17:49.150
And now we can set these load slot view models from our widget switcher.

17:49.330 --> 17:52.690
As soon as it's had its initialized slot function called.

17:52.840 --> 17:56.050
So how are we going to get that load slot view model?

17:56.050 --> 18:01.510
Well, we are inheriting a function that can find the load screen view model.

18:01.510 --> 18:05.050
It's called find load screen view model.

18:05.050 --> 18:09.910
We can even call that right here and get that load screen view model.

18:09.910 --> 18:14.620
The output is called new param but it should be called load screen view model.

18:14.620 --> 18:17.140
We can go into that function and fix that.

18:18.440 --> 18:22.490
By changing the name of its output on the return node.

18:23.560 --> 18:25.900
To ViewModel.

18:26.410 --> 18:30.010
We can save that and back in our switcher.

18:31.090 --> 18:32.380
It says view model.

18:32.740 --> 18:36.430
So I'm going to go ahead and add a sequence node.

18:38.280 --> 18:42.030
And the first thing we'll do is find that load screen view model.

18:43.870 --> 18:50.170
And from the load screen view model, I want to find the load slot view model with the blueprint callable

18:50.170 --> 18:53.530
function get load slot view model by index.

18:53.530 --> 18:54.670
We have an index.

18:54.670 --> 18:56.500
It's called slot index.

18:57.410 --> 18:59.390
So this is a blueprint pure function.

18:59.390 --> 19:02.120
It's going to get us the load slot view model.

19:02.120 --> 19:04.040
And I can promote this to a variable.

19:04.040 --> 19:06.110
It could even be a local variable.

19:06.110 --> 19:09.260
And this is the load slot view model.

19:11.210 --> 19:14.540
Now remember, the switcher itself doesn't have its own view model.

19:14.570 --> 19:17.330
If we go to the designer tab, we see there's nothing there.

19:17.660 --> 19:22.250
It's going to set the view models for its three child widgets.

19:22.820 --> 19:24.800
That's what we're going to do in our sequence here.

19:24.800 --> 19:29.660
So I'm going to take the three child widgets which we have to go to the designer and make sure they're

19:29.660 --> 19:31.310
all set to is variable.

19:32.820 --> 19:36.450
And we're going to set their view models and their slot indices.

19:36.960 --> 19:38.670
So here's the inter name.

19:39.160 --> 19:41.530
We can set its slot index first.

19:46.940 --> 19:48.710
And we can set its view model.

19:48.710 --> 19:52.940
Now that we've added one to it, we can access it like it's a member variable.

19:52.940 --> 19:55.700
It's called BP load slot view model.

19:56.440 --> 20:00.490
We can set that and we now have our view model right here.

20:00.490 --> 20:01.000
Load slot.

20:01.000 --> 20:01.900
View model.

20:03.770 --> 20:08.300
Now, actually, we can't set it because this requires the blueprint version.

20:08.300 --> 20:15.980
So what I'm going to do is instead of storing the C plus plus class, I'm going to delete that and cast

20:15.980 --> 20:17.570
to the blueprint version.

20:17.750 --> 20:24.500
So cast to BP load slot view model and we'll promote this one to a variable.

20:27.300 --> 20:28.650
And this will be.

20:29.490 --> 20:31.860
Called load slot view model.

20:32.370 --> 20:35.610
We can even prefix it with BP to make that clear.

20:35.610 --> 20:39.690
And now we can set this BP load slot view model right there.

20:40.970 --> 20:44.150
So we're going to do that for all three of our widgets.

20:44.540 --> 20:47.450
Here's the enter name on our switcher.

20:47.600 --> 20:49.550
We're going to add two more pins.

20:50.810 --> 20:53.630
And we'll do the same thing for Taken and Vacant.

20:53.630 --> 20:56.510
So for taken we'll set slot index.

20:57.920 --> 21:02.780
And for all of these, all of these children of our widget switcher, they're all going to share the

21:02.780 --> 21:05.540
same index that the widget switcher itself has.

21:06.230 --> 21:10.850
They're all going to get slot index, that value passed in.

21:16.540 --> 21:20.350
And we're passing it in from our load screen widget.

21:20.860 --> 21:22.480
Just to remind you.

21:23.110 --> 21:23.890
Right here.

21:23.890 --> 21:28.000
We're passing in a zero, a one and a two respectively.

21:28.000 --> 21:34.600
So we'll give our three child widgets in each of our widget switchers.

21:35.480 --> 21:37.760
The same index as the parent.

21:39.110 --> 21:44.750
And we'll set BP load slot ViewModel.

21:44.780 --> 21:51.110
Now notice we do have a function here called set BP load slot ViewModel.

21:51.110 --> 21:54.380
Target is BP load slot taken.

21:54.380 --> 21:57.380
That means this function exists right here on this class.

21:57.620 --> 21:59.090
BP load slot taken.

21:59.090 --> 22:00.770
Why does it exist on that class?

22:00.770 --> 22:02.510
Because we added a ViewModel.

22:02.510 --> 22:07.250
So a lot of things happen under the hood such as creating that setter there.

22:07.880 --> 22:10.550
So we have enter name taken.

22:10.550 --> 22:12.140
We just need vacant.

22:12.140 --> 22:14.480
We're going to set its slot index.

22:17.830 --> 22:20.170
To the slot index variable.

22:22.660 --> 22:23.710
We'll hook this up.

22:25.710 --> 22:29.100
And we'll get that load slot vacant.

22:29.890 --> 22:37.330
And set its BP load slot view model with that now created setter function.

22:37.330 --> 22:41.350
And both of these need to take our BP load slot view model.

22:42.010 --> 22:43.660
So we'll pass those both in.

22:46.690 --> 22:54.280
So now our load slot widget switcher is going to set all three of its child widgets to the same view

22:54.280 --> 22:54.580
model.

22:54.580 --> 23:01.120
Now, I did mention that there's a 1 to 1 relationship typically in the mVVM system, but we're considering

23:01.120 --> 23:03.400
these three to be part of one widget.

23:03.400 --> 23:12.040
All of this is one composite widget, so each of these individually will use the same view model.

23:12.580 --> 23:13.450
Okay.

23:13.450 --> 23:22.930
So with that we now know that all of our widgets, at least the three child widgets that exist in each

23:22.930 --> 23:30.190
of our widget switchers in the load screen widget will have their own load slot view models, and that's

23:30.190 --> 23:37.150
going to become really handy when we start binding values to variables so we can save all.

23:37.150 --> 23:41.380
And we don't really have an easy way to test out that.

23:41.380 --> 23:46.210
Our load slot view models are set other than just printing their names in tick, for example.

23:46.210 --> 23:49.960
But we can go to load menu and we can press play.

23:51.150 --> 23:59.100
And at least we know that as soon as we started the game, these three widget switchers will have three

23:59.100 --> 24:04.950
children each, and all of them will have their load slot view models set according to their index.

24:05.460 --> 24:11.940
Okay, so it's kind of a lot of setup, but now that we've set that up, we can start tying things together

24:11.940 --> 24:17.580
and binding values so that we can start actually saving and loading the game.

24:18.060 --> 24:19.200
I'll see you soon.
