Example #1
0
    public static void ReplaceAtlas(global::UIAtlas before, global::UIAtlas after)
    {
        global::UISprite[] array = global::NGUITools.FindActive <global::UISprite>();
        int i   = 0;
        int num = array.Length;

        while (i < num)
        {
            global::UISprite uisprite = array[i];
            if (uisprite.atlas == before)
            {
                uisprite.atlas = after;
            }
            i++;
        }
        global::UILabel[] array2 = global::NGUITools.FindActive <global::UILabel>();
        int j    = 0;
        int num2 = array2.Length;

        while (j < num2)
        {
            global::UILabel uilabel = array2[j];
            if (uilabel.font != null && uilabel.font.atlas == before)
            {
                uilabel.font.atlas = after;
            }
            j++;
        }
    }
Example #2
0
    // Token: 0x060029FB RID: 10747 RVA: 0x0009B488 File Offset: 0x00099688
    public void ForceUpdate()
    {
        global::HumanBodyTakeDamage humanBodyTakeDamage;
        global::DamageTypeList      damageTypeList;

        if (global::RPOS.GetObservedPlayerComponent <global::HumanBodyTakeDamage>(out humanBodyTakeDamage))
        {
            damageTypeList = humanBodyTakeDamage.GetArmorValues();
        }
        else
        {
            damageTypeList = new global::DamageTypeList();
        }
        this.leftText.text  = string.Empty;
        this.rightText.text = string.Empty;
        for (int i = 0; i < 6; i++)
        {
            if (damageTypeList[i] != 0f)
            {
                global::UILabel uilabel = this.leftText;
                uilabel.text = uilabel.text + global::TakeDamage.DamageIndexToString((global::DamageTypeIndex)i) + "\n";
                global::UILabel uilabel2 = this.rightText;
                string          text     = uilabel2.text;
                uilabel2.text = string.Concat(new object[]
                {
                    text,
                    "+",
                    (int)damageTypeList[i],
                    "\n"
                });
            }
        }
    }
Example #3
0
        static StackObject *AssignFromStack_label_0(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            global::UILabel @label = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            ((global::UIInput)o).label = @label;
            return(ptr_of_this_method);
        }
Example #4
0
 // Token: 0x060049C6 RID: 18886 RVA: 0x0011B098 File Offset: 0x00119298
 private void OnItemHover(GameObject go, bool isOver)
 {
     if (isOver)
     {
         global::UILabel component = go.GetComponent <global::UILabel>();
         this.Highlight(component, false);
     }
 }
Example #5
0
        static StackObject *AssignFromStack_TabTitle_2(ref object o, ILIntepreter __intp, StackObject *ptr_of_this_method, IList <object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            global::UILabel @TabTitle = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            global::UITabController.TabLibEntry ins = (global::UITabController.TabLibEntry)o;
            ins.TabTitle = @TabTitle;
            o            = ins;
            return(ptr_of_this_method);
        }
    // Token: 0x060028EC RID: 10476 RVA: 0x00095D68 File Offset: 0x00093F68
    public GameObject AddBasicLabel(string text, float aboveSpace, Color col)
    {
        float           contentHeight       = this.GetContentHeight();
        GameObject      gameObject          = global::NGUITools.AddChild(this.addParent, this.basicLabelPrefab);
        global::UILabel componentInChildren = gameObject.GetComponentInChildren <global::UILabel>();

        componentInChildren.text  = text;
        componentInChildren.color = col;
        gameObject.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
        return(gameObject);
    }
    // Token: 0x06002A24 RID: 10788 RVA: 0x0009C388 File Offset: 0x0009A588
    public GameObject AddProgressStat(string text, float currentAmount, float maxAmount, float aboveSpace)
    {
        float            contentHeight       = this.GetContentHeight();
        GameObject       gameObject          = global::NGUITools.AddChild(this.addParent, this.progressStatPrefab);
        global::UISlider componentInChildren = gameObject.GetComponentInChildren <global::UISlider>();
        global::UILabel  component           = global::FindChildHelper.FindChildByName("ProgressStatTitle", gameObject.gameObject).GetComponent <global::UILabel>();
        global::UILabel  component2          = global::FindChildHelper.FindChildByName("ProgressAmountLabel", gameObject.gameObject).GetComponent <global::UILabel>();

        component.text  = text;
        component2.text = ((currentAmount >= 1f) ? currentAmount.ToString("N0") : currentAmount.ToString("N2"));
        componentInChildren.sliderValue = currentAmount / maxAmount;
        gameObject.transform.SetLocalPositionY(-(contentHeight + aboveSpace));
        return(gameObject);
    }
Example #8
0
    // Token: 0x06004EAD RID: 20141 RVA: 0x00145A98 File Offset: 0x00143C98
    private static void ChangeFocus(global::UICamera camera, global::UIInput input, global::UILabel label)
    {
        bool flag = global::UIUnityEvents.lastInput != input;

        if (flag)
        {
            global::UIUnityEvents.lastInput        = input;
            global::UIUnityEvents.textInputContent = null;
            global::UIUnityEvents.requiresBinding  = input;
            global::UIUnityEvents.focusSetInOnGUI  = global::UIUnityEvents.inOnGUI;
        }
        global::UIUnityEvents.lastInputCamera = camera;
        global::UIUnityEvents.lastLabel       = label;
    }
Example #9
0
        static StackObject *get_text_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UILabel instance_of_this_method = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.text;

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Example #10
0
    // Token: 0x06004C0F RID: 19471 RVA: 0x00129890 File Offset: 0x00127A90
    public void MarkAsDirty()
    {
        global::UISprite[] array = global::NGUITools.FindActive <global::UISprite>();
        int i   = 0;
        int num = array.Length;

        while (i < num)
        {
            global::UISprite uisprite = array[i];
            if (global::UIAtlas.CheckIfRelated(this, uisprite.atlas))
            {
                global::UIAtlas atlas = uisprite.atlas;
                uisprite.atlas = null;
                uisprite.atlas = atlas;
            }
            i++;
        }
        global::UIFont[] array2 = global::Resources.FindObjectsOfTypeAll(typeof(global::UIFont)) as global::UIFont[];
        int j    = 0;
        int num2 = array2.Length;

        while (j < num2)
        {
            global::UIFont uifont = array2[j];
            if (global::UIAtlas.CheckIfRelated(this, uifont.atlas))
            {
                global::UIAtlas atlas2 = uifont.atlas;
                uifont.atlas = null;
                uifont.atlas = atlas2;
            }
            j++;
        }
        global::UILabel[] array3 = global::NGUITools.FindActive <global::UILabel>();
        int k    = 0;
        int num3 = array3.Length;

        while (k < num3)
        {
            global::UILabel uilabel = array3[k];
            if (uilabel.font != null && global::UIAtlas.CheckIfRelated(this, uilabel.font.atlas))
            {
                global::UIFont font = uilabel.font;
                uilabel.font = null;
                uilabel.font = font;
            }
            k++;
        }
    }
Example #11
0
    public static void ReplaceFont(global::UIFont before, global::UIFont after)
    {
        global::UILabel[] array = global::NGUITools.FindActive <global::UILabel>();
        int i   = 0;
        int num = array.Length;

        while (i < num)
        {
            global::UILabel uilabel = array[i];
            if (uilabel.font == before)
            {
                uilabel.font = after;
            }
            i++;
        }
    }
Example #12
0
        static StackObject *get_fontSize_5(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UILabel instance_of_this_method = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.fontSize;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
Example #13
0
        static StackObject *set_fontSize_7(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @value = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UILabel instance_of_this_method = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.fontSize = value;

            return(__ret);
        }
Example #14
0
        static StackObject *set_alignment_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::NGUIText.Alignment @value = (global::NGUIText.Alignment) typeof(global::NGUIText.Alignment).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UILabel instance_of_this_method = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.alignment = value;

            return(__ret);
        }
Example #15
0
        static StackObject *set_gradientTop_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Color @value = (UnityEngine.Color) typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            global::UILabel instance_of_this_method = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            instance_of_this_method.gradientTop = value;

            return(__ret);
        }
Example #16
0
        static StackObject *Add_0(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UILabel @item = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Collections.Generic.List <global::UILabel> instance_of_this_method = (System.Collections.Generic.List <global::UILabel>) typeof(System.Collections.Generic.List <global::UILabel>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Add(@item);

            return(__ret);
        }
Example #17
0
    // Token: 0x060049C7 RID: 18887 RVA: 0x0011B0BC File Offset: 0x001192BC
    private void Select(global::UILabel lbl, bool instant)
    {
        this.Highlight(lbl, instant);
        global::UIEventListener component = lbl.gameObject.GetComponent <global::UIEventListener>();

        this.selection = (component.parameter as string);
        global::UIButtonSound[] components = base.GetComponents <global::UIButtonSound>();
        int i   = 0;
        int num = components.Length;

        while (i < num)
        {
            global::UIButtonSound uibuttonSound = components[i];
            if (uibuttonSound.trigger == global::UIButtonSound.Trigger.OnClick)
            {
                global::NGUITools.PlaySound(uibuttonSound.audioClip, uibuttonSound.volume, 1f);
            }
            i++;
        }
    }
Example #18
0
        static StackObject *Instantiate_13(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            global::UILabel @original = (global::UILabel)typeof(global::UILabel).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));

            __intp.Free(ptr_of_this_method);


            var result_of_this_method = UnityEngine.Object.Instantiate <global::UILabel>(@original);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Example #19
0
 // Token: 0x060049C5 RID: 18885 RVA: 0x0011AFB4 File Offset: 0x001191B4
 private void Highlight(global::UILabel lbl, bool instant)
 {
     if (this.mHighlight != null)
     {
         global::TweenPosition component = lbl.GetComponent <global::TweenPosition>();
         if (component != null && component.enabled)
         {
             return;
         }
         this.mHighlightedLabel = lbl;
         global::UIAtlas.Sprite sprite = this.mHighlight.sprite;
         float   num    = sprite.inner.xMin - sprite.outer.xMin;
         float   num2   = sprite.inner.yMin - sprite.outer.yMin;
         Vector3 vector = lbl.cachedTransform.localPosition + new Vector3(-num, num2, 0f);
         if (instant || !this.isAnimated)
         {
             this.mHighlight.cachedTransform.localPosition = vector;
         }
         else
         {
             global::TweenPosition.Begin(this.mHighlight.gameObject, 0.1f, vector).method = global::UITweener.Method.EaseOut;
         }
     }
 }
 // Token: 0x06004DCA RID: 19914 RVA: 0x00135D8C File Offset: 0x00133F8C
 private void OnLocalize(global::Localization loc)
 {
     if (this.mLanguage != loc.currentLanguage)
     {
         global::UIWidget component = base.GetComponent <global::UIWidget>();
         global::UILabel  uilabel   = component as global::UILabel;
         global::UISprite uisprite  = component as global::UISprite;
         if (string.IsNullOrEmpty(this.mLanguage) && string.IsNullOrEmpty(this.key) && uilabel != null)
         {
             this.key = uilabel.text;
         }
         string text = (!string.IsNullOrEmpty(this.key)) ? loc.Get(this.key) : loc.Get(component.name);
         if (uilabel != null)
         {
             uilabel.text = text;
         }
         else if (uisprite != null)
         {
             uisprite.spriteName = text;
             uisprite.MakePixelPerfect();
         }
         this.mLanguage = loc.currentLanguage;
     }
 }
Example #21
0
 // Token: 0x06004EB7 RID: 20151 RVA: 0x00145DD4 File Offset: 0x00143FD4
 private static void TextKeyDown(global::UICamera camera, global::UIInput input, UnityEngine.Event @event, global::UILabel label)
 {
     if (input == global::UIUnityEvents.lastInput && camera == global::UIUnityEvents.lastInputCamera)
     {
         global::UIUnityEvents.lastLabel = label;
         TextEditor textEditor = null;
         if (!global::UIUnityEvents.GetTextEditor(out textEditor))
         {
             return;
         }
         if (!global::UIUnityEvents.GetKeyboardControl())
         {
             Debug.Log("Did not " + @event);
             return;
         }
         bool changed = false;
         if (global::UIUnityEvents.TextEditorHandleEvent(@event, textEditor))
         {
             @event.Use();
             changed = true;
         }
         else
         {
             KeyCode keyCode = @event.keyCode;
             if (keyCode == 9)
             {
                 return;
             }
             if (keyCode == null)
             {
                 char character = @event.character;
                 if (character == '\t')
                 {
                     return;
                 }
                 bool           flag = character == '\n';
                 global::BMFont bmFont;
                 if (flag && !input.inputMultiline && [email protected])
                 {
                     global::UIUnityEvents.submit = true;
                 }
                 else if (label.font && (bmFont = label.font.bmFont) != null)
                 {
                     if (flag || (character != '\0' && bmFont.ContainsGlyph((int)character)))
                     {
                         textEditor.Insert(character);
                         changed = true;
                     }
                     else if (character == '\0')
                     {
                         if (Input.compositionString.Length > 0)
                         {
                             textEditor.ReplaceSelection(string.Empty);
                             changed = true;
                         }
                         @event.Use();
                     }
                 }
             }
         }
         global::UIUnityEvents.TextSharedEnd(changed, textEditor, @event);
     }
 }
Example #22
0
 // Token: 0x06004EB6 RID: 20150 RVA: 0x00145DC4 File Offset: 0x00143FC4
 internal static void TextKeyDown(global::UICamera camera, global::UIInput input, NGUIHack.Event @event, global::UILabel label)
 {
     global::UIUnityEvents.TextKeyDown(camera, input, @event.real, label);
 }
Example #23
0
 // Token: 0x06004EB5 RID: 20149 RVA: 0x00145D78 File Offset: 0x00143F78
 private static void TextKeyUp(global::UICamera camera, global::UIInput input, UnityEngine.Event @event, global::UILabel label)
 {
     if (input == global::UIUnityEvents.lastInput && camera == global::UIUnityEvents.lastInputCamera)
     {
         global::UIUnityEvents.lastLabel = label;
         TextEditor te = null;
         if (!global::UIUnityEvents.GetTextEditor(out te))
         {
             return;
         }
         global::UIUnityEvents.TextSharedEnd(false, te, @event);
     }
 }
Example #24
0
 // Token: 0x06004EB3 RID: 20147 RVA: 0x00145CD8 File Offset: 0x00143ED8
 private static void TextDrag(global::UICamera camera, global::UIInput input, UnityEngine.Event @event, global::UILabel label)
 {
     if (input == global::UIUnityEvents.lastInput && camera == global::UIUnityEvents.lastInputCamera)
     {
         global::UIUnityEvents.lastLabel = label;
         TextEditor te = null;
         if (!global::UIUnityEvents.GetTextEditor(out te))
         {
             return;
         }
         if (global::UIUnityEvents.controlID == GUIUtility.hotControl)
         {
             global::UITextPosition uitextPosition = camera.RaycastText(Input.mousePosition, label);
             if ([email protected])
             {
                 global::UIUnityEvents.SelectTextPosition(@event, te, ref uitextPosition);
             }
             else
             {
                 global::UIUnityEvents.MoveTextPosition(@event, te, ref uitextPosition);
             }
             @event.Use();
         }
         global::UIUnityEvents.TextSharedEnd(false, te, @event);
     }
 }
Example #25
0
 // Token: 0x06004EB1 RID: 20145 RVA: 0x00145C14 File Offset: 0x00143E14
 private static void TextClickUp(global::UICamera camera, global::UIInput input, UnityEngine.Event @event, global::UILabel label)
 {
     if (input == global::UIUnityEvents.lastInput && camera == global::UIUnityEvents.lastInputCamera)
     {
         global::UIUnityEvents.lastLabel = label;
         TextEditor textEditor = null;
         if (!global::UIUnityEvents.GetTextEditor(out textEditor))
         {
             return;
         }
         if (global::UIUnityEvents.controlID == GUIUtility.hotControl)
         {
             textEditor.MouseDragSelectsWholeWords(false);
             GUIUtility.hotControl = 0;
             @event.Use();
             global::UIUnityEvents.SetKeyboardControl();
         }
         else
         {
             Debug.Log(string.Concat(new object[]
             {
                 "Did not match ",
                 global::UIUnityEvents.controlID,
                 " ",
                 GUIUtility.hotControl
             }));
         }
         global::UIUnityEvents.TextSharedEnd(false, textEditor, @event);
     }
 }
Example #26
0
    // Token: 0x06004EAF RID: 20143 RVA: 0x00145B2C File Offset: 0x00143D2C
    private static void TextClickDown(global::UICamera camera, global::UIInput input, UnityEngine.Event @event, global::UILabel label)
    {
        global::UITextPosition uitextPosition = ([email protected]) ? camera.RaycastText(Input.mousePosition, label) : default(global::UITextPosition);
        TextEditor             textEditor     = null;

        global::UIUnityEvents.ChangeFocus(camera, input, label);
        if (!global::UIUnityEvents.GetTextEditor(out textEditor))
        {
            Debug.LogError("Null Text Editor");
        }
        else
        {
            GUIUtility.hotControl = global::UIUnityEvents.controlID;
            global::UIUnityEvents.SetKeyboardControl();
            global::UIUnityEvents.MoveTextPosition(@event, textEditor, ref uitextPosition);
            int clickCount = @event.clickCount;
            if (clickCount != 2)
            {
                if (clickCount == 3)
                {
                    if (input.trippleClickSelect)
                    {
                        textEditor.SelectCurrentParagraph();
                        textEditor.MouseDragSelectsWholeWords(true);
                        textEditor.DblClickSnap(1);
                    }
                }
            }
            else
            {
                textEditor.SelectCurrentWord();
                textEditor.DblClickSnap(0);
                textEditor.MouseDragSelectsWholeWords(true);
            }
            @event.Use();
        }
        global::UIUnityEvents.TextSharedEnd(false, textEditor, @event);
    }
Example #27
0
 // Token: 0x060049CF RID: 18895 RVA: 0x0011B478 File Offset: 0x00119678
 private void OnClick()
 {
     if (this.mChild == null && this.atlas != null && this.font != null && this.items.Count > 1)
     {
         this.mLabelList.Clear();
         this.handleEvents = true;
         if (this.mPanel == null)
         {
             this.mPanel = global::UIPanel.Find(base.transform, true);
         }
         Transform      transform = base.transform;
         global::AABBox aabbox    = global::NGUIMath.CalculateRelativeWidgetBounds(transform.parent, transform);
         this.mChild       = new GameObject("Drop-down List");
         this.mChild.layer = base.gameObject.layer;
         Transform transform2 = this.mChild.transform;
         transform2.parent        = transform.parent;
         transform2.localPosition = aabbox.min;
         transform2.localRotation = Quaternion.identity;
         transform2.localScale    = Vector3.one;
         this.mBackground         = global::NGUITools.AddSprite(this.mChild, this.atlas, this.backgroundSprite);
         this.mBackground.pivot   = global::UIWidget.Pivot.TopLeft;
         this.mBackground.depth   = global::NGUITools.CalculateNextDepth(this.mPanel.gameObject);
         this.mBackground.color   = this.backgroundColor;
         Vector4 border = this.mBackground.border;
         this.mBgBorder = border.y;
         this.mBackground.cachedTransform.localPosition = new Vector3(0f, border.y, 0f);
         this.mHighlight       = global::NGUITools.AddSprite(this.mChild, this.atlas, this.highlightSprite);
         this.mHighlight.pivot = global::UIWidget.Pivot.TopLeft;
         this.mHighlight.color = this.highlightColor;
         global::UIAtlas.Sprite sprite = this.mHighlight.sprite;
         float num  = sprite.inner.yMin - sprite.outer.yMin;
         float num2 = (float)this.font.size * this.textScale;
         float num3 = 0f;
         float num4 = -this.padding.y;
         List <global::UILabel> list = new List <global::UILabel>();
         int i     = 0;
         int count = this.items.Count;
         while (i < count)
         {
             string          text    = this.items[i];
             global::UILabel uilabel = global::NGUITools.AddWidget <global::UILabel>(this.mChild);
             uilabel.pivot = global::UIWidget.Pivot.TopLeft;
             uilabel.font  = this.font;
             uilabel.text  = ((!this.isLocalized || !(global::Localization.instance != null)) ? text : global::Localization.instance.Get(text));
             uilabel.color = this.textColor;
             uilabel.cachedTransform.localPosition = new Vector3(border.x, num4, 0f);
             uilabel.MakePixelPerfect();
             if (this.textScale != 1f)
             {
                 Vector3 localScale = uilabel.cachedTransform.localScale;
                 uilabel.cachedTransform.localScale = localScale * this.textScale;
             }
             list.Add(uilabel);
             num4 -= num2;
             num4 -= this.padding.y;
             num3  = Mathf.Max(num3, uilabel.relativeSize.x * num2);
             global::UIEventListener uieventListener = global::UIEventListener.Get(uilabel.gameObject);
             uieventListener.onHover   = new global::UIEventListener.BoolDelegate(this.OnItemHover);
             uieventListener.onPress   = new global::UIEventListener.BoolDelegate(this.OnItemPress);
             uieventListener.parameter = text;
             if (this.mSelectedItem == text)
             {
                 this.Highlight(uilabel, true);
             }
             this.mLabelList.Add(uilabel);
             i++;
         }
         num3 = Mathf.Max(num3, aabbox.size.x - border.x * 2f);
         Vector3 center;
         center..ctor(num3 * 0.5f / num2, -0.5f, 0f);
         Vector3 size;
         size..ctor(num3 / num2, (num2 + this.padding.y) / num2, 1f);
         int j      = 0;
         int count2 = list.Count;
         while (j < count2)
         {
             global::UILabel   uilabel2  = list[j];
             global::UIHotSpot uihotSpot = global::NGUITools.AddWidgetHotSpot(uilabel2.gameObject);
             center.z         = uihotSpot.center.z;
             uihotSpot.center = center;
             uihotSpot.size   = size;
             j++;
         }
         num3 += border.x * 2f;
         num4 -= border.y;
         this.mBackground.cachedTransform.localScale = new Vector3(num3, -num4 + border.y, 1f);
         this.mHighlight.cachedTransform.localScale  = new Vector3(num3 - border.x * 2f + (sprite.inner.xMin - sprite.outer.xMin) * 2f, num2 + num * 2f, 1f);
         bool flag = this.position == global::UIPopupList.Position.Above;
         if (this.position == global::UIPopupList.Position.Auto)
         {
             global::UICamera uicamera = global::UICamera.FindCameraForLayer(base.gameObject.layer);
             if (uicamera != null)
             {
                 flag = (uicamera.cachedCamera.WorldToViewportPoint(transform.position).y < 0.5f);
             }
         }
         if (this.isAnimated)
         {
             float bottom = num4 + num2;
             this.Animate(this.mHighlight, flag, bottom);
             int k      = 0;
             int count3 = list.Count;
             while (k < count3)
             {
                 this.Animate(list[k], flag, bottom);
                 k++;
             }
             this.AnimateColor(this.mBackground);
             this.AnimateScale(this.mBackground, flag, bottom);
         }
         if (flag)
         {
             transform2.localPosition = new Vector3(aabbox.min.x, aabbox.max.y - num4 - border.y, aabbox.min.z);
         }
     }
     else
     {
         this.OnSelect(false);
     }
 }