private void OnValueChange(CustomClothesScrollController.ScrollData _data, bool _isOn)
 {
     if (_isOn)
     {
         bool flag = !this.IsNowSelectInfo(_data?.info);
         this.selectInfo = _data;
         if (!flag)
         {
             return;
         }
         for (int index = 0; index < this.view.ShownItemCount; ++index)
         {
             LoopListViewItem2 shownItemByIndex = this.view.GetShownItemByIndex(index);
             if (!Object.op_Equality((Object)shownItemByIndex, (Object)null))
             {
                 CustomClothesScrollViewInfo component = (CustomClothesScrollViewInfo)((Component)shownItemByIndex).GetComponent <CustomClothesScrollViewInfo>();
                 for (int _index = 0; _index < this.countPerRow; ++_index)
                 {
                     if (!this.IsNowSelectInfo(component.GetListInfo(_index)))
                     {
                         component.SetToggleON(_index, false);
                     }
                 }
             }
         }
         if (this.onSelect != null)
         {
             this.onSelect(this.selectInfo.info);
         }
         if (this.selectInfo == null)
         {
             return;
         }
         this.SelectName = this.selectInfo.info.name;
     }
     else
     {
         if (!this.IsNowSelectInfo(_data?.info))
         {
             return;
         }
         this.selectInfo = (CustomClothesScrollController.ScrollData)null;
         if (this.onDeSelect == null)
         {
             return;
         }
         this.onDeSelect();
     }
 }
        private LoopListViewItem2 OnUpdate(LoopListView2 _view, int _index)
        {
            if (_index < 0)
            {
                return((LoopListViewItem2)null);
            }
            LoopListViewItem2           loopListViewItem2 = _view.NewListViewItem(((Object)this.original).get_name());
            CustomClothesScrollViewInfo component         = (CustomClothesScrollViewInfo)((Component)loopListViewItem2).GetComponent <CustomClothesScrollViewInfo>();

            for (int _index1 = 0; _index1 < this.countPerRow; ++_index1)
            {
                CustomClothesScrollController.ScrollData data = this.scrollerDatas.SafeGet <CustomClothesScrollController.ScrollData>(_index * this.countPerRow + _index1);
                component.SetData(_index1, data, (Action <bool>)(_isOn => this.OnValueChange(data, _isOn)), new Action <string>(this.OnPointerEnter), new Action(this.OnPointerExit));
                component.SetToggleON(_index1, this.IsNowSelectInfo(data?.info));
            }
            return(loopListViewItem2);
        }
 public void SelectInfoClear()
 {
     this.selectInfo = (CustomClothesScrollController.ScrollData)null;
 }
Esempio n. 4
0
        public void SetData(
            int _index,
            CustomClothesScrollController.ScrollData _data,
            Action <bool> _onClickAction,
            Action <string> _onPointerEnter,
            Action _onPointerExit)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            CustomClothesScrollViewInfo.\u003CSetData\u003Ec__AnonStorey0 dataCAnonStorey0 = new CustomClothesScrollViewInfo.\u003CSetData\u003Ec__AnonStorey0();
            // ISSUE: reference to a compiler-generated field
            dataCAnonStorey0._onClickAction = _onClickAction;
            // ISSUE: reference to a compiler-generated field
            dataCAnonStorey0._onPointerEnter = _onPointerEnter;
            // ISSUE: reference to a compiler-generated field
            dataCAnonStorey0._onPointerExit = _onPointerExit;
            // ISSUE: reference to a compiler-generated field
            dataCAnonStorey0._info = _data?.info;
            // ISSUE: reference to a compiler-generated field
            bool active = dataCAnonStorey0._info != null;

            ((Component)this.rows[_index].tgl).get_gameObject().SetActiveIfDifferent(active);
            ((UnityEventBase)this.rows[_index].tgl.onValueChanged).RemoveAllListeners();
            if (!active)
            {
                return;
            }
            ((UnityEventBase)this.rows[_index].tgl.onValueChanged).RemoveAllListeners();
            // ISSUE: method pointer
            ((UnityEvent <bool>) this.rows[_index].tgl.onValueChanged).AddListener(new UnityAction <bool>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__0)));
            EventTriggerNoScroll eventTriggerNoScroll = (EventTriggerNoScroll)((Component)this.rows[_index].tgl).get_gameObject().AddComponent <EventTriggerNoScroll>();

            eventTriggerNoScroll.triggers = new List <EventTriggerNoScroll.Entry>();
            EventTriggerNoScroll.Entry entry1 = new EventTriggerNoScroll.Entry();
            entry1.eventID = (EventTriggerType)0;
            // ISSUE: method pointer
            entry1.callback.AddListener(new UnityAction <BaseEventData>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__1)));
            eventTriggerNoScroll.triggers.Add(entry1);
            EventTriggerNoScroll.Entry entry2 = new EventTriggerNoScroll.Entry();
            entry2.eventID = (EventTriggerType)1;
            // ISSUE: method pointer
            entry2.callback.AddListener(new UnityAction <BaseEventData>((object)dataCAnonStorey0, __methodptr(\u003C\u003Em__2)));
            eventTriggerNoScroll.triggers.Add(entry2);
            this.rows[_index].tgl.SetIsOnWithoutCallback(false);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            if (dataCAnonStorey0._info.pngData != null || !dataCAnonStorey0._info.FullPath.IsNullOrEmpty())
            {
                if (Object.op_Implicit((Object)this.rows[_index].imgThumb.get_texture()))
                {
                    Object.Destroy((Object)this.rows[_index].imgThumb.get_texture());
                }
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                this.rows[_index].imgThumb.set_texture((Texture)PngAssist.ChangeTextureFromByte(dataCAnonStorey0._info.pngData ?? PngFile.LoadPngBytes(dataCAnonStorey0._info.FullPath), 0, 0, (TextureFormat)5, false));
            }
            else
            {
                this.rows[_index].imgThumb.set_texture((Texture)this.texEmpty);
            }
            // ISSUE: reference to a compiler-generated field
            this.rows[_index].info = dataCAnonStorey0._info;
        }