// Token: 0x06000942 RID: 2370 RVA: 0x0003AB20 File Offset: 0x00038D20
 public void Draw(Rect rect, bool forceAlpha = false)
 {
     if (this.holder == null)
     {
         this.holder = AutoMonoBehaviour <TextureLoader> .Instance.Load(this.url, null);
     }
     if (this.holder.State == TextureLoader.State.Ok)
     {
         if (forceAlpha)
         {
             GUI.DrawTexture(rect, this.holder.Texture);
         }
         else
         {
             Color color = GUI.color;
             this.alpha = Mathf.Lerp(this.alpha, 1f, Time.deltaTime);
             GUI.color  = new Color(1f, 1f, 1f, (!GUI.enabled) ? Mathf.Min(this.alpha, 0.5f) : this.alpha);
             GUI.DrawTexture(rect, this.holder.Texture);
             GUI.color = color;
         }
     }
     else if (this.holder.State == TextureLoader.State.Downloading)
     {
         WaitingTexture.Draw(rect.center, 0);
     }
     else
     {
         GUI.Label(rect, "N/A", BlueStonez.label_interparkbold_13pt);
     }
 }
Пример #2
0
    // Token: 0x06000DBA RID: 3514 RVA: 0x0005F820 File Offset: 0x0005DA20
    public void OnGUI()
    {
        Rect position = this.GetPosition();

        GUI.Box(position, GUIContent.none, BlueStonez.window);
        GUITools.PushGUIState();
        GUI.enabled = !this.IsUIDisabled;
        GUI.BeginGroup(position);
        if (this._showExitButton && GUI.Button(new Rect(position.width - 20f, 0f, 20f, 20f), "X", BlueStonez.friends_hidden_button))
        {
            PopupSystem.HideMessage(this);
        }
        this.DrawPlayGUI(position);
        GUI.EndGroup();
        GUITools.PopGUIState();
        if (this.IsWaiting)
        {
            WaitingTexture.Draw(position.center, 0);
        }
        if (this.ClickAnywhereToExit && Event.current.type == EventType.MouseDown && !position.Contains(Event.current.mousePosition))
        {
            this.ClosePopup();
            Event.current.Use();
        }
        this.OnAfterGUI();
    }
    // Token: 0x06000DA8 RID: 3496 RVA: 0x0005F480 File Offset: 0x0005D680
    public void OnGUI()
    {
        Rect position = this.GetPosition();

        GUI.Box(position, GUIContent.none, BlueStonez.window);
        GUITools.PushGUIState();
        GUI.BeginGroup(position);
        this.DrawPlayGUI(position);
        GUI.EndGroup();
        GUITools.PopGUIState();
        if (this.IsWaiting)
        {
            WaitingTexture.Draw(position.center, 0);
        }
    }
Пример #4
0
    // Token: 0x06000CA2 RID: 3234 RVA: 0x00055358 File Offset: 0x00053558
    private void OnGUI()
    {
        float num = 400f;

        if (Mathf.Abs(this._keyboardOffset - this._targetKeyboardOffset) > 2f)
        {
            this._keyboardOffset = Mathf.Lerp(this._keyboardOffset, this._targetKeyboardOffset, Time.deltaTime * 4f);
        }
        else
        {
            this._keyboardOffset = this._targetKeyboardOffset;
        }
        if (this._height != this._targetHeight)
        {
            this._height = Mathf.Lerp(this._height, this._targetHeight, Time.deltaTime * 5f);
            if (Mathf.Approximately(this._height, this._targetHeight))
            {
                this._height = this._targetHeight;
            }
        }
        GUI.depth = 1;
        Rect position = new Rect(((float)Screen.width - num) * 0.5f, ((float)Screen.height - this._height) * 0.5f - this._keyboardOffset, num, this._height);

        GUI.BeginGroup(position, GUIContent.none, BlueStonez.window);
        GUI.Label(new Rect(0f, 0f, position.width, 56f), LocalizedStrings.ChooseCharacterName, BlueStonez.tab_strip);
        Rect position2 = new Rect(20f, 55f, position.width - 40f, position.height - 76f);

        GUI.Label(position2, GUIContent.none, BlueStonez.window_standard_grey38);
        GUI.BeginGroup(position2);
        GUI.Label(new Rect(10f, 8f, position2.width - 20f, 40f), "Please choose your character name.\nThis is the name that will be displayed to other players in game.", BlueStonez.label_interparkbold_11pt);
        GUI.color = new Color(1f, 1f, 1f, 0.3f);
        GUI.Label(new Rect(20f, 66f, 15f, 11f), (18 - this._characterName.Length).ToString(), BlueStonez.label_interparkmed_11pt_right);
        GUI.color   = Color.white;
        GUI.enabled = !this._waitingForWsReturn;
        GUI.changed = false;
        GUI.SetNextControlName("@Name");
        this._characterName = GUI.TextField(new Rect(40f, 60f, 180f, 22f), this._characterName, 18, BlueStonez.textField);
        this._characterName = TextUtilities.Trim(this._characterName);
        if (GUI.changed)
        {
            this._selectedIndex      = -1;
            this._checkButtonClicked = false;
        }
        if (string.IsNullOrEmpty(this._characterName) && GUI.GetNameOfFocusedControl() != "@Name")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(85f, 67f, 180f, 22f), LocalizedStrings.EnterYourName, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.enabled = true;
        this.DrawCheckAvailabilityButton(position2);
        if (this._waitingForWsReturn)
        {
            GUI.contentColor = Color.gray;
            GUI.Label(new Rect(165f, 100f, 100f, 20f), LocalizedStrings.PleaseWait, BlueStonez.label_interparkbold_11pt_left);
            GUI.contentColor = Color.white;
            WaitingTexture.Draw(new Vector2(140f, 110f), 0);
        }
        else
        {
            GUI.contentColor = this._feedbackMessageColor;
            GUI.Label(new Rect(0f, 100f, position2.width, 20f), this._errorMessage, BlueStonez.label_interparkbold_11pt);
            GUI.contentColor = Color.white;
        }
        this.DrawAvailableNames(new Rect(0f, 120f, position2.width, position2.height - 162f));
        this.DrawOKButton(position2);
        GUI.EndGroup();
        GUI.EndGroup();
    }
    // Token: 0x06000BC9 RID: 3017 RVA: 0x0004D3CC File Offset: 0x0004B5CC
    private void OnGUI()
    {
        if (Mathf.Abs(this._keyboardOffset - this._targetKeyboardOffset) > 2f)
        {
            this._keyboardOffset = Mathf.Lerp(this._keyboardOffset, this._targetKeyboardOffset, Time.deltaTime * 4f);
        }
        else
        {
            this._keyboardOffset = this._targetKeyboardOffset;
        }
        this._groupRect = new Rect((float)(Screen.width - 340) * 0.5f, (float)(Screen.height - 200) * 0.5f - this._keyboardOffset, 340f, 200f);
        GUI.depth       = 3;
        GUI.skin        = BlueStonez.Skin;
        Rect groupRect = this._groupRect;

        GUI.BeginGroup(groupRect, string.Empty, BlueStonez.window_standard_grey38);
        if (this.nameChangeItem != null)
        {
            this.nameChangeItem.DrawIcon(new Rect(8f, 8f, 48f, 48f));
            if (BlueStonez.label_interparkbold_32pt_left.CalcSize(new GUIContent(this.nameChangeItem.View.Name)).x > groupRect.width - 72f)
            {
                GUI.Label(new Rect(64f, 8f, groupRect.width - 72f, 30f), this.nameChangeItem.View.Name, BlueStonez.label_interparkbold_18pt_left);
            }
            else
            {
                GUI.Label(new Rect(64f, 8f, groupRect.width - 72f, 30f), this.nameChangeItem.View.Name, BlueStonez.label_interparkbold_32pt_left);
            }
        }
        GUI.Label(new Rect(64f, 30f, groupRect.width - 72f, 30f), LocalizedStrings.FunctionalItem, BlueStonez.label_interparkbold_16pt_left);
        Rect rect = new Rect(8f, 116f, this._groupRect.width - 16f, this._groupRect.height - 120f - 46f);

        GUI.BeginGroup(new Rect(rect.xMin, 74f, rect.width, rect.height + 42f), string.Empty, BlueStonez.group_grey81);
        GUI.EndGroup();
        GUI.Label(new Rect(56f, 72f, 227f, 20f), LocalizedStrings.ChooseCharacterName, BlueStonez.label_interparkbold_11pt);
        GUI.SetNextControlName("@ChooseName");
        Rect position = new Rect(56f, 102f, 227f, 24f);

        GUI.changed  = false;
        this.newName = GUI.TextField(position, this.newName, 18, BlueStonez.textField);
        this.newName = TextUtilities.Trim(this.newName);
        if (string.IsNullOrEmpty(this.newName) && GUI.GetNameOfFocusedControl() != "@ChooseName")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(position, LocalizedStrings.EnterYourName, BlueStonez.label_interparkmed_11pt);
            GUI.color = Color.white;
        }
        if (GUITools.Button(new Rect(groupRect.width - 118f, 160f, 110f, 32f), new GUIContent(LocalizedStrings.CancelCaps), BlueStonez.button))
        {
            this.HideKeyboard();
            this.Hide();
        }
        GUI.enabled = !this.isChangingName;
        if (GUITools.Button(new Rect(groupRect.width - 230f, 160f, 110f, 32f), new GUIContent(LocalizedStrings.OkCaps), BlueStonez.button_green))
        {
            this.HideKeyboard();
            this.ChangeName();
        }
        GUI.EndGroup();
        GUI.enabled = true;
        if (this.isChangingName)
        {
            WaitingTexture.Draw(new Vector2(groupRect.x + 305f, groupRect.y + 114f), 0);
        }
        GuiManager.DrawTooltip();
    }