Added /expert command to toggled expert mode

This commit is contained in:
White 2015-07-06 10:51:08 +09:30
parent 800ef86b65
commit 2dd4be0081
2 changed files with 14 additions and 0 deletions

View file

@ -453,6 +453,10 @@ namespace TShockAPI
}); });
#endregion #endregion
#region World Commands #region World Commands
add(new Command(Permissions.toggleexpert, ToggleExpert, "expert")
{
HelpText = "Toggles expert mode."
});
add(new Command(Permissions.antibuild, ToggleAntiBuild, "antibuild") add(new Command(Permissions.antibuild, ToggleAntiBuild, "antibuild")
{ {
HelpText = "Toggles build protection." HelpText = "Toggles build protection."
@ -1965,6 +1969,13 @@ namespace TShockAPI
} }
} }
private static void ToggleExpert(CommandArgs args)
{
Main.expertMode = !Main.expertMode;
TSPlayer.All.SendData(PacketTypes.WorldInfo);
args.Player.SendSuccessMessage("Expert mode is now {0}.", Main.expertMode ? "on" : "off");
}
private static void Hardmode(CommandArgs args) private static void Hardmode(CommandArgs args)
{ {
if (Main.hardMode) if (Main.hardMode)

View file

@ -254,6 +254,9 @@ namespace TShockAPI
// tshock.world nodes // tshock.world nodes
[Description("User can change expert state.")]
public static readonly string toggleexpert = "tshock.world.toggleexpert";
[Description("Allows you to edit the spawn.")] [Description("Allows you to edit the spawn.")]
public static readonly string editspawn = "tshock.world.editspawn"; public static readonly string editspawn = "tshock.world.editspawn";