Make buttons translatable

This commit is contained in:
Daniel Saukel 2017-02-28 13:22:21 +01:00
parent 63421037ad
commit 92ea016603
16 changed files with 10 additions and 20 deletions

View File

@ -21,7 +21,6 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.inventory.Inventory;
import org.bukkit.scheduler.BukkitTask;

View File

@ -60,11 +60,11 @@ public class DeleteCommand extends BRCommand {
if (args.length == 2 && CompatibilityHandler.getInstance().isSpigot() && sender instanceof Player) {
ClickEvent onClickConfirm = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl delete " + args[1] + " true");
TextComponent confirm = new TextComponent(ChatColor.GREEN + "[ YES ]");
TextComponent confirm = new TextComponent(DMessages.MISC_YES.getMessage());
confirm.setClickEvent(onClickConfirm);
ClickEvent onClickDeny = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl delete " + args[1] + " false");
TextComponent deny = new TextComponent(ChatColor.DARK_RED + "[ NO ]");
TextComponent deny = new TextComponent(DMessages.MISC_NO.getMessage());
deny.setClickEvent(onClickDeny);
MessageUtil.sendMessage(sender, DMessages.CMD_DELETE_BACKUPS.getMessage());

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.global.DPortal;
import java.util.Set;

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.player.DGroup;

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import static io.github.dre2n.dungeonsxl.command.DCommands.LEAVE;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.player.DPermissions;

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;

View File

@ -18,7 +18,6 @@ package io.github.dre2n.dungeonsxl.command;
import io.github.dre2n.commons.command.BRCommand;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.player.DPermissions;
import io.github.dre2n.dungeonsxl.world.DEditWorld;

View File

@ -57,7 +57,7 @@ public class ReloadCommand extends BRCommand {
if (!dPlayers.isEmpty() && args.length == 1 && CompatibilityHandler.getInstance().isSpigot() && sender instanceof Player) {
MessageUtil.sendMessage(sender, DMessages.CMD_RELOAD_PLAYERS.getMessage());
ClickEvent onClick = new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/dungeonsxl reload -force");
String message = DefaultFontInfo.center("&a[ OK ]");
String message = DefaultFontInfo.center(DMessages.MISC_OKAY.getMessage());
TextComponent text = new TextComponent(message);
text.setClickEvent(onClick);
((Player) sender).spigot().sendMessage(text);

View File

@ -147,7 +147,7 @@ public enum DMessages implements Messages {
GROUP_CONGRATS("Group_Congrats", "&6Congratulations!"),
GROUP_CONGRATS_SUB("Group_CongratsSub", "&l&4Your group &v1 &4won the match!"),
GROUP_CREATED("Group_Created", "&4&v1&6 created the group &4&v2&6!"),
GROUP_DEATH("Group_Death", "&4&v1 &6died. &4&v2 have &4&v3 &6lives left."),
GROUP_DEATH("Group_Death", "&4&v1 &6died. &4&v2 &6have &4&v3 &6lives left."),
GROUP_DEATH_KICK("Group_DeathKick", "&4&v1 &6was kicked because &4&v2 &6have no lives left."),
GROUP_DEFEATED("Group_Defeated", "&4The group &4v1 &6is defeated because it lost its last score point."),
GROUP_DISBANDED("Group_Disbanded", "&4&v1&6 disbanded the group &4&v2&6."),
@ -176,6 +176,9 @@ public enum DMessages implements Messages {
LOG_NEW_MAP("Log_NewDungeon", "&6Creating new map."),
LOG_NEW_PLAYER_DATA("Log_NewPlayerData", "&6A new player data file has been created and saved as &v1."),
LOG_WORLD_GENERATION_FINISHED("Log_WorldGenerationFinished", "&6World generation finished!"),
MISC_NO("Misc_No", "&4[ NO ]"),
MISC_OKAY("Misc_Okay", "&a[ OK ]"),
MISC_YES("Misc_Yes", "&a[ YES ]"),
PLAYER_BLOCK_INFO("Player_BlockInfo", "&6Block ID: &2&v1"),
PLAYER_CHECKPOINT_REACHED("Player_CheckpointReached", "&6Checkpoint reached!"),
PLAYER_DEATH("Player_Death", "&4&v1 &6died and has &4&v2 &6lives left."),

View File

@ -19,7 +19,6 @@ package io.github.dre2n.dungeonsxl.player;
import io.github.dre2n.caliburn.item.UniversalItemStack;
import io.github.dre2n.commons.compatibility.CompatibilityHandler;
import io.github.dre2n.commons.compatibility.Version;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.util.DeserializationUtil;
import java.io.File;
import java.util.ArrayList;

View File

@ -75,7 +75,7 @@ public class DGroup {
private int lives = -1;
public DGroup(Player player) {
this("Group_" + DungeonsXL.getDGroups().size(), player);
this(DungeonsXL.getMainConfig().getGroupColorPriority().get(DungeonsXL.getDGroups().size()).toString(), player);
}
public DGroup(String name, Player player) {
@ -91,7 +91,7 @@ public class DGroup {
@Deprecated
public DGroup(Player player, String identifier, boolean multiFloor) {
this("Group_" + DungeonsXL.getDGroups().size(), player, identifier, multiFloor);
this(DungeonsXL.getMainConfig().getGroupColorPriority().get(DungeonsXL.getDGroups().size()).toString(), player, identifier, multiFloor);
}
@Deprecated
@ -134,7 +134,7 @@ public class DGroup {
}
public DGroup(Player player, Dungeon dungeon) {
this("Group_" + DungeonsXL.getDGroups().size(), player, dungeon);
this(DungeonsXL.getMainConfig().getGroupColorPriority().get(DungeonsXL.getDGroups().size()).toString(), player, dungeon);
}
public DGroup(String name, Player player, Dungeon dungeon) {

View File

@ -21,8 +21,6 @@ import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.config.MainConfig;
import io.github.dre2n.dungeonsxl.game.Game;
import io.github.dre2n.dungeonsxl.global.DPortal;
import io.github.dre2n.dungeonsxl.global.GlobalProtection;
import io.github.dre2n.dungeonsxl.mob.DMob;
import io.github.dre2n.dungeonsxl.trigger.UseItemTrigger;
import io.github.dre2n.dungeonsxl.util.ParsingUtil;

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.requirement;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.event.requirement.RequirementRegistrationEvent;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.sign;
import io.github.dre2n.commons.util.NumberUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

View File

@ -17,7 +17,6 @@
package io.github.dre2n.dungeonsxl.world.block;
import io.github.dre2n.commons.util.messageutil.MessageUtil;
import io.github.dre2n.dungeonsxl.DungeonsXL;
import io.github.dre2n.dungeonsxl.config.DMessages;
import io.github.dre2n.dungeonsxl.player.DGamePlayer;
import io.github.dre2n.dungeonsxl.player.DGroup;