def LogicUpdate(self):
     Window.LogicUpdate(self)
     if not self.loging_in:
         if self.references["Accept"].pressed or pygame.key.get_pressed(
         )[pygame.K_RETURN] or pygame.key.get_pressed()[pygame.K_KP_ENTER]:
             self.was_pressed2 = True
         else:
             if self.was_pressed2:
                 self.was_pressed2 = False
                 self.loging_in = True
                 self.parent.Send({
                     "action":
                     "check_login",
                     "username":
                     self.references["User Input"].text,
                     "password":
                     self.references["Pass Input"].text
                 })
                 self.username = self.references["User Input"].text
                 self.password = self.references["Pass Input"].text
         if self.references["Cancel"].pressed:
             self.was_pressed1 = True
         else:
             if self.was_pressed1:
                 self.parent.DeleteWindow("Login window")
                 self.parent.AddWindowCenteredOnFront(
                     self.save, None, "Login")
             else:
                 self.was_pressed1 = False
    def LogicUpdate(self):
        Window.LogicUpdate(self)

        if not self.sending_data:
            if (self.references["Accept"].pressed
                    or pygame.key.get_pressed()[pygame.K_RETURN]
                    or pygame.key.get_pressed()[pygame.K_KP_ENTER]
                ) and self.mouseOut:
                self.pressed = True
            else:
                if self.pressed:
                    self.sending_data = True
                    self.pressed = False
                    data = {
                        "action": "register",
                        "username": self.references["User Input"].text,
                        "password": self.references["Pass Input"].text,
                        "confirmation":
                        self.references["Confirm Password Input"].text,
                        "email": self.references["Email Input"].text
                    }
                    self.parent.Send(data)
            if self.references["Cancel"].pressed:
                self.pressed2 = True
            else:
                if self.pressed2:
                    self.pressed2 = False
                    self.parent.DeleteWindow("SignUp")
                    self.parent.AddWindowCenteredOnFront(
                        self.save, None, "Login")
    def LogicUpdate(self):
        Window.LogicUpdate(self)

        if self.ButtonCheck("Cancel"):
            self.Kill()
            session_query.SessionDeclareDisconnect()
        elif self.ButtonCheck("Accept"):
            self.RestoreSession(self.data)
        elif self.ButtonCheck("okButton"):
            self.SendName(self.references["inputField"].text)
 def LogicUpdate(self):
     Window.LogicUpdate(self)
     if self.references["Login"].pressed:
         self.parent.AddWindowCenteredOnFront(Login(self.parent, self),
                                              None, "Login window")
         self.parent.DeleteWindow("Login")
     if self.references["Sign Up"].pressed:
         self.parent.AddWindowCenteredOnFront(SignUp(self.parent, self),
                                              None, "SignUp")
         self.parent.DeleteWindow("Login")
     if self.references["Guest"].pressed:
         self.parent.DeleteWindow("Login")
         self.parent.AddWindowCenteredOnFront(self.save, None, "loading")
         self.parent.references["loading"].SetNameInput()