예제 #1
0
 public override void Dispose()
 {
     base.Dispose();
     _labelName.Dispose();
     _labelPing.Dispose();
     _labelPacketLoss.Dispose();
 }
예제 #2
0
        public override void UnloadContent()
        {
            SDL.SDL_GetWindowBordersSize(Window.Handle, out int top, out int left, out int bottom, out int right);
            Settings.GlobalSettings.WindowPosition = new Point(Math.Max(0, Window.ClientBounds.X - left), Math.Max(0, Window.ClientBounds.Y - top));

            _scene?.Unload();
            Settings.GlobalSettings.Save();
            Plugin.OnClosing();

            ArtLoader.Instance.Dispose();
            GumpsLoader.Instance.Dispose();
            TexmapsLoader.Instance.Dispose();
            AnimationsLoader.Instance.Dispose();
            LightsLoader.Instance.Dispose();
            TileDataLoader.Instance.Dispose();
            AnimDataLoader.Instance.Dispose();
            ClilocLoader.Instance.Dispose();
            FontsLoader.Instance.Dispose();
            HuesLoader.Instance.Dispose();
            MapLoader.Instance.Dispose();
            MultiLoader.Instance.Dispose();
            MultiMapLoader.Instance.Dispose();
            ProfessionLoader.Instance.Dispose();
            SkillsLoader.Instance.Dispose();
            SoundsLoader.Instance.Dispose();
            SpeechesLoader.Instance.Dispose();
            Verdata.File?.Dispose();
            World.Map?.Destroy();

            //NOTE: My dispose related changes, see if they're still necessary
            _hues_sampler[0]?.Dispose();
            _hues_sampler[0] = null;
            _hues_sampler[1]?.Dispose();
            _hues_sampler[1] = null;
            _scene?.Dispose();
            AuraManager.Dispose();
            UIManager.Dispose();
            Texture2DCache.Dispose();
            RenderedText.Dispose();

            //NOTE: We force the sockets to disconnect in case they haven't already been disposed
            //This is good practice since the Client can be quit while the socket is still active
            if (NetClient.LoginSocket.IsDisposed == false)
            {
                NetClient.LoginSocket.Disconnect();
            }
            if (NetClient.Socket.IsDisposed == false)
            {
                NetClient.Socket.Disconnect();
            }

            base.UnloadContent();
        }
        public override bool Draw(SpriteBatch3D spriteBatch, Vector3 position, MouseOverList objectList)
        {
            if (!AllowedToDraw || GameObject.IsDisposed)
            {
                _text?.Dispose();
                _text = null;
                return(false);
            }

            Texture.Ticks = CoreGame.Ticks;
            TextOverhead overhead = (TextOverhead)GameObject;

            if (!overhead.IsPersistent && overhead.Alpha < 1.0f)
            {
                HueVector = RenderExtentions.GetHueVector(0, false, overhead.Alpha, true);
            }
            Settings settings = Service.Get <Settings>();
            int      width    = Texture.Width - Bounds.X;
            int      height   = Texture.Height - Bounds.Y;

            if (position.X < Bounds.X)
            {
                position.X = Bounds.X;
            }
            else if (position.X > settings.GameWindowWidth - width)
            {
                position.X = settings.GameWindowWidth - width;
            }

            if (position.Y - Bounds.Y < 0)
            {
                position.Y = Bounds.Y;
            }
            else if (position.Y > settings.GameWindowHeight - height)
            {
                position.Y = settings.GameWindowHeight - height;
            }

            return(base.Draw(spriteBatch, position, objectList));
        }
예제 #4
0
 public override void Dispose()
 {
     _renderedText?.Dispose();
     _edge?.Dispose();
     base.Dispose();
 }
예제 #5
0
 private void ParentOnDisposed(object sender, EventArgs e)
 {
     GameObject.Disposed -= ParentOnDisposed;
     _text?.Dispose();
 }
예제 #6
0
 public override void Dispose()
 {
     _gameText?.Dispose();
     _gameText = null;
     base.Dispose();
 }
예제 #7
0
 public override void Dispose()
 {
     base.Dispose();
     _gameText?.Dispose();
 }