This commit is contained in:
Jelle De Geest
2023-04-26 19:04:34 +02:00
parent 172938cec8
commit 47f8b96122
1004 changed files with 60756 additions and 117444 deletions

View File

@@ -22,11 +22,6 @@ public class ChangeUserScreen : MonoBehaviour
/// </summary>
public GameObject error;
/// <summary>
/// Reference to the user list
/// </summary>
public UserList userList;
/// <summary>
/// Index of the current selected user in the UserList
/// </summary>
@@ -42,7 +37,7 @@ public class ChangeUserScreen : MonoBehaviour
/// </summary>
void Start()
{
userList.Load();
PersistentDataController.GetInstance().Load();
error.SetActive(false);
DisplayUsers();
}
@@ -57,8 +52,8 @@ public class ChangeUserScreen : MonoBehaviour
Destroy(child.gameObject);
}
List<User> users = userList.GetUsers();
currentUserIndex = userList.GetCurrentUserIndex();
List<User> users = UserList.GetUsers();
currentUserIndex = UserList.IndexOf(UserList.GetCurrentUser().GetUsername());
for (int i = 0; i < users.Count; i++)
{
User user = users[i];
@@ -99,8 +94,7 @@ public class ChangeUserScreen : MonoBehaviour
/// </summary>
public void IChooseYou()
{
userList.ChangeCurrentUser(currentUserIndex);
userList.Save();
UserList.ChangeCurrentUser(currentUserIndex);
SystemController.GetInstance().BackToPreviousScene();
}