private void OnBreakListItemEnable(CUIEvent uiEvent)
 {
     if (((this.m_breakDetailIndex >= 0) && (this.m_breakDetailIndex < this.m_breakSymbolList.Length)) && ((this.m_breakSymbolList[this.m_breakDetailIndex] != null) && (null != uiEvent.m_srcWidget)))
     {
         int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
         if ((srcWidgetIndexInBelongedList >= 0) && (srcWidgetIndexInBelongedList < this.m_breakSymbolList[this.m_breakDetailIndex].Count))
         {
             CBreakSymbolItem item = this.m_breakSymbolList[this.m_breakDetailIndex][srcWidgetIndexInBelongedList];
             if ((item != null) && (item.symbol != null))
             {
                 Transform transform = uiEvent.m_srcWidget.transform.Find("itemCell");
                 this.m_symbolSys.m_symbolWearCtrl.SetSymbolListItem(uiEvent.m_srcFormScript, transform.gameObject, item.symbol);
                 Transform transform2 = transform.Find("selectFlag");
                 if (transform2 != null)
                 {
                     CUIEventScript component = transform2.GetComponent <CUIEventScript>();
                     if (component != null)
                     {
                         stUIEventParams eventParams = new stUIEventParams {
                             tag = srcWidgetIndexInBelongedList
                         };
                         component.SetUIEvent(enUIEventType.Click, enUIEventID.Symbol_BreakListItemSelToggle, eventParams);
                     }
                     transform2.GetComponent <Toggle>().isOn = item.bBreakToggle;
                 }
             }
         }
     }
 }
        private void OnBreakListItemSelToggle(CUIEvent uiEvent)
        {
            int tag = uiEvent.m_eventParams.tag;

            if ((tag >= 0) && (tag < this.m_breakSymbolList[this.m_breakDetailIndex].Count))
            {
                CBreakSymbolItem item = this.m_breakSymbolList[this.m_breakDetailIndex][tag];
                if (((item != null) && (item.symbol != null)) && (uiEvent.m_srcWidget != null))
                {
                    Toggle component = uiEvent.m_srcWidget.GetComponent <Toggle>();
                    item.bBreakToggle = component.isOn;
                }
            }
        }
 private void SetBreakSymbolListData(int index)
 {
     if ((index >= 0) && (index < this.m_breakSymbolList.Length))
     {
         ListView <CSymbolItem> allSymbolList = this.m_symbolSys.GetAllSymbolList();
         int    count        = allSymbolList.Count;
         ushort breakLvlMask = (ushort)(((int)1) << (index + 1));
         for (int i = 0; i < count; i++)
         {
             if (this.CheckSymbolBreak(allSymbolList[i], breakLvlMask))
             {
                 CBreakSymbolItem item = new CBreakSymbolItem(allSymbolList[i], true);
                 this.m_breakSymbolList[index].Add(item);
             }
         }
     }
 }
Beispiel #4
0
        public int CompareTo(object obj)
        {
            CBreakSymbolItem cBreakSymbolItem = obj as CBreakSymbolItem;

            if (this.symbol.m_SymbolData.wLevel < cBreakSymbolItem.symbol.m_SymbolData.wLevel)
            {
                return(1);
            }
            if (this.symbol.m_SymbolData.wLevel > cBreakSymbolItem.symbol.m_SymbolData.wLevel)
            {
                return(-1);
            }
            if (this.symbol.m_SymbolData.bColor != cBreakSymbolItem.symbol.m_SymbolData.bColor)
            {
                return((this.symbol.m_SymbolData.bColor > cBreakSymbolItem.symbol.m_SymbolData.bColor) ? 1 : -1);
            }
            if (this.symbol.m_SymbolData.dwID == cBreakSymbolItem.symbol.m_SymbolData.dwID)
            {
                return(0);
            }
            return((this.symbol.m_SymbolData.dwID > cBreakSymbolItem.symbol.m_SymbolData.dwID) ? 1 : -1);
        }
Beispiel #5
0
        public int CompareTo(object obj)
        {
            CBreakSymbolItem item = obj as CBreakSymbolItem;

            if (this.symbol.m_SymbolData.wLevel < item.symbol.m_SymbolData.wLevel)
            {
                return(1);
            }
            if (this.symbol.m_SymbolData.wLevel > item.symbol.m_SymbolData.wLevel)
            {
                return(-1);
            }
            if (this.symbol.m_SymbolData.bColor != item.symbol.m_SymbolData.bColor)
            {
                return((this.symbol.m_SymbolData.bColor <= item.symbol.m_SymbolData.bColor) ? -1 : 1);
            }
            if (this.symbol.m_SymbolData.dwID == item.symbol.m_SymbolData.dwID)
            {
                return(0);
            }
            return((this.symbol.m_SymbolData.dwID <= item.symbol.m_SymbolData.dwID) ? -1 : 1);
        }