1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

editquests locale

This commit is contained in:
Zrips 2023-01-06 14:00:27 +02:00
parent 04a9ee487c
commit ba27449336
2 changed files with 39 additions and 27 deletions

View File

@ -364,13 +364,20 @@ public class editquests implements Cmd {
cmle.print(); cmle.print();
} }
private static String toString(List<String> list) {
String objectiveString = CMIList.listToString(list, " ");
if (objectiveString.length() > 32)
objectiveString = objectiveString.substring(0, 32) + "..";
return objectiveString;
}
private static void mainWindow(CommandSender sender, Quest quest) { private static void mainWindow(CommandSender sender, Quest quest) {
LC.info_Spliter.sendMessage(sender); LC.info_Spliter.sendMessage(sender);
RawMessage rm = new RawMessage(); RawMessage rm = new RawMessage();
rm.addText("&eName: &f" + quest.getQuestName()); rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.name") + quest.getQuestName());
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", quest.getQuestName())); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", quest.getQuestName()));
RawMessageCommand rmc = new RawMessageCommand() { RawMessageCommand rmc = new RawMessageCommand() {
@Override @Override
@ -394,7 +401,7 @@ public class editquests implements Cmd {
rm.addCommand(rmc); rm.addCommand(rmc);
String jobName = quest.getJob() == null ? "&c-" : quest.getJob().getName(); String jobName = quest.getJob() == null ? "&c-" : quest.getJob().getName();
rm.addText(" &eJob: &f" + jobName); rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.job") + jobName);
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", jobName)); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", jobName));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
@ -439,7 +446,7 @@ public class editquests implements Cmd {
}; };
rm.addCommand(rmc); rm.addCommand(rmc);
rm.addText(" &eChance: &f" + quest.getChance()); rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.chance") + quest.getChance());
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", quest.getChance())); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", quest.getChance()));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
@ -470,7 +477,7 @@ public class editquests implements Cmd {
}; };
rm.addCommand(rmc); rm.addCommand(rmc);
rm.addText(" &eEnabled: &f" + (quest.isEnabled() ? LC.info_variables_True.getLocale() : LC.info_variables_False.getLocale())); rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.enabled") + (quest.isEnabled() ? LC.info_variables_True.getLocale() : LC.info_variables_False.getLocale()));
rm.addHover(LC.info_Click.getLocale()); rm.addHover(LC.info_Click.getLocale());
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
@ -484,7 +491,7 @@ public class editquests implements Cmd {
rm.addText("\n"); rm.addText("\n");
rm.addText("&eLevel from: &f" + quest.getMinLvl()); rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.from") + quest.getMinLvl());
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", quest.getMinLvl())); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", quest.getMinLvl()));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
@ -519,7 +526,7 @@ public class editquests implements Cmd {
}; };
rm.addCommand(rmc); rm.addCommand(rmc);
rm.addText(" &eto: &f" + (quest.getMaxLvl() == null ? "-" : quest.getMaxLvl())); rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.to") + (quest.getMaxLvl() == null ? "-" : quest.getMaxLvl()));
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", (quest.getMaxLvl() == null ? "-" : quest.getMaxLvl()))); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", (quest.getMaxLvl() == null ? "-" : quest.getMaxLvl())));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
@ -561,12 +568,10 @@ public class editquests implements Cmd {
else else
objectives = tempObjectives.get(sender.getName()); objectives = tempObjectives.get(sender.getName());
String objectiveString = CMIList.listToString(objectives, " "); String objectiveString = toString(objectives);
if (objectiveString.length() > 32)
objectiveString = objectiveString.substring(0, 32) + "..";
rm.addText((objectives.isEmpty() ? "&c" : "&e") + "Objectives" + (objectiveString.isBlank() ? "" : " - &f" + objectiveString)); rm.addText((objectives.isEmpty() ? "&c" : "&e") + Jobs.getLanguage().getMessage("command.editquests.help.output.objectives") + (objectiveString.isBlank() ? "" : " - &f" + objectiveString));
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", "Objectives")); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", Jobs.getLanguage().getMessage("command.editquests.help.output.objectives")));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
public void run(CommandSender sender) { public void run(CommandSender sender) {
@ -577,12 +582,10 @@ public class editquests implements Cmd {
rm.addText("\n"); rm.addText("\n");
String rewardsString = CMIList.listToString(quest.getRewardCmds(), " "); String rewardsString = toString(quest.getRewardCmds());
if (rewardsString.length() > 32)
rewardsString = rewardsString.substring(0, 30) + "..";
rm.addText((quest.getRewardCmds().isEmpty() ? "&c" : "&e") + "Reward commands" + (rewardsString.isBlank() ? "" : " - &f" + rewardsString)); rm.addText((quest.getRewardCmds().isEmpty() ? "&c" : "&e") + Jobs.getLanguage().getMessage("command.editquests.help.output.rewards") + (rewardsString.isBlank() ? "" : " - &f" + rewardsString));
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", "Reward commands")); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", Jobs.getLanguage().getMessage("command.editquests.help.output.rewards")));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
public void run(CommandSender sender) { public void run(CommandSender sender) {
@ -592,11 +595,10 @@ public class editquests implements Cmd {
rm.addCommand(rmc); rm.addCommand(rmc);
rm.addText("\n"); rm.addText("\n");
String descString = CMIList.listToString(quest.getDescription(), " "); String descString = toString(quest.getDescription());
if (descString.length() > 32)
descString = descString.substring(0, 30) + ".."; rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.description") + (rewardsString.isBlank() ? "" : " - &f" + descString));
rm.addText("&eDescription" + (rewardsString.isBlank() ? "" : " - &f" + descString)); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", Jobs.getLanguage().getMessage("command.editquests.help.output.description")));
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", "Description"));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
public void run(CommandSender sender) { public void run(CommandSender sender) {
@ -606,11 +608,10 @@ public class editquests implements Cmd {
rm.addCommand(rmc); rm.addCommand(rmc);
rm.addText("\n"); rm.addText("\n");
String restrictedString = CMIList.listToString(quest.getRestrictedAreas(), " "); String restrictedString = toString(quest.getRestrictedAreas());
if (restrictedString.length() > 32)
restrictedString = restrictedString.substring(0, 30) + ".."; rm.addText(Jobs.getLanguage().getMessage("command.editquests.help.output.areas") + (restrictedString.isBlank() ? "" : " - &f" + restrictedString));
rm.addText("&eRestricted areas" + (restrictedString.isBlank() ? "" : " - &f" + restrictedString)); rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", Jobs.getLanguage().getMessage("command.editquests.help.output.areas")));
rm.addHover(LC.modify_editSymbolHover.getLocale("[text]", "Restricted areas"));
rmc = new RawMessageCommand() { rmc = new RawMessageCommand() {
@Override @Override
public void run(CommandSender sender) { public void run(CommandSender sender) {

View File

@ -251,6 +251,17 @@ public class LanguageManager {
c.get("command.editquests.help.args", "(page)"); c.get("command.editquests.help.args", "(page)");
c.get("command.editquests.help.output.list", "&6[questName] &7- &f[jobName]"); c.get("command.editquests.help.output.list", "&6[questName] &7- &f[jobName]");
c.get("command.editquests.help.output.name", "&eName: &f");
c.get("command.editquests.help.output.job", " &eJob: &f");
c.get("command.editquests.help.output.chance", " &eChance: &f");
c.get("command.editquests.help.output.enabled", " &eEnabled: &f");
c.get("command.editquests.help.output.from", "&eLevel from: &f");
c.get("command.editquests.help.output.to", " &eto: &f");
c.get("command.editquests.help.output.objectives", "Objectives");
c.get("command.editquests.help.output.rewards", "Reward commands");
c.get("command.editquests.help.output.description", "&eDescription");
c.get("command.editquests.help.output.areas", "&eRestricted areas");
c.get("command.blockinfo.help.info", "Shows information for the block you are looking at."); c.get("command.blockinfo.help.info", "Shows information for the block you are looking at.");
c.get("command.blockinfo.help.args", ""); c.get("command.blockinfo.help.args", "");
c.get("command.blockinfo.output.material", " &eBlock name: &6%blockname%"); c.get("command.blockinfo.output.material", " &eBlock name: &6%blockname%");