public void ShowWidnow(bool bIsShow)
        {
            CGameScene pGameScene = (CGameScene)parent();

            bool bShow = (pGameScene.m_dwRoomType == 0) ? bIsShow : false;

            bool bVisible = visible();

            if (bVisible == bShow)
            {
                return;
            }

            set_visible(bShow);
            m_btnCancle.set_visible(bShow);
            m_btnMax.set_visible(bShow);
            m_btnOk.set_visible(bShow);
            m_btnMinus.set_visible(bShow);
            m_btnAdd.set_visible(bShow);
            m_sldNumber.set_visible(bShow);

            if (bShow)
            {
                try
                {
                    Sound_Instance pSound = Root.instance().sound_manager().sound_instance(16);
                    pSound.play(false, true);
                }
                catch
                {
                }
            }

            if (bIsShow == true)
            {
                CClientKernel pClientKernel = pGameScene.GetClientKernel();
                if (pClientKernel == null)
                {
                    return;
                }

                UserInfo pUserData = pClientKernel.GetMeUserInfo();
                if ((pUserData != null) && (pUserData.GetGameMoney() > 100))
                {
                    int nMeBuyCount = (pUserData.GetGameMoney() - 100) / m_lCellScore;
                    m_nMaxBuyFishGold = (m_nMaxFishGold <= nMeBuyCount) ? m_nMaxFishGold : nMeBuyCount;
                }
                else
                {
                    m_nMaxBuyFishGold = 0;
                }

                button_press(10011);
            }
        }
        public void SetMaxFishGold(int nMaxFishGold)
        {
            m_nMaxFishGold = nMaxFishGold;

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            UserInfo pUserData = pClientKernel.GetMeUserInfo();

            if ((pUserData != null) && (pUserData.GetGameMoney() > 100))
            {
                int nMeBuyCount = (pUserData.GetGameMoney() - 100) / m_lCellScore;
                m_nMaxBuyFishGold = (m_nMaxFishGold <= nMeBuyCount) ? m_nMaxFishGold : nMeBuyCount;
            }
            else
            {
                m_nMaxBuyFishGold = 0;
            }
        }
Exemple #3
0
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	public void Dispose();

        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	virtual void update(float dt);

        public override void draw()
        {
            if (!visible_)
            {
                return;
            }

            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            Point         pt     = new Point(position_absolute());
            Point         ptDraw = new Point();
            ostringstream ostr   = new ostringstream();

            //for (int i=0; i<4; i++)
            //{
            //    ostr.str("");
            //    ostr = ostr + m_CaptureFishs[i];

            //    ptDraw.x_ = pt.x_ + 136+i*180;
            //    ptDraw.y_ = pt.y_ +104;

            //    DrawNumber(ostr.str(), ptDraw);
            //}

            //for (int i=0; i<4; i++)
            //{
            //    ostr.str("");
            //    ostr = ostr + m_CaptureFishs[i+4];

            //    ptDraw.x_ = pt.x_ + 136+i*180;
            //    ptDraw.y_ = pt.y_ +104+74;

            //    DrawNumber(ostr.str(), ptDraw);
            //}

            //for (int i=0; i<4; i++)
            //{
            //    ostr.str("");
            //    ostr = ostr + m_CaptureFishs[i+8];

            //    ptDraw.x_ = pt.x_ + 136+i*180;
            //    ptDraw.y_ = pt.y_ +104+148;

            //    DrawNumber(ostr.str(), ptDraw);
            //}


            int wMeChairID = pGameScene.GetMeChairID();

            if (wMeChairID != GameDefine.INVALID_CHAIR)
            {
                int nFishGold = pGameScene.m_layRoles[wMeChairID].GetFishGold();
                ostr.str("");
                ostr      = ostr + nFishGold;
                ptDraw.x_ = pt.x_ + 296;
                ptDraw.y_ = pt.y_ + 310;
                DrawNumber(ostr.str(), ptDraw);

                int lCellScore = pGameScene.m_layBuyBulletLayer.GetCellScore();

                ostr.str("");
                ostr      = ostr + nFishGold * lCellScore;
                ptDraw.x_ = pt.x_ + 500;
                ptDraw.y_ = pt.y_ + 310;
                DrawNumber(ostr.str(), ptDraw);



                UserInfo pUserData = pClientKernel.GetMeUserInfo();

                if (pUserData != null)
                {
                    ostr.str("");
                    ostr      = ostr + 0;
                    ptDraw.x_ = pt.x_ + 240;
                    ptDraw.y_ = pt.y_ + 352;
                    DrawNumber(ostr.str(), ptDraw);

                    ostr.str("");
                    ostr      = ostr + pUserData.GetGameMoney();
                    ptDraw.x_ = pt.x_ + 580;
                    ptDraw.y_ = pt.y_ + 352;
                    DrawNumber(ostr.str(), ptDraw);
                }
            }

            long dwTime = FishDefine.time() - m_dwStartTime;

            if (dwTime >= 20)
            {
                ShowWidnow(false);
            }
            else
            {
                ostr.str("");
                ostr = ostr + (20 - dwTime).ToString();

                ptDraw.x_ = pt.x_ + 696;
                ptDraw.y_ = pt.y_ + 38;

                DrawTimer(ostr.str(), ptDraw);
            }
        }
        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	public void Dispose();

        //C++ TO C# CONVERTER TODO TASK: The implementation of the following method could not be found:
        //	virtual void update(float dt);

        public override void draw()
        {
            base.draw();

            CGameScene    pGameScene    = (CGameScene)parent();
            CClientKernel pClientKernel = pGameScene.GetClientKernel();

            if (pClientKernel == null)
            {
                return;
            }

            UserInfo pUserData = pClientKernel.GetMeUserInfo();


            //for(WORD wChair=0;wChair<GAME_PLAYER;wChair++)
            //{
            //	if(pGameScene->m_layRoles[wChair]->m_sprMessage->visible())
            //	{
            //		Point pt = pGameScene->m_layRoles[wChair]->m_sprMessage->position() + pGameScene->m_layRoles[wChair]->position();
            //		std::ostringstream ostr;
            //		ostr = ostr + "new Point(" + pt.x_ + "," + pt.y_ +")" + pGameScene->m_layRoles[wChair]->m_cbShowData;

            //		m_Font->draw_string(pt, ostr.str().c_str(), Color(176,222,238));

            //	}

            //}

            if (pUserData != null)
            {
                int wChair = ((CGameScene)parent()).GetClientKernel().GetMeChairID();

                Point pt = position_absolute();
                pt.x_ += 56;
                pt.y_ += 14;

                //   m_Font->draw_string(pt, pUserData->szNickName, Color(14,236,212));
                //m_Font->draw_string(pt, g_WideCharToMultiByte(pUserData->szNickName), Color(14,236,212));
                m_Font.draw_string(pt, pUserData.Nickname, new Color(14, 236, 212));

                //std::string szRank;
                //if (pUserData->lScore>0 && pUserData->lScore<1000)
                //{
                //    szRank = "渔夫";
                //}
                //else
                //{
                //    szRank = "船长";
                //}

                ostringstream ostrRank = new ostringstream();
                ostrRank = ostrRank + pGameScene.m_layRoles[wChair].GetExpValue();

                pt.x_ += 160;
                m_Font.draw_string(pt, ostrRank.str(), new Color(14, 236, 212));

                pt.x_ -= 160;
                pt.y_ += 28;

                int nFishGold = pGameScene.m_layRoles[pGameScene.GetMeChairID()].GetFishGold();

                ostringstream ostr = new ostringstream();
                ostr = ostr + pUserData.GetGameMoney() + "(+" + nFishGold + ")";

                m_Font.draw_string(pt, ostr.str(), new Color(14, 236, 212));

                pt.x_ += 30;
                pt.y_ += 27;

                ostringstream ostr1 = new ostringstream();
                ostr1 = ostr1 + pGameScene.m_layRoles[wChair].GetMaxMulRate();
                m_Font.draw_string(pt, ostr1.str(), new Color(14, 236, 212));

                pt.x_ += 16;
                pt.y_ += 26;

                int           nExpToLevel = FishDefine.EXP_CHANGE_TO_LEVEL;
                ostringstream ostr2       = new ostringstream();
                ostr2 = ostr2 + pGameScene.m_layRoles[wChair].GetFireCount() % FishDefine.EXP_CHANGE_TO_LEVEL + " / " + nExpToLevel;
                m_Font.draw_string(pt, ostr2.str(), new Color(14, 236, 212));
            }
        }