// Token: 0x06002CE0 RID: 11488 RVA: 0x000A7FF4 File Offset: 0x000A61F4
 private void SetContextClientState(ContextClientState state)
 {
     if (this._clientState != state)
     {
         if (this._clientState == ContextClientState.Off)
         {
             this._clientState = state;
             if (ContextUI.clientWorkingCallbacks != null)
             {
                 ContextUI.clientWorkingCallbacks(true);
             }
         }
         else if (state == ContextClientState.Off)
         {
             this._clientState = state;
             if (ContextUI.clientWorkingCallbacks != null)
             {
                 ContextUI.clientWorkingCallbacks(false);
             }
         }
         else
         {
             this._clientState = state;
         }
     }
 }
    // 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);
    }
예제 #3
0
    private void OnGUI()
    {
        GUI.depth = 1;
        GUI.skin  = this.skin;
        GUIStyle           gUIStyle           = "ctxbox";
        GUIStyle           gUIStyle1          = "ctxbutton";
        int                num                = -1;
        ContextClientState contextClientState = this.clientState;

        if (contextClientState == ContextClientState.Options)
        {
            num = this.GUIOptions(gUIStyle, gUIStyle1);
            if (num == -1 && NetCull.localTimeInMillis - this.clientQueryTime > (long)300 && !Context.UICommands.IsButtonHeld(false))
            {
                Context.EndQuery();
            }
        }
        else
        {
            if (contextClientState != ContextClientState.Validating)
            {
                return;
            }
            ContextUI.GUIString(this.validatingString, gUIStyle);
        }
        if (num != -1)
        {
            this.OnClientSelection(num);
        }
    }
    // Token: 0x06002CDF RID: 11487 RVA: 0x000A7F48 File Offset: 0x000A6148
    private void OnGUI()
    {
        GUI.depth = 1;
        GUI.skin  = this.skin;
        GUIStyle           box         = "ctxbox";
        GUIStyle           button      = "ctxbutton";
        int                num         = -1;
        ContextClientState clientState = this.clientState;

        if (clientState != ContextClientState.Options)
        {
            if (clientState != ContextClientState.Validating)
            {
                return;
            }
            ContextUI.GUIString(this.validatingString, box);
        }
        else
        {
            num = this.GUIOptions(box, button);
            if (num == -1 && global::NetCull.localTimeInMillis - this.clientQueryTime > 300UL && !global::Context.UICommands.IsButtonHeld(false))
            {
                global::Context.EndQuery();
            }
        }
        if (num != -1)
        {
            this.OnClientSelection(num);
        }
    }
예제 #5
0
        /// <summary>
        /// 添加联系上下文
        /// </summary>
        /// <param name="trans"></param>
        /// <param name="insID"></param>
        public void AddContext(UIElement trans, int insID)
        {
            ContextUI co = new ContextUI();

            co.Ins   = trans;
            co.InsID = insID;
            uiobjects.Add(co);
        }
예제 #6
0
 private void OnDestroy()
 {
     if (Context.self == this)
     {
         Context.self              = null;
         Context.network           = null;
         Context.swallowInputCount = 0;
         Context.ui = null;
     }
 }
예제 #7
0
 private void OnDestroy()
 {
     if (self == this)
     {
         self              = null;
         network           = null;
         swallowInputCount = 0;
         ui = null;
     }
 }
예제 #8
0
 private void Awake()
 {
     if (Context.self && Context.self != this)
     {
         Debug.LogError("More than one", this);
         return;
     }
     Context.self    = this;
     Context.network = base.GetComponent <uLinkNetworkView>();
     Context.ui      = base.GetComponent <ContextUI>();
 }
예제 #9
0
 private void Awake()
 {
     if ((self != null) && (self != this))
     {
         Debug.LogError("More than one", this);
     }
     else
     {
         self    = this;
         network = base.GetComponent <uLinkNetworkView>();
         ui      = base.GetComponent <ContextUI>();
     }
 }
    // 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);
    }
예제 #11
0
        /// <summary>
        ///		Carga los datos del árbol
        /// </summary>
        public void Load()
        {
            object state = new object();

            // Carga los nodos en el árbol
            //? _contexUi mantiene el contexto de sincronización que creó el ViewModel (que debería ser la interface de usuario)
            //? Al generarse las tablas en otro hilo o desde un evento, no se puede borrar ObservableCollection sin una
            //? excepción del tipo "Este tipo de CollectionView no admite cambios en su SourceCollection desde un hilo diferente del hilo Dispatcher"
            //? Por eso se tiene que añadir el mensaje de log desde el contexto de sincronización de la UI
            ContextUI.Send(_ => {
                List <IHierarchicalViewModel> nodesExpanded = GetNodesExpanded(Children);

                // Limpia la colección de hijos
                Children.Clear();
                // Añade los nodos raíz
                AddRootNodes();
                // Expande los nodos previamente abiertos
                ExpandNodes(Children, nodesExpanded);
            },
                           state
                           );
        }
예제 #12
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);
    }
예제 #13
0
 private void OnDestroy()
 {
     if (Context.self == this)
     {
         Context.self = null;
         Context.network = null;
         Context.swallowInputCount = 0;
         Context.ui = null;
     }
 }
예제 #14
0
 private void Awake()
 {
     if (Context.self && Context.self != this)
     {
         Debug.LogError("More than one", this);
         return;
     }
     Context.self = this;
     Context.network = base.GetComponent<uLinkNetworkView>();
     Context.ui = base.GetComponent<ContextUI>();
 }