Exemple #1
0
 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);
     }
 }
Exemple #2
0
 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;
     }
 }
Exemple #3
0
        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');
        }
Exemple #4
0
 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;
Exemple #8
0
 public void Initialize(SRL Engine)
 {
 }
Exemple #9
0
 public void Detach()
 {
     SRL.Clear();
 }
Exemple #10
0
 public Remaper(SRL Main) => Engine = Main;