private void LoadModProjects() { SetProgressText("正在加载Mod项目列表..."); ModGlobalData.LoadModProjects(); SetProgressValue(1); Thread.Sleep(new Random().Next(500, 1000)); }
public ScriptedVariableEditorWindow() { InitializeComponent(); dataGrid.ItemsSource = Variables; ModGlobalData.LoadScriptedVariables(null); ProgressTask = new Thread(() => UpdateProgress(UpdateData)); ProgressTask.Start(); }
public LocalizationEditorWindow() { InitializeComponent(); dataGrid.ItemsSource = Localizations; ModGlobalData.LoadLocalizations(cancel); ProgressTask = new Thread(() => UpdateProgress(UpdateData)); ProgressTask.Start(); }
private void SaveModFile(object sender, RoutedEventArgs e) { if (String.IsNullOrWhiteSpace(pathView.Text)) { MessageBox.Show("路径不能为空"); } else if (String.IsNullOrWhiteSpace(versionView.Text)) { MessageBox.Show("Mod版本号不能为空"); } else if (String.IsNullOrWhiteSpace(supportedVersionView.Text)) { MessageBox.Show("群星版本号不能为空"); } else if (String.IsNullOrWhiteSpace(tagsdView.Text)) { MessageBox.Show("标签不能为空"); } else if (String.IsNullOrEmpty(CurrentMod.Picture)) { MessageBox.Show("还未选择封面图", "错误"); } else { if (!CurrentMod.IsModData) { WirteModFile(CurrentMod); } else { var mod = CurrentMod.Clone(); mod.IsModData = false; WirteModFile(mod); ModGlobalData.CreateExampleModProject(); listView.ItemsSource = null; listView.ItemsSource = ModGlobalData.ModProjects; CurrentMod = ModGlobalData.ModProjects.First(); } MessageBox.Show("已保存"); } }
public EditorWindow() { InitializeComponent(); ModGlobalData.LoadDatas(); }