Localize /addlevels and /addxp commands

This commit is contained in:
GJ 2013-01-16 23:58:12 -05:00
parent 07211611a6
commit 37c92b8d7c
5 changed files with 37 additions and 29 deletions

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.general; package com.gmail.nossr50.commands.general;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
@ -29,8 +28,7 @@ public class AddlevelsCommand implements CommandExecutor{
PlayerProfile profile; PlayerProfile profile;
int levels; int levels;
SkillType skill; SkillType skill;
String skillName; String usage = LocaleLoader.getString("Commands.Usage.3", new Object[] {"addlevels", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.Level") + ">" });
String usage = ChatColor.RED + "Proper usage is /addlevels [player] <skill> <level>"; //TODO: Needs more locale.
if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit")) { if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit")) {
return true; return true;
@ -51,14 +49,13 @@ public class AddlevelsCommand implements CommandExecutor{
profile = Users.getProfile(modifiedPlayer); profile = Users.getProfile(modifiedPlayer);
if (skill.equals(SkillType.ALL)) { if (skill.equals(SkillType.ALL)) {
skillName = "all skills"; sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", new Object[] {levels}));
} }
else { else {
skillName = Misc.getCapitalized(skill.toString()); sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", new Object[] {levels, Misc.getCapitalized(skill.toString())}));
} }
profile.addLevels(skill, levels); profile.addLevels(skill, levels);
sender.sendMessage(ChatColor.GREEN + "You were awarded " + levels + " levels in " + skillName + "!"); //TODO: Needs more locale.
} }
} }
else { else {
@ -90,23 +87,23 @@ public class AddlevelsCommand implements CommandExecutor{
if (Misc.isInt(args[2])) { if (Misc.isInt(args[2])) {
levels = Integer.valueOf(args[2]); levels = Integer.valueOf(args[2]);
skill = Skills.getSkillType(args[1]); skill = Skills.getSkillType(args[1]);
String message;
Users.getProfile(modifiedPlayer).addLevels(skill, levels); Users.getProfile(modifiedPlayer).addLevels(skill, levels);
if (skill.equals(SkillType.ALL)) { if (skill.equals(SkillType.ALL)) {
skillName = "all skills"; sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", new Object[] {playerName}));
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
} }
else { else {
skillName = Misc.getCapitalized(skill.toString()); sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", new Object[] {Misc.getCapitalized(skill.toString()), playerName}));
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
} }
sender.sendMessage(message);
if (modifiedPlayer.isOnline()) { if (modifiedPlayer.isOnline()) {
((Player) modifiedPlayer).sendMessage(ChatColor.GREEN + "You were awarded " + levels + " levels in " + skillName + "!"); //TODO: Needs more locale. if (skill.equals(SkillType.ALL)) {
((Player) modifiedPlayer).sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.1", new Object[] {levels}));
}
else {
((Player) modifiedPlayer).sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", new Object[] {levels, Misc.getCapitalized(skill.toString())}));
}
} }
} }
else { else {

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.general; package com.gmail.nossr50.commands.general;
import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -29,8 +28,7 @@ public class AddxpCommand implements CommandExecutor {
Player modifiedPlayer; Player modifiedPlayer;
int xp; int xp;
SkillType skill; SkillType skill;
String skillName; String usage = LocaleLoader.getString("Commands.Usage.3", new Object[] {"addxp", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.XP") + ">" });
String usage = ChatColor.RED + "Proper usage is /addxp [playername] <skill> <xp>"; //TODO: Needs more locale.
if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit")) { if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit")) {
return true; return true;
@ -54,14 +52,12 @@ public class AddxpCommand implements CommandExecutor {
mcMMOPlayer.addXPOverride(skill, xp); mcMMOPlayer.addXPOverride(skill, xp);
if (skill.equals(SkillType.ALL)) { if (skill.equals(SkillType.ALL)) {
skillName = "all skills"; modifiedPlayer.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", new Object[] {xp}));
} }
else { else {
skillName = Misc.getCapitalized(skill.toString()); modifiedPlayer.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", new Object[] {xp, Misc.getCapitalized(skill.toString())}));
} }
modifiedPlayer.sendMessage(ChatColor.GREEN + "You were awarded " + xp + " experience in " + skillName + "!"); //TODO: Needs more locale.
if (skill.equals(SkillType.ALL)) { if (skill.equals(SkillType.ALL)) {
Skills.xpCheckAll(modifiedPlayer, profile); Skills.xpCheckAll(modifiedPlayer, profile);
} }
@ -103,26 +99,22 @@ public class AddxpCommand implements CommandExecutor {
if (Misc.isInt(args[2])) { if (Misc.isInt(args[2])) {
xp = Integer.valueOf(args[2]); xp = Integer.valueOf(args[2]);
skill = Skills.getSkillType(args[1]); skill = Skills.getSkillType(args[1]);
String message;
mcMMOPlayer.addXPOverride(skill, xp); mcMMOPlayer.addXPOverride(skill, xp);
if (skill.equals(SkillType.ALL)) { if (skill.equals(SkillType.ALL)) {
skillName = "all skills"; sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", new Object[] {playerName}));
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
} }
else { else {
skillName = Misc.getCapitalized(skill.toString()); sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", new Object[] {Misc.getCapitalized(skill.toString()), playerName}));
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
} }
sender.sendMessage(message);
modifiedPlayer.sendMessage(ChatColor.GREEN + "You were awarded " + xp + " experience in " + skillName + "!"); //TODO: Needs more locale.
if (skill.equals(SkillType.ALL)) { if (skill.equals(SkillType.ALL)) {
modifiedPlayer.sendMessage(LocaleLoader.getString("Commands.addxp.AwardAll", new Object[] {xp}));
Skills.xpCheckAll(modifiedPlayer, profile); Skills.xpCheckAll(modifiedPlayer, profile);
} }
else { else {
modifiedPlayer.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", new Object[] {xp, Misc.getCapitalized(skill.toString())}));
Skills.xpCheckSkill(skill, modifiedPlayer, profile); Skills.xpCheckSkill(skill, modifiedPlayer, profile);
} }
} }

View File

@ -334,6 +334,12 @@ Combat.StruckByGore=[[RED]]**YOU HAVE BEEN GORED**
Combat.TargetDazed=Target was [[DARK_RED]]Dazed Combat.TargetDazed=Target was [[DARK_RED]]Dazed
Combat.TouchedFuzzy=[[DARK_RED]] cyffwrdd Fuzzy. Teimlo benysgafn. Combat.TouchedFuzzy=[[DARK_RED]] cyffwrdd Fuzzy. Teimlo benysgafn.
mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread
Commands.addlevels.AwardAll.1=[[GREEN]]You were awarded {0} levels in all skills!
Commands.addlevels.AwardAll.2=[[RED]]All skills have been modified for {0}.
Commands.addlevels.AwardSkill.1=[[GREEN]]You were awarded {0} levels in {1}!
Commands.addlevels.AwardSkill.2=[[RED]]{0} has been modified for {1}.
Commands.addxp.AwardAll=[[GREEN]]You were awarded {0} experience in all skills!
Commands.addxp.AwardSkill=[[GREEN]]You were awarded {0} experience in {1}!
Commands.Ability.Off=Ability use toggled [[RED]]off Commands.Ability.Off=Ability use toggled [[RED]]off
Commands.Ability.On=Ability use toggled [[GREEN]]on Commands.Ability.On=Ability use toggled [[GREEN]]on
Commands.AdminChat.Off=Admin Sgwrs unig [[RED]] Oddi ar Commands.AdminChat.Off=Admin Sgwrs unig [[RED]] Oddi ar

View File

@ -377,6 +377,12 @@ Combat.TouchedFuzzy=[[DARK_RED]]Ungl\u00FCcklich ber\u00FChrt. Schwindelgef\u00F
#KOMMANDOS #KOMMANDOS
##allgemein ##allgemein
mcMMO.Description=[[DARK_AQUA]]\u00DCber das [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO ist ein [[RED]]Open Source[[GOLD]] RPG Mod [[GOLD]]von [[BLUE]]nossr50[[GOLD]] aus 2011,[[GOLD]]Ziel ist es eine qualitative RPG Erfahrung zu bieten.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GOLD]]Nutze [[RED]]/mcc[[GOLD]] f\u00FCr die Commands,[[GOLD]] - [[GOLD]]Nutze [[RED]]/SKILLNAME[[GOLD]] f\u00FCr detailierte Skillinfos,[[DARK_AQUA]]Entwickler:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Projekleiter),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Entwickler),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Entwickler),[[DARK_AQUA]]N\u00FCtzliche Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Fehlerberichte,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Thema im Bukkit Forum,[[DARK_AQUA]]Deutsche \u00DCbersetzung:,[[GOLD]] - [[BLUE]] Jobsti mcMMO.Description=[[DARK_AQUA]]\u00DCber das [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO ist ein [[RED]]Open Source[[GOLD]] RPG Mod [[GOLD]]von [[BLUE]]nossr50[[GOLD]] aus 2011,[[GOLD]]Ziel ist es eine qualitative RPG Erfahrung zu bieten.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GOLD]]Nutze [[RED]]/mcc[[GOLD]] f\u00FCr die Commands,[[GOLD]] - [[GOLD]]Nutze [[RED]]/SKILLNAME[[GOLD]] f\u00FCr detailierte Skillinfos,[[DARK_AQUA]]Entwickler:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Projekleiter),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Entwickler),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Entwickler),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Entwickler),[[DARK_AQUA]]N\u00FCtzliche Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Fehlerberichte,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Thema im Bukkit Forum,[[DARK_AQUA]]Deutsche \u00DCbersetzung:,[[GOLD]] - [[BLUE]] Jobsti
Commands.addlevels.AwardAll.1=[[GREEN]]You were awarded {0} levels in all skills!
Commands.addlevels.AwardAll.2=[[RED]]All skills have been modified for {0}.
Commands.addlevels.AwardSkill.1=[[GREEN]]You were awarded {0} levels in {1}!
Commands.addlevels.AwardSkill.2=[[RED]]{0} has been modified for {1}.
Commands.addxp.AwardAll=[[GREEN]]You were awarded {0} experience in all skills!
Commands.addxp.AwardSkill=[[GREEN]]You were awarded {0} experience in {1}!
Commands.Ability.Off=F\u00E4higkeiten [[RED]]deaktiviert Commands.Ability.Off=F\u00E4higkeiten [[RED]]deaktiviert
Commands.Ability.On=F\u00E4higkeiten [[GREEN]]aktivivert Commands.Ability.On=F\u00E4higkeiten [[GREEN]]aktivivert
Commands.AdminChat.Off=Admin Chat only [[RED]]deaktiviert Commands.AdminChat.Off=Admin Chat only [[RED]]deaktiviert

View File

@ -386,6 +386,12 @@ Combat.TouchedFuzzy=[[DARK_RED]]Touched Fuzzy. Felt Dizzy.
#COMMANDS #COMMANDS
##generic ##generic
mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread mcMMO.Description=[[DARK_AQUA]]About the [[YELLOW]]mcMMO[[DARK_AQUA]] Project:,[[GOLD]]mcMMO is an [[RED]]open source[[GOLD]] RPG mod created in February 2011,[[GOLD]]by [[BLUE]]nossr50[[GOLD]]. The goal is to provide a quality RPG experience.,[[DARK_AQUA]]Tips:,[[GOLD]] - [[GREEN]]Use [[RED]]/mcc[[GREEN]] to see commands,[[GOLD]] - [[GREEN]]Type [[RED]]/SKILLNAME[[GREEN]] to see detailed skill info,[[DARK_AQUA]]Developers:,[[GOLD]] - [[GREEN]]nossr50 [[BLUE]](Project Lead),[[GOLD]] - [[GREEN]]GJ [[BLUE]](Senior Developer),[[GOLD]] - [[GREEN]]NuclearW [[BLUE]](Developer),[[GOLD]] - [[GREEN]]bm01 [[BLUE]](Developer),[[DARK_AQUA]]Useful Links:,[[GOLD]] - [[GREEN]]issues.mcmmo.org[[GOLD]] Bug Reporting,[[GOLD]] - [[GREEN]]#mcmmo @ irc.esper.net[[GOLD]] IRC Chat,[[GOLD]] - [[GREEN]]http://bit.ly/H6XwFb[[GOLD]] Bukkit Forum Thread
Commands.addlevels.AwardAll.1=[[GREEN]]You were awarded {0} levels in all skills!
Commands.addlevels.AwardAll.2=[[RED]]All skills have been modified for {0}.
Commands.addlevels.AwardSkill.1=[[GREEN]]You were awarded {0} levels in {1}!
Commands.addlevels.AwardSkill.2=[[RED]]{0} has been modified for {1}.
Commands.addxp.AwardAll=[[GREEN]]You were awarded {0} experience in all skills!
Commands.addxp.AwardSkill=[[GREEN]]You were awarded {0} experience in {1}!
Commands.Ability.Off=Ability use toggled [[RED]]off Commands.Ability.Off=Ability use toggled [[RED]]off
Commands.Ability.On=Ability use toggled [[GREEN]]on Commands.Ability.On=Ability use toggled [[GREEN]]on
Commands.AdminChat.Off=Admin Chat only [[RED]]Off Commands.AdminChat.Off=Admin Chat only [[RED]]Off
@ -455,6 +461,7 @@ Commands.Usage.Message=message
Commands.Usage.PartyName=party-name Commands.Usage.PartyName=party-name
Commands.Usage.Player=player Commands.Usage.Player=player
Commands.Usage.Skill=skill Commands.Usage.Skill=skill
Commands.Usage.XP=xp
mcMMO.NoInvites=[[RED]]You have no invites at this time mcMMO.NoInvites=[[RED]]You have no invites at this time
mcMMO.NoPermission=[[DARK_RED]]Insufficient permissions. mcMMO.NoPermission=[[DARK_RED]]Insufficient permissions.
mcMMO.NoSkillNote=[[DARK_GRAY]]If you don't have access to a skill it will not be shown here. mcMMO.NoSkillNote=[[DARK_GRAY]]If you don't have access to a skill it will not be shown here.