Exemple #1
0
        public void OnReceiveMessageAsyncCallback(object message)
        {
            // Check if it is possible to append a new textballoon on the scene
            if (message is PlayerMessage)
            {
                PlayerMessage pMessage = (PlayerMessage)message;
                Mobile        pMob     = null;

                // Find the mobile owned by the player who sent the message
                lock (playerButtonList)
                {
                    foreach (PlayerButton pb in playerButtonList.PlayerTeamButtonList)
                    {
                        if (pb.Player.Nickname == pMessage.Player.Nickname)
                        {
                            pMob = pb.Mobile;
                            break;
                        }
                    }
                }

                // Append the balloon on the scene
                if (pMob != null)
                {
                    TextBalloonHandler.AsyncAddTextBalloon(pMob, pMessage, 25);
                }
            }

            textBox.AsyncAppendText(message);
        }
Exemple #2
0
        public override void Draw(GameTime gameTime)
        {
            Camera.Draw(spriteBatch);
            Cursor.Instance.Draw(gameTime, spriteBatch);

            if (!Parameter.ShouldChangeBGScale)
            {
                Background.Draw(gameTime, spriteBatch);
            }

            PopupHandler.Draw(gameTime, spriteBatch);

            if (!Parameter.ShouldChangeBGScale)
            {
                BackgroundFlipbookList.ForEach((x) => x.Draw(gameTime, spriteBatch));
            }

            Foreground.Draw(gameTime, spriteBatch);

            WeatherHandler.Draw(gameTime, spriteBatch);

            lock (MobileList)
            {
                MobileList.ForEach((x) => x.Draw(gameTime, spriteBatch));
                HUD.Draw(gameTime, spriteBatch);
            }

            MineList.ForEach((x) => x.Draw(gameTime, spriteBatch));

            ThorSatellite.Draw(gameTime, spriteBatch);

            DeathAnimation.Draw(gameTime, spriteBatch);
            SpecialEffectHandler.Draw(gameTime, spriteBatch);
            TextBalloonHandler.Draw(spriteBatch);
        }