Exemplo n.º 1
0
    public void OnMsgGoodsList(CliProto.SC_SHOP_GET_GOODSLIST_ACK refMsg)
    {
        m_ProductBoughtCount.Clear();

        byte count = refMsg.m_Count;

        for (int i = 0; i < count && i < HeaderProto.MAX_SHOP_GOODS_COUNT; ++i)
        {
            CliProto.SGoodsInfo productInfo = refMsg.m_GOODSINFOS[i];
            m_ProductBoughtCount[productInfo.m_GoodsId] = productInfo.m_Num;
        }

        if (m_MainPanel != null && m_MainPanel.GetComponent <MallPanel>().m_isPanelOpen)
        {
            m_MainPanel.GetComponent <MallPanel>().RefreshTabPanel((int)MallPanel.TabName.TAB_NAME_VIP, false);
            m_MainPanel.GetComponent <MallPanel>().RefreshTabPanel((int)MallPanel.TabName.TAB_NAME_MALL, false);
        }
    }
Exemplo n.º 2
0
    public void OnMsgGoods(CliProto.SC_SHOP_BUY_GOODS_ACK refMsg)
    {
        CliProto.SGoodsInfo goodsInfo = refMsg.m_TemplateID[0];
        int goodsId  = (int)goodsInfo.m_GoodsId;
        int goodsNum = (int)goodsInfo.m_Num;

        Hashtable productInfo = sdConfDataMgr.Instance().GetItemById(goodsId.ToString());
        int       quality     = int.Parse(productInfo["Quility"].ToString());
        string    goodsName   = productInfo["ShowName"].ToString();

        string colorStr = null;
        string msgStr   = null;

        if (quality == 0)
        {
            colorStr = "[cccccc]";
        }
        else if (quality == 1)
        {
            colorStr = "[ffffff]";
        }
        else if (quality == 2)
        {
            colorStr = "[00ff00]";
        }
        else if (quality == 3)
        {
            colorStr = "[0000ff]";
        }
        else if (quality == 4)
        {
            colorStr = "[9933cc]";
        }
        else if (quality == 5)
        {
            colorStr = "[ffff00]";
        }

        msgStr = string.Format("购买成功,获得{0}{1}[-] x{2}!", colorStr, goodsName, goodsNum);
        sdUICharacter.Instance.ShowOkMsg(msgStr, null);
    }