feat: add reordering, editing, and multiple globs per filter
This commit is contained in:
parent
cd3b8bd066
commit
af20de19fd
|
@ -32,11 +32,19 @@ namespace SoundFilter {
|
|||
var split = args.Split(' ');
|
||||
if (split.Length < 1) {
|
||||
chat.PrintError($"[{SoundFilterPlugin.Name}] {Language.CommandNotEnoughArguments}");
|
||||
chat.PrintError($"[{SoundFilterPlugin.Name}] /soundfilter log");
|
||||
chat.PrintError($"[{SoundFilterPlugin.Name}] /soundfilter <enable|disable|toggle> [filter name]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (split[0] == "log") {
|
||||
this.Plugin.Config.ShowLog ^= true;
|
||||
this.Plugin.Config.Save();
|
||||
return;
|
||||
}
|
||||
|
||||
var filterName = split.Length > 1 ? string.Join(" ", split.Skip(1)) : null;
|
||||
var filter = filterName == null ? null : this.Plugin.Config.Filtered.Values.FirstOrDefault(filter => filter.Name == filterName);
|
||||
var filter = filterName == null ? null : this.Plugin.Config.Filters.FirstOrDefault(filter => filter.Name == filterName);
|
||||
if (filterName != null && filter == null) {
|
||||
chat.PrintError($"[{SoundFilterPlugin.Name}] {Language.CommandNoSuchFilter}");
|
||||
return;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dalamud.Configuration;
|
||||
using Dalamud.Plugin;
|
||||
using DotNet.Globbing;
|
||||
|
@ -8,30 +7,37 @@ using DotNet.Globbing;
|
|||
namespace SoundFilter.Config {
|
||||
[Serializable]
|
||||
internal class Configuration : IPluginConfiguration {
|
||||
public int Version { get; set; } = 1;
|
||||
internal const int LatestVersion = 2;
|
||||
|
||||
public int Version { get; set; } = LatestVersion;
|
||||
|
||||
private DalamudPluginInterface? Interface { get; set; }
|
||||
private Dictionary<string, Glob> CachedGlobs { get; } = new();
|
||||
|
||||
public bool Enabled = true;
|
||||
public bool ShowLog;
|
||||
public bool LogEnabled = true;
|
||||
public bool LogFiltered = false;
|
||||
public uint LogEntries = 250;
|
||||
public Dictionary<string, CustomFilter> Filtered { get; set; } = new();
|
||||
public List<CustomFilter> Filters { get; set; } = new();
|
||||
|
||||
internal IReadOnlyDictionary<Glob, bool> Globs {
|
||||
get {
|
||||
return this.Filtered.ToDictionary(
|
||||
entry => {
|
||||
if (this.CachedGlobs.TryGetValue(entry.Key, out var cached)) {
|
||||
return cached;
|
||||
var dictionary = new Dictionary<Glob, bool>();
|
||||
foreach (var filter in this.Filters) {
|
||||
foreach (var globString in filter.Globs) {
|
||||
if (this.CachedGlobs.TryGetValue(globString, out var cached)) {
|
||||
dictionary[cached] = filter.Enabled;
|
||||
continue;
|
||||
}
|
||||
|
||||
var glob = Glob.Parse(entry.Key);
|
||||
this.CachedGlobs[entry.Key] = glob;
|
||||
return glob;
|
||||
},
|
||||
entry => entry.Value.Enabled
|
||||
);
|
||||
var glob = Glob.Parse(globString);
|
||||
this.CachedGlobs[globString] = glob;
|
||||
dictionary[glob] = filter.Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
return dictionary;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SoundFilter.Config {
|
||||
[Serializable]
|
||||
internal class CustomFilter {
|
||||
public string Name = "Unnamed filter";
|
||||
public bool Enabled = true;
|
||||
public List<string> Globs { get; set; } = new();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Dalamud.Plugin;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace SoundFilter.Config {
|
||||
internal static class Migrator {
|
||||
private static void WithEachObject(JToken old, Action<string, JObject> action) {
|
||||
foreach (var property in old.Children<JProperty>()) {
|
||||
if (property.Name == "$type") {
|
||||
continue;
|
||||
}
|
||||
|
||||
var layout = (JObject) property.Value;
|
||||
|
||||
action(property.Name, layout);
|
||||
}
|
||||
}
|
||||
|
||||
private static void MigrateV1(JObject old) {
|
||||
var filters = new List<CustomFilter>();
|
||||
|
||||
WithEachObject(old["Filtered"], (glob, filter) => {
|
||||
var name = filter["Name"].Value<string>();
|
||||
var enabled = filter["Enabled"].Value<bool>();
|
||||
filters.Add(new CustomFilter {
|
||||
Name = name,
|
||||
Enabled = enabled,
|
||||
Globs = { glob },
|
||||
});
|
||||
});
|
||||
|
||||
old.Remove("Filtered");
|
||||
old["Filters"] = JArray.FromObject(filters);
|
||||
|
||||
old["Version"] = 2;
|
||||
}
|
||||
|
||||
public static Configuration LoadConfiguration(SoundFilterPlugin plugin) {
|
||||
var fileInfo = plugin.Interface.ConfigFile;
|
||||
var text = fileInfo.Exists
|
||||
? File.ReadAllText(fileInfo.FullName)
|
||||
: null;
|
||||
|
||||
if (text == null) {
|
||||
goto DefaultConfiguration;
|
||||
}
|
||||
|
||||
var config = JsonConvert.DeserializeObject<JObject>(text);
|
||||
|
||||
int GetVersion() {
|
||||
if (config.TryGetValue("Version", out var token)) {
|
||||
return token.Value<int>();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
var version = GetVersion();
|
||||
if (version < 1) {
|
||||
goto DefaultConfiguration;
|
||||
}
|
||||
|
||||
// run migrations until done
|
||||
while (version < Configuration.LatestVersion) {
|
||||
switch (version) {
|
||||
case 1:
|
||||
MigrateV1(config);
|
||||
break;
|
||||
default:
|
||||
PluginLog.Warning($"Tried to migrate from an unknown version: {version}");
|
||||
goto DefaultConfiguration;
|
||||
}
|
||||
|
||||
version = GetVersion();
|
||||
}
|
||||
|
||||
if (version == Configuration.LatestVersion) {
|
||||
return config.ToObject<Configuration>();
|
||||
}
|
||||
|
||||
DefaultConfiguration:
|
||||
return plugin.Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -159,14 +159,17 @@ namespace SoundFilter {
|
|||
path = path.ToLowerInvariant();
|
||||
var specificPath = $"{path}/{idx}";
|
||||
|
||||
var shouldFilter = this.Plugin.Config.Globs
|
||||
.Where(entry => entry.Value)
|
||||
.Any(entry => entry.Key.IsMatch(specificPath));
|
||||
|
||||
if (this.Plugin.Config.LogEnabled && (!shouldFilter || this.Plugin.Config.LogFiltered)) {
|
||||
this.Recent.Enqueue(specificPath);
|
||||
while (this.Recent.Count > this.Plugin.Config.LogEntries) {
|
||||
this.Recent.TryDequeue(out _);
|
||||
}
|
||||
}
|
||||
|
||||
var shouldFilter = this.Plugin.Config.Globs
|
||||
.Where(entry => entry.Value)
|
||||
.Any(entry => entry.Key.IsMatch(specificPath));
|
||||
if (shouldFilter) {
|
||||
return this.PlaySpecificSoundHook!.Original((long) this.InfoPtr, 0);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace SoundFilter.Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not enough arguments. Please specify 'enable' or 'disable' and an optional filter name.
|
||||
/// Looks up a localized string similar to Not enough arguments..
|
||||
/// </summary>
|
||||
internal static string CommandNotEnoughArguments {
|
||||
get {
|
||||
|
@ -96,6 +96,24 @@ namespace SoundFilter.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enable logging.
|
||||
/// </summary>
|
||||
internal static string LogEnableLogging {
|
||||
get {
|
||||
return ResourceManager.GetString("LogEnableLogging", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Log filtered.
|
||||
/// </summary>
|
||||
internal static string LogLogFiltered {
|
||||
get {
|
||||
return ResourceManager.GetString("LogLogFiltered", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Max sounds.
|
||||
/// </summary>
|
||||
|
@ -123,6 +141,15 @@ namespace SoundFilter.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Add filter.
|
||||
/// </summary>
|
||||
internal static string SettingsAddFilter {
|
||||
get {
|
||||
return ResourceManager.GetString("SettingsAddFilter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Filter name.
|
||||
/// </summary>
|
||||
|
@ -141,6 +168,15 @@ namespace SoundFilter.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Edit filter.
|
||||
/// </summary>
|
||||
internal static string SettingsEditFilter {
|
||||
get {
|
||||
return ResourceManager.GetString("SettingsEditFilter", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enable sound filter.
|
||||
/// </summary>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
<value>Sound path to filter</value>
|
||||
</data>
|
||||
<data name="CommandNotEnoughArguments" xml:space="preserve">
|
||||
<value>Not enough arguments. Please specify 'enable' or 'disable' and an optional filter name</value>
|
||||
<value>Not enough arguments.</value>
|
||||
</data>
|
||||
<data name="CommandInvalidSubcommand" xml:space="preserve">
|
||||
<value>Invalid subcommand.</value>
|
||||
|
@ -54,4 +54,16 @@
|
|||
<data name="CommandNoSuchFilter" xml:space="preserve">
|
||||
<value>No such filter.</value>
|
||||
</data>
|
||||
<data name="SettingsAddFilter" xml:space="preserve">
|
||||
<value>Add filter</value>
|
||||
</data>
|
||||
<data name="LogEnableLogging" xml:space="preserve">
|
||||
<value>Enable logging</value>
|
||||
</data>
|
||||
<data name="LogLogFiltered" xml:space="preserve">
|
||||
<value>Log filtered</value>
|
||||
</data>
|
||||
<data name="SettingsEditFilter" xml:space="preserve">
|
||||
<value>Edit filter</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\ImGuiScene.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>$(AppData)\XIVLauncher\addon\Hooks\dev\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Resources\Language.resx">
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace SoundFilter {
|
|||
internal SoundFilterPlugin(DalamudPluginInterface @interface) {
|
||||
this.Interface = @interface;
|
||||
|
||||
this.Config = this.Interface.GetPluginConfig() as Configuration ?? new Configuration();
|
||||
this.Config = Migrator.LoadConfiguration(this);
|
||||
this.Config.Initialise(this.Interface);
|
||||
|
||||
this.Filter = new Filter(this);
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dalamud.Interface;
|
||||
using ImGuiNET;
|
||||
using SoundFilter.Config;
|
||||
using SoundFilter.Resources;
|
||||
|
||||
namespace SoundFilter.Ui {
|
||||
internal class AddFilter {
|
||||
private Guid Id { get; } = Guid.NewGuid();
|
||||
private SoundFilterPlugin Plugin { get; }
|
||||
private CustomFilter? Filter { get; }
|
||||
|
||||
private string _filterName = string.Empty;
|
||||
private string _newSoundPath = string.Empty;
|
||||
private readonly List<string> _soundPaths = new();
|
||||
|
||||
internal AddFilter(SoundFilterPlugin plugin) {
|
||||
this.Plugin = plugin;
|
||||
this.Filter = null;
|
||||
}
|
||||
|
||||
internal AddFilter(SoundFilterPlugin plugin, CustomFilter filter) {
|
||||
this.Plugin = plugin;
|
||||
this.Filter = filter;
|
||||
|
||||
this._filterName = filter.Name;
|
||||
this._soundPaths.AddRange(filter.Globs);
|
||||
}
|
||||
|
||||
internal bool Draw() {
|
||||
ImGui.TextUnformatted(Language.SettingsAddFilterName);
|
||||
|
||||
ImGui.SetNextItemWidth(-1f);
|
||||
ImGui.InputText($"##sound-filter-name-{this.Id}", ref this._filterName, 255);
|
||||
|
||||
ImGui.TextUnformatted(Language.SettingsAddPathToFilter);
|
||||
int? toRemove = null;
|
||||
for (var i = 0; i < this._soundPaths.Count; i++) {
|
||||
var path = this._soundPaths[i];
|
||||
SetNextItemWidth();
|
||||
if (ImGui.InputText($"##sound-path-edit-{i}-{this.Id}", ref path, 255)) {
|
||||
this._soundPaths[i] = path;
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (Util.IconButton(FontAwesomeIcon.Trash, $"sound-path-delete-{i}-{this.Id}")) {
|
||||
toRemove = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (toRemove != null) {
|
||||
this._soundPaths.RemoveAt(toRemove.Value);
|
||||
}
|
||||
|
||||
SetNextItemWidth();
|
||||
ImGui.InputText($"##sound-path-{this.Id}", ref this._newSoundPath, 255);
|
||||
ImGui.SameLine();
|
||||
if (Util.IconButton(FontAwesomeIcon.Plus, "add") && !string.IsNullOrWhiteSpace(this._newSoundPath)) {
|
||||
this._soundPaths.Add(this._newSoundPath);
|
||||
this._newSoundPath = string.Empty;
|
||||
}
|
||||
|
||||
if (Util.IconButton(FontAwesomeIcon.Save, $"save-filter-{this.Id}") && this._soundPaths.Count > 0 && !string.IsNullOrWhiteSpace(this._filterName)) {
|
||||
if (!string.IsNullOrWhiteSpace(this._newSoundPath)) {
|
||||
this._soundPaths.Add(this._newSoundPath);
|
||||
}
|
||||
|
||||
this.Save();
|
||||
|
||||
this._filterName = string.Empty;
|
||||
this._newSoundPath = string.Empty;
|
||||
this._soundPaths.Clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (this.Filter != null) {
|
||||
ImGui.SameLine();
|
||||
if (Util.IconButton(FontAwesomeIcon.Ban, $"cancel-filter-{this.Id}")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void SetNextItemWidth() {
|
||||
ImGui.PushFont(UiBuilder.IconFont);
|
||||
ImGui.SetNextItemWidth(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Ban.ToIconString()).X - ImGui.GetStyle().ItemSpacing.X * 2);
|
||||
ImGui.PopFont();
|
||||
}
|
||||
|
||||
private void Save() {
|
||||
if (this.Filter != null) {
|
||||
this.Filter.Name = this._filterName;
|
||||
this.Filter.Globs.Clear();
|
||||
this.Filter.Globs.AddRange(this._soundPaths);
|
||||
} else {
|
||||
this.Plugin.Config.Filters.Add(new CustomFilter {
|
||||
Name = this._filterName,
|
||||
Enabled = true,
|
||||
Globs = this._soundPaths.ToList(),
|
||||
});
|
||||
}
|
||||
|
||||
this.Plugin.Config.Save();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,21 +1,21 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using ImGuiNET;
|
||||
using SoundFilter.Config;
|
||||
using SoundFilter.Resources;
|
||||
|
||||
namespace SoundFilter.Ui {
|
||||
public class Settings : IDisposable {
|
||||
private SoundFilterPlugin Plugin { get; }
|
||||
private AddFilter AddFilter { get; }
|
||||
private AddFilter? EditFilter { get; set; }
|
||||
|
||||
private bool _showWindow;
|
||||
private string _filterName = string.Empty;
|
||||
private string _soundPath = string.Empty;
|
||||
private int _dragging = -1;
|
||||
|
||||
internal Settings(SoundFilterPlugin plugin) {
|
||||
this.Plugin = plugin;
|
||||
this.AddFilter = new AddFilter(plugin);
|
||||
|
||||
this.Plugin.Interface.UiBuilder.OnOpenConfigUi += this.Toggle;
|
||||
}
|
||||
|
@ -33,6 +33,19 @@ namespace SoundFilter.Ui {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.EditFilter != null) {
|
||||
ImGui.SetNextWindowSize(new Vector2(ImGui.GetWindowSize().X, -1));
|
||||
if (ImGui.BeginPopupModal($"{Language.SettingsEditFilter}###edit-filter-modal")) {
|
||||
if (this.EditFilter.Draw()) {
|
||||
this.EditFilter = null;
|
||||
}
|
||||
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
|
||||
ImGui.OpenPopup("###edit-filter-modal");
|
||||
}
|
||||
|
||||
ImGui.SetNextWindowSize(new Vector2(500, 450), ImGuiCond.FirstUseEver);
|
||||
|
||||
var windowTitle = string.Format(Language.SettingsWindowTitle, SoundFilterPlugin.Name);
|
||||
|
@ -56,49 +69,80 @@ namespace SoundFilter.Ui {
|
|||
|
||||
ImGui.Separator();
|
||||
|
||||
ImGui.TextUnformatted(Language.SettingsAddFilterName);
|
||||
ImGui.InputText("##sound-filter-name", ref this._filterName, 255);
|
||||
|
||||
ImGui.TextUnformatted(Language.SettingsAddPathToFilter);
|
||||
ImGui.InputText("##sound-path", ref this._soundPath, 255);
|
||||
ImGui.SameLine();
|
||||
if (Util.IconButton(FontAwesomeIcon.Plus, "add") && !string.IsNullOrWhiteSpace(this._soundPath) && !string.IsNullOrWhiteSpace(this._filterName)) {
|
||||
this.Plugin.Config.Filtered[this._soundPath] = new CustomFilter {
|
||||
Name = this._filterName,
|
||||
Enabled = true,
|
||||
};
|
||||
shouldSave = true;
|
||||
if (ImGui.CollapsingHeader(Language.SettingsAddFilter)) {
|
||||
this.AddFilter.Draw();
|
||||
}
|
||||
|
||||
ImGui.Separator();
|
||||
|
||||
if (ImGui.BeginChild("filtered-sounds")) {
|
||||
var i = 0;
|
||||
int? toRemove = null;
|
||||
(int src, int dst)? drag = null;
|
||||
for (var i = 0; i < this.Plugin.Config.Filters.Count; i++) {
|
||||
var filter = this.Plugin.Config.Filters[i];
|
||||
|
||||
foreach (var entry in this.Plugin.Config.Filtered.ToList()) {
|
||||
var glob = entry.Key;
|
||||
|
||||
if (Util.IconButton(FontAwesomeIcon.Trash, $"delete-{glob}")) {
|
||||
this.Plugin.Config.Filtered.Remove(glob);
|
||||
if (Util.IconButton(FontAwesomeIcon.Trash, $"delete-filter-{i}")) {
|
||||
toRemove = i;
|
||||
shouldSave = true;
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (Util.IconButton(FontAwesomeIcon.Copy, $"copy-{glob}")) {
|
||||
ImGui.SetClipboardText(glob);
|
||||
if (Util.IconButton(FontAwesomeIcon.PencilAlt, $"edit-filter-{i}")) {
|
||||
this.EditFilter = new AddFilter(this.Plugin, filter);
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
shouldSave |= ImGui.Checkbox($"{entry.Value.Name}##{i}-{glob}", ref entry.Value.Enabled);
|
||||
if (ImGui.IsItemHovered()) {
|
||||
if (Util.IconButton(FontAwesomeIcon.Copy, $"copy-filter-{i}")) {
|
||||
ImGui.SetClipboardText(string.Join("\n", filter.Globs));
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
shouldSave |= ImGui.Checkbox($"{filter.Name}##{i}", ref filter.Enabled);
|
||||
|
||||
if (ImGui.IsItemActive() || this._dragging == i) {
|
||||
this._dragging = i;
|
||||
var step = 0;
|
||||
if (ImGui.GetIO().MouseDelta.Y < 0 && ImGui.GetMousePos().Y < ImGui.GetItemRectMin().Y) {
|
||||
step = -1;
|
||||
}
|
||||
|
||||
if (ImGui.GetIO().MouseDelta.Y > 0 && ImGui.GetMousePos().Y > ImGui.GetItemRectMax().Y) {
|
||||
step = 1;
|
||||
}
|
||||
|
||||
if (step != 0) {
|
||||
drag = (i, i + step);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ImGui.IsItemHovered()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ImGui.BeginTooltip();
|
||||
foreach (var glob in filter.Globs) {
|
||||
ImGui.TextUnformatted(glob);
|
||||
}
|
||||
|
||||
ImGui.EndTooltip();
|
||||
}
|
||||
|
||||
i += 1;
|
||||
if (!ImGui.IsMouseDown(ImGuiMouseButton.Left) && this._dragging != -1) {
|
||||
this._dragging = -1;
|
||||
this.Plugin.Config.Save();
|
||||
}
|
||||
|
||||
if (drag != null && drag.Value.dst < this.Plugin.Config.Filters.Count && drag.Value.dst >= 0) {
|
||||
this._dragging = drag.Value.dst;
|
||||
var temp = this.Plugin.Config.Filters[drag.Value.src];
|
||||
this.Plugin.Config.Filters[drag.Value.src] = this.Plugin.Config.Filters[drag.Value.dst];
|
||||
this.Plugin.Config.Filters[drag.Value.dst] = temp;
|
||||
}
|
||||
|
||||
if (toRemove != null) {
|
||||
this.Plugin.Config.Filters.RemoveAt(toRemove.Value);
|
||||
}
|
||||
|
||||
ImGui.EndChild();
|
||||
|
|
|
@ -28,6 +28,16 @@ namespace SoundFilter.Ui {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ImGui.Checkbox(Language.LogEnableLogging, ref this.Plugin.Config.LogEnabled)) {
|
||||
this.Plugin.Config.Save();
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGui.Checkbox(Language.LogLogFiltered, ref this.Plugin.Config.LogFiltered)) {
|
||||
this.Plugin.Config.Save();
|
||||
}
|
||||
|
||||
ImGui.InputText(Language.LogSearch, ref this._search, 255);
|
||||
|
||||
var entries = (int) this.Plugin.Config.LogEntries;
|
||||
|
|
Loading…
Reference in New Issue