Beispiel #1
0
    public string GetListText(MINE_BATTLE_RESULT_INFO info)
    {
        string           empty = string.Empty;
        byte             grade = 0;
        MINE_CREATE_DATA mineCreateDataFromID = BASE_MINE_CREATE_DATA.GetMineCreateDataFromID(info.i16MineDataID);

        if (mineCreateDataFromID != null)
        {
            grade = mineCreateDataFromID.GetGrade();
        }
        string text = (!info.bIsHiddenName) ? TKString.NEWString(info.szEnemyGuildName) : "????";

        if (info.bMeveBack)
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2993"),
                "targetname",
                BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
            });
        }
        else if (info.bAttack)
        {
            if (info.bWin)
            {
                if (text != string.Empty)
                {
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2990"),
                        "targetname",
                        text,
                        "targetname2",
                        BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
                    });
                }
                else
                {
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2991"),
                        "targetname",
                        BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
                    });
                }
            }
            else if (text != string.Empty)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2994"),
                    "targetname",
                    text,
                    "targetname2",
                    BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
                });
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3041"),
                    "targetname",
                    BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
                });
            }
        }
        else if (!info.bAttack)
        {
            if (info.bWin)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2996"),
                    "targetname",
                    text,
                    "targetname2",
                    BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
                });
            }
            else
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2995"),
                    "targetname",
                    text,
                    "targetname2",
                    BASE_MINE_DATA.GetMineName(grade, info.i16MineDataID)
                });
            }
        }
        return(empty);
    }
Beispiel #2
0
    public void SetList()
    {
        this.m_lbCurrentStatus.Clear();
        this.m_InfoSettingTime = Time.realtimeSinceStartup;
        string text = string.Empty;
        int    num  = 0;

        foreach (MINE_GUILD_CURRENTSTATUS_INFO current in this.m_listMineGuild_CurrentStatus)
        {
            NewListItem      newListItem          = new NewListItem(this.m_lbCurrentStatus.ColumnNum, true, string.Empty);
            MINE_CREATE_DATA mineCreateDataFromID = BASE_MINE_CREATE_DATA.GetMineCreateDataFromID(current.i16MineDataID);
            if (mineCreateDataFromID != null)
            {
                newListItem.SetListItemData(13, BASE_MINE_DATA.GetMineName(mineCreateDataFromID.GetGrade(), current.i16MineDataID), null, null, null);
                MINE_DATA mineDataFromGrade = BASE_MINE_DATA.GetMineDataFromGrade(BASE_MINE_DATA.ParseGradeFromString(mineCreateDataFromID.MINE_GRADE));
                if (mineDataFromGrade != null)
                {
                    UIBaseInfoLoader uIBaseInfoLoader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary(mineDataFromGrade.MINE_ICON_NAME);

                    if (uIBaseInfoLoader != null)
                    {
                        newListItem.SetListItemData(6, uIBaseInfoLoader, current, new EZValueChangedDelegate(this.OnClickDefenceMilitaryInfo), null);
                    }
                }
                int    num2  = 9;
                string text2 = string.Empty;
                if (current.i64DefenceGuildID > 0L)
                {
                    text2 = TKString.NEWString(current.szDefenceGuildName);
                    if (current.bIsGuildWarDefenceGuild)
                    {
                        text2 = string.Format("{0}{1}", NrTSingleton <CTextParser> .Instance.GetTextColor("1401"), text2);
                    }
                    num2 = (int)current.byDefenceMilitaryCount;
                }
                else
                {
                    text2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1325");
                }
                if (100 <= NrTSingleton <NkCharManager> .Instance.m_kCharAccountInfo.m_nMasterLevel)
                {
                    text2 = text2 + " " + current.i64MineID.ToString();
                }
                newListItem.SetListItemData(2, text2, null, null, null);
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1629"),
                    "count",
                    num2,
                    "count2",
                    9
                });

                newListItem.SetListItemData(10, text, null, null, null);
                newListItem.SetListItemData(12, string.Empty, null, null, null);
                if (current.byCurrentStatusType == 1 || current.byCurrentStatusType == 0)
                {
                    if (current.i64AttackGuildID > 0L)
                    {
                        text = TKString.NEWString(current.szAttackGuildName);
                        if (current.bIsGuildWarAttackGuild)
                        {
                            text = string.Format("{0}{1}", NrTSingleton <CTextParser> .Instance.GetTextColor("1401"), text);
                        }
                        newListItem.SetListItemData(1, text, null, null, null);
                        newListItem.SetListItemData(5, string.Empty, current, new EZValueChangedDelegate(this.OnClickAttackMilitaryInfo), null);
                        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                        {
                            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1629"),
                            "count",
                            current.byAttackMilitaryCount,
                            "count2",
                            9
                        });

                        newListItem.SetListItemData(9, text, null, null, null);
                        newListItem.SetListItemData(11, string.Empty, null, null, null);
                    }
                    else
                    {
                        newListItem.SetListItemData(1, string.Empty, null, null, null);
                        newListItem.SetListItemData(9, string.Empty, null, null, null);
                        newListItem.SetListItemData(11, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1632"), null, null, null);
                    }
                    text = this.GetTextFromState(current);
                    if (current.byMilitaryState == 2 || current.byMilitaryState == 3 || current.byMilitaryState == 6 || current.byMilitaryState == 7)
                    {
                        newListItem.SetListItemData(0, false);
                        newListItem.SetListItemData(3, string.Empty, null, null, null);
                        newListItem.SetListItemData(4, text, null, null, null);
                    }
                    else
                    {
                        if (current.byJoinMilitary == 0)
                        {
                            bool flag = true;
                            if (current.i64AttackGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID())
                            {
                                flag = (current.byAttackMilitaryCount < 9);
                            }
                            else if (current.i64DefenceGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID())
                            {
                                flag = (current.byDefenceMilitaryCount < 9);
                            }
                            newListItem.SetListItemData(0, flag);
                            if (flag)
                            {
                                UIBaseInfoLoader loader = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_B_NewTileBtnBlue");

                                newListItem.SetListItemData(0, loader, current, new EZValueChangedDelegate(this.OnClickMilitaryBatch), null);
                                newListItem.SetListItemData2(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1323"));
                            }
                        }
                        else if (current.byJoinMilitary == 1)
                        {
                            newListItem.SetListItemData(0, true);
                            UIBaseInfoLoader loader2 = NrTSingleton <UIImageInfoManager> .Instance.FindUIImageDictionary("Win_B_BattleControl");

                            newListItem.SetListItemData(0, loader2, current, new EZValueChangedDelegate(this.OnClickMilitaryReturn), null);
                            newListItem.SetListItemData2(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1615"));
                        }
                        newListItem.SetListItemData(3, text, null, null, null);
                        newListItem.SetListItemData(4, string.Empty, null, null, null);
                    }
                }
                else if (current.byCurrentStatusType == 2)
                {
                    NrCharBase @char = NrTSingleton <NkCharManager> .Instance.GetChar(1);

                    newListItem.SetListItemData(1, @char.GetCharName(), null, null, null);
                    text = this.GetTextFromState(current);
                    newListItem.SetListItemData(3, string.Empty, null, null, null);
                    newListItem.SetListItemData(4, text, null, null, null);
                }
                newListItem.Data = current;
                this.m_lbCurrentStatus.Add(newListItem);
                num++;
            }
        }
        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1633"),
            "count1",
            this.m_Page,
            "count2",
            this.m_MaxPage
        });

        this.m_bxPage.SetText(text);
        this.SetListAttackGuildMark();
        this.m_lbCurrentStatus.RepositionItems();
    }
Beispiel #3
0
    public void OnClickMilitaryBatch(IUIObject obj)
    {
        string text    = string.Empty;
        string message = string.Empty;
        MINE_GUILD_CURRENTSTATUS_INFO mINE_GUILD_CURRENTSTATUS_INFO = obj.Data as MINE_GUILD_CURRENTSTATUS_INFO;

        if (mINE_GUILD_CURRENTSTATUS_INFO != null)
        {
            if (mINE_GUILD_CURRENTSTATUS_INFO.i64MineID <= 0L)
            {
                return;
            }
            if (0L >= NrTSingleton <NewGuildManager> .Instance.GetGuildID())
            {
                return;
            }
            NrMyCharInfo   kMyCharInfo            = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
            NewGuildMember memberInfoFromPersonID = NrTSingleton <NewGuildManager> .Instance.GetMemberInfoFromPersonID(kMyCharInfo.m_PersonID);

            if (memberInfoFromPersonID == null)
            {
                return;
            }
            if (memberInfoFromPersonID.GetRank() <= NewGuildDefine.eNEWGUILD_MEMBER_RANK.eNEWGUILD_MEMBER_RANK_INITIATE)
            {
                message = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("532");

                Main_UI_SystemMessage.ADDMessage(message, SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
                return;
            }
            MINE_CREATE_DATA mineCreateDataFromID = BASE_MINE_CREATE_DATA.GetMineCreateDataFromID(mINE_GUILD_CURRENTSTATUS_INFO.i16MineDataID);
            if (mineCreateDataFromID == null)
            {
                return;
            }
            MINE_DATA mineDataFromGrade = BASE_MINE_DATA.GetMineDataFromGrade(BASE_MINE_DATA.ParseGradeFromString(mineCreateDataFromID.MINE_GRADE));
            if (kMyCharInfo.GetLevel() < (int)mineDataFromGrade.POSSIBLELEVEL)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("408");

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

                Main_UI_SystemMessage.ADDMessage(message, SYSTEM_MESSAGE_TYPE.NAGATIVE_MESSAGE);
                return;
            }
            byte nMode    = 0;
            long nGuildID = 0L;
            if (mINE_GUILD_CURRENTSTATUS_INFO.i64DefenceGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID())
            {
                nMode    = 2;
                nGuildID = mINE_GUILD_CURRENTSTATUS_INFO.i64DefenceGuildID;
            }
            else if (mINE_GUILD_CURRENTSTATUS_INFO.i64AttackGuildID == NrTSingleton <NewGuildManager> .Instance.GetGuildID() || mINE_GUILD_CURRENTSTATUS_INFO.i64DefenceGuildID > 0L)
            {
                nMode    = 4;
                nGuildID = NrTSingleton <NewGuildManager> .Instance.GetGuildID();
            }
            GS_MINE_SEARCH_REQ gS_MINE_SEARCH_REQ = new GS_MINE_SEARCH_REQ();
            gS_MINE_SEARCH_REQ.bSearchMineGrade = mineCreateDataFromID.nMine_Grade;
            gS_MINE_SEARCH_REQ.m_nMineID        = mINE_GUILD_CURRENTSTATUS_INFO.i64MineID;
            gS_MINE_SEARCH_REQ.m_nGuildID       = nGuildID;
            gS_MINE_SEARCH_REQ.m_nMode          = nMode;
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_MINE_SEARCH_REQ, gS_MINE_SEARCH_REQ);
        }
    }
Beispiel #4
0
    public void SetList(GS_MINE_BATTLE_RESULT_GUILDWAR_LIST_ACK _ACK, NkDeserializePacket kDeserializePacket)
    {
        if (_ACK.i16Page != 1 && _ACK.ui8Count == 0)
        {
            return;
        }
        string text = string.Empty;

        this.m_Box_Page.Text = _ACK.i16Page.ToString();
        this.m_nlbRecordList.Clear();
        this.m_page = _ACK.i16Page;
        for (int i = 0; i < (int)_ACK.ui8Count; i++)
        {
            NewListItem newListItem = new NewListItem(this.m_nlbRecordList.ColumnNum, true, string.Empty);
            MINE_BATTLE_RESULT_GUILDWAR_INFO packet = kDeserializePacket.GetPacket <MINE_BATTLE_RESULT_GUILDWAR_INFO>();
            if (i == 0)
            {
                NrTSingleton <MineManager> .Instance.m_i64FirstLegionActionID_By_List = packet.i64LegionActionID;
            }
            NrTSingleton <MineManager> .Instance.m_i64LastLegionActionID_By_List = packet.i64LegionActionID;
            newListItem.Data = packet;
            if (packet.i64BattleTime >= 0L)
            {
                DateTime dueDate = PublicMethod.GetDueDate(packet.i64BattleTime);
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("602"),
                    "year",
                    dueDate.Year,
                    "month",
                    dueDate.Month,
                    "day",
                    dueDate.Day
                });

                newListItem.SetListItemData(1, text, null, null, null);
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1527"),
                    "hour",
                    dueDate.Hour,
                    "min",
                    dueDate.Minute,
                    "sec",
                    dueDate.Second
                });

                newListItem.SetListItemData(2, text, null, null, null);
            }
            byte             grade = 0;
            MINE_CREATE_DATA mineCreateDataFromID = BASE_MINE_CREATE_DATA.GetMineCreateDataFromID(packet.i16MineDataID);
            if (mineCreateDataFromID != null)
            {
                grade = mineCreateDataFromID.GetGrade();
            }
            newListItem.SetListItemData(3, BASE_MINE_DATA.GetMineName(grade, packet.i16MineDataID), null, null, null);
            newListItem.SetListItemData(4, string.Empty, packet, new EZValueChangedDelegate(this.OnClickReplay), null);
            newListItem.SetListItemData(5, string.Empty, packet, new EZValueChangedDelegate(this.ClickShare), null);
            newListItem.SetListItemData(6, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("289"), null, null, null);
            newListItem.SetListItemData(7, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("496"), null, null, null);
            if (packet.bAttack)
            {
                if (packet.bWin)
                {
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2997"),
                        "count",
                        packet.i32GildWarPoint
                    });
                }
                else
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2999");
                }
            }
            else if (packet.bWin)
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2998");
            }
            else
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("3000");
            }
            newListItem.SetListItemData(9, text, null, null, null);
            this.m_nlbRecordList.Add(newListItem);
        }
        this.m_nlbRecordList.RepositionItems();
    }