Adds In-depth help messages to commands (/plan <cmd> ?)

This commit is contained in:
Rsl1122 2017-07-27 15:14:07 +03:00 committed by Fuzzlemann
parent 845a991308
commit 7072940121
14 changed files with 286 additions and 5 deletions

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCommand;
import com.djrapitops.plugin.command.defaultcmds.StatusCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.command.commands.*;
@ -27,6 +29,24 @@ public class PlanCommand extends TreeCommand<Plan> {
public PlanCommand(Plan plugin) {
super(plugin, "plan", CommandType.CONSOLE, "", "", "plan");
super.setDefaultCommand("inspect");
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"/plan - Main Command",
tCol+" Used to access all SubCommands & help",
sCol+" /plan - List subcommands",
sCol+" /plan <subcommand> ? - in depth help"
};
}
@Override

View File

@ -5,6 +5,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.*;
import main.java.com.djrapitops.plan.command.ConditionUtils;
@ -32,9 +34,27 @@ public class AnalyzeCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public AnalyzeCommand(Plan plugin) {
super("analyze, analyse, analysis", CommandType.CONSOLE, Permissions.ANALYZE.getPermission(), Phrase.CMD_USG_ANALYZE.parse());
super("analyze, analyse, analysis, a", CommandType.CONSOLE, Permissions.ANALYZE.getPermission(), Phrase.CMD_USG_ANALYZE.parse());
this.plugin = plugin;
analysisCache = plugin.getAnalysisCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Analysis Command",
tCol+" Used to Refresh analysis cache & Access the result page",
sCol+" /plan status can be used to check status of analysis while it is running.",
sCol+" Aliases: analyze, analyse, analysis, a"
};
}
@Override

View File

@ -5,6 +5,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.*;
@ -41,6 +43,24 @@ public class InspectCommand extends SubCommand {
this.plugin = plugin;
inspectCache = plugin.getInspectCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Inspect command",
tCol+" Used to get a link to User's inspect page.",
sCol+" Own inspect page can be accessed with /plan inspect",
sCol+" Alias: /plan <name>"
};
}
@Override
@ -133,4 +153,4 @@ public class InspectCommand extends SubCommand {
sender.sendMessage(Phrase.CMD_FOOTER + "");
}
}
}

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
@ -29,9 +31,27 @@ public class ListCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public ListCommand(Plan plugin) {
super("list", CommandType.CONSOLE, Permissions.INSPECT_OTHER.getPermission(), "List to all cached players", "");
super("list, pl", CommandType.CONSOLE, Permissions.INSPECT_OTHER.getPermission(), "List to all cached players", "");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"List command",
tCol+" Used to get a link to players page.",
sCol+" Players page contains links to all cached inspect pages.",
sCol+" Alias: /plan pl"
};
}
@Override

View File

@ -2,6 +2,8 @@ package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Phrase;
import main.java.com.djrapitops.plan.Plan;
@ -24,6 +26,25 @@ public class ManageCommand extends TreeCommand<Plan> {
*/
public ManageCommand(Plan plugin) {
super(plugin, "manage,m", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE + "", "plan m");
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage command",
tCol+" Used to Manage Database of the plugin.",
sCol+" Alias: /plan m",
sCol+" /plan m - List subcommands",
sCol+" /plan m <subcommand> ? - in depth help"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
@ -33,9 +35,27 @@ public class QuickAnalyzeCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public QuickAnalyzeCommand(Plan plugin) {
super("qanalyze, qanalyse, qanalysis", CommandType.CONSOLE, Permissions.QUICK_ANALYZE.getPermission(), Phrase.CMD_USG_QANALYZE.parse());
super("qanalyze, qanalyse, qanalysis, qa", CommandType.CONSOLE, Permissions.QUICK_ANALYZE.getPermission(), Phrase.CMD_USG_QANALYZE.parse());
this.plugin = plugin;
analysisCache = plugin.getAnalysisCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Quick Analysis command",
tCol+" Used to get in game info about analysis.",
sCol+" Has less info than full Analysis web page.",
sCol+" Aliases: qanalyze, ganalyse, qanalysis, qa"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.api.TimeAmount;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
@ -37,10 +39,28 @@ public class QuickInspectCommand extends SubCommand {
* @param plugin Current instance of Plan
*/
public QuickInspectCommand(Plan plugin) {
super("qinspect", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.QUICK_INSPECT.getPermission(), Phrase.CMD_USG_QINSPECT + "", Phrase.ARG_PLAYER + "");
super("qinspect, qi", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.QUICK_INSPECT.getPermission(), Phrase.CMD_USG_QINSPECT + "", Phrase.ARG_PLAYER + "");
this.plugin = plugin;
inspectCache = plugin.getInspectCache();
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Quick Inspect command",
tCol+" Used to get some inspect info in game.",
sCol+" Has less info than full Inspect web page.",
sCol+" Alias: /plan qi"
};
}
@Override

View File

@ -4,6 +4,8 @@ import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
@ -34,6 +36,24 @@ public class RegisterCommand extends SubCommand {
public RegisterCommand(Plan plugin) {
super("register", CommandType.CONSOLE_WITH_ARGUMENTS, "", "Register a user for the webserver", "<password> [name] [access lvl]");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Web Register command",
tCol+" Used to register a new user for the webserver.",
sCol+" Registering a user for another player requires "+Permissions.MANAGE_WEB.getPerm()+" permission.",
sCol+" Passwords are hashed with PBKDF2 (64,000 iterations of SHA1) using a cryptographically-random salt."
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.FormattingUtils;
import main.java.com.djrapitops.plan.Permissions;
@ -32,6 +34,23 @@ public class SearchCommand extends SubCommand {
public SearchCommand(Plan plugin) {
super("search", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.SEARCH.getPermission(), Phrase.CMD_USG_SEARCH + "", Phrase.ARG_SEARCH + "");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Search command",
tCol+" Used to get a list of Player names that match the given argument.",
sCol+" Example: /plan search 123 - Finds all users with 123 in their name."
};
}
@Override

View File

@ -2,6 +2,8 @@ package main.java.com.djrapitops.plan.command.commands;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.TreeCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.command.commands.webuser.WebCheckCommand;
@ -20,6 +22,27 @@ public class WebUserCommand extends TreeCommand<Plan> {
public WebUserCommand(Plan plugin, RegisterCommand register) {
super(plugin, "webuser, web", CommandType.CONSOLE, Permissions.MANAGE_WEB.getPerm(), "Manage Webusers", "plan web");
commands.add(register);
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Web User Manage command",
tCol+" Used to manage web users of the plugin",
sCol+" Users have a permission level:",
tCol+" 0 - Access to all pages",
tCol+" 1 - Access to /players & all inspect pages",
tCol+" 2 - Access to own inspect page",
sCol+" Alias: /plan web"
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
@ -32,6 +34,24 @@ public class ManageClearCommand extends SubCommand {
super("clear", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_CLEAR + "", "<DB> [-a]");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Clear command",
tCol+" Used to delete ALL data in the active database.",
sCol+" Plugin should be reloaded after successful clear.",
sCol+" Alias: /plan pl"
};
}
@Override
@ -71,6 +91,7 @@ public class ManageClearCommand extends SubCommand {
sender.sendMessage(Phrase.MANAGE_PROCESS_START.parse());
if (database.removeAllData()) {
plugin.getHandler().getDataCache().clear();
sender.sendMessage(Phrase.MANAGE_CLEAR_SUCCESS.toString());
} else {
sender.sendMessage(Phrase.MANAGE_PROCESS_FAIL.toString());

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions;
@ -32,6 +34,23 @@ public class ManageHotswapCommand extends SubCommand {
super("hotswap", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_HOTSWAP.toString(), "<DB>");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Hotswap command",
tCol+" Used to change database in use on the fly.",
sCol+" Does not change database if connection fails"
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.FormattingUtils;
import com.djrapitops.plugin.utilities.player.Fetch;
@ -39,6 +41,24 @@ public class ManageImportCommand extends SubCommand {
public ManageImportCommand(Plan plugin) {
super("import", CommandType.CONSOLE, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_IMPORT.toString(), Phrase.ARG_IMPORT.toString());
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Import command",
tCol+" Used to import data from other sources",
sCol+" Analysis will be disabled during import.",
sCol+" If a lot of users are not in the database, saving may take a long time."
};
}
@Override

View File

@ -3,6 +3,8 @@ package main.java.com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.ISender;
import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.settings.ColorScheme;
import com.djrapitops.plugin.settings.DefaultMessages;
import com.djrapitops.plugin.task.AbsRunnable;
import com.djrapitops.plugin.utilities.Verify;
import main.java.com.djrapitops.plan.Log;
@ -35,6 +37,22 @@ public class ManageRemoveCommand extends SubCommand {
super("remove", CommandType.CONSOLE_WITH_ARGUMENTS, Permissions.MANAGE.getPermission(), Phrase.CMD_USG_MANAGE_REMOVE.toString(), Phrase.ARG_PLAYER + " [-a]");
this.plugin = plugin;
setHelp(plugin);
}
private void setHelp(Plan plugin) {
ColorScheme colorScheme = plugin.getColorScheme();
String ball = DefaultMessages.BALL.toString();
String mCol = colorScheme.getMainColor();
String sCol = colorScheme.getSecondaryColor();
String tCol = colorScheme.getTertiaryColor();
String[] help = new String[]{
mCol +"Manage Remove command",
tCol+" Used to Remove user's data from the active database."
};
}
@Override