Skip to content

Instantly share code, notes, and snippets.

@Qofar
Created July 14, 2017 13:59
Show Gist options
  • Save Qofar/397e0863ab1781be9048afeb0efb78b2 to your computer and use it in GitHub Desktop.
Save Qofar/397e0863ab1781be9048afeb0efb78b2 to your computer and use it in GitHub Desktop.
戦闘開始カウントでEndEncounterするPlugin
using Advanced_Combat_Tracker;
using System.Windows.Forms;
// 戦闘開始カウントでEndEncounterするPlugin
namespace ACTv3Plugins
{
public class EndEncounterByCountdown : IActPluginV1
{
// "00:0139:戦闘開始まで5秒! (xxx xxx)"
// "00:0039:戦闘開始まで5秒!"
const string COUNTDOWN_SYSTEM_MESSAGE = "39:戦闘開始まで5秒!";
Label lblStatus;
public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
{
ActGlobals.oFormActMain.OnLogLineRead += OnLogLineRead;
lblStatus = pluginStatusText;
lblStatus.Text = "Plugin Started";
}
public void DeInitPlugin()
{
ActGlobals.oFormActMain.OnLogLineRead -= OnLogLineRead;
lblStatus.Text = "Plugin Exited";
}
private void OnLogLineRead(bool isImport, LogLineEventArgs logInfo)
{
if (isImport) return;
if (logInfo.logLine.IndexOf(COUNTDOWN_SYSTEM_MESSAGE) != -1)
{
ActGlobals.oFormActMain.ActCommands("end");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment