public frmMain() { Directory.SetCurrentDirectory(Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString()); Config = new Config("ObjectEditor"); if (Config.IsFirstTime()) { OptionsForm = new frmOptions(Config); OptionsForm.ShowDialog(); } Config.Load(); Utils.InitLog("." + Path.DirectorySeparatorChar + "ObjectEditor.log"); FOCommon.Utils.InitLog("." + Path.DirectorySeparatorChar + "ObjectEditor.log", false); Utils.Log("Initializing Object Editor " + Utils.GetVersion() + " compatible with " + Utils.GetFormatCompatibilityVersion() + " format."); Utils.Log(FOCommon.Utils.GetCLRInfo()); if (Config.ScriptingEnabled) { Utils.Log("Starting scripthost..."); Scripting.Host.ScriptHost = new Scripting.OEScriptHost(); Scripting.Host.ScriptGlobal = new Scripting.ScriptGlobal(); Scripting.Host.ScriptGlobal.Init(Scripting.Host.ScriptHost); Scripting.Host.ScriptHost.Init(this, Config.PathEditorScript); Scripting.Host.ScriptHost.RegisterFormEvents(this); } InitializeComponent(); this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); }
private void frmMain_Load(object sender, EventArgs e) { this.Text = "FOnline Object Editor " + Utils.GetVersion(); MainObj = this; System.Windows.Forms.ToolTip ToolTip = new System.Windows.Forms.ToolTip(); ToolTip.SetToolTip(this.txtSearch, "Enter text to search for in any visible column (name, pid, script function etc.). Case insensitive."); this.Size = new Size(Config.WindowSizeX, Config.WindowSizeY); this.Location = new Point(Config.WindowLocationX, Config.WindowLocationY); if (!Data.LoadDefines(Config)) Exit(); OptionsForm = new frmOptions(Config); Utils.SerializeObjectListView("." + Path.DirectorySeparatorChar + "listview.bin", ref lstProtos, true); InitGuiDefines(); SetListViewFormatters(); Translate.WriteTemplateLanguageFile(this); Data.Init(); InitData(); SetTabPages(); ItemProtoParser ProtoParser = new ItemProtoParser(); if (Config.ScriptingEnabled) { Utils.Log("Starting script thread..."); ScriptThread = new Thread(new ThreadStart(UpdateScripts_Tick)); ScriptThread.Start(); } Utils.Log("Initializing successful."); }