示例#1
0
    public void OnClickBuy(IUIObject obj)
    {
        string empty = string.Empty;

        if (this.m_nCurrPopUpShopIdx != 0L)
        {
            ITEM_MALL_ITEM item = NrTSingleton <ItemMallItemManager> .Instance.GetItem(this.m_nCurrPopUpShopIdx);

            if (item == null)
            {
                return;
            }
            this.m_ItemMall = item;
            MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

            if (msgBoxUI != null)
            {
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("78"),
                    "targetname",
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(item.m_strTextKey)
                });

                if (item.m_nGroup == 8)
                {
                    string empty2 = string.Empty;
                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty2, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromItem(item.m_strTextKey),
                        "count",
                        item.m_nItemNum
                    });

                    NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                    {
                        NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("78"),
                        "targetname",
                        empty2
                    });
                }
                msgBoxUI.OkEventImmediatelyClose = false;
                NrTSingleton <ItemMallItemManager> .Instance.CheckMsgBox = msgBoxUI;
                msgBoxUI.SetMsg(new YesDelegate(this.MsgBoxOKEvent), null, null, null, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("845"), empty, eMsgType.MB_OK_CANCEL);
                msgBoxUI.SetLocation(msgBoxUI.GetLocationX(), msgBoxUI.GetLocationY(), -900f);
            }
        }
        else
        {
            TsLog.LogError("CurrPopUpShopIdx", new object[]
            {
                this.m_nCurrPopUpShopIdx
            });
        }
    }
示例#2
0
    public void OnClickCancel(IUIObject obj)
    {
        ITEMMALL_POPUPSHOP originalItem = NrTSingleton <ItemMallPoPupShopManager> .Instance.GetOriginalItem(this.m_nCurrPopUpIdx);

        if (originalItem == null)
        {
            return;
        }
        MsgBoxUI msgBoxUI = NrTSingleton <FormsManager> .Instance.LoadForm(G_ID.MSGBOX_DLG) as MsgBoxUI;

        if (msgBoxUI != null)
        {
            if (this.m_cbCheckBox.IsChecked())
            {
                msgBoxUI.SetMsg(new YesDelegate(this.OnClickClose), null, null, null, NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("352"), NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox(originalItem.m_strCloseDayText), eMsgType.MB_OK_CANCEL);
            }
            else
            {
                msgBoxUI.SetMsg(new YesDelegate(this.OnClickClose), null, null, null, NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox("352"), NrTSingleton <NrTextMgr> .Instance.GetTextFromMessageBox(originalItem.m_strCloseText), eMsgType.MB_OK_CANCEL);
            }
            msgBoxUI.SetLocation(msgBoxUI.GetLocationX(), msgBoxUI.GetLocationY(), -900f);
        }
    }