Advertisement
Guest User

Untitled

a guest
Sep 26th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.70 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Text;
  6. using System.Windows.Forms;
  7. using Advanced_Combat_Tracker;
  8. using System.IO;
  9. using System.Reflection;
  10. using System.Xml;
  11. using System.Text.RegularExpressions;
  12. using System.Globalization;
  13. using System.Net;
  14. using Newtonsoft.Json;
  15.  
  16. namespace Test_Plugin
  17. {
  18.     public partial class TestPlugin: UserControl, IActPluginV1
  19.     {
  20.         private EncounterData ActiveEnconter;
  21.         private Label label1;
  22.         Label lblStatus;
  23.  
  24.         public TestPlugin()
  25.         {
  26.             InitializeComponent();
  27.         }
  28.  
  29.         public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
  30.         {
  31.             lblStatus = pluginStatusText;
  32.             pluginScreenSpace.Controls.Add(this);
  33.             this.Dock = DockStyle.Fill;
  34.             pluginScreenSpace.Text = "Test Plugin";
  35.  
  36.             //Events
  37.             ActGlobals.oFormActMain.BeforeLogLineRead += new LogLineEventDelegate(OnBeforeLogLineRead);
  38.  
  39.             lblStatus.Text = "Plugin Started";
  40.             label2.Text = "Started";
  41.  
  42.         }
  43.  
  44.         public void DeInitPlugin()
  45.         {
  46.             // Unsubscribe from any events you listen to when exiting!
  47.             ActGlobals.oFormActMain.BeforeLogLineRead -= OnBeforeLogLineRead;
  48.  
  49.             lblStatus.Text = "Plugin Exited";
  50.         }
  51.  
  52.         void OnBeforeLogLineRead(bool isImport, LogLineEventArgs logInfo)
  53.         {
  54.             MessageBox.Show(@"Show a box to prove this code executed.");
  55.  
  56.             //Fetch Data
  57.             var log = logInfo.logLine;
  58.             var actData = ActiveEnconter.GetCombatant("YOU");
  59.            
  60.  
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement