/// <summary> プラグインセッティングデータをXML形式で保存します。 /// </summary> /// <param name="pFilePath"> 書き込みファイルパス </param> /// <param name="pPluginSettingsData"> プラグインセッティングデータ </param> public void PluginSettingsDataSave(string pFilePath, PluginSettingsData pPluginSettingsData) { this.xmlSerializerProcess.XmlSave(pFilePath, pPluginSettingsData, true); pPluginSettingsData.SaveChangedTarget = false; return; }
private void DrawSinglePlugin(PluginSettingsData plugin) { var style = new GUIStyle(GUI.skin.box); style.normal.textColor = _fontColor.Value; style.normal.background = EntryBackground; style.fontSize = fontSize; GUI.backgroundColor = _entryBackgroundColor.Value; GUILayout.BeginVertical(style); var categoryHeader = _showDebug ? new GUIContent(plugin.Info.Name.TrimStart('!') + " " + plugin.Info.Version, "GUID: " + plugin.Info.GUID) : new GUIContent(plugin.Info.Name.TrimStart('!') + " " + plugin.Info.Version); var isSearching = !string.IsNullOrEmpty(SearchString); if (SettingFieldDrawer.DrawPluginHeader(categoryHeader, plugin.Collapsed && !isSearching) && !isSearching) { plugin.Collapsed = !plugin.Collapsed; } if (isSearching || !plugin.Collapsed) { foreach (var category in plugin.Categories) { if (!string.IsNullOrEmpty(category.Name)) { if (plugin.Categories.Count > 1 || !_hideSingleSection.Value) { SettingFieldDrawer.DrawCategoryHeader(category.Name); } } foreach (var setting in category.Settings) { DrawSingleSetting(setting); GUILayout.Space(2); } } } GUILayout.EndVertical(); }
private void DrawSinglePlugin(PluginSettingsData plugin) { var style = new GUIStyle(GUI.skin.box); style.normal.textColor = _fontColor.Value; style.normal.background = EntryBackground; style.fontSize = fontSize; GUI.backgroundColor = _entryBackgroundColor.Value; GUILayout.BeginVertical(style); var categoryHeader = _showDebug ? new GUIContent(plugin.Info.Name.TrimStart('!') + " " + plugin.Info.Version, "GUID: " + plugin.Info.GUID) : new GUIContent(plugin.Info.Name.TrimStart('!') + " " + plugin.Info.Version); var isSearching = !string.IsNullOrEmpty(SearchString); if (SettingFieldDrawer.DrawPluginHeader(categoryHeader, plugin.Collapsed && !isSearching) && !isSearching) { plugin.Collapsed = !plugin.Collapsed; } if (isSearching || !plugin.Collapsed) { foreach (var category in plugin.Categories) { if (!string.IsNullOrEmpty(category.Name)) { if (plugin.Categories.Count > 1 || !_hideSingleSection.Value) { SettingFieldDrawer.DrawCategoryHeader(category.Name); } } foreach (var setting in category.Settings) { DrawSingleSetting(setting); GUILayout.Space(2); } } GUILayout.BeginHorizontal(); var color = GUI.backgroundColor; GUI.backgroundColor = _widgetBackgroundColor.Value; if (GUILayout.Button(_reloadText.Value, buttonStyle, GUILayout.ExpandWidth(true))) { foreach (var category in plugin.Categories) { foreach (var setting in category.Settings) { setting.PluginInstance.Config.Reload(); break; } break; } BuildFilteredSettingList(); } if (GUILayout.Button(_resetText.Value, buttonStyle, GUILayout.ExpandWidth(true))) { foreach (var category in plugin.Categories) { foreach (var setting in category.Settings) { setting.Set(setting.DefaultValue); } } BuildFilteredSettingList(); } GUI.backgroundColor = color; GUILayout.EndHorizontal(); } GUILayout.EndVertical(); }