Ejemplo n.º 1
0
    private void OnRightMouseCliked(Grid_N grid)
    {
        if (grid.ItemObj == null)
        {
            return;
        }

        if (mSellOpLayer.gameObject.activeSelf)
        {
            return;
        }

        if (grid.ItemObj.GetCount() == 0)
        {
            new PeTipMsg(PELocalization.GetString(82209007), PeTipMsg.EMsgLevel.Warning);
            return;
        }

        SelectItem_N.Instance.SetItem(null);

        m_CurOpItem = grid.ItemObj;

        //lz-2016.10.27 购买所有的时候提示加上购买所有的价格
        int count = m_CurOpItem.GetCount();
        int price = 0;

        if (m_CurPackTab == 0)
        {
            price = Mathf.RoundToInt(m_CurOpItem.GetBuyPrice() * (1 + ColonyConst.TRADE_POST_CHARGE_RATE));
        }
        else
        {
            price = m_CurOpItem.GetSellPrice(); //赎回的价格等于卖出的价格
        }
        string name   = m_CurOpItem.protoData.GetName();
        string msgStr = string.Format("{0} {1}\n{2} {3}", PELocalization.GetString(8000077), name + " X " + count, PELocalization.GetString(8000253), (count * price));

        MessageBox_N.ShowYNBox(msgStr, BuyAll, ResetOpInfo);
    }
Ejemplo n.º 2
0
    private void UpdateOpPanelInfo()
    {
        if (null == m_CurOpItem)
        {
            return;
        }

        ShowOpPanel(true);
        m_CurOpGrid.SetItem(m_CurOpItem);
        m_CurrentNum = 1;
        if (m_CurPackTab == 0 && m_IsBuy)
        {
            //lz-2016.10.24 贸易站收取一定比例的服务费
            m_CurPrice = Mathf.RoundToInt(m_CurOpItem.GetBuyPrice() * (1 + ColonyConst.TRADE_POST_CHARGE_RATE));
        }
        else
        {
            m_CurPrice = m_CurOpItem.GetSellPrice(); //赎回的价格等于卖出的价格
        }
        m_InputOpNum.text = m_CurrentNum.ToString();
        m_LbTotal.text    = m_CurPrice.ToString();
        m_LbPrice.text    = m_CurPrice.ToString();
        m_BtnOp.text      = PELocalization.GetString(m_IsBuy ? 8000556 : 8000555);
    }