mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Add chat command to clear temporary settings.
This commit is contained in:
parent
1d70be8060
commit
93b0996794
1 changed files with 32 additions and 15 deletions
|
|
@ -87,6 +87,7 @@ public class CommandHandler : IDisposable, IApiService
|
||||||
"collection" => SetCollection(arguments),
|
"collection" => SetCollection(arguments),
|
||||||
"mod" => SetMod(arguments),
|
"mod" => SetMod(arguments),
|
||||||
"bulktag" => SetTag(arguments),
|
"bulktag" => SetTag(arguments),
|
||||||
|
"clearsettings" => ClearSettings(arguments),
|
||||||
"knowledge" => HandleKnowledge(arguments),
|
"knowledge" => HandleKnowledge(arguments),
|
||||||
_ => PrintHelp(argumentList[0]),
|
_ => PrintHelp(argumentList[0]),
|
||||||
};
|
};
|
||||||
|
|
@ -126,6 +127,21 @@ public class CommandHandler : IDisposable, IApiService
|
||||||
_chat.Print(new SeStringBuilder()
|
_chat.Print(new SeStringBuilder()
|
||||||
.AddCommand("bulktag", "Change multiple mods settings based on their tags. Use without further parameters for more detailed help.")
|
.AddCommand("bulktag", "Change multiple mods settings based on their tags. Use without further parameters for more detailed help.")
|
||||||
.BuiltString);
|
.BuiltString);
|
||||||
|
_chat.Print(new SeStringBuilder()
|
||||||
|
.AddCommand("clearsettings",
|
||||||
|
"Clear all temporary settings applied manually through Penumbra in the current or all collections. Use with 'all' parameter for all.")
|
||||||
|
.BuiltString);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool ClearSettings(string arguments)
|
||||||
|
{
|
||||||
|
if (arguments.Trim().ToLowerInvariant() is "all")
|
||||||
|
foreach (var collection in _collectionManager.Storage)
|
||||||
|
_collectionEditor.ClearTemporarySettings(collection);
|
||||||
|
else
|
||||||
|
_collectionEditor.ClearTemporarySettings(_collectionManager.Active.Current);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -416,7 +432,8 @@ public class CommandHandler : IDisposable, IApiService
|
||||||
var split2 = nameSplit[1].Split('|', 3, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
var split2 = nameSplit[1].Split('|', 3, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
||||||
if (split2.Length < 2)
|
if (split2.Length < 2)
|
||||||
{
|
{
|
||||||
_chat.Print("Not enough arguments for changing settings provided. Please add a group name and a list of setting names - which can be empty for multi options.");
|
_chat.Print(
|
||||||
|
"Not enough arguments for changing settings provided. Please add a group name and a list of setting names - which can be empty for multi options.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue