public void Initialize(SRL Engine) { this.Engine = Engine; if (!Config.Default.GetValue("SampleModifier", "Modifiers").ToBoolean()) { ShowMessageBox("The Sample Plugin is loaded, but the SampleModifier isn't enabled in the SRL.ini", "Sample Warning", MBButtons.Ok, MBIcon.Warning); } }
public void Attach() { if (Model.PresetsAreLoaded) { uint index = 1; foreach (var p in Model.PresetsList) { SRL.AddItem(new PresetsListSubpageReferenceListItem(p, index, SRL, this)); index++; } SRL.Count = (ushort)Model.PresetsList.Count; } }
public TrimMatch(SRL Engine) : base(Engine) { this.Engine = Engine; var Dic = Engine.Settings.GetValues("Trim"); if (Dic == null) { Prefixes = Sufixes = new string[0]; return; } Prefixes = Dic["prefixes"].Unescape().Split('\n'); Sufixes = Dic["sufixes"].Unescape().Split('\n'); }
public static SRL Load(string filepath) { if (File.Exists(filepath)) { FileStream fs = new FileStream(filepath, FileMode.Open); XmlSerializer serializer = new XmlSerializer(typeof(SRL)); SRL srl = serializer.Deserialize(fs) as SRL; foreach (StarpointResource r in srl.resources) { r.srl = srl; } return(srl); } else { throw new Exception(filepath + " doesn't exist!"); } }
public RegexMatch(SRL Engine) { this.Engine = Engine; string LSTPath = Path.Combine(Config.Default.WorkingDirectory, "Regex.lst"); if (File.Exists(LSTPath)) { using (var LST = new LSTParser(LSTPath)) { foreach (var Entry in LST.GetEntries()) { RDB[new Regex(Entry.OriginalLine)] = Entry.TranslationLine; } } } DumpThread = new Thread(Dump); DumpThread.IsBackground = true; DumpThread.Start(); }
public MonoWordWrap(SRL Main) { Main.OnFlagTriggered += (Flag, Cancel) => { string Name = Flag.Name.ToUpperInvariant(); if (Name != "MAXWIDTH" && Name != "WIDTH") { return; } Cancel.Cancel = true; if (int.TryParse(Flag.Value, out int Size)) { this.Size = Size; } else { this.Size = null; } }; }
public BasicMatch(SRL Engine) => this.Engine = Engine;
public void Initialize(SRL Engine) { }
public void Detach() { SRL.Clear(); }
public Remaper(SRL Main) => Engine = Main;