示例#1
0
    public override void SetTicketList()
    {
        COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance();

        if (instance == null)
        {
            Debug.LogError("ERROR, SolRecruitDlg_ChallengeQuest.cs, SetTicketList(), pkConstant is null");
            return;
        }
        string text  = string.Empty;
        string empty = string.Empty;

        this.m_TicketList.Clear();
        if (!NrTSingleton <ContentsLimitManager> .Instance.IsLegendHire())
        {
            text = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2862");

            NewListItem newListItem = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty);
            int         value       = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_ESSENCE_ITEMUNIQUE);
            int         needItemNum = SolRecruitDlg.GetNeedItemNum(13);
            newListItem.SetListItemData(1, NrTSingleton <ItemManager> .Instance.GetItemTexture(value), null, null, null);
            newListItem.SetListItemEnable(3, true);
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                text,
                "targetname",
                NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(value),
                "count1",
                needItemNum,
                "count2",
                SolRecruitDlg.GetSolCount(13)
            });

            newListItem.SetListItemData(2, empty, null, null, null);
            newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), eSolRecruitType.SOLRECRUIT_ESSENCE_ONE, new EZValueChangedDelegate(this.ClickTicketList), null);
            newListItem.SetListItemData(4, false);
            newListItem.SetListItemData(6, false);
            newListItem.Data = eSolRecruitType.SOLRECRUIT_ESSENCE_ONE;
            this.m_TicketList.Add(newListItem);
        }
        this.m_TicketList.RepositionItems();
    }
示例#2
0
    protected override void ClickTicketList(IUIObject obj)
    {
        UI_UIGuide uI_UIGuide = NrTSingleton <FormsManager> .Instance.GetForm((G_ID)this.m_nWinID) as UI_UIGuide;

        if (uI_UIGuide != null)
        {
            uI_UIGuide.CloseUI = true;
        }
        else
        {
            NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.UIGUIDE_DLG);
        }
        if (obj.Data == null)
        {
            Debug.LogError("ERROR, SolRecruitDlg_ChallengeQuest.cs, ClickTicketList(), obj.Data is Null");
            return;
        }
        eSolRecruitType recruittype       = (eSolRecruitType)((int)obj.Data);
        string          textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1699");

        string textFromMessageBox = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("296");

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref textFromMessageBox, new object[]
        {
            textFromMessageBox,
            "count",
            SolRecruitDlg.GetNeedItemNum((int)recruittype)
        });

        MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

        if (msgBoxUI == null)
        {
            return;
        }
        msgBoxUI.SetMsg(new YesDelegate(this.OkTickekLegendHero), null, null, null, textFromInterface, textFromMessageBox, eMsgType.MB_OK_CANCEL);
    }
示例#3
0
    protected virtual void ClickTicketList(IUIObject obj)
    {
        UI_UIGuide uI_UIGuide = NrTSingleton <FormsManager> .Instance.GetForm((G_ID)this.m_nWinID) as UI_UIGuide;

        if (uI_UIGuide != null)
        {
            uI_UIGuide.CloseUI = true;
        }
        else
        {
            NrTSingleton <FormsManager> .Instance.CloseForm(G_ID.UIGUIDE_DLG);
        }
        if (obj == null)
        {
            return;
        }
        if (!NrTSingleton <NkClientLogic> .Instance.GetCanOpenTicket())
        {
            string textFromNotify = NrTSingleton <NrTextMgr> .Instance.GetTextFromNotify("508");

            Main_UI_SystemMessage.ADDMessage(textFromNotify, SYSTEM_MESSAGE_TYPE.NORMAL_MESSAGE);
            return;
        }
        if (obj.Data is eSolRecruitType)
        {
            eSolRecruitType eSolRecruitType   = (eSolRecruitType)((int)obj.Data);
            string          textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1699");

            string text = string.Empty;
            if (eSolRecruitType != eSolRecruitType.SOLRECRUIT_VOUCHER_FREE_HEARTS_RECRUIT)
            {
                if (eSolRecruitType == eSolRecruitType.SOLRECRUIT_ESSENCE_ONE)
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("296");
                }
                else
                {
                    text = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("127");
                }
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref text, new object[]
                {
                    text,
                    "count",
                    SolRecruitDlg.GetNeedItemNum((int)eSolRecruitType)
                });
            }
            else
            {
                text = NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("233");
            }
            MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

            if (msgBoxUI != null)
            {
                msgBoxUI.SetMsg(new YesDelegate(this.MsgBoxOKEvent), eSolRecruitType, null, null, textFromInterface, text, eMsgType.MB_OK_CANCEL);
            }
        }
        else
        {
            ITEM iTEM = (ITEM)obj.Data;
            if (iTEM != null)
            {
                this.SetGetNowOpenTicket(iTEM);
                this.SolTicketOpen();
                if (this.m_OpenTicket.m_nItemNum > 1)
                {
                    this.m_ReUseTicket = true;
                }
                if (this.m_bTutorial)
                {
                    this.Close();
                }
            }
        }
        this.m_fRequestTime    = Time.time;
        this.m_fScrollPosition = this.m_TicketList.ScrollPosition;
    }
示例#4
0
    public virtual void SetTicketList()
    {
        COMMON_CONSTANT_Manager instance = COMMON_CONSTANT_Manager.GetInstance();

        if (instance == null)
        {
            return;
        }
        string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2016");

        string empty = string.Empty;

        this.m_TicketList.Clear();
        if (!NrTSingleton <ContentsLimitManager> .Instance.IsLegendHire())
        {
            textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2862");

            NewListItem newListItem = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty);
            int         value       = instance.GetValue(eCOMMON_CONSTANT.eCOMMON_CONSTANT_ESSENCE_ITEMUNIQUE);
            int         needItemNum = SolRecruitDlg.GetNeedItemNum(13);
            ITEM        item        = NkUserInventory.GetInstance().GetItem(value);
            if (item != null)
            {
                newListItem.SetListItemData(1, item, null, null, null);
                if (item.m_nItemNum >= needItemNum)
                {
                    newListItem.SetListItemEnable(3, true);
                }
                else
                {
                    newListItem.SetListItemEnable(3, false);
                }
            }
            else
            {
                newListItem.SetListItemData(1, NrTSingleton <ItemManager> .Instance.GetItemTexture(value), null, null, null);
                newListItem.SetListItemEnable(3, false);
            }
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                textFromInterface,
                "targetname",
                NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(value),
                "count1",
                needItemNum,
                "count2",
                SolRecruitDlg.GetSolCount(13)
            });

            newListItem.SetListItemData(2, empty, null, null, null);
            newListItem.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), eSolRecruitType.SOLRECRUIT_ESSENCE_ONE, new EZValueChangedDelegate(this.ClickTicketList), null);
            newListItem.SetListItemData(4, false);
            newListItem.SetListItemData(6, false);
            newListItem.Data = eSolRecruitType.SOLRECRUIT_ESSENCE_ONE;
            this.m_TicketList.Add(newListItem);
        }
        this.AddTicketSellInfo();
        List <ITEM> functionItemsByInvenType = NkUserInventory.instance.GetFunctionItemsByInvenType(6, eITEM_SUPPLY_FUNCTION.SUPPLY_GETSOLDIER);

        foreach (ITEM current in functionItemsByInvenType)
        {
            if (NrTSingleton <ItemManager> .Instance.IsItemATB(current.m_nItemUnique, 2048L))
            {
                NewListItem newListItem2 = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty);
                string      name         = NrTSingleton <ItemManager> .Instance.GetName(current);

                newListItem2.SetListItemData(1, current, null, null, null);
                newListItem2.SetListItemData(2, name, null, null, null);
                newListItem2.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), current, new EZValueChangedDelegate(this.ClickTicketList), null);
                newListItem2.SetListItemData(4, false);
                newListItem2.SetListItemData(5, string.Empty, current.m_nItemID, new EZValueChangedDelegate(this.ClickTicketItemToolTip), null);
                newListItem2.SetListItemData(6, false);
                newListItem2.Data = current.m_nItemUnique;
                this.m_TicketList.Add(newListItem2);
            }
        }
        foreach (ITEM current2 in functionItemsByInvenType)
        {
            if (!NrTSingleton <ItemManager> .Instance.IsItemATB(current2.m_nItemUnique, 2048L))
            {
                NewListItem newListItem3 = new NewListItem(this.m_TicketList.ColumnNum, true, string.Empty);
                string      name2        = NrTSingleton <ItemManager> .Instance.GetName(current2);

                newListItem3.SetListItemData(1, current2, null, null, null);
                newListItem3.SetListItemData(2, name2, null, null, null);
                newListItem3.SetListItemData(3, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("573"), current2, new EZValueChangedDelegate(this.ClickTicketList), null);
                newListItem3.SetListItemData(4, false);
                newListItem3.SetListItemData(5, string.Empty, current2.m_nItemID, new EZValueChangedDelegate(this.ClickTicketItemToolTip), null);
                newListItem3.SetListItemData(6, false);
                this.m_TicketList.Add(newListItem3);
            }
        }
        this.m_TicketList.RepositionItems();
        this.SetLastSelectItemScrol();
    }