GetElement() public method

Searches for and returns the first control/element it encounters with the specified name that is a child of this container.
public GetElement ( string elementName ) : SpriteRoot,
elementName string Name of the control/element to be found.
return SpriteRoot,
Beispiel #1
0
 public void UpdateTournamentMatchInfoFromListBox(TOURNAMENT_MATCH_LIST pkMatch)
 {
     for (int i = 0; i < this.m_liMatchList.Count; i++)
     {
         UIListItemContainer item = this.m_lbBattleMatchInfo.GetItem(i);
         if (item != null)
         {
             Label label = item.GetElement(this.MATCHINDEX) as Label;
             if (label != null)
             {
                 int num = int.Parse(label.GetText());
                 if (num == pkMatch.nIndex)
                 {
                     TextField textField = item.GetElement(this.PLAYER1) as TextField;
                     if (textField != null && !textField.GetText().Equals(pkMatch.m_szPlayer[0]))
                     {
                         pkMatch.m_szPlayer[0] = textField.GetText();
                     }
                     textField = (item.GetElement(this.PLAYER2) as TextField);
                     if (textField != null && !textField.GetText().Equals(pkMatch.m_szPlayer[1]))
                     {
                         pkMatch.m_szPlayer[1] = textField.GetText();
                     }
                     textField = (item.GetElement(this.OBSERVER) as TextField);
                     if (textField != null && !textField.GetText().Equals(pkMatch.m_szObserver))
                     {
                         pkMatch.m_szObserver = textField.GetText();
                     }
                 }
             }
         }
     }
 }
Beispiel #2
0
 private void CountSolInitiativeValue(long SolID, int AddValue)
 {
     if (0L < SolID)
     {
         int index = this.m_SoldierInfoSortList.FindIndex((NkSoldierInfo value) => value.GetSolID() == SolID);
         int num   = this.m_SolInitiativeList[index] + AddValue;
         if (num < 0)
         {
             num = 0;
         }
         else if (num >= 100)
         {
             num = 100;
         }
         if (num != this.m_SolInitiativeList[index])
         {
             this.m_SolInitiativeList[index] = num;
             UIListItemContainer selectItem = this.InitiativeNewListBox.GetSelectItem();
             if (selectItem != null)
             {
                 Label label = selectItem.GetElement(11) as Label;
                 if (label != null)
                 {
                     label.SetText(num.ToString());
                 }
                 float            num2             = (float)num / 100f;
                 HorizontalSlider horizontalSlider = selectItem.GetElement(12) as HorizontalSlider;
                 horizontalSlider.CallChangeDelegate = false;
                 horizontalSlider.defaultValue       = num2;
                 horizontalSlider.Value = num2;
                 this.m_oldHSInittiativeValue[index] = num2;
             }
         }
     }
 }
Beispiel #3
0
 public void ChangeTURNState(TOURNAMENT_MATCH_LIST pkMatch)
 {
     for (int i = 0; i < this.m_liMatchList.Count; i++)
     {
         UIListItemContainer item = this.m_lbBattleMatchInfo.GetItem(i);
         if (item != null)
         {
             TextField textField = item.GetElement(this.PLAYER1) as TextField;
             if (textField != null && textField.GetText().Equals(pkMatch.m_szPlayer[0]))
             {
                 Label label = item.GetElement(this.TURN) as Label;
                 if (label != null)
                 {
                     if (pkMatch.m_nStartTurnAlly == 0)
                     {
                         label.SetText(pkMatch.m_szPlayer[0]);
                     }
                     else if (pkMatch.m_nStartTurnAlly == 1)
                     {
                         label.SetText(pkMatch.m_szPlayer[1]);
                     }
                     else
                     {
                         label.SetText("RANDOM");
                     }
                 }
             }
         }
     }
 }
Beispiel #4
0
 public void ChangeButtonState(TOURNAMENT_MATCH_LIST pkMatch)
 {
     for (int i = 0; i < this.m_liMatchList.Count; i++)
     {
         UIListItemContainer item = this.m_lbBattleMatchInfo.GetItem(i);
         if (item != null)
         {
             TextField textField = item.GetElement(this.PLAYER1) as TextField;
             if (textField != null && textField.GetText().Equals(pkMatch.m_szPlayer[0]))
             {
                 UIButton uIButton = item.GetElement(this.BUTTON) as UIButton;
                 if (uIButton != null)
                 {
                     if (pkMatch.eMatchState != eTOURNAMENT_PLAYER_STATE.eTOURNAMENT_PLAYER_STATE_NONE)
                     {
                         if (pkMatch.eMatchState == eTOURNAMENT_PLAYER_STATE.eTOURNAMENT_PLAYER_STATE_MATCH)
                         {
                             uIButton.enabled = true;
                             uIButton.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2391"));
                         }
                         else if (pkMatch.eMatchState == eTOURNAMENT_PLAYER_STATE.eTOURNAMENT_PLAYER_STATE_READY)
                         {
                             uIButton.enabled = false;
                             uIButton.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2422"));
                         }
                         else if (pkMatch.eMatchState == eTOURNAMENT_PLAYER_STATE.eTOURNAMENT_PLAYER_STATE_LOBBY)
                         {
                             uIButton.enabled = true;
                             uIButton.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2765"));
                         }
                         else if (pkMatch.eMatchState == eTOURNAMENT_PLAYER_STATE.eTOURNAMENT_PLAYER_STATE_BATTLE)
                         {
                             uIButton.enabled = true;
                             uIButton.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2392"));
                         }
                         else if (pkMatch.eMatchState == eTOURNAMENT_PLAYER_STATE.eTOURNAMENT_PLAYER_STATE_LOBBY_WAIT)
                         {
                             uIButton.enabled = false;
                             uIButton.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2766"));
                         }
                     }
                     else
                     {
                         uIButton.enabled = false;
                         uIButton.SetText(string.Empty);
                     }
                 }
             }
         }
     }
 }
Beispiel #5
0
    public void UpdateTime()
    {
        for (int i = 0; i < this.m_nlbNPCList.Count; i++)
        {
            UIListItemContainer item = this.m_nlbNPCList.GetItem(i);
            if (!(item == null))
            {
                if (item.Data != null)
                {
                    AGIT_NPC_SUB_DATA aGIT_NPC_SUB_DATA = item.Data as AGIT_NPC_SUB_DATA;
                    if (aGIT_NPC_SUB_DATA != null)
                    {
                        Label label = item.GetElement(5) as Label;
                        if (label != null)
                        {
                            long i64Time = aGIT_NPC_SUB_DATA.i64NPCEndTime - PublicMethod.GetCurTime();
                            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strTime, new object[]
                            {
                                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1763"),
                                "timestring",
                                this.GetTimeToString(i64Time)
                            });

                            label.SetText(this.m_strTime);
                        }
                    }
                }
            }
        }
    }
Beispiel #6
0
    private void OnMoveSlider(IUIObject obj)
    {
        HorizontalSlider horizontalSlider = obj as HorizontalSlider;

        if (horizontalSlider == null)
        {
            return;
        }
        int num = -1;

        if (obj.Data != null)
        {
            num = (int)obj.Data;
        }
        if (num > -1 && num < this.m_SoldierInfoSortList.Count && this.m_oldHSInittiativeValue[num] != horizontalSlider.Value)
        {
            int num2 = (int)(horizontalSlider.Value * 100f);
            if (num2 != this.m_SolInitiativeList[num])
            {
                this.m_SolInitiativeList[num] = num2;
                UIListItemContainer item = this.InitiativeNewListBox.GetItem(num);
                if (item != null)
                {
                    Label label = item.GetElement(11) as Label;
                    if (label != null)
                    {
                        label.SetText(this.m_SolInitiativeList[num].ToString());
                    }
                }
            }
        }
    }
    private AutoSpriteControlBase GetCharKindContainer(UIListItemContainer item, int pTargetCharKind)
    {
        if (item == null)
        {
            return(null);
        }
        int objCount = item.GetObjCount();

        for (int i = 0; i < objCount; i++)
        {
            object elementObject = item.GetElementObject(i);
            if (elementObject != null)
            {
                if (elementObject is NrCharKindInfo)
                {
                    NrCharKindInfo nrCharKindInfo = (NrCharKindInfo)elementObject;
                    if (nrCharKindInfo.GetCharKind() == pTargetCharKind)
                    {
                        return(item.GetElement(i));
                    }
                }
            }
        }
        return(null);
    }
Beispiel #8
0
 public void SetRecruitButtonEnable(bool bEnable)
 {
     if (bEnable)
     {
         if (this.m_fRecruitPassCheckTime > 0f)
         {
             this.bRecruitPassCheck = true;
             return;
         }
     }
     else
     {
         this.m_fRecruitPassCheckTime = Time.time;
     }
     for (int i = 0; i < this.m_TicketList.Count; i++)
     {
         UIListItemContainer item = this.m_TicketList.GetItem(i);
         if (item != null)
         {
             UIButton uIButton = item.GetElement(3) as UIButton;
             if (uIButton != null)
             {
                 uIButton.SetEnabled(bEnable);
             }
         }
     }
 }
Beispiel #9
0
    private void ExcuteUIGuide()
    {
        if (this.m_nWinID == 0 || this.m_nGuideFloor == 0)
        {
            return;
        }
        short num = NrTSingleton <BabelTowerManager> .Instance.GetLastFloor(this.m_nFloorType);

        short num2 = num / 5;

        for (short num3 = num2; num3 > 0; num3 -= 1)
        {
            for (int i = 4; i >= 0; i--)
            {
                if ((int)num == this.m_nGuideFloor)
                {
                    this.m_nSelectindex = num2 - num3;
                    break;
                }
                num -= 1;
            }
        }
        float scrollPosition = 0f;

        if (0 < this.m_lbFloor.LimitListNum - 1)
        {
            scrollPosition = (float)this.m_nSelectindex / (float)(this.m_lbFloor.LimitListNum - 1);
        }
        this.m_lbFloor.ScrollPosition = scrollPosition;
        this.m_lbFloor.SetSelectedItem((int)this.m_nSelectindex);
        UIListItemContainer selectItem = this.m_lbFloor.GetSelectItem();

        if (null == selectItem)
        {
            return;
        }
        int num4 = this.m_nGuideFloor % 5;

        if (num4 == 0)
        {
            num4 = 5;
        }
        this._GuideItem = (selectItem.GetElement(num4) as UIButton);
        if (null != this._GuideItem)
        {
            this._GuideItem.EffectAni = false;
            UI_UIGuide uI_UIGuide = NrTSingleton <FormsManager> .Instance.GetForm((G_ID)this.m_nWinID) as UI_UIGuide;

            if (uI_UIGuide != null)
            {
                Vector2 vector = new Vector2(base.GetLocationX() + this._GuideItem.GetLocationX() + 80f, base.GetLocationY() + this._GuideItem.GetLocationY() + 64f);
                uI_UIGuide.Move(vector, vector);
                this._GuideItem.AlphaAni(1f, 0.5f, -0.5f);
            }
            this.m_lbFloor.touchScroll = false;
        }
        this.m_bShowGuide = false;
    }
 public override void Update()
 {
     base.Update();
     if (this.IsRadioAlarmMode())
     {
         return;
     }
     for (int i = 0; i < 9; i++)
     {
         UIListItemContainer item            = this.m_nlbEmoticon.GetItem(i);
         BATTLE_EMOTICON     bATTLE_EMOTICON = (BATTLE_EMOTICON)item.GetElementObject(0);
         if (!Battle.BATTLE.IsEmotionSet)
         {
             if (item != null)
             {
                 UIButton uIButton = item.GetElement(0) as UIButton;
                 if (uIButton != null)
                 {
                     uIButton.SetControlState(UIButton.CONTROL_STATE.NORMAL);
                 }
             }
         }
         else if (Battle.BATTLE.SetEmoticon == bATTLE_EMOTICON.m_eConstant)
         {
             if (item != null)
             {
                 UIButton uIButton2 = item.GetElement(0) as UIButton;
                 if (uIButton2 != null)
                 {
                     uIButton2.SetControlState(UIButton.CONTROL_STATE.ACTIVE);
                 }
             }
         }
         else if (item != null)
         {
             UIButton uIButton3 = item.GetElement(0) as UIButton;
             if (uIButton3 != null)
             {
                 uIButton3.SetControlState(UIButton.CONTROL_STATE.NORMAL);
             }
         }
     }
 }
Beispiel #11
0
    public void Load_SetEffect()
    {
        UIListItemContainer item = this.m_nlbEquipInfo.GetItem(0);

        if (item != null)
        {
            AutoSpriteControlBase element = item.GetElement(12);
            if (element != null)
            {
                string  str     = string.Format("{0}{1}", "Effect/Instant/fx_setbuuton_ui", NrTSingleton <UIDataManager> .Instance.AddFilePath);
                WWWItem wWWItem = Holder.TryGetOrCreateBundle(str + Option.extAsset, NkBundleCallBack.UIBundleStackName);
                wWWItem.SetItemType(ItemType.USER_ASSETB);
                wWWItem.SetCallback(new PostProcPerItem(this.Effect_Set), element);
                TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true);
            }
        }
    }
Beispiel #12
0
 public override void InitData()
 {
     if (!this.hide)
     {
         base.SetLocation(GUICamera.width - base.GetSizeX(), 0f);
     }
     for (int i = 0; i < this.bookmarkList.Count; i++)
     {
         UIListItemContainer item = this.bookmarkList.GetItem(i);
         if (null != item)
         {
             UIButton uIButton = item.GetElement(0) as UIButton;
             if (null != uIButton)
             {
                 uIButton.transform.localPosition = new Vector3(6f, 0f, uIButton.transform.localPosition.z);
             }
         }
     }
 }
Beispiel #13
0
    public void ClickVip(IUIObject obj)
    {
        if (obj == null && obj.Data == null)
        {
            return;
        }
        byte b = (byte)obj.Data;
        UIListItemContainer selectItem = this.m_nlbVip.GetSelectItem();

        if (selectItem == null)
        {
            return;
        }
        if (this.m_oldSelectIndex != selectItem.index)
        {
            UIListItemContainer item     = this.m_nlbVip.GetItem(this.m_oldSelectIndex);
            UIButton            uIButton = item.GetElement(1) as UIButton;
            uIButton.Visible      = false;
            this.m_oldSelectIndex = selectItem.index;
        }
        UIButton uIButton2 = selectItem.GetElement(1) as UIButton;

        if (uIButton2 != null)
        {
            uIButton2.Visible = true;
        }
        if (b == 0)
        {
            base.ShowLayer(1, 3);
        }
        else
        {
            base.ShowLayer(1, 4);
        }
        this.SetVipInfo(b);
    }
Beispiel #14
0
    private void ClickList(IUIObject obj)
    {
        if (this.m_eType == ExchangePointDlg.TYPE.TYPE_TICKET)
        {
            UIListItemContainer selectedItem = this.m_kList.SelectedItem;
            if (null == selectedItem)
            {
                return;
            }
            ITEM iTEM = (ITEM)selectedItem.Data;
            if (iTEM == null)
            {
                return;
            }
            this.m_kSelectItem.SetItemTexture(iTEM);
            this.m_kSelectItem.Data     = iTEM;
            this.m_nSelectItemUnique    = iTEM.m_nItemUnique;
            this.m_nSelectItemNum       = 1;
            this.m_kSellNum.MaxValue    = (long)iTEM.m_nItemNum;
            this.m_kSellNum.Text        = this.m_nSelectItemNum.ToString();
            this.m_kSelectItemName.Text = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(iTEM.m_nItemUnique);

            this.GetPoint(iTEM);
            this.SetVisible(true);
        }
        else if (this.m_eType == ExchangePointDlg.TYPE.TYPE_EQUIPITEM)
        {
            for (int i = 0; i < this.m_kList.Count; i++)
            {
                UIListItemContainer item = this.m_kList.GetItem(i);
                if (!(null == item))
                {
                    if (item.IsSelected())
                    {
                        item.GetElement(5).Visible = true;
                    }
                    else
                    {
                        item.GetElement(5).Visible = false;
                    }
                }
            }
            this.InitRemoveItemID();
            int num = this.m_kList.SelectedItems.Count;
            if (num == 0)
            {
                this.InitSelectItemInfo();
                return;
            }
            if (num > 10)
            {
                return;
            }
            num = 0;
            long num2 = 0L;
            bool flag = false;
            foreach (IUIListObject current in this.m_kList.SelectedItems.Values)
            {
                IUIListObject iUIListObject = current;
                if (iUIListObject != null)
                {
                    if (num > 10)
                    {
                        break;
                    }
                    ITEM iTEM2 = (ITEM)iUIListObject.Data;
                    if (iTEM2 != null)
                    {
                        ITEMINFO itemInfo = NrTSingleton <ItemManager> .Instance.GetItemInfo(iTEM2.m_nItemUnique);

                        if (itemInfo != null)
                        {
                            int       itemMakeRank = iTEM2.m_nOption[2];
                            ITEM_SELL itemSellData = NrTSingleton <ITEM_SELL_Manager> .Instance.GetItemSellData(itemInfo.m_nQualityLevel, itemMakeRank);

                            if (itemSellData != null)
                            {
                                long num3 = (long)(itemSellData.nItemSellMoney / NrTSingleton <PointManager> .Instance.GetItemBuyRate());
                                if (0L < num3)
                                {
                                    if (!flag)
                                    {
                                        this.m_kSelectItem.SetItemTexture(iTEM2);
                                        this.m_kSelectItem.Data     = iTEM2;
                                        this.m_kSelectItemName.Text = NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(iTEM2.m_nItemUnique);

                                        flag = true;
                                    }
                                    this.m_nRemoveItemID[num++] = iTEM2.m_nItemID;
                                    num2 += num3;
                                }
                            }
                        }
                    }
                }
            }
            string empty = string.Empty;
            if (1 < this.m_kList.SelectedItems.Count)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("295"),
                    "count",
                    this.m_kList.SelectedItems.Count - 1
                });

                this.m_kEquipCount.Text = empty;
            }
            else
            {
                this.m_kEquipCount.Text = string.Empty;
            }
            this.m_kEquipPointName.Visible = true;
            empty = string.Empty;
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2256"),
                "count",
                num2
            });

            this.m_kTotalEquipPoint.Text = empty;
        }
        this.SetPoint();
    }
Beispiel #15
0
    public void SelectNPCLevel()
    {
        AgitInfoData agitData = NrTSingleton <NrBaseTableManager> .Instance.GetAgitData(this.m_i16NPCLevel.ToString());

        if (agitData == null)
        {
            return;
        }
        for (int i = 0; i < this.m_nlbInviteNPC.Count; i++)
        {
            UIListItemContainer item = this.m_nlbInviteNPC.GetItem(i);
            if (!(item == null))
            {
                if (item.Data != null)
                {
                    AgitNPCData agitNPCData = item.Data as AgitNPCData;
                    if (agitNPCData != null)
                    {
                        Label label = item.GetElement(0) as Label;
                        if (label != null)
                        {
                            label.SetText(ANNUALIZED.Convert(agitData.i32NPCCost));
                        }
                        Label label2 = item.GetElement(4) as Label;
                        if (label2 != null)
                        {
                            this.m_strText = string.Empty;
                            int num = agitNPCData.i32LevelRate[(int)(this.m_i16NPCLevel - 1)];
                            switch (agitNPCData.ui8NPCType)
                            {
                            case 2:
                                this.m_strInfo = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2747");

                                num /= 100;
                                break;

                            case 3:
                                this.m_strInfo = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2751");

                                num /= 100;
                                break;

                            case 4:
                                this.m_strInfo = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2750");

                                num /= 100;
                                break;

                            case 5:
                                this.m_strInfo = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2794");

                                break;
                            }
                            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strText, new object[]
                            {
                                this.m_strInfo,
                                "count",
                                num
                            });

                            label2.SetText(this.m_strText);
                        }
                    }
                }
            }
        }
    }
    public void ShowUIGuide(string param1, string param2, int winID)
    {
        if (string.IsNullOrEmpty(param1))
        {
            return;
        }
        if (this.guideWinIDList != null && !this.guideWinIDList.Contains(winID))
        {
            this.guideWinIDList.Add(winID);
        }
        string[] array = param1.Split(new char[]
        {
            ','
        });
        if (array == null || array.Length != 4)
        {
            return;
        }
        string    a         = array[0];
        IUIObject iUIObject = null;

        if (a == "MATERIAL_GUIDE")
        {
            int index = 4;
            UIListItemContainer item = this.m_NewListBox_Reincarnate.GetItem(index);
            if (item == null)
            {
                return;
            }
            iUIObject = item.GetElement(10);
        }
        else if (a == "EVOLUTION_GUIDE")
        {
            iUIObject = base.GetControl("btn_Legend");
        }
        if (iUIObject == null)
        {
            return;
        }
        if (this._Touch == null)
        {
            this._Touch = UICreateControl.Button("touch", "Main_I_Touch01", 196f, 154f);
        }
        if (this._Touch == null)
        {
            return;
        }
        int anchor = int.Parse(array[1]);

        this._Touch.SetAnchor((SpriteRoot.ANCHOR_METHOD)anchor);
        this._Touch.PlayAni(true);
        this._Touch.gameObject.SetActive(true);
        this._Touch.gameObject.transform.parent = iUIObject.gameObject.transform;
        this._Touch.transform.position          = new Vector3(iUIObject.transform.position.x, iUIObject.transform.position.y, iUIObject.transform.position.z - 3f);
        float x = float.Parse(array[2]);
        float y = float.Parse(array[3]);

        this._Touch.transform.eulerAngles = new Vector3(x, y, this._Touch.transform.eulerAngles.z);
        BoxCollider component = this._Touch.gameObject.GetComponent <BoxCollider>();

        if (null != component)
        {
            UnityEngine.Object.Destroy(component);
        }
    }
    public void UpdateTime()
    {
        if (NrTSingleton <GuildWarManager> .Instance.GuildWarStartTime > 0L)
        {
            this.m_strText = this.GetTimeToString(NrTSingleton <GuildWarManager> .Instance.GuildWarStartTime);
            if (this.m_strText != string.Empty)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.m_strTime, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1763"),
                    "timestring",
                    this.m_strText
                });

                this.m_lbState.SetText(this.m_strTime);
            }
            else
            {
                this.m_lbState.SetText(string.Empty);
            }
        }
        else
        {
            this.m_lbState.SetText(string.Empty);
        }
        for (int i = 0; i < this.m_nlbGuildWarList.Count; i++)
        {
            UIListItemContainer uIListItemContainer = this.m_nlbGuildWarList.GetItem(i) as UIListItemContainer;
            if (!(uIListItemContainer == null))
            {
                byte b = (byte)uIListItemContainer.Data;
                if ((short)b < NrTSingleton <GuildWarManager> .Instance.GuildWarRound)
                {
                    GUILDWAR_APPLY_INFO guildWarApplyInfo = this.GetGuildWarApplyInfo(NrTSingleton <NewGuildManager> .Instance.GetGuildID(), b);
                    if (guildWarApplyInfo != null)
                    {
                        eGUILDWAR_MILITARY_STATE ui8MilitaryStatus = (eGUILDWAR_MILITARY_STATE)guildWarApplyInfo.ui8MilitaryStatus;
                        if (ui8MilitaryStatus != eGUILDWAR_MILITARY_STATE.eGUILDWAR_MILITARY_STATE_MOVE)
                        {
                            if (ui8MilitaryStatus == eGUILDWAR_MILITARY_STATE.eGUILDWAR_MILITARY_STATE_MOVECANCEL)
                            {
                                if (guildWarApplyInfo.i64MilitaryActionTime > 0L)
                                {
                                    Label label = uIListItemContainer.GetElement(4) as Label;
                                    if (label != null)
                                    {
                                        this.m_strText = this.GetTimeToString(guildWarApplyInfo.i64MilitaryActionTime);
                                        if (this.m_strText != string.Empty)
                                        {
                                            this.m_strTime = string.Format("{0} : {1}", NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1525"), this.m_strText);
                                            label.SetText(this.m_strTime);
                                        }
                                        else
                                        {
                                            label.SetText(string.Empty);
                                        }
                                    }
                                }
                            }
                        }
                        else if (guildWarApplyInfo.i64MilitaryActionTime > 0L)
                        {
                            Label label2 = uIListItemContainer.GetElement(3) as Label;
                            if (label2 != null)
                            {
                                this.m_strText = this.GetTimeToString(guildWarApplyInfo.i64MilitaryActionTime);
                                if (this.m_strText != string.Empty)
                                {
                                    this.m_strTime = string.Format("{0} : {1}", NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1525"), this.m_strText);
                                    label2.SetText(this.m_strTime);
                                }
                                else
                                {
                                    label2.SetText(string.Empty);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
Beispiel #18
0
    public void ChangePlayerState(GS_TOURNAMENT_PLAYER_STATE_NFY _NFY)
    {
        string value = TKString.NEWString(_NFY.szPlayerName);
        bool   flag  = false;

        foreach (TOURNAMENT_MATCH_LIST current in this.m_liMatchList)
        {
            int i = 0;
            while (i < 2)
            {
                if (current.m_szPlayer[i].Equals(value))
                {
                    if (_NFY.nPlayerState == 10)
                    {
                        this.m_liMatchList.Remove(current);
                        flag = true;
                        break;
                    }
                    if (_NFY.nPlayerState != 9)
                    {
                        current.ePlayerState[i] = (eTOURNAMENT_PLAYER_STATE)_NFY.nPlayerState;
                    }
                    string tournamentStateToString = this.GetTournamentStateToString(current.ePlayerState[i]);
                    for (int j = 0; j < this.m_liMatchList.Count; j++)
                    {
                        UIListItemContainer item = this.m_lbBattleMatchInfo.GetItem(j);
                        if (item != null)
                        {
                            TextField textField = item.GetElement(this.PLAYER1) as TextField;
                            if (textField != null && textField.GetText().Equals(value))
                            {
                                if (_NFY.nPlayerState == 9)
                                {
                                    Label label = item.GetElement(this.WINCOUNT1) as Label;
                                    if (label != null)
                                    {
                                        current.m_nWinCount[i] = current.m_nWinCount[i] + 1;
                                        label.SetText(current.m_nWinCount[i].ToString());
                                    }
                                }
                                else
                                {
                                    Label label2 = item.GetElement(this.STATE1) as Label;
                                    if (label2 != null)
                                    {
                                        label2.SetText(tournamentStateToString);
                                        break;
                                    }
                                }
                            }
                            textField = (item.GetElement(this.PLAYER2) as TextField);
                            if (textField != null && textField.GetText().Equals(value))
                            {
                                if (_NFY.nPlayerState == 9)
                                {
                                    Label label3 = item.GetElement(this.WINCOUNT2) as Label;
                                    if (label3 != null)
                                    {
                                        current.m_nWinCount[i] = current.m_nWinCount[i] + 1;
                                        label3.SetText(current.m_nWinCount[i].ToString());
                                    }
                                }
                                else
                                {
                                    Label label4 = item.GetElement(this.STATE2) as Label;
                                    if (label4 != null)
                                    {
                                        label4.SetText(tournamentStateToString);
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    return;
                }
                else
                {
                    i++;
                }
            }
            if (flag)
            {
                break;
            }
        }
        if (flag)
        {
            this.m_lbBattleMatchInfo.Clear();
            this.SetShowList();
        }
    }