public void ShowSplashScreen() { SplashForm splash = new SplashForm(); try { splash.SetLoadAfter(OnLoadAfter); splash.ShowDialog(); } catch (ArgumentNullException ex) { MessageBox.Show(ex.Message + " - " + ex.ParamName); Environment.Exit(-1); } catch (NullReferenceException ex) { MessageBox.Show(ex.Message + " - " + ex.Source); Environment.Exit(-1); } catch (Exception ex) { if (ex.InnerException != null) { MessageBox.Show(ex.Message + "\n\n" + ex.InnerException.Message + "\n\n" + ex.InnerException.StackTrace, "로딩 에러"); } else { MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace, "로딩 에러"); } Environment.Exit(-1); } staPath.Text = SHGlobal.GetFolder(); fsWatcher.Path = SHGlobal.GetFolder(); }
private void bgWorker_DoWork(object sender, DoWorkEventArgs e) { try { SHGlobal.CheckFiles(bgWorker); RetestRequired = false; } catch (Exception ex) { progressUpdateDelegate td = new progressUpdateDelegate(OutputError); this.Invoke(td, new object[] { ex.Message }); //DialogResult result = MessageBox.Show(ex.Message + "\n\n이 버그를 수정한 뒤에 \"재시도\"를 누르시면 처음부터 다시 시작됩니다.", Application.ProductName, MessageBoxButtons.AbortRetryIgnore); //if (result == DialogResult.Retry) //{ // bgWorker.CancelAsync(); // RetestRequired = true; //} //else if (result == DialogResult.Abort) //{ // Environment.Exit(-1); //} } bgWorker.ReportProgress(100, Environment.NewLine + "초기화를 하고 있습니다."); }
public void LoadEnvironment() { int nTmp = 0; if (SHGlobal.GetSetting("Width", ref nTmp)) { Width = nTmp; } if (SHGlobal.GetSetting("Height", ref nTmp)) { Height = nTmp; } if (SHGlobal.GetSetting("Left", ref nTmp)) { Left = nTmp; } if (SHGlobal.GetSetting("Top", ref nTmp)) { Top = nTmp; } // 기본값은 Unchecked이다. 따라서 값을 읽어서 그 값이 1이 된 경우에만 체크한다. mnuViewHideNoLoot.CheckState = (SHGlobal.GetSetting("mnuViewHideNoLoot", ref nTmp) && nTmp == 1) ? CheckState.Checked : CheckState.Unchecked; mnuViewHideNoninteract.CheckState = (SHGlobal.GetSetting("mnuViewHideNoninteract", ref nTmp) && nTmp == 1) ? CheckState.Checked : CheckState.Unchecked; // 기본값은 Checked이다. 따라서 값을 읽어서 그 값이 0이 된 경우에만 끈다. mnuViewMonster.CheckState = (SHGlobal.GetSetting("mnuViewMonster", ref nTmp) && nTmp == 0) ? CheckState.Unchecked : CheckState.Checked; mnuViewObject.CheckState = (SHGlobal.GetSetting("mnuViewObject", ref nTmp) && nTmp == 0) ? CheckState.Unchecked : CheckState.Checked; mnuViewNPC.CheckState = (SHGlobal.GetSetting("mnuViewNPC", ref nTmp) && nTmp == 0) ? CheckState.Unchecked : CheckState.Checked; Option.AutoMonitorFile = (SHGlobal.GetSetting("AutoMonitorFile", ref nTmp) && nTmp == 0) ? false : true; }
private void SaveEnvironment() { SHGlobal.SetSetting("ProjectFolder", SHGlobal.GetFolder()); SHGlobal.SetSetting("AutoMonitorFile", (Option.AutoMonitorFile == true) ? 1 : 0); if (WindowState == FormWindowState.Normal) { SHGlobal.SetSetting("Width", Width); SHGlobal.SetSetting("Height", Height); SHGlobal.SetSetting("Left", Left); SHGlobal.SetSetting("Top", Top); } SHGlobal.SetSetting("mnuViewHideNoLoot", (mnuViewHideNoLoot.CheckState == CheckState.Checked) ? 1 : 0); SHGlobal.SetSetting("mnuViewHideNoninteract", (mnuViewHideNoninteract.CheckState == CheckState.Checked) ? 1 : 0); SHGlobal.SetSetting("mnuViewMonster", (mnuViewMonster.CheckState == CheckState.Checked) ? 1 : 0); SHGlobal.SetSetting("mnuViewObject", (mnuViewObject.CheckState == CheckState.Checked) ? 1 : 0); SHGlobal.SetSetting("mnuViewNPC", (mnuViewNPC.CheckState == CheckState.Checked) ? 1 : 0); for (int i = 0; i < (int)ValixianFormType.PAGE_MAX; i++) { SaveTabEnvironment(i); } SHGlobal.SaveSetting(); }
public void ReloadAllXmlFile() { if (_Forms.IsExistModifiedFiles()) { if (MessageBox.Show("저장하지 않은 항목이 있습니다. 정말 모든 XML을 다시 읽겠습니까?", Application.ProductName, MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } RefreshData(); try { SHGlobal.CheckFiles(null); } catch (Exception ex) { Global.OutputWarning(ex.Message); } InitEditForms(); Global.Output("모든 XML 다시 읽기 완료\n"); }
private void mnuSVNUpdate_Click(object sender, EventArgs e) { String param = "update \"" + SHGlobal.GetFolder() + "\""; MessageBox.Show(param); LaunchExternalProgram("svn.exe", param, true); }
private void mnuSetPath_Click(object sender, EventArgs e) { if (SHGlobal.SetupFolder() == true) { RefreshData(); } }
static void Main(String[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SHGlobal.Init(); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\npc.xml", SHSCF_Type.Both, Encoding.GetEncoding(51949))); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\talent.xml", SHSCF_Type.Both, Encoding.GetEncoding(51949))); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\conditions.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\conditions_item.xml", SHSCF_Type.Both, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\xitem.xml", SHSCF_Type.Both, Encoding.GetEncoding(51949))); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\lang\\ko_KR\\strings.xml", SHSCF_Type.Client, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\dialog.xml", "\\dialog.xsd", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\quest.xml", "\\quest.xsd", SHSCF_Type.Both, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\loot.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\craft.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\npcshop.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\recipe.xml", SHSCF_Type.Both, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\fieldlist.xml", SHSCF_Type.Both, Encoding.UTF8)); if (0 >= args.Length) { Application.Run(new MainForm()); } else if ("droper" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveItemDropers(); } else if ("questrewarder" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveItemQuestRewarders(); } else if ("fieldnpc" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveNPCSpawnInfo(); } else if ("recipenpc" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveRecipeByNPC(); } else if ("all" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveItemDropers(); xmlCore.SaveItemQuestRewarders(); xmlCore.SaveNPCSpawnInfo(); xmlCore.SaveRecipeByNPC(); } }
private void MonitoredFileChanged(object sender, System.IO.FileSystemEventArgs e) { if (!Option.AutoMonitorFile) { return; } bool bMonitoredFile = false; foreach (SHSmartCheckFile scf in SHGlobal.GetChecklist()) { if (scf.CheckType == SHSCF_Type.Both || scf.CheckType == SHSCF_Type.Server) { if (e.FullPath.ToUpper() == (SHGlobal.GetServerSystemFolder() + scf.FilePath).ToUpper()) { bMonitoredFile = true; break; } } if (scf.CheckType == SHSCF_Type.Both || scf.CheckType == SHSCF_Type.Client) { if (e.FullPath.ToUpper() == (SHGlobal.GetClientSystemFolder() + scf.FilePath).ToUpper()) { bMonitoredFile = true; break; } } } if (bMonitoredFile == true) { // 모든 모니터 중지 fsWatcher.EnableRaisingEvents = false; ShowSplashScreen(); staMain.Text = e.Name + " 파일이 변경되었습니다. 자동갱신했습니다."; fsWatcher.EnableRaisingEvents = true; } }
public void SaveTabEnvironment(int nIndex) { /* * VelixianTab MatchedTab = null; * * if (_Tabs._TabPages.TryGetValue(nIndex, out MatchedTab)) * { * if (MatchedTab.MainList != null) * { * for (int i = 0; i < MatchedTab.MainList.Columns.Count; i++) * { * ColumnHeader head = MatchedTab.MainList.Columns[i]; * SHGlobal.SetSetting(MatchedTab.MainList.Name + "Col" + i.ToString(), head.Width); * } * * SplitContainer splitContainer = MatchedTab.MainList.Parent.Parent as SplitContainer; * if (splitContainer != null) * { * SHGlobal.SetSetting(splitContainer.Name, splitContainer.SplitterDistance); * * // 왼쪽 패널의 Child를 검색해서 스플리터가 있으면 환경값 저장 * for (int i = 0; i < splitContainer.Panel1.Controls.Count; i++) * { * SplitContainer childContainer = splitContainer.Panel1.Controls[i] as SplitContainer; * if (childContainer != null) SHGlobal.SetSetting(childContainer.Name, childContainer.SplitterDistance); * } * * // 오른쪽 패널의 Child를 검색하여 스플리터가 있으면 환경값 저장 * for (int i = 0; i < splitContainer.Panel2.Controls.Count; i++) * { * SplitContainer childContainer = splitContainer.Panel2.Controls[i] as SplitContainer; * if (childContainer != null) SHGlobal.SetSetting(childContainer.Name, childContainer.SplitterDistance); * } * } * } * } */ SHGlobal.SaveSetting(); }
private void mnuOpenClientSystemFolder_Click(object sender, EventArgs e) { Process.Start(SHGlobal.GetClientSystemFolder()); }
private void mnuRunClient_Click(object sender, EventArgs e) { LaunchExternalProgram(SHGlobal.GetFolder() + "\\Raiderz.exe", null, false); }
private void mnuRunServer_Click(object sender, EventArgs e) { LaunchExternalProgram(SHGlobal.GetFolder() + "\\Dev\\GameServer\\GameServer.exe", null, false); }