void ChatConsole_Disposed(object sender, EventArgs e) { instance.ClientChanged -= new EventHandler <ClientChangedEventArgs>(instance_ClientChanged); netcom.ClientLoginStatus -= new EventHandler <LoginProgressEventArgs>(netcom_ClientLoginStatus); netcom.ClientLoggedOut -= new EventHandler(netcom_ClientLoggedOut); UnregisterClientEvents(client); chatManager.Dispose(); chatManager = null; }
private void InitializeChatTab() { chatConsole = new ChatConsole(instance); mainChatManger = chatConsole.ChatManager; METAboltTab tab = AddTab("chat", "Chat", chatConsole); tab.AllowClose = false; tab.AllowDetach = false; tab.AllowHide = false; }
public ChatConsole(METAboltInstance instance) { InitializeComponent(); Disposed += new EventHandler(ChatConsole_Disposed); if (!instance.advancedDebugging) { ctxAnim.Visible = false; ctxTextures.Visible = false; } this.instance = instance; this.instance.ClientChanged += new EventHandler <ClientChangedEventArgs>(instance_ClientChanged); if (instance.GlobalSettings["chat_font_size"].Type != OSDType.Real) { instance.GlobalSettings["chat_font_size"] = OSD.FromReal(cbxInput.Font.Size); } instance.GlobalSettings.OnSettingChanged += new Settings.SettingChangedCallback(GlobalSettings_OnSettingChanged); // Callbacks netcom.ClientLoginStatus += new EventHandler <LoginProgressEventArgs>(netcom_ClientLoginStatus); netcom.ClientLoggedOut += new EventHandler(netcom_ClientLoggedOut); RegisterClientEvents(client); chatManager = new ChatTextManager(instance, new RichTextBoxPrinter(rtbChat)); chatManager.PrintStartupMessage(); this.instance.MainForm.Load += new EventHandler(MainForm_Load); lvwObjects.ListViewItemSorter = new SorterClass(instance); cbChatType.SelectedIndex = 1; UpdateFontSize(); }
public void PrintAvUUID() { chatManager = new ChatTextManager(instance, new RichTextBoxPrinter(instance, rtbChat)); chatManager.PrintUUID(); }
//void StartTPTimer() //{ // tpTimer = new System.Timers.Timer(); // tpTimer.Interval = 3000; // tpTimer.Elapsed += new ElapsedEventHandler(OnTimedTPEvent); // tpTimer.Enabled = true; // tpTimer.Start(); //} //private void OnTimedTPEvent(object sender, ElapsedEventArgs e) //{ // pTP.Visible = false; // label13.Text = "Teleporting..."; // StopTPTimer(); //} //void StopTPTimer() //{ // tpTimer.Stop(); // tpTimer.Enabled = false; // tpTimer.Elapsed -= new ElapsedEventHandler(OnTimedTPEvent); // //tpTimer.Dispose(); //} void ChatConsole_Disposed(object sender, EventArgs e) { this.instance.Config.ConfigApplied -= new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied); client.Objects.ObjectProperties -= new EventHandler<ObjectPropertiesEventArgs>(Objects_OnObjectProperties); client.Appearance.AppearanceSet -= new EventHandler<AppearanceSetEventArgs>(Appearance_OnAppearanceSet); client.Parcels.ParcelDwellReply -= new EventHandler<ParcelDwellReplyEventArgs>(Parcels_OnParcelDwell); client.Avatars.UUIDNameReply -= new EventHandler<UUIDNameReplyEventArgs>(Avatars_OnAvatarNames); RemoveEvents(); chatManager = null; }
//private const UInt32 SB_TOP = 0x6; //private const UInt32 WM_VSCROLL = 0x115; //[return: MarshalAs(UnmanagedType.Bool)] //[DllImport("user32.dll", SetLastError = true)] //private static extern bool PostMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); //private void HandleRichTextBoxAdjustScroll(Object sender, // EventArgs e) //{ // PostMessage(rtbChat.Handle, WM_VSCROLL, (IntPtr)SB_TOP, IntPtr.Zero); //} public ChatConsole(METAboltInstance instance) { try { InitializeComponent(); } catch { ; } SetExceptionReporter(); Application.ThreadException += new ThreadExceptionHandler().ApplicationThreadException; this.instance = instance; netcom = this.instance.Netcom; client = this.instance.Client; AddNetcomEvents(); chatManager = new ChatTextManager(instance, new RichTextBoxPrinter(instance, rtbChat)); chatManager.PrintStartupMessage(); afffile = this.instance.AffFile = instance.Config.CurrentConfig.SpellLanguage + ".aff"; // "en_GB.aff"; dicfile = this.instance.DictionaryFile = instance.Config.CurrentConfig.SpellLanguage + ".dic"; // "en_GB.dic"; this.instance.MainForm.Load += new EventHandler(MainForm_Load); ApplyConfig(this.instance.Config.CurrentConfig); this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied); CreateSmileys(); //AddLanguages(); Disposed += new EventHandler(ChatConsole_Disposed); lvwRadar.ListViewItemSorter = new RadarSorter(); //sim = client.Network.CurrentSim; world.Cursor = Cursors.NoMove2D; //pictureBox1.Cursor = Cursors.Hand; string msg1 = "Click for help on how to use/setup the Voice feature."; tTip = new Popup(customToolTip = new CustomToolTip(instance, msg1)); tTip.AutoClose = false; tTip.FocusOnOpen = false; tTip.ShowingAnimation = tTip.HidingAnimation = PopupAnimations.Blend; string msg2 = ">Hover mouse on avatar icon for info\n>Click on avatar icon for Profile\n>Left click on map and drag to zoom\n>Double click on map to open large map"; tTip1 = new Popup(customToolTip = new CustomToolTip(instance, msg2)); tTip1.AutoClose = false; tTip1.FocusOnOpen = false; tTip1.ShowingAnimation = tTip1.HidingAnimation = PopupAnimations.Blend; toolTip.AutoPopDelay = 7000; toolTip.InitialDelay = 450; toolTip.ReshowDelay = 450; toolTip.IsBalloon = false; //toolTip.ToolTipIcon = ToolTipIcon.Info; toolTip.OwnerDraw = true; toolTip.BackColor = Color.RoyalBlue; toolTip.ForeColor = Color.White; toolTip.Draw += new DrawToolTipEventHandler(toolTip_Draw); tp1 = tabPage1; tp2 = tabPage2; tp3 = tabPage3; tp4 = tabPage4; //pTP.BackColor = Color.FromArgb(170, 64, 64, 64); //Color.FromArgb(25, Color.DimGray); //rtbChat.VScroll += HandleRichTextBoxAdjustScroll; //rtbChat.TextChanged += HandleRichTextBoxAdjustScroll; }