コード例 #1
0
ファイル: GameScene.cs プロジェクト: Andries1985/ClassicUO
        public override void Unload()
        {
            Client.Game.SetWindowTitle(string.Empty);

            ItemHold.Clear();

            try
            {
                Plugin.OnDisconnected();
            }
            catch
            {
            }

            TargetManager.Reset();

            // special case for wmap. this allow us to save settings
            UIManager.GetGump <WorldMapGump>()?.SaveSettings();

            ProfileManager.CurrentProfile?.Save(ProfileManager.ProfilePath);

            Macros.Save();
            InfoBars.Save();
            ProfileManager.UnLoadProfile();

            StaticFilters.CleanCaveTextures();
            StaticFilters.CleanTreeTextures();

            NetClient.Socket.Disconnected -= SocketOnDisconnected;
            NetClient.Socket.Disconnect();
            _lightRenderTarget?.Dispose();
            _world_render_target?.Dispose();

            CommandManager.UnRegisterAll();
            Weather.Reset();
            UIManager.Clear();
            World.Clear();
            ChatManager.Clear();
            DelayedObjectClickManager.Clear();

            _useItemQueue?.Clear();
            _useItemQueue = null;
            Hotkeys       = null;
            Macros        = null;
            MessageManager.MessageReceived -= ChatOnMessageReceived;


            Settings.GlobalSettings.WindowSize = new Point(Client.Game.Window.ClientBounds.Width, Client.Game.Window.ClientBounds.Height);

            Settings.GlobalSettings.IsWindowMaximized = Client.Game.IsWindowMaximized();
            Client.Game.SetWindowBorderless(false);

            base.Unload();
        }
コード例 #2
0
ファイル: Cudumar.xaml.cs プロジェクト: yhtsnda/cudumar-xmpp
        private void ClearUI()
        {
            timerCommHolder.Stop();

            Dispatcher.BeginInvoke(new Action(() => {
                ChatMgr.SetConversationInput(false);
                AvatarImg.Source = null;
                Avatar.ClearCache();

                if (panelConnect.Visibility != Visibility.Visible)
                {
                    this.FadeIn(panelConnect.Name, new TimeSpan(0, 0, 0, 0, 500));
                }
                panelConnect.Visibility = Visibility.Visible;
                panelRoster.Visibility  = Visibility.Hidden;
                miLogout.IsEnabled      = false;
                btConnect.IsEnabled     = true;
            }), DispatcherPriority.Normal);

            ChatMgr.Clear();
            RosterMgr.Clear();
            Signals.Clear();
        }