Ejemplo n.º 1
0
    public void UpdateFloor(short floor)
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        short        num         = floor / 5;

        if (floor % 5 != 0)
        {
            num += 1;
        }
        short       num2        = (floor - 1) % 5;
        NewListItem newListItem = this.CreateItem(num);

        if (newListItem != null)
        {
            bool flag = this.GuildBossRewardCheck();
            if (flag)
            {
                this.m_dtNotice.Visible = true;
            }
            for (int i = 0; i < this.m_lbFloor.Count; i++)
            {
                IUIListObject item = this.m_lbFloor.GetItem(i);
                if (item != null && (short)item.Data == num)
                {
                    NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(floor);
                    bool        guildBossRoomStateInfo            = kMyCharInfo.GetGuildBossRoomStateInfo(floor);
                    DrawTexture drawTexture = ((UIListItemContainer)item).GetElement((int)(51 + num2)) as DrawTexture;
                    if (guildBossMyRoomInfo != null && guildBossMyRoomInfo.byRoomState != 0)
                    {
                        drawTexture.Visible = guildBossRoomStateInfo;
                        drawTexture.SetTexture("Win_I_Notice04");
                    }
                    UIButton    uIButton     = ((UIListItemContainer)item).GetElement((int)(num2 + 1)) as UIButton;
                    DrawTexture drawTexture2 = ((UIListItemContainer)item).GetElement((int)(56 + num2 * 2)) as DrawTexture;
                    if (drawTexture2 != null)
                    {
                        drawTexture2.Visible = false;
                    }
                    ItemTexture itemTexture = ((UIListItemContainer)item).GetElement((int)(56 + num2 * 2 + 1)) as ItemTexture;
                    if (itemTexture != null)
                    {
                        itemTexture.Visible = false;
                    }
                    if (guildBossMyRoomInfo != null)
                    {
                        if (guildBossMyRoomInfo.i64PlayPersonID > 0L)
                        {
                            if (drawTexture2 != null)
                            {
                                drawTexture2.Visible = true;
                            }
                            if (itemTexture != null)
                            {
                                itemTexture.Visible = true;
                            }
                            NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(guildBossMyRoomInfo.i64PlayPersonID);

                            if (memberInfoFromPersonID != null)
                            {
                                if (memberInfoFromPersonID.GetPortrait() != null)
                                {
                                    itemTexture.SetTexture(memberInfoFromPersonID.GetPortrait());
                                    itemTexture.AddValueChangedDelegate(new EZValueChangedDelegate(this.BtnClickMemberInfo));
                                    itemTexture.Data = guildBossMyRoomInfo.i64PlayPersonID;
                                }
                                else
                                {
                                    itemTexture.SetSolImageTexure(eCharImageType.SMALL, new NkListSolInfo
                                    {
                                        SolCharKind = memberInfoFromPersonID.GetFaceCharKind(),
                                        SolGrade    = -1,
                                        SolLevel    = memberInfoFromPersonID.GetLevel()
                                    }, false);
                                    itemTexture.AddValueChangedDelegate(new EZValueChangedDelegate(this.BtnClickMemberInfo));
                                    itemTexture.Data = guildBossMyRoomInfo.i64PlayPersonID;
                                }
                            }
                        }
                        string effectKey = string.Empty;
                        if (guildBossMyRoomInfo != null)
                        {
                            effectKey = this.GetRoomStateEffect(guildBossMyRoomInfo.byRoomState);
                        }
                        else
                        {
                            effectKey = this.GetRoomStateEffect(0);
                        }
                        if (uIButton != null)
                        {
                            uIButton.DeleteChildEffect();
                            NrTSingleton <FormsManager> .Instance.AttachEffectKey(effectKey, uIButton, uIButton.GetSize());
                        }
                    }
                    break;
                }
            }
        }
    }
    public void SetInfo()
    {
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return;
        }
        string          text  = string.Empty;
        string          text2 = string.Empty;
        BABEL_GUILDBOSS babelGuildBossinfo = NrTSingleton <BabelTowerManager> .Instance.GetBabelGuildBossinfo(this.m_GuildBossFloor);

        if (babelGuildBossinfo == null)
        {
            return;
        }
        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(babelGuildBossinfo.m_nBossKind);

        this.m_laGuildBossName.Text = charKindInfo.GetName();
        this.m_dtBossImg.SetTexture(eCharImageType.LARGE, charKindInfo.GetCharKind(), -1, string.Empty);
        text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1808");

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
        {
            text,
            "count1",
            ANNUALIZED.Convert(this.m_i32CurBossHp),
            "count2",
            ANNUALIZED.Convert(babelGuildBossinfo.m_nBossMaxHP)
        });

        this.m_laGuildBossHp.Text = text2;
        float num = (float)this.m_i32CurBossHp / (float)babelGuildBossinfo.m_nBossMaxHP;

        this.m_dtBossCurHP.SetSize(this.BOSSHP_BAR_WIDTH * num, this.m_dtBossCurHP.GetSize().y);
        text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1697");

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
        {
            text,
            "itemname",
            NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(babelGuildBossinfo.m_nBaseReward_ItemUnique),
            "count",
            babelGuildBossinfo.m_nBaseReward_ItemNum
        });

        this.m_lbRewardBaseItemNum.Text = text2;
        int num2 = (babelGuildBossinfo.m_nReward_BaseMoney * kMyCharInfo.GetLevel() >= babelGuildBossinfo.m_nReward_BaseMoney_Max) ? babelGuildBossinfo.m_nReward_BaseMoney_Max : (babelGuildBossinfo.m_nReward_BaseMoney * kMyCharInfo.GetLevel());

        this.m_laBasicReward.Text = ANNUALIZED.Convert(num2);
        this.m_dtRewardBaseItem.SetTexture(NrTSingleton <ItemManager> .Instance.GetItemTexture(babelGuildBossinfo.m_nBaseReward_ItemUnique));
        this.SortMemberInfo();
        int  num3  = 1;
        bool flag  = false;
        bool flag2 = false;

        this.m_lbGuildMemberList.Clear();
        for (int i = 0; i < this.m_listMemberInfo.Count; i++)
        {
            NEWGUILD_BOSS_PLAYER_INFO nEWGUILD_BOSS_PLAYER_INFO = this.m_listMemberInfo[i];
            NewGuildMember            memberInfoFromPersonID    = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(nEWGUILD_BOSS_PLAYER_INFO.i64PersonID);

            if (memberInfoFromPersonID != null)
            {
                if (this.m_byRoomState != 3 && nEWGUILD_BOSS_PLAYER_INFO.i64PersonID == NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_PersonID)
                {
                    flag2 = true;
                }
                bool        flag3       = false;
                NewListItem newListItem = new NewListItem(this.m_lbGuildMemberList.ColumnNum, true, string.Empty);
                Texture2D   portrait    = memberInfoFromPersonID.GetPortrait();
                if (this.m_byRoomState == 3)
                {
                    if (nEWGUILD_BOSS_PLAYER_INFO.i64PersonID == NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo.m_PersonID)
                    {
                        flag = true;
                    }
                    if (nEWGUILD_BOSS_PLAYER_INFO.i64PersonID == this.ClearPersonID)
                    {
                        this.m_itClearUserFace.Visible = true;
                        if (portrait != null)
                        {
                            this.m_itClearUserFace.SetTexture(portrait);
                        }
                        else
                        {
                            NkListSolInfo nkListSolInfo = new NkListSolInfo();
                            nkListSolInfo.SolCharKind            = memberInfoFromPersonID.GetFaceCharKind();
                            nkListSolInfo.SolLevel               = memberInfoFromPersonID.GetLevel();
                            nkListSolInfo.SolCostumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(memberInfoFromPersonID.GetCostumeUnique());

                            nkListSolInfo.SolGrade = -1;
                            this.m_itClearUserFace.SetSolImageTexure(eCharImageType.SMALL, nkListSolInfo, false);
                        }
                        this.m_lbClearUserName.SetText(memberInfoFromPersonID.GetCharName());
                        this.m_lbClearUserName.Visible = true;
                        newListItem.SetListItemData(21, true);
                        newListItem.SetListItemData(8, false);
                        flag3 = true;
                    }
                }
                if (!flag3)
                {
                    newListItem.SetListItemData(12, false);
                }
                newListItem.SetListItemData(2, memberInfoFromPersonID.GetCharName(), null, null, null);
                text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1915");

                newListItem.SetListItemData(3, text2, null, null, null);
                float num4 = (float)nEWGUILD_BOSS_PLAYER_INFO.i32Damage / (float)babelGuildBossinfo.m_nBossMaxHP;
                float num5 = num4 * 340f;
                newListItem.SetListItemData(5, string.Empty, num5, null, null);
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1916");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
                {
                    text,
                    "count1",
                    ANNUALIZED.Convert(nEWGUILD_BOSS_PLAYER_INFO.i32Damage),
                    "count2",
                    (int)(num4 * 100f)
                });

                newListItem.SetListItemData(6, text2, null, null, null);
                if (portrait != null)
                {
                    newListItem.SetListItemData(7, portrait, null, null, null, null);
                }
                else
                {
                    newListItem.SetListItemData(7, new NkListSolInfo
                    {
                        SolCharKind            = memberInfoFromPersonID.GetFaceCharKind(),
                        SolLevel               = memberInfoFromPersonID.GetLevel(),
                        SolCostumePortraitPath = NrTSingleton <NrCharCostumeTableManager> .Instance.GetCostumePortraitPath(memberInfoFromPersonID.GetCostumeUnique()),
                        SolGrade               = -1
                    }, null, null, null);
                }
                if (!flag3)
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1186");

                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text2, new object[]
                    {
                        text,
                        "count",
                        num3
                    });

                    newListItem.SetListItemData(9, text2, null, null, null);
                }
                else
                {
                    newListItem.SetListItemData(9, false);
                }
                newListItem.SetListItemData(10, memberInfoFromPersonID.GetRankText(), null, null, null);
                this.m_lbGuildMemberList.Add(newListItem);
                num3++;
            }
        }
        this.m_lbGuildMemberList.RepositionItems();
        if (flag2 && !flag)
        {
            this.m_btGuildBossStart.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3292"));
        }
        else
        {
            this.m_btGuildBossStart.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("633"));
        }
        if (!flag)
        {
            Button expr_596 = this.m_btGuildBossStart;
            expr_596.Click = (EZValueChangedDelegate)Delegate.Combine(expr_596.Click, new EZValueChangedDelegate(this.OnClickStart));
        }
        else
        {
            this.m_btGuildBossStart.SetEnabled(false);
        }
        if (this.m_byRoomState == 3)
        {
            this.m_dtBossVictoyImg.Visible = true;
            this.m_dtClearUserBG.Visible   = true;
            this.m_dtClearBG.Visible       = true;
        }
    }
Ejemplo n.º 3
0
    public NewListItem CreateItem(short Column)
    {
        NrMyCharInfo kMyCharInfo        = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
        string       text               = string.Empty;
        string       text2              = string.Empty;
        short        num                = Column * 5;
        bool         flag               = Column % 2 == 0;
        short        guildBossLastFloor = NrTSingleton <ContentsLimitManager> .Instance.GetGuildBossLastFloor();

        string columnData = string.Empty;

        if (flag)
        {
            columnData = string.Format("Mobile/DLG/GuildBoss/newlistbox_floor_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        else
        {
            columnData = string.Format("Mobile/DLG/GuildBoss/newlistbox_floor1_columndata{0}", NrTSingleton <UIDataManager> .Instance.AddFilePath);
        }
        this.m_lbFloor.SetColumnData(columnData);
        NewListItem newListItem = new NewListItem(this.m_lbFloor.ColumnNum, true, string.Empty);

        if (!flag)
        {
            newListItem.SetListItemData(0, "UI/BabelTower/boss_main1", true, null, null);
        }
        else
        {
            newListItem.SetListItemData(0, "UI/BabelTower/boss_main2", true, null, null);
        }
        bool flag2 = this.GuildBossRewardCheck();

        if (flag2)
        {
            this.m_dtNotice.Visible = true;
        }
        for (int i = 4; i >= 0; i--)
        {
            newListItem.SetListItemData(i * 6 + 6, false);
            newListItem.SetListItemData(i * 6 + 6 + 2, false);
            newListItem.SetListItemData(i * 6 + 6 + 4, false);
            newListItem.SetListItemData(i * 6 + 7, false);
            newListItem.SetListItemData(i * 6 + 7 + 2, false);
            newListItem.SetListItemData(i * 6 + 7 + 4, false);
            newListItem.SetListItemData(i + 36, false);
            newListItem.SetListItemData(i + 41, false);
            newListItem.SetListItemData(i + 5 + 41, false);
            newListItem.SetListItemData(i + 1, false);
            newListItem.SetListItemData(51 + i, false);
            newListItem.SetListItemData(56 + i * 2, false);
            newListItem.SetListItemData(56 + i * 2 + 1, false);
            if (num <= guildBossLastFloor)
            {
                newListItem.SetListItemData(i + 1, true);
                if (num / 10 <= 0 && num % 10 > 0)
                {
                    text = "Win_Number_" + num;
                    newListItem.SetListItemData(i + 36, true);
                    newListItem.SetListItemData(i + 36, text, null, null, null);
                }
                else
                {
                    short num2 = num / 10;
                    short num3 = num % 10;
                    text  = "Win_Number_" + num2;
                    text2 = "Win_Number_" + num3;
                    newListItem.SetListItemData(i + 41, true);
                    newListItem.SetListItemData(i + 41, text, null, null, null);
                    newListItem.SetListItemData(i + 5 + 41, true);
                    newListItem.SetListItemData(i + 5 + 41, text2, null, null, null);
                }
                newListItem.SetListItemData(i + 1, string.Empty, num, new EZValueChangedDelegate(this.BtClickFloor), null);
                newListItem.SetListItemData(51 + i, false);
                newListItem.SetListItemData(51 + i, "Win_I_Notice04", null, null, null);
                NEWGUILD_MY_BOSS_ROOMINFO guildBossMyRoomInfo = kMyCharInfo.GetGuildBossMyRoomInfo(num);
                if (guildBossMyRoomInfo != null)
                {
                    if (this.m_SelectFloor < num)
                    {
                        this.m_Selectindex = Column;
                        this.m_SelectFloor = num;
                    }
                    if (guildBossMyRoomInfo.i64PlayPersonID > 0L)
                    {
                        newListItem.SetListItemData(56 + i * 2, true);
                        newListItem.SetListItemData(56 + i * 2 + 1, true);
                        NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(guildBossMyRoomInfo.i64PlayPersonID);

                        if (memberInfoFromPersonID != null)
                        {
                            if (memberInfoFromPersonID.GetPortrait() != null)
                            {
                                newListItem.SetListItemData(56 + i * 2 + 1, memberInfoFromPersonID.GetPortrait(), guildBossMyRoomInfo.i64PlayPersonID, null, new EZValueChangedDelegate(this.BtnClickMemberInfo), null);
                            }
                            else
                            {
                                NkListSolInfo nkListSolInfo = new NkListSolInfo();
                                nkListSolInfo.SolCharKind = memberInfoFromPersonID.GetFaceCharKind();
                                nkListSolInfo.SolGrade    = -1;
                                nkListSolInfo.SolLevel    = memberInfoFromPersonID.GetLevel();
                                newListItem.SetListItemData(56 + i * 2 + 1, nkListSolInfo, guildBossMyRoomInfo.i64PlayPersonID, new EZValueChangedDelegate(this.BtnClickMemberInfo), null);
                            }
                        }
                    }
                }
            }
            num -= 1;
        }
        flag             = !flag;
        newListItem.Data = Column;
        return(newListItem);
    }