Esempio n. 1
0
    void BtnSure_OnClickEventHandler(UIButton sender)
    {
        switch (m_wndType)
        {
        case 1:    //确定
            BtnWndBg_OnClickEventHandler(null);
            break;

        case 2:    //合成公式
            TweenLeft();
            EquipComposeWnd wnd = WndManager.GetDialog <EquipComposeWnd>();
            if (wnd)
            {
                EnableBtn(false);
                wnd.SetData(m_iItemTypeID);
            }
            break;

        case 3:    //穿装备
            PdbycWnd wnd1 = WndManager.FindDialog <PdbycWnd>();
            if (wnd1)
            {
                wnd1.SetEquipDataNoReady();
            }
            MyHead.BtnSure.isEnabled = false;
            SoldierDC.Send_SoldierEquipRequest(m_soldierInfo.ID, m_posIndex);
            WndManager.DestoryDialog <EquipmentInfoWnd>();
            break;

        case 4:    //购买
            //堆叠数量上限判定
            bool overLimit = ItemDC.CheckItemOverLimit(m_iItemTypeID, m_iBuyCount);
            if (overLimit)
            {
                NGUIUtil.ShowTipWndByKey(30000030);
                break;
            }
            //持有代币是否足够
            bool currencyEnough = UserDC.CheckCurrencyEnough(m_iBuyCurrency, m_iBuyPrice);
            if (currencyEnough)
            {
            }
            else
            {
                string currencyName = NGUIUtil.GetStringByKey(99700000 + m_iBuyCurrency);
                string tipText      = string.Format(NGUIUtil.GetStringByKey(30000029), currencyName);
                //NGUIUtil.ShowTipWnd(tipText);
                NGUIUtil.ShowFreeSizeTipWnd(tipText);
            }
            break;

        case 5:    //获得途径
            ItemComeFromWnd Formwnd = WndManager.GetDialog <ItemComeFromWnd>();
            s_itemtypeInfo  info    = ItemM.GetItemInfo(m_iItemTypeID);
            Formwnd.SetData(info, m_soldierInfo, null);
            break;
        }
    }