示例#1
0
    IEnumerator TryRegister()
    {
        registerPanel.Disable();
        var user = new Player()
        {
            Username = Username.Text,
            Password = Password.Text,
            Email    = Email.Text,
            Level    = 1,
            Health   = 100
        };


        Task signUpTask = user.SignUpAsync();

        while (!signUpTask.IsCompleted)
        {
            yield return(null);
        }
        if (signUpTask.IsFaulted || signUpTask.IsCanceled)
        {
            DialogPanel.Show("Think differently", "The username or email adress is already in use. Please choose something even more original.");
            DialogPanel.Dismissed += new global::DialogPanel.DismissedEventHandler(DialogPanel_Dismissed);
        }
        else
        {
            LoginPanel.GetComponent <LoginPanel>().Username.Text = user.Username;
            LoginPanel.GetComponent <LoginPanel>().Password.Text = Password.Text;

            registerPanel.Hide();
            LoginPanel.Show();
        }
    }
示例#2
0
    public virtual void Show()
    {
        if (showTweensDestination != null)
        {
            showTweensDestination.Play();
        }
        else
        {
            owner.Show();
        }

        dfProgressBar bar = GetComponent <dfProgressBar>();

        if (bar == null)
        {
            bar = GetComponentInChildren <dfProgressBar>();
        }
        if (bar == null)
        {
            return;
        }

        bar.Hide();
        bar.Value = 0;
    }
    /// <summary>
    /// Displays the drag cursor, which will follow the mouse until hidden
    /// </summary>
    /// <param name="sprite">The sprite to display in the drag cursor</param>
    /// <param name="position">The initial position of the drag cursor</param>
    /// <param name="offset">The mouse offset within the dragged object</param>
    public static void Show(SpellDefinition spell)
    {
        if (spell == null)
        {
            Hide();
            return;
        }

        // Assign label text, which will internally recalculate the label's Size
        _name.Text = spell.Name;
        _info.Text = spell.Description;

        // Resize this control to match the size of the contents
        var labelHeight = _info.RelativePosition.y + _info.Size.y;

        _panel.Height = labelHeight;

        // The tooltip should appear above the mouse
        _cursorOffset = new Vector2(0, labelHeight + 10);

        // Display the base panel
        _panel.Show();
        _panel.BringToFront();

        // Call the update function to position the tooltip
        _instance.Update();
    }
示例#4
0
 void RegisterButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     loginPanel.Hide();
     RegisterPanel.Show();
     RegisterPanel.GetComponent <RegisterPanel>().Username.Text = Username.Text;
     RegisterPanel.GetComponent <RegisterPanel>().Password.Text = Password.Text;
 }
示例#5
0
 void ChampionsButton_Click(dfControl control, dfMouseEventArgs mouseEvent)
 {
     if (Player.Level < 4)
     {
         WaitPanel.Show();
         panel.Disable();
     }
     else
     {
         Application.LoadLevel("Champions arena");
     }
 }
示例#6
0
    public void ShowMissionMenu()
    {
        switch (PlayerPrefs.GetString(CameFromScript.CAME_FROM))
        {
        case CameFromScript.BOOTCAMP:
            Time.timeScale = 0;
            break;

        case CameFromScript.CHAMPIONS_ARENA:
            Time.timeScale = 1;
            break;
        }

        panel.Show();
    }
示例#7
0
    public IEnumerator missionDone(bool win)
    {
        yield return(new WaitForSeconds(2));

        if (win)
        {
            logger.StopLogging("won");
            MissionDonePanel.Show();
        }
        else
        {
            logger.StopLogging("lost");
            MissionDoneLosePanel.Show();
        }
        // Camera.main.GetComponent<MousePan>().Activated = false;
    }
示例#8
0
    public void SetVisible(bool visible)
    {
        this.entryLabel.Text = (!this.changingEntry ? "Password:"******"New Password:");
        dfPanel component = base.GetComponent <dfPanel>();

        if (!visible)
        {
            component.Hide();
            this.passwordInput.Unfocus();
        }
        else
        {
            component.Show();
            component.BringToFront();
            this.passwordInput.Text = string.Empty;
            this.passwordInput.Focus();
        }
        base.gameObject.SetActive(visible);
    }
    public void ShowSelectWeapons(WeaponType type)
    {
        Weapon1.weaponButton.Click += new MouseEventHandler(weaponButton_Click);
        Weapon2.weaponButton.Click += new MouseEventHandler(weaponButton_Click);
        Weapon3.weaponButton.Click += new MouseEventHandler(weaponButton_Click);
        panel.Show();
        switch (type)
        {
        case WeaponType.Melee:
            ShowMeleeWeapons();
            break;

        case WeaponType.Ranged:
            ShowRangedWeapons();
            break;

        case WeaponType.Mortar:
            ShowMortarWeapons();
            break;
        }
    }
示例#10
0
    private void DoEnding()
    {
        showBanner = true;
        if ((Time.time > timeGameOver + 2) && !panelResults.IsVisible)
        {
            audio.Play();
            panelResults.Show();

            socialController.DoUpdateEndGameStatus(distance);
            if (googlePlay)
            {
                socialController.ComputeSocial();
            }

            int highScore = socialController.highScore;
            int score     = socialController.score;

            labelScore.Text     = score.ToString();
            labelHighScore.Text = highScore.ToString();
        }
    }
示例#11
0
    public void SetDialog(string title, string text, string buttonText, bool pause, bool endGame, GameObject prefab = null)
    {
        if (prefab != null)
        {
            guiCamera      = (GameObject)Instantiate(guiCameraPrefab, Vector3.zero, Quaternion.identity);
            guiCameraLight = (GameObject)Instantiate(guiCameraLightPrefab, Vector3.zero, Quaternion.identity);
            renderObject   = (GameObject)Instantiate(prefab, guiCamera.transform.position + guiCamera.transform.forward * 32, Quaternion.identity);
            renderObject.transform.Translate(guiCamera.transform.up * -9);
            Building b = renderObject.GetComponent <Building>();
            if (b != null)
            {
                text = text + "\n\n" + b.StatsText();
            }
            //renderObject.transform.Rotate(100, 0, 0);
            timestamp = System.DateTime.Now;
            dialogImage.Parent.Show();
            dialogImage.Show();
        }
        else
        {
            dialogImage.Parent.Hide();
            dialogImage.Hide();
        }

        dialogTitle.Text  = title;
        dialogText.Text   = text;
        dialogButton.Text = buttonText;


        dialogButton.Focus();
        //show the dialog and pause time if desired
        dialogPanel.Show();
        if (pause)
        {
            Time.timeScale = 0;
        }
        this.endGame = endGame;
    }
示例#12
0
 public void doNotPlayLogin()
 {
     googlePlay = false;
     panelStartMenu.Show();
 }
示例#13
0
 // Use this for initialization
 void Start()
 {
     socialController = SocialController.GetInstance();
     panelGooglePlay.Show();
 }
 public void ShowDialog()
 {
     panel.Show();
 }
示例#15
0
 public void ShowDialog(string text)
 {
     _label.Text = text;
     _panel.Show();
     _button.Enable();
 }
示例#16
0
 public void InvitePlayer(Player player)
 {
     playerToInvite = player;
     InvitePanel.Show();
     TextLabel.Text = string.Format("Invite {0} to a match.", player.Username);
 }
示例#17
0
 public void ShowDialog()
 {
     AssignText();
     Panel.Show();
 }
示例#18
0
 public void ShowTutorial()
 {
     panel.Show();
     StartButton.Text = "OK";
 }