Exemplo n.º 1
0
    public override void Draw(MonoBehaviour owner = null)
    {
        if (loading)
        {
            InitStyles();
            loading = false;
        }

        GUILayout.BeginArea(buttonAreaRect);
        {
            GUILayout.BeginHorizontal();
            {
                if (ADAGEMenu.AllowPasswordLogin)
                {
                    if (GUILayout.Button("Password", buttonStyle, GUILayout.Width(buttonWidth), GUILayout.ExpandHeight(true)))
                    {
                        OnPassword();
                    }

                    if (ADAGE.AllowGuestLogin || ADAGEMenu.AllowQRLogin)
                    {
                        GUILayout.Space(buttonSpacing);
                    }
                }

                if (ADAGEMenu.AllowQRLogin)
                {
                    if (GUILayout.Button("QR", buttonStyle, GUILayout.Width(buttonWidth), GUILayout.ExpandHeight(true)))
                    {
                        OnQR();
                    }
                    if (ADAGE.AllowGuestLogin)
                    {
                        GUILayout.Space(buttonSpacing);
                    }
                }

                if (ADAGE.AllowGuestLogin)
                {
                    if (GUILayout.Button("Guest", buttonStyle, GUILayout.Width(buttonWidth), GUILayout.ExpandHeight(true)))
                    {
                        OnGuest();
                    }
                }
            }
            GUILayout.EndHorizontal();
        }
        GUILayout.EndArea();

        if (!isLocked)
        {
            if (GUI.Button(backButtonRect, "Back", buttonStyle))
            {
                ADAGEMenu.ShowPanel <ADAGEHomePanel>();
            }
        }

        GUI.enabled = true;
    }
Exemplo n.º 2
0
    public override void Draw(MonoBehaviour owner = null)
    {
        if (loading)
        {
            InitStyles();
            loading = false;
        }

        usernameFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        username        = GUI.TextField(usernameFieldRect, username, usernameStyle);

        passwordFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        if (keyboardFieldID == passwordFieldID || password != kDefaultPasswordText)
        {
            password = GUI.PasswordField(passwordFieldRect, password, '*', passwordStyle);
        }
        else
        {
            password = GUI.TextField(passwordFieldRect, password, passwordStyle);
        }

        confirmFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        if (keyboardFieldID == confirmFieldID || confirm != kDefaultConfirmText)
        {
            confirm = GUI.PasswordField(confirmFieldRect, confirm, '*', confirmStyle);
        }
        else
        {
            confirm = GUI.TextField(confirmFieldRect, confirm, confirmStyle);
        }

        emailFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        email        = GUI.TextField(emailFieldRect, email, emailStyle);

        if (GUI.Button(submitButtonRect, "Submit", buttonStyle))
        {
            ClearFocus();
            ADAGEMenu.ShowPanel <ADAGESplashPanel>();
            if (IsValid())
            {
                ADAGE.RegisterPlayer(username, email, password, confirm);
            }
        }

        if (GUI.Button(backButtonRect, "Back", buttonStyle))
        {
            ClearFocus();
            ADAGEMenu.ShowLast();
        }

        CheckFields();
    }
Exemplo n.º 3
0
    public override void Draw(MonoBehaviour owner = null)
    {
        if (loading)
        {
            InitStyles();
            CheckFields();
            loading = false;
        }

        usernameFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        username        = GUI.TextField(usernameFieldRect, username, usernameStyle);

        passwordFieldID = GUIUtility.GetControlID(FocusType.Keyboard) + 1;
        if (keyboardFieldID == passwordFieldID || password != kDefaultPasswordText)
        {
            password = GUI.PasswordField(passwordFieldRect, password, '*', passwordStyle);
        }
        else
        {
            password = GUI.TextField(passwordFieldRect, password, passwordStyle);
        }

        GUI.enabled = (password != kDefaultPasswordText && username != kDefaultUsernameText && password.Trim().Length != 0 && username.Trim().Length != 0);
        if (GUI.Button(loginButtonRect, "Login", buttonStyle))
        {
            ClearFocus();
            loginAttempts++;
            ADAGEMenu.ShowPanel <ADAGESplashPanel>();
            ADAGE.LoginPlayer(username.Trim(), password.Trim());
        }
        GUI.enabled = true;

        if (!isLocked)
        {
            if (GUI.Button(backButtonRect, "Back", buttonStyle))
            {
                ClearFocus();
                ADAGEMenu.ShowLast();
            }
        }

        if (ADAGE.AllowFacebook)
        {
            if (GUI.Button(facebookButtonRect, "", imageButtonStyle))
            {
                ClearFocus();
            }
        }

        CheckFields();
    }
Exemplo n.º 4
0
    public override void Draw()
    {
        GUI.BeginGroup(drawRect, "", "box");
        {
            GUI.Label(labelRect, string.Format("The system has made {0} failed attempts to connect to ADAGE. Continue in Offline Mode?", numAttempts));

            if (GUI.Button(yesRect, "Yes"))
            {
                Messenger.Broadcast(ADAGE.k_OnGameStart);
            }

            if (GUI.Button(noRect, "No"))
            {
                ADAGEMenu.ShowPanel <ADAGELoginPanel>();
            }
        }
        GUI.EndGroup();
    }
Exemplo n.º 5
0
    void Draw(int windowID)
    {
        if (backgroundImage != null)
        {
            GUI.DrawTexture(backgroundRect, backgroundImage);
        }

        if (overlay != null)
        {
            GUI.DrawTexture(overlayRect, overlay);
        }

        GUI.Box(menuRect, "");

        GUI.DrawTexture(logoRect, logo);

        if (GUI.Button(logoRect, "", invisibleButtonStyle))
        {
            ADAGEMenu.ShowPanel <ADAGEHomePanel>();
        }

        GUI.enabled = (popup == null);
        currentPanel.Draw();
        GUI.enabled = true;

        GUI.Label(errorRect, instance.error, errorStyle);

        if (popup != null)
        {
            if (overlay != null)
            {
                GUI.DrawTexture(overlayRect, overlay);
            }

            popup.Draw();
        }
    }
Exemplo n.º 6
0
 private void OnQR(bool locked = false)
 {
     ADAGEMenu.ShowPanel <ADAGEQRPanel>(locked);
 }
Exemplo n.º 7
0
 private void OnPassword(bool locked = false)
 {
     ADAGEMenu.ShowPanel <ADAGELoginPanel>(locked);
 }
Exemplo n.º 8
0
    public override IEnumerator Update()
    {
        if (cameraTexture == null)
        {
                        #if UNITY_WEBPLAYER
            yield return(Application.RequestUserAuthorization(UserAuthorization.WebCam));

            if (Application.HasUserAuthorization(UserAuthorization.WebCam))
            {
                InitCamera();
                yield return(null);
            }
            else
            {
                ADAGEMenu.ShowPanel <ADAGELoginPanel>();
            }
                        #else
            InitCamera();
                        #endif
        }
        else
        {
            if (!cameraTexture.isPlaying)
            {
                cameraTexture.Play();
            }
            else
            {
                if (W != cameraTexture.width)
                {
                    W = cameraTexture.width;
                }
                if (H != cameraTexture.height)
                {
                    H = cameraTexture.height;
                }
            }
        }

        if (c == null)
        {
            c = cameraTexture.GetPixels32();
        }

        if (qrResult != "" && !decoding)
        {
            lastQrResult = qrResult;

            try
            {
                ADAGEQRGroup qrData = LitJson.JsonMapper.ToObject <ADAGEQRGroup>(qrResult);
                ADAGEMenu.ShowPanel <ADAGESplashPanel>();
                ADAGE.ConnectWithQR(qrData.group);
            }
            catch
            {
                if (ADAGEMenu.instance != null)
                {
                    ADAGEMenu.ShowError(-1, "Invalid QR Code");
                    StartThread();
                }
            }
            qrResult = "";
        }
        yield return(null);
    }
Exemplo n.º 9
0
 private void OnRegistration()
 {
     ClearFocus();
     ADAGEMenu.ShowPanel <ADAGERegisterPanel>();
 }
Exemplo n.º 10
0
 private void OnLogin()
 {
     ClearFocus();
     ADAGEMenu.ShowPanel <ADAGELoginPanel>();
 }
Exemplo n.º 11
0
 private void OnRegistration(bool locked = false)
 {
     ClearFocus();
     ADAGEMenu.ShowPanel <ADAGERegisterPanel>(locked);
 }
Exemplo n.º 12
0
 private void OnLogin(bool locked = false)
 {
     ClearFocus();
     ADAGEMenu.ShowPanel <ADAGELoginOptionsPanel>(locked);
 }