Skip to content

Commit

Permalink
Improve explanatory comments for /cmdcreate generated command skeletons
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Dec 19, 2020
1 parent 86f143c commit a98c00e
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions MCGalaxy/Scripting/Backends.cs
Expand Up @@ -49,28 +49,29 @@ namespace MCGalaxy
\t\t// The command's name (what you put after a slash to use this command)
\t\tpublic override string name {{ get {{ return ""{0}""; }} }}
\t\t// Command's shortcut (please take care not to use an existing one, or you may have issues.)
\t\t// Command's shortcut, can be left blank (e.g. ""/copy"" has a shortcut of ""c"")
\t\tpublic override string shortcut {{ get {{ return """"; }} }}
\t\t// Determines which submenu this command displays in under /Help.
\t\t// Which submenu this command displays in under /Help
\t\tpublic override string type {{ get {{ return ""other""; }} }}
\t\t// Determines whether or not this command can be used in a museum. Block/map altering commands should be made false to avoid errors.
\t\tpublic override bool museumUsable {{ get {{ return false; }} }}
\t\t// Whether or not this command can be used in a museum. Block/map altering commands should return false to avoid errors.
\t\tpublic override bool museumUsable {{ get {{ return true; }} }}
\t\t// Determines the default rank required to use this command. Valid values are:
\t\t// LevelPermission.Nobody, LevelPermission.Banned, LevelPermission.Guest
\t\t// LevelPermission.Builder, LevelPermission.AdvBuilder, LevelPermission.Operator, LevelPermission.Admin
\t\tpublic override LevelPermission defaultRank {{ get {{ return LevelPermission.Banned; }} }}
\t\t// The default rank required to use this command. Valid values are:
\t\t// LevelPermission.Guest, LevelPermission.Builder, LevelPermission.AdvBuilder,
\t\t// LevelPermission.Operator, LevelPermission.Admin, LevelPermission.Nobody
\t\tpublic override LevelPermission defaultRank {{ get {{ return LevelPermission.Guest; }} }}
\t\t// This is where the magic happens, naturally.
\t\t// p is the player object for the player executing the command. message is everything after the command invocation itself.
\t\t// This is for when a player executes this command by doing /{0}
\t\t// p is the player object for the player executing the command.
\t\t// message is the arguments given to the command. (e.g. for '/update this', message is ""this"")
\t\tpublic override void Use(Player p, string message)
\t\t{{
\t\t\tp.Message(""Hello World!"");
\t\t}}
\t\t// This one controls what happens when you use /Help [commandname].
\t\t// This is for when a player does /Help {0}
\t\tpublic override void Help(Player p)
\t\t{{
\t\t\tp.Message(""/{0} - Does stuff. Example command."");
Expand All @@ -91,7 +92,7 @@ public sealed class ScriptingVB : IScripting {
get {
return @"'\tAuto-generated command skeleton class.
'\tUse this as a basis for custom MCGalaxy commands.
'\tFile and class should be named a specific way. For example, /update is named 'CmdUpdate.vb' for the file, and 'CmdUpdate' for the class.
'\tFile and class should be named a specific way. For example, /update is named 'CmdUpdate.vb' for the file, and 'CmdUpdate' for the class.
' As a note, MCGalaxy is designed for .NET 4.0.
' To reference other assemblies, put a ""//reference [assembly filename]"" at the top of the file
Expand All @@ -104,50 +105,51 @@ Namespace MCGalaxy
\tPublic Class Cmd{0}
\t\tInherits Command
' The command's name (what you put after a slash to use this command)
\t\t' The command's name (what you put after a slash to use this command)
\t\tPublic Overrides ReadOnly Property name() As String
\t\t\tGet
\t\t\t\tReturn ""{0}""
\t\t\tEnd Get
\t\tEnd Property
' Command's shortcut (please take care not to use an existing one, or you may have issues.)
\t\t' Command's shortcut, can be left blank (e.g. ""/copy"" has a shortcut of ""c"")
\t\tPublic Overrides ReadOnly Property shortcut() As String
\t\t\tGet
\t\t\t\tReturn """"
\t\t\tEnd Get
\t\tEnd Property
' Determines which submenu this command displays in under /Help.
\t\t' Which submenu this command displays in under /Help
\t\tPublic Overrides ReadOnly Property type() As String
\t\t\tGet
\t\t\t\tReturn ""other""
\t\t\tEnd Get
\t\t End Property
' Determines whether or not this command can be used in a museum. Block/map altering commands should be made false to avoid errors.
\t\t' Whether or not this command can be used in a museum. Block/map altering commands should return False to avoid errors.
\t\tPublic Overrides ReadOnly Property museumUsable() As Boolean
\t\t\tGet
\t\t\t\tReturn False
\t\t\t\tReturn True
\t\t\tEnd Get
\t\tEnd Property
' Determines the default rank required to use this command. Valid values are:
' LevelPermission.Nobody, LevelPermission.Banned, LevelPermission.Guest
' LevelPermission.Builder, LevelPermission.AdvBuilder, LevelPermission.Operator, LevelPermission.Admin
\t\t' The default rank required to use this command. Valid values are:
\t\t' LevelPermission.Guest, LevelPermission.Builder, LevelPermission.AdvBuilder,
\t\t' LevelPermission.Operator, LevelPermission.Admin, LevelPermission.Nobody
\t\tPublic Overrides ReadOnly Property defaultRank() As LevelPermission
\t\t\tGet
\t\t\t\tReturn LevelPermission.Banned
\t\t\t\tReturn LevelPermission.Guest
\t\t\tEnd Get
\t\tEnd Property
' This is where the magic happens, naturally.
' p is the player object for the player executing the command. message is everything after the command invocation itself.
\t\t' This is for when a player executes this command by doing /{0}
\t\t' p is the player object for the player executing the command.
\t\t' message is the arguments given to the command. (e.g. for '/update this', message is ""this"")
\t\tPublic Overrides Sub Use(p As Player, message As String)
\t\t\tp.Message(""Hello World!"")
\t\tEnd Sub
' This one controls what happens when you use /Help [commandname].
\t\t' This is for when a player does /Help {0}
\t\tPublic Overrides Sub Help(p As Player)
\t\t\tp.Message(""/{0} - Does stuff. Example command."")
\t\tEnd Sub
Expand Down

0 comments on commit a98c00e

Please sign in to comment.