// Token: 0x06002CDD RID: 11485 RVA: 0x000A7CD8 File Offset: 0x000A5ED8
    private static void GUIString(string text, GUIStyle box)
    {
        int num;
        int num2;

        GUI.Box(ContextUI.BoxRect(box.CalcSize(ContextUI.temp), box, out num, out num2), ContextUI.temp, box);
    }
    // Token: 0x06002CDE RID: 11486 RVA: 0x000A7D08 File Offset: 0x000A5F08
    private int GUIOptions(GUIStyle box, GUIStyle button)
    {
        Rect[] array = new Rect[this.clientContext.length];
        int?   num   = (button.fixedWidth != 0f) ? new int?((int)button.fixedWidth) : null;
        int?   num2  = (button.fixedHeight != 0f) ? new int?((int)button.fixedHeight) : null;
        float  num3  = float.NegativeInfinity;
        float  num4  = 0f;

        for (int i = 0; i < this.clientContext.length; i++)
        {
            ContextUI.temp.text = this.clientContext.option[i].text;
            Vector2 vector = button.CalcSize(ContextUI.temp);
            Rect    rect   = button.margin.Add(array[i] = button.padding.Add(new Rect(0f, 0f, (float)((num == null) ? Mathf.CeilToInt(vector.x) : num.Value), (float)((num2 == null) ? Mathf.CeilToInt(vector.y) : num2.Value))));
            if (rect.width > num3)
            {
                num3 = rect.width;
            }
            num4 += rect.height;
        }
        int num5;
        int num6;

        GUI.Box(ContextUI.BoxRect(new Vector2(num3, num4), box, out num5, out num6), GUIContent.none, box);
        int result = -1;

        for (int j = 0; j < this.clientContext.length; j++)
        {
            Rect rect2 = button.margin.Add(array[j]);
            rect2.width = num3;
            rect2.x     = (float)num5;
            rect2.y     = (float)num6;
            num6        = Mathf.FloorToInt(button.margin.Add(rect2).yMax);
            if (GUI.Button(button.margin.Remove(rect2), this.clientContext.option[j].text, button))
            {
                result = j;
            }
        }
        return(result);
    }
Beispiel #3
0
    private int GUIOptions(GUIStyle box, GUIStyle button)
    {
        int  num;
        int  num1;
        Rect rect;
        int? nullable;
        int? nullable1;

        Rect[] rectArray = new Rect[this.clientContext.length];
        if (button.fixedWidth != 0f)
        {
            nullable = new int?((int)button.fixedWidth);
        }
        else
        {
            nullable = null;
        }
        int?nullable2 = nullable;

        if (button.fixedHeight != 0f)
        {
            nullable1 = new int?((int)button.fixedHeight);
        }
        else
        {
            nullable1 = null;
        }
        int?  nullable3 = nullable1;
        float single    = Single.NegativeInfinity;
        float single1   = 0f;

        for (int i = 0; i < this.clientContext.length; i++)
        {
            ContextUI.temp.text = this.clientContext.option[i].text;
            Vector2    vector2    = button.CalcSize(ContextUI.temp);
            RectOffset rectOffset = button.margin;
            Rect       rect1      = button.padding.Add(new Rect(0f, 0f, (float)((!nullable2.HasValue ? Mathf.CeilToInt(vector2.x) : nullable2.Value)), (float)((!nullable3.HasValue ? Mathf.CeilToInt(vector2.y) : nullable3.Value))));
            rect         = rect1;
            rectArray[i] = rect1;
            Rect rect2 = rectOffset.Add(rect);
            if (rect2.width > single)
            {
                single = rect2.width;
            }
            single1 = single1 + rect2.height;
        }
        GUI.Box(ContextUI.BoxRect(new Vector2(single, single1), box, out num, out num1), GUIContent.none, box);
        int num2 = -1;

        for (int j = 0; j < this.clientContext.length; j++)
        {
            Rect rect3 = button.margin.Add(rectArray[j]);
            rect3.width = single;
            rect3.x     = (float)num;
            rect3.y     = (float)num1;
            rect        = button.margin.Add(rect3);
            num1        = Mathf.FloorToInt(rect.yMax);
            if (GUI.Button(button.margin.Remove(rect3), this.clientContext.option[j].text, button))
            {
                num2 = j;
            }
        }
        return(num2);
    }