translate some text

This commit is contained in:
CCTV-1
2019-12-17 19:49:11 +08:00
parent 2fa3179a31
commit 3846be2321
8 changed files with 296 additions and 65 deletions

View File

@@ -19,6 +19,7 @@ import forge.game.zone.ZoneType;
import forge.item.PaperCard;
import forge.util.MyRandom;
import forge.util.collect.FCollectionView;
import forge.util.Localizer;
import java.util.*;
import java.util.Map.Entry;
@@ -291,12 +292,13 @@ public class Match {
}
}
final Localizer localizer = Localizer.getInstance();
if (!rAICards.isEmpty() && !rules.getGameType().isCardPoolLimited()) {
game.getAction().revealAnte("AI can't play these cards well", rAICards);
game.getAction().revealAnte(localizer.getMessage("lblAICantPlayCards"), rAICards);
}
if (!removedAnteCards.isEmpty()) {
game.getAction().revealAnte("These ante cards were removed", removedAnteCards);
game.getAction().revealAnte(localizer.getMessage("lblAnteCardsRemoved"), removedAnteCards);
}
}

View File

@@ -36,6 +36,7 @@ import forge.screens.home.sanctioned.CSubmenuDraft;
import forge.screens.match.controllers.CDetailPicture;
import forge.toolbox.FOptionPane;
import forge.util.ItemPool;
import forge.util.Localizer;
import java.util.HashSet;
import java.util.Map.Entry;
@@ -59,6 +60,7 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
private DragCell tinyLeadersDecksParent = null;
private DragCell deckGenParent = null;
private boolean saved = false;
private final Localizer localizer = Localizer.getInstance();
//========== Constructor
@@ -186,19 +188,19 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
do{
// Cancel button will be null; OK will return string.
// Must check for null value first, then string length.
s = FOptionPane.showInputDialog("Save this draft as:", "Save Draft", FOptionPane.QUESTION_ICON);
s = FOptionPane.showInputDialog(localizer.getMessage("lblSaveDraftAs") + ":", localizer.getMessage("lblSaveDraft"), FOptionPane.QUESTION_ICON);
if (s == null && FOptionPane.showConfirmDialog(
"Quit without saving?",
"Quit Draft?", false)) {
localizer.getMessage("lblQuitWithoutSaving") + "?",
localizer.getMessage("lblQuitDraft") + "?", false)) {
FScreen.DRAFTING_PROCESS.close();
return;
}
// Overwrite same name?
else if (names.contains(s) && !FOptionPane.showConfirmDialog(
"There is already a deck named '" + s + "'. Overwrite?",
"Overwrite Deck?", false)) {
localizer.getMessage("lblAlreadyDeckName") + s + localizer.getMessage("lblOverwriteConfirm"),
localizer.getMessage("lblOverwriteDeck"), false)) {
s = "";
}
@@ -299,10 +301,8 @@ public class CEditorDraftingProcess extends ACEditorBase<PaperCard, DeckGroup> {
@Override
public boolean canSwitchAway(boolean isClosing) {
if (isClosing && !saved) {
String userPrompt =
"This will end the current draft and you will not be able to resume.\n\n" +
"Leave anyway?";
return FOptionPane.showConfirmDialog(userPrompt, "Leave Draft?", "Leave", "Cancel", false);
String userPrompt = localizer.getMessage("lblEndDraftConfirm");
return FOptionPane.showConfirmDialog(userPrompt, localizer.getMessage("lblLeaveDraft"), localizer.getMessage("lblLeave"), localizer.getMessage("lblCancel"), false);
}
return true;
}

View File

@@ -15,9 +15,11 @@ import forge.screens.FScreen;
import forge.screens.home.LoadGameMenu.LoadGameScreen;
import forge.toolbox.FOptionPane;
import forge.util.Callback;
import forge.util.Localizer;
public class DraftingProcessScreen extends FDeckEditor {
private boolean isDraftSaved;
private final Localizer localizer = Localizer.getInstance();
private final BoosterDraft draft;
private final QuestTournamentController questDraftController;
@@ -48,7 +50,7 @@ public class DraftingProcessScreen extends FDeckEditor {
return;
}
FOptionPane.showInputDialog("Save this draft as?", new Callback<String>() {
FOptionPane.showInputDialog(localizer.getMessage("lblSaveDraftAs") + "?", new Callback<String>() {
@Override
public void run(final String name) {
if (StringUtils.isEmpty(name)) {
@@ -60,8 +62,8 @@ public class DraftingProcessScreen extends FDeckEditor {
for (DeckGroup d : FModel.getDecks().getDraft()) {
if (name.equalsIgnoreCase(d.getName())) {
FOptionPane.showConfirmDialog(
"There is already a deck named '" + name + "'. Overwrite?",
"Overwrite Deck?", false, new Callback<Boolean>() {
localizer.getMessage("lblAlreadyDeckName") + name + localizer.getMessage("lblOverwriteConfirm"),
localizer.getMessage("lblOverwriteDeck"), false, new Callback<Boolean>() {
@Override
public void run(Boolean result) {
if (result) {
@@ -142,8 +144,7 @@ public class DraftingProcessScreen extends FDeckEditor {
return;
}
FOptionPane.showConfirmDialog("This will end the current draft and you will not be able to resume.\n\n" +
"Leave anyway?", "Leave Draft?", "Leave", "Cancel", false, canCloseCallback);
FOptionPane.showConfirmDialog(localizer.getMessage("lblEndDraftConfirm"), localizer.getMessage("lblLeaveDraft"), localizer.getMessage("lblLeave"), localizer.getMessage("lblCancel"), false, canCloseCallback);
}
@Override

View File

@@ -1411,3 +1411,62 @@ lblFailedTournament=You have failed to pass the tournament.
#GauntletWinLoseController.java
lblGauntletTournament=You made it through the gauntlet!
lblFailedGauntlet=You have failed to pass the gauntlet.
#QuestTournamentController.java
lblLeaveTournamentDraftWarning1=If you leave now, this tournament will be forever gone.\nYou will keep the cards you drafted, but will receive no other prizes.\n\nWould you still like to quit the tournament?
lblLeaveTournamentDraftWarning2=You have matches left to play!\nLeaving the tournament early will forfeit your potential future winnings.\nYou will still receive winnings as if you conceded your next match and you will keep the cards you drafted.\n\nWould you still like to quit the tournament?
lblReallyQuit=Really Quit?
lblForPlacing=For placing
lblHaveBeAward=, you have been awarded
lblTournamentReward=Tournament Reward
lblParticipateingTournamentReward=For participating in the tournament, you have been awarded the following promotional card:
lblCreditsAwarded=Credits Awarded
lblBoosterPack=Booster Pack
lblAwarded=Awarded
lblFoundCards=You have found the following cards inside
lblRareAwarded=Rare Awarded
lblSelectRareAwarded=, you may select a rare or mythic rare card from the drafted block.
lblSelectACard=Select a Card
lblSelectKeepCard=Select a card to keep:
lblAddToCollection=has been added to your collection!
lblCardAdded=Card Added
lblBonusToken=Bonus Token
lblHaveBeAwardToken=, you have been awarded a token!\nUse tokens to create new drafts to play.
lblWouldLikeSaveDraft=Would you like to save this draft to the regular draft mode?
lblSaveDraft=Save Draft
lblNoAvailableDraftsMessage=You do not have any draft-able sets unlocked!\nCome back later when you've unlocked more sets.
lblNoAvailableDrafts=No Available Drafts
lblEntryFeeOfDraftTournament=The entry fee for this booster draft tournament is
lblWouldLikeCreateTournament= credits.\nWould you like to spend a token and create this tournament?
lblCreatingDraftTournament=Creating a Booster Draft Tournament
lblUnexpectedCreatingDraftTournament=Unexpected error when creating a draft tournament
lblPleaseReportBug=. Please report this as a bug.
lbl1stPlace=1st Place:
lbl2ndPlace=2nd Place:
lbl3rdPlace=3rd Place:
lbl4thPlace=4th Place:
lblTime= time
lblCollectPrizes=Collect Prizes
lblCurrentlyInDraft=You are currently in a draft.\nYou should leave or finish that draft before starting another.
lblYouNeed=You need
lblMoreCredits=more credits to enter this tournament.
lblNotEnoughCredits=Not Enough Credits
lblTournamentCosts=This tournament costs
lblSureEnterTournament= credits to enter.\nAre you sure you wish to enter?
lblEnterDraftTournament=Enter Draft Tournament?
lblLeaveDraftConfirm=This will end the current draft and you will not be able to join this tournament again.\nYour credits will be refunded and the draft will be removed.\n\nLeave anyway?
lblLeave=Leave
lblDeckInvalid=Deck Invalid
lblAlreadyMatchPleaseWait=There is already a match in progress.\nPlease wait for the current round to end before attempting to continue.
#DraftingProcessScreen.java
lblSaveDraftAs=Save this draft as
lblAlreadyDeckName=There is already a deck named '
lblOverwriteConfirm='. Overwrite?
lblOverwriteDeck=Overwrite Deck?
lblEndDraftConfirm=This will end the current draft and you will not be able to resume.\n\nLeave anyway?
lblLeaveDraft=Leave Draft?
#Match.java
lblAICantPlayCards=AI can't play these cards well
lblAnteCardsRemoved=These ante cards were removed
#CEditorDraftingProcess.java
lblQuitWithoutSaving=Quit without saving
lblQuitDraft=Quit Draft

View File

@@ -1411,3 +1411,62 @@ lblFailedTournament=You have failed to pass the tournament.
#GauntletWinLoseController.java
lblGauntletTournament=You made it through the gauntlet!
lblFailedGauntlet=You have failed to pass the gauntlet.
#QuestTournamentController.java
lblLeaveTournamentDraftWarning1=If you leave now, this tournament will be forever gone.\nYou will keep the cards you drafted, but will receive no other prizes.\n\nWould you still like to quit the tournament?
lblLeaveTournamentDraftWarning2=You have matches left to play!\nLeaving the tournament early will forfeit your potential future winnings.\nYou will still receive winnings as if you conceded your next match and you will keep the cards you drafted.\n\nWould you still like to quit the tournament?
lblReallyQuit=Really Quit?
lblForPlacing=For placing
lblHaveBeAward=, you have been awarded
lblTournamentReward=Tournament Reward
lblParticipateingTournamentReward=For participating in the tournament, you have been awarded the following promotional card:
lblCreditsAwarded=Credits Awarded
lblBoosterPack=Booster Pack
lblAwarded=Awarded
lblFoundCards=You have found the following cards inside
lblRareAwarded=Rare Awarded
lblSelectRareAwarded=, you may select a rare or mythic rare card from the drafted block.
lblSelectACard=Select a Card
lblSelectKeepCard=Select a card to keep:
lblAddToCollection=has been added to your collection!
lblCardAdded=Card Added
lblBonusToken=Bonus Token
lblHaveBeAwardToken=, you have been awarded a token!\nUse tokens to create new drafts to play.
lblWouldLikeSaveDraft=Would you like to save this draft to the regular draft mode?
lblSaveDraft=Save Draft
lblNoAvailableDraftsMessage=You do not have any draft-able sets unlocked!\nCome back later when you've unlocked more sets.
lblNoAvailableDrafts=No Available Drafts
lblEntryFeeOfDraftTournament=The entry fee for this booster draft tournament is
lblWouldLikeCreateTournament= credits.\nWould you like to spend a token and create this tournament?
lblCreatingDraftTournament=Creating a Booster Draft Tournament
lblUnexpectedCreatingDraftTournament=Unexpected error when creating a draft tournament
lblPleaseReportBug=. Please report this as a bug.
lbl1stPlace=1st Place:
lbl2ndPlace=2nd Place:
lbl3rdPlace=3rd Place:
lbl4thPlace=4th Place:
lblTime= time
lblCollectPrizes=Collect Prizes
lblCurrentlyInDraft=You are currently in a draft.\nYou should leave or finish that draft before starting another.
lblYouNeed=You need
lblMoreCredits=more credits to enter this tournament.
lblNotEnoughCredits=Not Enough Credits
lblTournamentCosts=This tournament costs
lblSureEnterTournament= credits to enter.\nAre you sure you wish to enter?
lblEnterDraftTournament=Enter Draft Tournament?
lblLeaveDraftConfirm=This will end the current draft and you will not be able to join this tournament again.\nYour credits will be refunded and the draft will be removed.\n\nLeave anyway?
lblLeave=Leave
lblDeckInvalid=Deck Invalid
lblAlreadyMatchPleaseWait=There is already a match in progress.\nPlease wait for the current round to end before attempting to continue.
#DraftingProcessScreen.java
lblSaveDraftAs=Save this draft as
lblAlreadyDeckName=There is already a deck named '
lblOverwriteConfirm='. Overwrite?
lblOverwriteDeck=Overwrite Deck?
lblEndDraftConfirm=This will end the current draft and you will not be able to resume.\n\nLeave anyway?
lblLeaveDraft=Leave Draft?
#Match.java
lblAICantPlayCards=AI can't play these cards well
lblAnteCardsRemoved=These ante cards were removed
#CEditorDraftingProcess.java
lblQuitWithoutSaving=Quit without saving
lblQuitDraft=Quit Draft

View File

@@ -1411,3 +1411,62 @@ lblFailedTournament=No has conseguido pasar el torneo.
#GauntletWinLoseController.java
lblGauntletTournament=¡Conseguiste superar el desafío!
lblFailedGauntlet=No has podido superar el desafío.
#QuestTournamentController.java
lblLeaveTournamentDraftWarning1=If you leave now, this tournament will be forever gone.\nYou will keep the cards you drafted, but will receive no other prizes.\n\nWould you still like to quit the tournament?
lblLeaveTournamentDraftWarning2=You have matches left to play!\nLeaving the tournament early will forfeit your potential future winnings.\nYou will still receive winnings as if you conceded your next match and you will keep the cards you drafted.\n\nWould you still like to quit the tournament?
lblReallyQuit=Really Quit?
lblForPlacing=For placing
lblHaveBeAward=, you have been awarded
lblTournamentReward=Tournament Reward
lblParticipateingTournamentReward=For participating in the tournament, you have been awarded the following promotional card:
lblCreditsAwarded=Credits Awarded
lblBoosterPack=Booster Pack
lblAwarded=Awarded
lblFoundCards=You have found the following cards inside
lblRareAwarded=Rare Awarded
lblSelectRareAwarded=, you may select a rare or mythic rare card from the drafted block.
lblSelectACard=Select a Card
lblSelectKeepCard=Select a card to keep:
lblAddToCollection=has been added to your collection!
lblCardAdded=Card Added
lblBonusToken=Bonus Token
lblHaveBeAwardToken=, you have been awarded a token!\nUse tokens to create new drafts to play.
lblWouldLikeSaveDraft=Would you like to save this draft to the regular draft mode?
lblSaveDraft=Save Draft
lblNoAvailableDraftsMessage=You do not have any draft-able sets unlocked!\nCome back later when you've unlocked more sets.
lblNoAvailableDrafts=No Available Drafts
lblEntryFeeOfDraftTournament=The entry fee for this booster draft tournament is
lblWouldLikeCreateTournament= credits.\nWould you like to spend a token and create this tournament?
lblCreatingDraftTournament=Creating a Booster Draft Tournament
lblUnexpectedCreatingDraftTournament=Unexpected error when creating a draft tournament
lblPleaseReportBug=. Please report this as a bug.
lbl1stPlace=1st Place:
lbl2ndPlace=2nd Place:
lbl3rdPlace=3rd Place:
lbl4thPlace=4th Place:
lblTime= time
lblCollectPrizes=Collect Prizes
lblCurrentlyInDraft=You are currently in a draft.\nYou should leave or finish that draft before starting another.
lblYouNeed=You need
lblMoreCredits=more credits to enter this tournament.
lblNotEnoughCredits=Not Enough Credits
lblTournamentCosts=This tournament costs
lblSureEnterTournament= credits to enter.\nAre you sure you wish to enter?
lblEnterDraftTournament=Enter Draft Tournament?
lblLeaveDraftConfirm=This will end the current draft and you will not be able to join this tournament again.\nYour credits will be refunded and the draft will be removed.\n\nLeave anyway?
lblLeave=Leave
lblDeckInvalid=Deck Invalid
lblAlreadyMatchPleaseWait=There is already a match in progress.\nPlease wait for the current round to end before attempting to continue.
#DraftingProcessScreen.java
lblSaveDraftAs=Save this draft as
lblAlreadyDeckName=There is already a deck named '
lblOverwriteConfirm='. Overwrite?
lblOverwriteDeck=Overwrite Deck?
lblEndDraftConfirm=This will end the current draft and you will not be able to resume.\n\nLeave anyway?
lblLeaveDraft=Leave Draft?
#Match.java
lblAICantPlayCards=AI can't play these cards well
lblAnteCardsRemoved=These ante cards were removed
#CEditorDraftingProcess.java
lblQuitWithoutSaving=Quit without saving
lblQuitDraft=Quit Draft

View File

@@ -1411,3 +1411,62 @@ lblFailedTournament=你未能通关锦标赛。
#GauntletWinLoseController.java
lblGauntletTournament=你通关了决斗!
lblFailedGauntlet=你未能通关决斗。
#QuestTournamentController.java
lblLeaveTournamentDraftWarning1=如果你现在离开,这场比赛将会永远消失。\n你将保留自己所选的所有牌但是无法获得任何其他的奖励。\n\n你是否仍然打算退出比赛
lblLeaveTournamentDraftWarning2=你还有没打完的比赛!\n提前离开锦标赛会使你失去可能得到的奖励\n你将获得等同与输掉下一轮比赛的奖励并且保留所选的所有牌。\n\n你是否仍然打算退出比赛
lblReallyQuit=真的退出?
lblForPlacing=放于
lblHaveBeAward= 你获得了奖励
lblTournamentReward=锦标赛奖励
lblParticipateingTournamentReward=参加锦标赛,你将获得以下单卡奖励:
lblCreditsAwarded=积分奖励
lblBoosterPack=补充包
lblAwarded=奖励
lblFoundCards=你在里面找到了以下卡牌
lblRareAwarded=稀有奖励
lblSelectRareAwarded= 你可以在抓选区选择一张稀有或秘稀牌。
lblSelectACard=选择一张牌
lblSelectKeepCard=选择一张牌保留:
lblAddToCollection=已经添加到你的收藏!
lblCardAdded=卡已添加
lblBonusToken=门票奖励
lblHaveBeAwardToken= 你已经得到了门票奖励!\n使用门票可以创建新的轮抓然后玩。
lblWouldLikeSaveDraft=你想把这个轮抓保存为常规模式轮抓吗?
lblSaveDraft=保存轮抓
lblNoAvailableDraftsMessage=你没有解锁任何可用的轮抓系列!\n请解锁更多轮抓系列再来。
lblNoAvailableDrafts=没有可用的轮抓
lblEntryFeeOfDraftTournament=这场补充包轮抓锦标赛的入场费为
lblWouldLikeCreateTournament= 积分。\n你想使用一个门票来创建这场锦标赛吗
lblCreatingDraftTournament=创建补充包轮抓锦标赛
lblUnexpectedCreatingDraftTournament=创建补充包轮抓锦标赛时出现意外错误
lblPleaseReportBug=。 请将这个错误报告。
lbl1stPlace=第一名:
lbl2ndPlace=第二名:
lbl3rdPlace=第三名:
lbl4thPlace=第四名:
lblTime= 时间
lblCollectPrizes=收藏品
lblCurrentlyInDraft=你现在正在一场轮抓中。\n你应该先离开轮抓或者玩完这场轮抓然后再开始新的轮抓。
lblYouNeed=你还需要
lblMoreCredits=积分才可以参与这场锦标赛。
lblNotEnoughCredits=积分不足
lblTournamentCosts=这次锦标赛的费用为
lblSureEnterTournament= 积分。\n你确定要进入吗
lblEnterDraftTournament=进入轮抓锦标赛?
lblLeaveDraftConfirm=这将结束当前轮抓,你将无法再次加入此锦标赛。\n你的积分将被退还轮抓将被删除。\n\n仍然要离开吗
lblLeave=离开
lblDeckInvalid=套牌无效
lblAlreadyMatchPleaseWait=比赛处于进行中。\n请等当前轮结束后再来尝试。
#DraftingProcessScreen.java
lblSaveDraftAs=保存此轮抓为
lblAlreadyDeckName=已经存在的套牌名
lblOverwriteConfirm=’。 覆盖?
lblOverwriteDeck=覆盖套牌?
lblEndDraftConfirm=这将结束当前的轮抓并且无法恢复\n\n离开轮抓吗
lblLeaveDraft=离开轮抓?
#Match.java
lblAICantPlayCards=人工智能不知道如何使用这些牌
lblAnteCardsRemoved=这些赌注牌已删除
#CEditorDraftingProcess.java
lblQuitWithoutSaving=不保存直接退出
lblQuitDraft=退出轮抓

View File

@@ -27,9 +27,11 @@ import forge.util.TextUtil;
import forge.util.gui.SGuiChoose;
import forge.util.gui.SOptionPane;
import forge.util.storage.IStorage;
import forge.util.Localizer;
public class QuestTournamentController {
private final IQuestTournamentView view;
private final Localizer localizer = Localizer.getInstance();
private boolean drafting = false;
private IGuiGame gui = null;
@@ -68,18 +70,14 @@ public class QuestTournamentController {
final QuestEventDraft draft = FModel.getQuest().getAchievements().getCurrentDraft();
if (!draft.isStarted()) {
final boolean shouldQuit = SOptionPane.showOptionDialog("If you leave now, this tournament will be forever gone."
+ "\nYou will keep the cards you drafted, but will receive no other prizes."
+ "\n\nWould you still like to quit the tournament?", "Really Quit?", SOptionPane.WARNING_ICON, ImmutableList.of("Yes", "No"), 1) == 0;
final boolean shouldQuit = SOptionPane.showOptionDialog(localizer.getMessage("lblLeaveTournamentDraftWarning1"), localizer.getMessage("lblReallyQuit"), SOptionPane.WARNING_ICON, ImmutableList.of(localizer.getMessage("lblYes"), localizer.getMessage("lblNo")), 1) == 0;
if (!shouldQuit) {
return;
}
}
else {
if (draft.playerHasMatchesLeft()) {
final boolean shouldQuit = SOptionPane.showOptionDialog("You have matches left to play!\nLeaving the tournament early will forfeit your potential future winnings."
+ "\nYou will still receive winnings as if you conceded your next match and you will keep the cards you drafted."
+ "\n\nWould you still like to quit the tournament?", "Really Quit?", SOptionPane.WARNING_ICON, ImmutableList.of("Yes", "No"), 1) == 0;
final boolean shouldQuit = SOptionPane.showOptionDialog(localizer.getMessage("lblLeaveTournamentDraftWarning2"), localizer.getMessage("lblReallyQuit"), SOptionPane.WARNING_ICON, ImmutableList.of(localizer.getMessage("lblYes"), localizer.getMessage("lblNo")), 1) == 0;
if (!shouldQuit) {
return;
}
@@ -90,17 +88,17 @@ public class QuestTournamentController {
final QuestEventDraft.QuestDraftPrizes prizes = draft.collectPrizes();
if (prizes.hasCredits()) {
SOptionPane.showMessageDialog("For placing " + placement + ", you have been awarded " + QuestUtil.formatCredits(prizes.credits) + " credits!", "Credits Awarded", FSkinProp.ICO_QUEST_GOLD);
SOptionPane.showMessageDialog(localizer.getMessage("lblForPlacing") + placement + localizer.getMessage("lblHaveBeAward") + QuestUtil.formatCredits(prizes.credits) + " " + localizer.getMessage("lblCredits") + "!", localizer.getMessage("lblCreditsAwarded"), FSkinProp.ICO_QUEST_GOLD);
}
if (prizes.hasIndividualCards()) {
GuiBase.getInterface().showCardList("Tournament Reward", "For participating in the tournament, you have been awarded the following promotional card:", prizes.individualCards);
GuiBase.getInterface().showCardList(localizer.getMessage("lblTournamentReward"), localizer.getMessage("lblParticipateingTournamentReward"), prizes.individualCards);
}
if (prizes.hasBoosterPacks()) {
final String packPlural = (prizes.boosterPacks.size() == 1) ? "" : "s";
SOptionPane.showMessageDialog("For placing " + placement + ", you have been awarded " + prizes.boosterPacks.size() + " booster pack" + packPlural + "!", "Booster Pack" + packPlural + " Awarded", FSkinProp.ICO_QUEST_BOX);
SOptionPane.showMessageDialog(localizer.getMessage("lblForPlacing") + placement + localizer.getMessage("lblHaveBeAward") + prizes.boosterPacks.size() + " " + localizer.getMessage("lblBoosterPack") + packPlural + "!", localizer.getMessage("lblBoosterPack") + packPlural + " " + localizer.getMessage("lblAwarded"), FSkinProp.ICO_QUEST_BOX);
if (FModel.getPreferences().getPrefBoolean(FPref.UI_OPEN_PACKS_INDIV) && prizes.boosterPacks.size() > 1) {
boolean skipTheRest = false;
@@ -118,11 +116,11 @@ public class QuestTournamentController {
continue;
}
skipTheRest = GuiBase.getInterface().showBoxedProduct(pack.getName(), "You have found the following cards inside (Booster Pack " + currentPack + " of " + totalPacks + "):", pack.getCards());
skipTheRest = GuiBase.getInterface().showBoxedProduct(pack.getName(), localizer.getMessage("lblFoundCards") + " (" + localizer.getMessage("lblBoosterPack") + " " + currentPack + " / " + totalPacks + "):", pack.getCards());
}
if (skipTheRest && !remainingCards.isEmpty()) {
GuiBase.getInterface().showCardList("Tournament Reward", "You have found the following cards inside:", remainingCards);
GuiBase.getInterface().showCardList(localizer.getMessage("lblTournamentReward"), localizer.getMessage("lblFoundCards") + ":", remainingCards);
}
}
else {
@@ -133,27 +131,27 @@ public class QuestTournamentController {
cards.addAll(pack.getCards());
}
GuiBase.getInterface().showCardList("Tournament Reward", "You have found the following cards inside:", cards);
GuiBase.getInterface().showCardList(localizer.getMessage("lblTournamentReward"), localizer.getMessage("lblFoundCards") + ":", cards);
}
}
if (prizes.selectRareFromSets()) {
SOptionPane.showMessageDialog("For placing " + placement + ", you may select a rare or mythic rare card from the drafted block.", "Rare Awarded", FSkinProp.ICO_QUEST_STAKES);
SOptionPane.showMessageDialog(localizer.getMessage("lblForPlacing") + placement + localizer.getMessage("lblSelectRareAwarded"), localizer.getMessage("lblRareAwarded"), FSkinProp.ICO_QUEST_STAKES);
final PaperCard card = GuiBase.getInterface().chooseCard("Select a Card", "Select a card to keep:", prizes.selectRareCards);
final PaperCard card = GuiBase.getInterface().chooseCard(localizer.getMessage("lblSelectACard"), localizer.getMessage("lblSelectKeepCard"), prizes.selectRareCards);
prizes.addSelectedCard(card);
SOptionPane.showMessageDialog("'" + card.getName() + "' has been added to your collection!", "Card Added", FSkinProp.ICO_QUEST_STAKES);
SOptionPane.showMessageDialog("'" + card.getName() + "' " + localizer.getMessage("lblAddToCollection"), localizer.getMessage("lblCardAdded"), FSkinProp.ICO_QUEST_STAKES);
}
if (draft.getPlayerPlacement() == 1) {
SOptionPane.showMessageDialog("For placing " + placement + ", you have been awarded a token!\nUse tokens to create new drafts to play.", "Bonus Token", FSkinProp.ICO_QUEST_NOTES);
SOptionPane.showMessageDialog(localizer.getMessage("lblForPlacing") + placement + localizer.getMessage("lblHaveBeAwardToken"), localizer.getMessage("lblBonusToken"), FSkinProp.ICO_QUEST_NOTES);
FModel.getQuest().getAchievements().addDraftToken();
}
}
final boolean saveDraft = SOptionPane.showOptionDialog("Would you like to save this draft to the regular draft mode?", "Save Draft?", SOptionPane.QUESTION_ICON, ImmutableList.of("Yes", "No"), 0) == 0;
final boolean saveDraft = SOptionPane.showOptionDialog(localizer.getMessage("lblWouldLikeSaveDraft"), localizer.getMessage("lblSaveDraft") + "?", SOptionPane.QUESTION_ICON, ImmutableList.of(localizer.getMessage("lblYes"), localizer.getMessage("lblNo")), 0) == 0;
if (saveDraft) {
draft.saveToRegularDraft();
}
@@ -170,26 +168,23 @@ public class QuestTournamentController {
List<QuestDraftFormat> formats = QuestEventDraft.getAvailableFormats(FModel.getQuest());
if (formats.isEmpty()) {
SOptionPane.showErrorDialog(
"You do not have any draft-able sets unlocked!\n" +
"Come back later when you've unlocked more sets.",
"No Available Drafts");
SOptionPane.showErrorDialog(localizer.getMessage("lblNoAvailableDraftsMessage"),localizer.getMessage("lblNoAvailableDrafts"));
return;
}
final QuestDraftFormat format = SGuiChoose.oneOrNone("Choose Draft Format", formats);
final QuestDraftFormat format = SGuiChoose.oneOrNone(localizer.getMessage("lblChooseDraftFormat"), formats);
if (format != null) {
QuestEventDraft evt = QuestEventDraft.getDraftOrNull(FModel.getQuest(), format);
if (evt != null) {
String fee = TextUtil.concatNoSpace("The entry fee for this booster draft tournament is ", String.valueOf(evt.getEntryFee()), " credits.\nWould you like to spend a token and create this tournament?");
if (SOptionPane.showConfirmDialog(fee, "Creating a Booster Draft Tournament")) {
String fee = TextUtil.concatNoSpace(localizer.getMessage("lblEntryFeeOfDraftTournament"), String.valueOf(evt.getEntryFee()), localizer.getMessage("lblWouldLikeCreateTournament"));
if (SOptionPane.showConfirmDialog(fee, localizer.getMessage("lblCreatingDraftTournament"))) {
achievements.spendDraftToken(format);
update();
view.populate();
}
} else {
SOptionPane.showErrorDialog("Unexpected error when creating a draft tournament " + format.getName() + ". Please report this as a bug.");
SOptionPane.showErrorDialog(localizer.getMessage("lblUnexpectedCreatingDraftTournament") + format.getName() + localizer.getMessage("lblPleaseReportBug"));
System.err.println("Error creating booster draft tournament (QuestEventDraft object was null): " + format.getName());
}
}
@@ -241,7 +236,7 @@ public class QuestTournamentController {
}
private void updateSelectTournament() {
view.getLblCredits().setText("Credits: " + QuestUtil.formatCredits(FModel.getQuest().getAssets().getCredits()));
view.getLblCredits().setText(localizer.getMessage("lblCredits") + ": " + QuestUtil.formatCredits(FModel.getQuest().getAssets().getCredits()));
final QuestAchievements achievements = FModel.getQuest().getAchievements();
achievements.generateDrafts();
@@ -258,12 +253,12 @@ public class QuestTournamentController {
view.updateEventList(null);
}
view.getLblFirst().setText("1st Place: " + achievements.getWinsForPlace(1) + " time" + (achievements.getWinsForPlace(1) == 1 ? "" : "s"));
view.getLblSecond().setText("2nd Place: " + achievements.getWinsForPlace(2) + " time" + (achievements.getWinsForPlace(2) == 1 ? "" : "s"));
view.getLblThird().setText("3rd Place: " + achievements.getWinsForPlace(3) + " time" + (achievements.getWinsForPlace(3) == 1 ? "" : "s"));
view.getLblFourth().setText("4th Place: " + achievements.getWinsForPlace(4) + " time" + (achievements.getWinsForPlace(4) == 1 ? "" : "s"));
view.getLblFirst().setText(localizer.getMessage("lbl1stPlace") + achievements.getWinsForPlace(1) + localizer.getMessage("lblTime") + (achievements.getWinsForPlace(1) == 1 ? "" : "s"));
view.getLblSecond().setText(localizer.getMessage("lbl2ndPlace") + achievements.getWinsForPlace(2) + localizer.getMessage("lblTime") + (achievements.getWinsForPlace(2) == 1 ? "" : "s"));
view.getLblThird().setText(localizer.getMessage("lbl3rdPlace") + achievements.getWinsForPlace(3) + localizer.getMessage("lblTime") + (achievements.getWinsForPlace(3) == 1 ? "" : "s"));
view.getLblFourth().setText(localizer.getMessage("lbl4thPlace") + achievements.getWinsForPlace(4) + localizer.getMessage("lblTime") + (achievements.getWinsForPlace(4) == 1 ? "" : "s"));
view.getBtnSpendToken().setText("Spend Token (" + achievements.getDraftTokens() + ")");
view.getBtnSpendToken().setText(localizer.getMessage("btnSpendToken") + " (" + achievements.getDraftTokens() + ")");
view.getBtnSpendToken().setEnabled(achievements.getDraftTokens() > 0);
}
@@ -308,10 +303,10 @@ public class QuestTournamentController {
}
if (FModel.getQuest().getAchievements().getCurrentDraft().playerHasMatchesLeft()) {
view.getBtnLeaveTournament().setText("Leave Tournament");
view.getBtnLeaveTournament().setText(localizer.getMessage("btnLeaveTournament"));
}
else {
view.getBtnLeaveTournament().setText("Collect Prizes");
view.getBtnLeaveTournament().setText(localizer.getMessage("lblCollectPrizes"));
}
}
@@ -367,10 +362,10 @@ public class QuestTournamentController {
}
if (draft.playerHasMatchesLeft()) {
view.getBtnLeaveTournament().setText("Leave Tournament");
view.getBtnLeaveTournament().setText(localizer.getMessage("btnLeaveTournament"));
}
else {
view.getBtnLeaveTournament().setText("Collect Prizes");
view.getBtnLeaveTournament().setText(localizer.getMessage("lblCollectPrizes"));
}
}
@@ -387,8 +382,7 @@ public class QuestTournamentController {
public void startDraft() {
if (drafting) {
SOptionPane.showErrorDialog("You are currently in a draft.\n" +
"You should leave or finish that draft before starting another.");
SOptionPane.showErrorDialog(localizer.getMessage("lblCurrentlyInDraft"));
return;
}
@@ -396,11 +390,11 @@ public class QuestTournamentController {
final long creditsAvailable = FModel.getQuest().getAssets().getCredits();
if (draftEvent.canEnter()) {
SOptionPane.showMessageDialog("You need " + QuestUtil.formatCredits(draftEvent.getEntryFee() - creditsAvailable) + " more credits to enter this tournament.", "Not Enough Credits", SOptionPane.WARNING_ICON);
SOptionPane.showMessageDialog(localizer.getMessage("lblYouNeed") + QuestUtil.formatCredits(draftEvent.getEntryFee() - creditsAvailable) + " " + localizer.getMessage("lblMoreCredits"), localizer.getMessage("lblNotEnoughCredits"), SOptionPane.WARNING_ICON);
return;
}
final boolean okayToEnter = SOptionPane.showOptionDialog("This tournament costs " + QuestUtil.formatCredits(draftEvent.getEntryFee()) + " credits to enter.\nAre you sure you wish to enter?", "Enter Draft Tournament?", FSkinProp.ICO_QUEST_GOLD, ImmutableList.of("Yes", "No"), 1) == 0;
final boolean okayToEnter = SOptionPane.showOptionDialog(localizer.getMessage("lblTournamentCosts") + QuestUtil.formatCredits(draftEvent.getEntryFee()) + localizer.getMessage("lblSureEnterTournament"), localizer.getMessage("lblEnterDraftTournament"), FSkinProp.ICO_QUEST_GOLD, ImmutableList.of(localizer.getMessage("lblYes"), localizer.getMessage("lblNo")), 1) == 0;
if (!okayToEnter) {
return;
@@ -413,8 +407,7 @@ public class QuestTournamentController {
}
public boolean cancelDraft() {
if (SOptionPane.showConfirmDialog("This will end the current draft and you will not be able to join this tournament again.\nYour credits will be refunded and the draft will be removed.\n\n" +
"Leave anyway?", "Leave Draft?", "Leave", "Cancel", false)) {
if (SOptionPane.showConfirmDialog(localizer.getMessage("lblLeaveDraftConfirm"), localizer.getMessage("lblLeaveDraft") + "?", localizer.getMessage("lblLeave"), localizer.getMessage("lblCancel"), false)) {
drafting = false;
QuestController quest = FModel.getQuest();
@@ -433,7 +426,7 @@ public class QuestTournamentController {
final String message = GameType.QuestDraft.getDeckFormat().getDeckConformanceProblem(FModel.getQuest().getAssets().getDraftDeckStorage().get(QuestEventDraft.DECK_NAME).getHumanDeck());
if (message != null && FModel.getPreferences().getPrefBoolean(FPref.ENFORCE_DECK_LEGALITY)) {
SOptionPane.showMessageDialog("Deck " + message, "Deck Invalid");
SOptionPane.showMessageDialog(localizer.getMessage("lblDeck") + " " + message, localizer.getMessage("lblDeckInvalid"));
return;
}
@@ -449,13 +442,12 @@ public class QuestTournamentController {
final String message = QuestDraftUtils.getDeckLegality();
if (message != null) {
SOptionPane.showMessageDialog(message, "Deck Invalid");
SOptionPane.showMessageDialog(message, localizer.getMessage("lblDeckInvalid"));
return;
}
if (QuestDraftUtils.matchInProgress) {
SOptionPane.showErrorDialog("There is already a match in progress.\n" +
"Please wait for the current round to end before attempting to continue.");
SOptionPane.showErrorDialog(localizer.getMessage("lblAlreadyMatchPleaseWait"));
return;
}