Ejemplo n.º 1
0
        internal static void CheckArguments()
        {
            if (CmdLineChecked)
            {
                return;
            }
            CmdLineChecked = true;
            string[] Commands = Environment.GetCommandLineArgs();

            if (Ini.GetConfigStatus(CfgName, "WorkingDir;WorkDir;DataDir", IniPath) == Ini.ConfigStatus.Ok)
            {
                CustomDir = Ini.GetConfig(CfgName, "WorkingDir;WorkDir;DataDir", IniPath, true);
                if (!CustomDir.EndsWith("\\"))
                {
                    CustomDir += '\\';
                }
            }

            if (Ini.GetConfig(CfgName, "Debug", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-debug");
            }
            if (Ini.GetConfig(CfgName, "Delay", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-delay");
            }
            if (Ini.GetConfig(CfgName, "Log;LogAll", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-log");
            }
            if (Ini.GetConfig(CfgName, "LogInput;LogIn", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-loginput");
            }
            if (Ini.GetConfig(CfgName, "LogOutput;LogOut", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-logoutput");
            }
            if (Ini.GetConfig(CfgName, "Unsafe", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-unsafe");
            }
            if (Ini.GetConfig(CfgName, "LogFile", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-logfile");
            }
            if (Ini.GetConfig(CfgName, "DetectText", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-detectstr");
            }
            if (Ini.GetConfig(CfgName, "Dump", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-dump");
            }
            if (Ini.GetConfig(CfgName, "DumpRetail", IniPath, false).ToLower() == "true")
            {
                AppendArray(ref Commands, "-dumpretail");
            }

            if (Commands?.Length == 0)
            {
                return;
            }

            foreach (string Command in Commands)
            {
                switch (Command.ToLower().TrimStart('-', '/', '\\', ' '))
                {
                case "litemode":
                case "fastmode":
                case "compatibilitymode":
                case "compatibility":
                    LiteMode = true;
                    break;

                case "showlogwindow":
                case "showconsole":
                case "console":
                case "debug":
                    Debugging = true;
                    break;

                case "logdelay":
                case "delaytest":
                case "pingtest":
                case "delay":
                    Log("Delay Test Mode - Enabled");
                    DelayTest = true;
                    break;

                case "recovery":
                case "recoverytl":
                case "dumptranslation":
                case "dump":
                    if (!File.Exists(TLMap))
                    {
                        Log("How you want dump the string if you don't have one?");
                        continue;
                    }
                    DumpData();
                    break;

                case "dumporiginal":
                case "restorelist":
                case "retranslate":
                case "dumptotl":
                case "dumpretail":
                    if (!File.Exists(TLMap))
                    {
                        Log("How you want dump the string if you don't have one?");
                        continue;
                    }
                    DumpData(true);
                    break;

                case "reloaddb":
                case "updatedb":
                case "refreshdb":
                case "refreshdatabase":
                case "reconstruct":
                case "rebuild":
                    if (!File.Exists(TLMapSrc))
                    {
                        continue;
                    }
                    if (File.Exists(TLMap))
                    {
                        File.Delete(TLMap);
                    }
                    CompileStrMap();
                    break;

                case "unsafe":
                case "nodialogcheck":
                case "noverifyfrist":
                    DialogFound = true;
                    break;

                case "log":
                case "debugstring":
                case "debugencoding":
                case "encodingtest":
                    Log("String Deubugger Enabled", true);
                    LogAll = true;
                    break;

                case "loginput":
                case "login":
                    Log("Input Log Enabled", true);
                    LogInput = true;
                    break;

                case "logout":
                case "logoutput":
                    Log("Output Log Enabled", true);
                    LogOutput = true;
                    break;

                case "dumptext":
                case "dumpstr":
                case "detectstr":
                case "detectstring":
                case "detecttext":
                case "detecttxt":
                    Log("String Dumping Filter Enabled", true);
                    DumpStrOnly = true;
                    break;

                case "about":
                case "credits":
                    Log("Credits:\n-String Reloader - Soft-Translation Engine\nCreated by Marcussacana");
                    break;

                case "logfile":
                case "fileoutput":
                case "debugfile":
                    LogFile = true;
                    break;

                case "whatisthis":
                case "wtf":
                case "help":
                case "?":
                    Log("Help:\nParameters:\tAction:\nDump\t\tDump all content of the Strings.srl to the game directory\nUnsafe\t\tDon't ignore strings while don't recive a text line.\nDumpText\tEnable Dialog Filter in the debugger dump (Latim only)\nDumpRetail\tDump the text to Retranslation\nRebuild\t\tForce rebuild the Strings.srl from the Strings.lst\nLogFile\tWrite debug output to a plain text file.\n\nDelay Test\tShow the delay from a string reload\nLog\t\tLog all string input/output bytes\nCredits\t\tShow credits message\nHelp\t\tShow this message");
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Load All Configs from the INI file.
        /// </summary>
        private static void LoadConfig()
        {
            SpecialLineBreaker        = false;
            EnableWordWrap            = false;
            AntiCrash                 = false;
            DecodeCharactersFromInput = false;
            InvalidateWindow          = false;
            LiteralMaskMatch          = false;
            DisableMasks              = false;
            DialogCheck               = true;
            FreeOnExit                = false;
            CachePointers             = false;
            TrimRangeMismatch         = false;
            Unicode              = false;
            MultipleDatabases    = false;
            OverlayEnabled       = false;
            NoReload             = false;
            NoTrim               = false;
            ReloadMaskParameters = false;
            LiteMode             = false;
            RemoveIlegals        = false;
            AsianInput           = false;
            QuoteList            = new Quote[0];
            Sensitivity          = 3;
            UseDatabase          = false;
            AutoUnks             = false;
            UndoChars            = false;
            CaseSensitive        = false;
            ForceTrim            = false;
            NotCachedOnly        = false;
            AllowEmpty           = false;
            ImportHook           = false;
            HookCreateWindowEx   = false;
            HookShowWindow       = false;
            HookSetWindowPos     = false;
            HookMoveWindow       = false;
            CheckProportion      = false;
            Seconds              = 0;
            MinSize              = 0;

            DenyList   = new string[0];
            IgnoreList = new string[0];
            RldPrefix  = string.Empty;
            RldSufix   = string.Empty;

            SRLSettings      Settings;
            OverlaySettings  OverlaySettings;
            WordwrapSettings WordwrapSettings;
            FilterSettings   FilterSettings;
            HookSettings     HookSettings;
            IntroSettings    IntroSettings;

            AdvancedIni.FastOpen(out Settings, IniPath);
            AdvancedIni.FastOpen(out OverlaySettings, IniPath);
            AdvancedIni.FastOpen(out WordwrapSettings, IniPath);
            AdvancedIni.FastOpen(out FilterSettings, IniPath);
            AdvancedIni.FastOpen(out HookSettings, IniPath);
            AdvancedIni.FastOpen(out IntroSettings, IniPath);

            Log(Initialized ? "Reloading Settings..." : "Loading Settings...", true);


            if (Settings.LiteMode)
            {
                LiteMode = true;
            }

            if (Settings.InEncoding != null)
            {
                Log("Loading Read Encoding Config...", true);
                ReadEncoding = ParseEncodingName(Settings.InEncoding);
            }

            if (Settings.OutEncoding != null)
            {
                Log("Loading Write Encoding Config...", true);
                WriteEncoding = ParseEncodingName(Settings.OutEncoding);

                if (Debugging)
                {
                    Console.OutputEncoding = WriteEncoding;
                }
            }

            if (Settings.Wide)
            {
                Log("Wide Character Mode Enabled...", true);
                Unicode = true;
            }

            if (Settings.Multithread)
            {
                if (Initialized && !Multithread)
                {
                    Warning("The Multithread Settings Changed - Restart Required");
                }
                else
                {
                    Log("Multithreaded Game Support Enabled", true);
                    Multithread = true;
                }
            }
            else if (Initialized && Multithread)
            {
                Warning("The Multithread Settings Changed - Restart Required");
            }

            if (!string.IsNullOrWhiteSpace(FilterSettings.DenyList))
            {
                Log("Custom Denied Chars List Loaded...", true);
                DenyList = FilterSettings.DenyList.Split(',');
            }

            if (FilterSettings.UseDB)
            {
                Log("Filter with Database Enabled", true);
                UseDatabase = true;
            }

            if (Settings.TrimRangeMismatch)
            {
                Log("Trim Mismatch Ranges Enabled...", true);
                TrimRangeMismatch = true;
            }

            if (Settings.CachePointers)
            {
                Warning("Pointer Cache Enabled...", true);
                CachePointers = true;
            }

            if (Settings.FreeOnExit)
            {
                Warning("Memory Leak Prevention Enabled...", true);
                FreeOnExit = true;
            }

            if (Settings.NoDialogCheck)
            {
                Warning("Dialog Check Disabled...", true);
                DialogCheck = false;
            }

            if (Settings.LiteralMaskMatch)
            {
                Log("Literal Mask Matching Enabled...", true);
                LiteralMaskMatch = true;
            }
            if (Settings.MultiDatabase)
            {
                Log("Multidatabase's Matching Method Enabled...", true);
                MultipleDatabases = true;
            }

            if (Settings.AsianInput)
            {
                Log("Asian Text Mode Enabled...", true);
                AsianInput = true;
            }

            if (Settings.AutoUnks)
            {
                Log("Auto Unk Char Reload Enabled...", true);
                AutoUnks = true;
            }

            if (Settings.DisableMask)
            {
                DisableMasks = true;
                Log("Masks Reloader Disabled...", true);
            }

            if (Settings.WindowHook)
            {
                Log("Enabling Window Reloader...", true);
                new Thread(() => WindowHook()).Start();

                if (Settings.InvalidateWindow)
                {
                    Log("Invalidate Window Mode Enabled.", true);
                    InvalidateWindow = true;
                }
            }

            if (!string.IsNullOrWhiteSpace(Settings.AcceptableRanges))
            {
                LoadRanges();
            }

            if (Settings.DecodeFromInput)
            {
                Log("Enabling Character Reloader Decoding From Input...", true);
                DecodeCharactersFromInput = true;
            }

            if (Settings.NoTrim)
            {
                Log("Disabling Trim Service...", true);
                NoTrim = true;
            }

            if (Settings.ReloadMaskParameters)
            {
                Log("Enabling Mask Parameters Reloader...", true);
                ReloadMaskParameters = true;

                if (!Settings.Multithread)
                {
                    Warning("You can't use the PIPE service with the Mask Parameter Reloader Feature, Enabling Multithreaded Game Support...");
                    Settings.Multithread = true;
                    Multithread          = true;
                }
            }

            if (Settings.NoReload)
            {
                NoReload = true;
                Warning("String Injection Disabled by User...", true);
            }

            if (Settings.RemoveViolations)
            {
                RemoveIlegals = true;
                Warning("Violation remover enabled, please, consider manual repair...");
            }

            if (Settings.NotCachedOnly)
            {
                NotCachedOnly = true;
                Log("Not Cached Only Reloader Mode Enabled", true);
            }

            if (Settings.AllowEmptyReloads)
            {
                AllowEmpty = true;
                Log("Empty Reloader Filter Disabled", true);
            }

            if (!Initialized && Settings.AllowDuplicates)
            {
                AllowDuplicates = true;
                Log("Duplicate Reload Support Enabled", true);
            }
            else if (Settings.AllowDuplicates != AllowDuplicates)
            {
                Warning("Duplicate Reload Support Changed - Restart Required");
            }

            if (Settings.SetOutputEncoding)
            {
                Log("Console Output Encoding Changed", false);
                if (!Debugging)
                {
                    ConsoleShowed = false;
                    HideConsole();
                }
            }

            RldPrefix = Settings.ReloadedPrefix;
            RldSufix  = Settings.ReloadedSufix;

            CaseSensitive = Settings.CaseSensitive;

            if (OverlaySettings.Enable)
            {
                OverlayEnabled = true;
                ShowNonReloads = OverlaySettings.ShowNonReloaded;

                if (!File.Exists(OEDP))
                {
                    Error("Can't Enabled the Overlay Because the Overlay.dll is missing.");
                }
                else
                {
                    Log("Overlay Allowed.", true);
                }
            }

            if (!string.IsNullOrWhiteSpace(Settings.CustomCredits))
            {
                CustomCredits = Settings.CustomCredits;

                //Just if you wanna hide from kids trying fake it. :)
                if (CustomCredits.StartsWith("Fx"))
                {
                    byte[] Coded = ParseHex(CustomCredits.Replace("Fx", "0x"));
                    for (int i = 0; i < Coded.Length; i++)
                    {
                        Coded[i] ^= 0xFF;
                    }

                    CustomCredits = Encoding.UTF8.GetString(Coded);
                }

                if (CustomCredits.StartsWith("0x"))
                {
                    CustomCredits = Encoding.UTF8.GetString(ParseHex(CustomCredits));
                }
            }

            if (!string.IsNullOrWhiteSpace(OverlaySettings.Padding))
            {
                PaddingSeted = false;
                string Padding = OverlaySettings.Padding;
                foreach (string Parameter in Padding.Split('|'))
                {
                    try {
                        string Border = Parameter.Split(':')[0].Trim().ToLower();
                        int    Value  = int.Parse(Parameter.Split(':')[1].Trim());
                        switch (Border)
                        {
                        case "top":
                            OPaddingTop = Value;
                            break;

                        case "bottom":
                            OPaddinBottom = Value;
                            break;

                        case "rigth":
                            OPaddingRigth = Value;
                            break;

                        case "left":
                            OPaddinLeft = Value;
                            break;

                        default:
                            Error("\"{0}\" Isn't a valid Padding Border", Border);
                            break;
                        }
                    } catch {
                        Error("\"{0}\" Isn't a valid Padding Parameter", Parameter);
                    }
                }
            }

            if (Settings.LiveSettings)
            {
                if (SettingsWatcher == null)
                {
                    Log("Enabling Live Settings....", true);
                    SettingsWatcher = new Thread(() => {
                        DateTime Before = new FileInfo(IniPath).LastWriteTime;
                        while (true)
                        {
                            DateTime Now = new FileInfo(IniPath).LastWriteTime;
                            if (Before != Now)
                            {
                                Before = Now;
                                Thread.Sleep(500);
                                LoadConfig();
                            }
                            Thread.Sleep(500);
                        }
                    });
                    SettingsWatcher.Start();
                }
            }
            else if (SettingsWatcher != null)
            {
                SettingsWatcher.Abort();
                SettingsWatcher = null;
            }

            if (Settings.AntiCrash)
            {
                if (!Initialized)
                {
                    Log("Enabling Crash Handler...", true);
                    System.Windows.Forms.Application.ThreadException += ProcessOver;
                    AppDomain.CurrentDomain.UnhandledException       += ProcessOver;
                    AntiCrash = true;
                }
            }

            if (WordwrapSettings.Enabled)
            {
                Log("Wordwrap Enabled.", true);
                EnableWordWrap = true;
                MaxWidth       = WordwrapSettings.Width;
                Monospaced     = WordwrapSettings.Monospaced;
                FakeBreakLine  = WordwrapSettings.FakeBreakLine;

                if (!Monospaced)
                {
                    Font = new Font(WordwrapSettings.FontName, WordwrapSettings.Size, WordwrapSettings.Bold ? FontStyle.Bold : FontStyle.Regular, GraphicsUnit.Pixel);
                }
            }

            if (!string.IsNullOrEmpty(Settings.GameLineBreaker))
            {
                GameLineBreaker    = Settings.GameLineBreaker;
                SpecialLineBreaker = true;
            }

            if (!string.IsNullOrEmpty(FilterSettings.IgnoreList))
            {
                Log("Using Custom Ignore List...", true);
                string IgnoreList = FilterSettings.IgnoreList;
                if (!IgnoreList.StartsWith(">>"))
                {
                    MatchDel = new string[0];
                }
                else
                {
                    IgnoreList = IgnoreList.Substring(2);
                }
                foreach (string str in IgnoreList.Split(','))
                {
                    if (str.Trim().StartsWith("0x"))
                    {
                        string Del = Encoding.UTF8.GetString(ParseHex(str.Trim()));
                        AppendArray(ref MatchDel, Del, true);
                    }
                    else
                    {
                        AppendArray(ref MatchDel, str.Replace(BreakLineFlag, "\n").Replace(ReturnLineFlag, "\r"), true);
                    }
                }
            }

            if (!string.IsNullOrEmpty(FilterSettings.TrimList))
            {
                Log("Using Custom Trim List...", true);
                TrimChars = new string[0];
                foreach (string str in FilterSettings.TrimList.Split(','))
                {
                    if (str.Trim().StartsWith("0x"))
                    {
                        string Trim = Encoding.UTF8.GetString(ParseHex(str.Trim()));
                        AppendArray(ref TrimChars, Trim, true);
                    }
                    else
                    {
                        AppendArray(ref TrimChars, str.Replace(BreakLineFlag, "\n").Replace(ReturnLineFlag, "\r"), true);
                    }
                }
            }
            if (!string.IsNullOrEmpty(FilterSettings.QuoteList))
            {
                Log("Using Custom Quotes...", true);
                foreach (string str in FilterSettings.TrimList.Split(','))
                {
                    if (string.IsNullOrEmpty(str))
                    {
                        continue;
                    }
                    AppendArray(ref QuoteList, new Quote()
                    {
                        Start = str.First(),
                        End   = str.Last()
                    }, true);
                    Ranges.Add(new Range()
                    {
                        Min = str.First(),
                        Max = str.First()
                    });
                    Ranges.Add(new Range()
                    {
                        Min = str.Last(),
                        Max = str.Last()
                    });
                }
            }

            if (FilterSettings.Sensitivity != 2)
            {
                Log("Dialogue Sensitivity Level Changed to {0}", true, FilterSettings.Sensitivity);
                Sensitivity = FilterSettings.Sensitivity;
            }

            if (FilterSettings.ForceTrim)
            {
                Log("Dialogue Filter Trim Enforcement Enabled", true);
                ForceTrim = true;
            }

            if (!string.IsNullOrWhiteSpace(Settings.WorkDirectory))
            {
                CustomDir = Settings.WorkDirectory.TrimStart(' ', '\\', '/').Replace("/", "\\");
                if (!CustomDir.EndsWith("\\"))
                {
                    CustomDir += '\\';
                }

                if (!Directory.Exists(BaseDir))
                {
                    Directory.CreateDirectory(BaseDir);
                }

                Log("Custom Directory Loaded", true);
            }

            if (HookSettings.CreateFile)
            {
                if (!HookCreateFile)
                {
                    InstallCreateFileHooks();
                }
                HookCreateFile = true;
                Log("CreateFile Hook Enabled", true);
            }
            else if (HookGlyphOutline)
            {
                Warning("CreateFile Hook Settings Changed - Restart Required");
            }

            if (HookSettings.GetGlyphOutline)
            {
                if (!HookGlyphOutline)
                {
                    InstallGlyphHooks();
                }
                HookGlyphOutline = true;
                Log("GetGlyphOutline Hook Enabled", true);
            }
            else if (HookGlyphOutline)
            {
                Warning("GetGlyphOutline Hook Settings Changed - Restart Required");
            }

            if (HookSettings.TextOut)
            {
                if (!HookTextOut)
                {
                    InstallTextOutHooks();
                }
                HookTextOut = true;
                Log("TextOut Hook Enabled", true);
            }
            else if (HookTextOut)
            {
                Warning("TextOut Hook Settings Changed - Restart Required");
            }

            if (HookSettings.ExtTextOut)
            {
                if (!HookExtTextOut)
                {
                    InstallExtTextOutHooks();
                }
                HookExtTextOut = true;
                Log("ExtTextOut Hook Enabled", true);
            }
            else if (HookExtTextOut)
            {
                Warning("ExtTextOut Hook Settings Changed - Restart Required");
            }

            if (HookSettings.CreateFont)
            {
                if (!HookCreateFont)
                {
                    InstallCreateFontHooks();
                }
                HookCreateFont = true;
                Log("CreateFont Hook Enabled", true);
            }
            else if (HookCreateFont)
            {
                Warning("CreateFont Hook Settings Changed - Restart Required");
            }

            if (HookSettings.CreateFontIndirect)
            {
                if (!HookCreateFontIndirect)
                {
                    InstallCreateFontIndirectHooks();
                }
                HookCreateFontIndirect = true;
                Log("CreateFontIndirect Hook Enabled", true);
            }
            else if (HookCreateFontIndirect)
            {
                Warning("CreateFontIndirect Hook Settings Changed - Restart Required");
            }

#if DEBUG
            if (HookSettings.SendMessage)
            {
                if (!HookSendMessage)
                {
                    InstallSendMessageHooks();
                }
                HookSendMessage = true;
                Log("SendMessage Hook Enabled", true);
            }
            else if (HookSendMessage)
            {
                Warning("SendMessage Hook Settings Changed - Restart Required");
            }

            if (HookSettings.CreateWindow)
            {
                if (!HookCreateWindow)
                {
                    InstallCreateWindowHooks();
                }
                HookCreateWindow = true;
                Log("CreateWindow Hook Enabled", true);
            }
            else if (HookCreateWindow)
            {
                Warning("CreateWindow Hook Settings Changed - Restart Required");
            }

            if (HookSettings.CreateWindowEx)
            {
                if (!HookCreateWindowEx)
                {
                    InstallCreateWindowExHooks();
                }
                HookCreateWindowEx = true;
                Log("CreateWindowEx Hook Enabled", true);
            }
            else if (HookCreateWindowEx)
            {
                Warning("CreateWindowEx Hook Settings Changed - Restart Required");
            }
#endif
            if (HookSettings.SetWindowText)
            {
                if (!HookSetWindowText)
                {
                    InstallSetWindowTextHooks();
                }
                HookSetWindowText = true;
                Log("SetWindowText Hook Enabled", true);
            }
            else if (HookSetWindowText)
            {
                Warning("SetWindowText Hook Settings Changed - Restart Required");
            }
            new Thread(() => {
                while (!DialogFound)
                {
                    Thread.Sleep(100);
                }
                if (HookSettings.MultiByteToWideChar)
                {
                    if (!HookMultiByteToWideChar)
                    {
                        InstallMultiByteToWideChar();
                    }
                    HookMultiByteToWideChar = true;
                    Log("MultiByteToWideChar Hook Enabled", true);
                }
                else if (HookMultiByteToWideChar)
                {
                    Warning("MultiByteToWideChar Hook Settings Changed - Restart Required");
                }
            }).Start();

            if (HookSettings.UndoChars)
            {
                UndoChars = true;
                Log("Hook Char Reloader Restoration Enabled", true);
            }
            if (HookSettings.FontCharset != 0)
            {
                FontCharset = HookSettings.FontCharset;
                Log("Font Hook Charset 0x{0:X2}", true, FontCharset);
            }

            if (!string.IsNullOrWhiteSpace(HookSettings.FaceName))
            {
                FontFaceName = HookSettings.FaceName;
                Log("Font Hook FaceName: {0}", true, FontFaceName);
            }
            else
            {
                FontFaceName = string.Empty;
                while (Ini.GetConfigStatus($"Hook.Font.{FontReplaces.Count}", "FromFont;From;SourceFont;Source", IniPath) == Ini.ConfigStatus.Ok)
                {
                    string KEY = $"Hook.Font.{FontReplaces.Count}";
                    string FN  = Ini.GetConfig(KEY, "FromFont;From;SourceFont;Source", IniPath).Trim();
                    FontReplaces.Add(FN, new FontRedirect()
                    {
                        From = FN,
                        To   = Ini.GetConfig(KEY, "ToFont;To;TargetFont;Target", IniPath),
                        Size = Ini.GetConfig(KEY, "ChageSize;Size;DiffSize;NewSize", IniPath)
                    });
                }
                if (FontReplaces.Count != 0)
                {
                    Log("{0} Font Replacement Loaded", true, FontReplaces.Count);
                }
            }

            if (IntroSettings.CreateWindowEx)
            {
                HookCreateWindowEx = true;

                Log("Intro Injector (CreateWindowEx) Enabled", true);
            }

            if (IntroSettings.ShowWindow)
            {
                HookShowWindow = true;

                Log("Intro Injector (ShowWindow) Enabled", true);
            }

            if (IntroSettings.SetWindowPos)
            {
                HookSetWindowPos = true;

                Log("Intro Injector (SetWindowPos) Enabled", true);
            }
            if (IntroSettings.MoveWindow)
            {
                HookMoveWindow = true;

                Log("Intro Injector (MoveWindow) Enabled", true);
            }

            if (IntroSettings.CheckProportion)
            {
                CheckProportion = true;

                Log("Intro Injector Proportion Validator Enabled", true);
            }

            if (HookSettings.ImportHook)
            {
                ImportHook = true;
                Log("Import Table Hook Method Enabled", true);
            }

            if (IntroSettings.Seconds > 0)
            {
                Seconds = IntroSettings.Seconds;
            }

            if (IntroSettings.MinSize > 0)
            {
                MinSize = IntroSettings.MinSize;
            }

            Log("Settings Loaded.", true);

            if (Managed)
            {
                Log("Managed Mode Enabled, Enforcing Compatible Settings", true);
                //OverlayEnabled = false;
                WriteEncoding = ReadEncoding = Encoding.Unicode;
#if TRACE
                Multithread = true;
#endif
                if (Debugging)
                {
                    LogFile = true;
                }
            }
        }