Skip to content

Commit

Permalink
Merge pull request #23 from TINF21CS1/UI-UX
Browse files Browse the repository at this point in the history
UI ux
  • Loading branch information
Petzys authored Mar 20, 2024
2 parents cbdf869 + cb8a9e3 commit 6576d17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion UI/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class Multiplayer(base_frame):
def __new__(cls, master, *args, **kwargs):
if(len(master.players) == 0 or master.player == None):
return Profile(master, *args, return_to=Multiplayer, **kwargs)
return super().__new__(cls, *args, **kwargs)
return super().__new__(cls)

def __init__(self, master, *args):
super().__init__(master)
Expand Down
7 changes: 4 additions & 3 deletions UI/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def _create(self):
self.master.players[i] = Player.with_color_str(self.etrName.val, self.color_str)
else:
self.master.players.append(Player.with_color_str(self.etrName.val, self.color_str))
self.master.player = len(self.master.players) - 1
ProfileIO.set_profiles(self.master.players, self.master.player)
self.master.show(self.next)

Expand All @@ -96,7 +97,7 @@ class Profile(base_frame):
def __new__(cls, master, *args, **kwargs):
if len(master.players) == 0:
return NewProfile(master, *args, **kwargs)
return super().__new__(cls, *args, **kwargs)
return super().__new__(cls)

def __init__(self, master, *args, **kwargs):
super().__init__(master)
Expand Down Expand Up @@ -146,9 +147,9 @@ def _display_widgets(self):

def _delete(self):
del self.master.players[self.master.player]
self.master.player = 0
self.master.show(Profile)
self.master.player = 0 if(len(self.master.players) > 0) else None
ProfileIO.set_profiles(self.master.players, self.master.player)
self.master.show(Profile)

def _dropdown_changed(self, *args):
for i, player in enumerate(self.master.players):
Expand Down
2 changes: 1 addition & 1 deletion UI/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Singleplayer(base_frame):
def __new__(cls, master, *args, **kwargs):
if(len(master.players) == 0 or master.player == None):
return Profile(master, *args, return_to=Singleplayer, **kwargs)
return super().__new__(cls, *args, **kwargs)
return super().__new__(cls)

def __init__(self, master, *args, **kwargs):
super().__init__(master)
Expand Down

0 comments on commit 6576d17

Please sign in to comment.