void IActPluginV1.DeInitPlugin() { if (checkBoxShowView != null) { ActGlobals.oFormActMain.Controls.Remove(checkBoxShowView); } if (Settings != null) { Settings.Save(); } if (TimelineView != null) { TimelineView.Close(); } if (Controller != null) { Controller.Stop(); } ActGlobals.oFormActMain.UpdateCheckClicked -= CheckForUpdate; if (StatusText != null) { StatusText.Text = "Plugin Exited m(_ _)m"; } }
private void checkBoxReverseOrder_CheckedChanged(object sender, EventArgs e) { CheckBox cb = (CheckBox)sender; TimelineView tv = getTimelineView(cb.Name); tv.ReverseOrder = cb.Checked; }
private void checkBoxShowCasting_CheckedChanged(object sender, EventArgs e) { CheckBox cb = (CheckBox)sender; TimelineView tv = getTimelineView(cb.Name); tv.ShowCasting = cb.Checked; }
private void checkBoxPopup_CheckedChanged(object sender, EventArgs e) { CheckBox cb = (CheckBox)sender; TimelineView tv = getTimelineView(cb.Name); tv.PopupMode = cb.Checked; }
private void trackBarOpacity_ValueChanged(object sender, EventArgs e) { TrackBar tb = (TrackBar)sender; TimelineView tv = getTimelineView(tb.Name); tv.MyOpacity = (double)tb.Value / 100; }
private void checkBoxShowOverlayButtons_CheckedChanged(object sender, EventArgs e) { CheckBox cb = (CheckBox)sender; TimelineView tv = getTimelineView(cb.Name); tv.ShowOverlayButtons = cb.Checked; }
private void udBarWidth_ValueChanged(object sender, EventArgs e) { NumericUpDown ud = (NumericUpDown)sender; TimelineView tv = getTimelineView(ud.Name); tv.BarWidth = (int)ud.Value; }
private void checkBoxMoveOverlayByDrag_CheckedChanged(object sender, EventArgs e) { CheckBox cb = (CheckBox)sender; TimelineView tv = getTimelineView(cb.Name); tv.MoveByDrag = cb.Checked; }
private void udNumRows_ValueChanged(object sender, EventArgs e) { NumericUpDown ud = (NumericUpDown)sender; TimelineView tv = getTimelineView(ud.Name); tv.NumberOfRowsToDisplay = (int)ud.Value; }
private void checkBoxOver10_CheckedChanged(object sender, EventArgs e) { CheckBox cb = (CheckBox)sender; TimelineView tv = getTimelineView(cb.Name); tv.Over10 = cb.Checked; }
public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { try { // DI log writer Globals.WriteLogImpl = (str) => { ActGlobals.oFormActMain.WriteInfoLog(String.Format("act_timeline: {0}", str)); }; ScreenSpace = pluginScreenSpace; StatusText = pluginStatusText; StatusText.Text = "Loading Sprache.dll"; #if DEBUG // Sprache.dll is already injected by libZ in Release builds. Assembly.LoadFrom("Sprache.dll"); #endif StatusText.Text = "Sprache.dll Load Success!"; #if DEBUG // See Issue #1 // Control.CheckForIllegalCrossThreadCalls = true; #endif Controller = new TimelineController(); TimelineView = new TimelineView(Controller); TimelineView.Show(); TimelineView.DoubleClick += TimelineView_DoubleClick; TimelineAutoLoader = new TimelineAutoLoader(this); TimelineAutoLoader.Start(); Settings = new PluginSettings(this); Settings.AddStringSetting("TimelineTxtFilePath"); Settings.AddStringSetting("FontString"); Settings.AddIntSetting("TextWidth"); Settings.AddIntSetting("BarWidth"); Settings.AddIntSetting("OpacityPercentage"); ActGlobals.oFormActMain.OnCombatEnd += CombatEnd; SetupTab(); InjectButton(); Settings.Load(); SetupUpdateChecker(); StatusText.Text = "Plugin Started (^^)!"; } catch (Exception e) { if (StatusText != null) { StatusText.Text = "Plugin Init Failed: " + e.Message; } } }
private void udOverlayY_ValueChanged(object sender, EventArgs e) { NumericUpDown ud = (NumericUpDown)sender; TimelineView tv = getTimelineView(ud.Name); if (!updateFromOverlayMove) { tv.Top = (int)ud.Value; } }
void checkBoxShowView_CheckedChanged(object sender, EventArgs e) { if (checkBoxShowView.Checked) { TimelineView.Show(); } else { TimelineView.Hide(); } }
private TimelineView getTimelineView(string name) { TimelineView result = plugin.TimelineViewList[0]; int overlayNumber = (int)Char.GetNumericValue(name[name.Length - 1]); if (overlayNumber > 1) { result = plugin.TimelineViewList[overlayNumber - 1]; } return(result); }
private void buttonFontSelect_TextChanged(object sender, EventArgs e) { try { Button btn = (Button)sender; TimelineView tv = getTimelineView(btn.Name); tv.TimelineFont = TypeDescriptor.GetConverter(typeof(Font)).ConvertFromString(btn.Text) as Font; } catch { // pass } }
private void buttonFontSelect_Click(object sender, EventArgs e) { FontDialog fontdialog = new FontDialog(); Button btn = (Button)sender; TimelineView tv = getTimelineView(btn.Name); fontdialog.Font = tv.TimelineFont; if (fontdialog.ShowDialog() == DialogResult.OK) { tv.TimelineFont = fontdialog.Font; } }
private void TimelineView_Move(object sender, EventArgs e) { NumericUpDown udx = udOverlayX; NumericUpDown udy = udOverlayY; TimelineView tv = (TimelineView)sender; for (int i = 0; i < plugin.NumberOfOverlays; i++) { if (sender == plugin.TimelineViewList[i]) { udx = udOverlayXList[i]; udy = udOverlayYList[i]; break; } } updateFromOverlayMove = true; udx.Value = tv.Left; udy.Value = tv.Top; updateFromOverlayMove = false; }
public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { try { AppDomain.CurrentDomain.AssemblyResolve += delegate(object sender, ResolveEventArgs args) { string asmFile = (args.Name.Contains(",") ? args.Name.Substring(0, args.Name.IndexOf(",")) : args.Name); if (!ASMCHK.Contains(asmFile)) { return(null); } try { return(Assembly.LoadFile(Path.Combine(GetPluginDirectory(), asmFile + ".dll"))); } catch { return(null); } }; // DI log writer Globals.WriteLogImpl = (str) => { ActGlobals.oFormActMain.WriteInfoLog(String.Format("act_timeline: {0}", str)); }; ScreenSpace = pluginScreenSpace; StatusText = pluginStatusText; StatusText.Text = "Loading Sprache.dll"; #if DEBUG // Sprache.dll is already injected by libZ in Release builds. Assembly.LoadFrom("Sprache.dll"); #endif StatusText.Text = "Sprache.dll Load Success!"; #if DEBUG // See Issue #1 // Control.CheckForIllegalCrossThreadCalls = true; #endif Controller = new TimelineController(); TimelineView = new TimelineView(Controller); TimelineView.DoubleClick += TimelineView_DoubleClick; visibilityControl = new VisibilityControl(TimelineView); visibilityControl.Visible = true; TimelineAutoLoader = new TimelineAutoLoader(Controller); TimelineAutoLoader.Start(); Settings = new PluginSettings(this); Settings.AddStringSetting("TimelineTxtFilePath"); Settings.AddStringSetting("FontString"); Settings.AddIntSetting("TextWidth"); Settings.AddIntSetting("BarWidth"); Settings.AddIntSetting("OpacityPercentage"); SetupTab(); InjectButton(); Settings.Load(); SetupUpdateChecker(); StatusText.Text = Translator.Get("_LN_PluginStarted"); xivWindowTimer = new System.Threading.Timer(e => { try { if (this.AutoHide) { uint pid; var hWndFg = NativeMethods.GetForegroundWindow(); if (hWndFg == IntPtr.Zero) { return; } NativeMethods.GetWindowThreadProcessId(hWndFg, out pid); var exePath = Process.GetProcessById((int)pid).MainModule.FileName; if (Path.GetFileName(exePath) == "ffxiv.exe" || Path.GetFileName(exePath) == "ffxiv_dx11.exe") { this.TimelineView.Invoke(new Action(() => this.TimelineView.Visible = true)); } else { this.TimelineView.Invoke(new Action(() => this.TimelineView.Visible = false)); } } } catch { } }); } catch (Exception e) { if (StatusText != null) { StatusText.Text = "Plugin Init Failed: " + e.Message; } } }
public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { try { // DI log writer Globals.WriteLogImpl = (str) => { ActGlobals.oFormActMain.WriteInfoLog(String.Format("act_timeline: {0}", str)); }; ScreenSpace = pluginScreenSpace; StatusText = pluginStatusText; StatusText.Text = "Loading Sprache.dll"; #if DEBUG // Sprache.dll is already injected by libZ in Release builds. Assembly.LoadFrom("Sprache.dll"); #endif StatusText.Text = "Sprache.dll Load Success!"; #if DEBUG // See Issue #1 // Control.CheckForIllegalCrossThreadCalls = true; #endif Controller = new TimelineController(); TimelineView = new TimelineView(Controller); TimelineView.Show(); TimelineView.DoubleClick += TimelineView_DoubleClick; Settings = new PluginSettings(this); Settings.AddStringSetting("TimelineTxtFilePath"); Settings.AddStringSetting("FontString"); Settings.AddIntSetting("TextWidth"); Settings.AddIntSetting("BarWidth"); Settings.AddIntSetting("OpacityPercentage"); SetupTab(); InjectButton(); Settings.Load(); SetupUpdateChecker(); StatusText.Text = "Plugin Started (^^)!"; } catch(Exception e) { if (StatusText != null) StatusText.Text = "Plugin Init Failed: "+e.Message; } }
void TimelineView_DoubleClick(object sender, EventArgs e) { TimelineView.Hide(); checkBoxShowView.Checked = false; }