Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import forge.model.FModel;
import forge.util.Aggregates;
import forge.util.IterableUtil;
import forge.util.Localizer;
import forge.util.MyRandom;
import forge.util.StreamUtil;

Expand Down Expand Up @@ -742,7 +743,7 @@ public void giveRewards() {
rewards[3].minWins = 3;
rewards[3].maxWins = 3;
rewardDeck.setName("Drafted Deck");
rewardDeck.setComment("Prize for placing 1st overall in draft event");
rewardDeck.setComment(Forge.getLocalizer().getMessage("advPrizeDraftFirst"));
rewards[3].cardRewards = new Deck[]{rewardDeck};

} else if (format == AdventureEventController.EventFormat.Sealed) {
Expand All @@ -751,7 +752,7 @@ public void giveRewards() {
rewards[3].minWins = 3;
rewards[3].maxWins = 3;
rewardDeck.setName("Sealed Card Pool");
rewardDeck.setComment("Prize for placing 1st overall in sealed event");
rewardDeck.setComment(Forge.getLocalizer().getMessage("advPrizeSealedFirst"));
rewards[3].cardRewards = new Deck[]{rewardDeck};

} else if (format == AdventureEventController.EventFormat.Jumpstart) {
Expand Down Expand Up @@ -852,9 +853,10 @@ public void giveRewards() {
}

public String getDescription(PointOfInterestChanges changes) {
Localizer localizer = Forge.getLocalizer();
float townPriceModifier = changes == null ? 1f : changes.getTownPriceModifier();
if (format == AdventureEventController.EventFormat.Draft) {
description = "Event Type: Booster Draft\n";
description = localizer.getMessage("advEventTypeBoosterDraft");
description += "Block: " + getCardBlock() + "\n";
description += "Boosters: " + String.join(", ", packConfiguration) + "\n";
description += "Competition Style: " + participants.length + " players, matches played as best of " + eventRules.gamesPerMatch + ", " + (eventRules.getPairingDescription()) + "\n\n";
Expand Down Expand Up @@ -886,8 +888,8 @@ public String getDescription(PointOfInterestChanges changes) {
} else {
description += "\n";
}
description += "Prizes\n3 round wins: 500 gold\n2 round wins: 200 gold\n1 round win: 100 gold\n";
description += "Participating in this event will award a valueless copy of each card in your Jumpstart deck.";
description += localizer.getMessage("advDraftPrizesDesc");
description += localizer.getMessage("advJumpstartParticipationPrize");
} else if (format == AdventureEventController.EventFormat.Sealed) {
description = "Event Type: Sealed Deck\n";
description += "Block: " + getCardBlock() + "\n";
Expand All @@ -909,7 +911,7 @@ public String getDescription(PointOfInterestChanges changes) {
}

description += "Prizes\n";
description += "Champion (3 wins): Keep your Sealed pool (all " + packConfiguration.length + " boosters)\n";
description += localizer.getMessage("advSealedChampionPrize", packConfiguration.length);
description += "2+ wins: Silver Challenge Coin\n";
description += String.format("1+ wins: %s Booster, %s Booster\n", rewardPacks[1].getComment(), rewardPacks[2].getComment());
description += String.format("0 wins: %s Booster", rewardPacks[0].getComment());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import forge.Forge;
import forge.adventure.character.EnemySprite;
import forge.adventure.pointofintrest.PointOfInterest;
import forge.adventure.scene.GameScene;
Expand Down Expand Up @@ -107,7 +108,7 @@ public AdventureQuestData(AdventureQuestData data){
public AdventureQuestData()
{
declinedDialog = new DialogData();
declinedDialog.text = "Come back tomorrow and perhaps I'll have something that you'll actually be willing to do.";
declinedDialog.text = Forge.getLocalizer().getMessage("advDefaultDeclinedDialog");
DialogData dismiss = new DialogData();
dismiss.name = "(Catching the not so subtle hint, you leave.)";
declinedDialog.options = new DialogData[1];
Expand Down
3 changes: 2 additions & 1 deletion forge-gui-mobile/src/forge/adventure/data/EffectData.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package forge.adventure.data;

import com.badlogic.gdx.utils.Array;
import forge.Forge;
import forge.item.IPaperCard;
import forge.item.PaperCard;
import forge.item.PaperToken;
Expand Down Expand Up @@ -109,7 +110,7 @@ public String getDescription() {
if(goldModifier > 0.0f)
description+="Shop discount: x" + (goldModifier) + "\n";
if(cardRewardBonus > 0)
description += "Bonus enemy deck rewards: +" + (cardRewardBonus) + "\n";
description += Forge.getLocalizer().getMessage("advBonusEnemyDeckRewards", cardRewardBonus);
if(this.opponent != null) {
String oppEffect = this.opponent.getDescription();
description += "Gives Opponent:\n";
Expand Down
14 changes: 9 additions & 5 deletions forge-gui-mobile/src/forge/adventure/scene/DuelScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import forge.toolbox.FOptionPane;
import forge.trackable.TrackableCollection;
import forge.util.Aggregates;
import forge.util.Localizer;
import forge.util.StreamUtil;
import org.apache.commons.lang3.tuple.Pair;

Expand Down Expand Up @@ -243,6 +244,7 @@ private void showAnteCardsSequentially(List<PaperCard> cards, int index, boolean
}

private void showAnteCardPopup(String title, PaperCard card, boolean won, Runnable onDone) {
Localizer localizer = Forge.getLocalizer();
CardView cardView = CardView.getCardForUi(card);

FDisplayObject cardDisplay = new FDisplayObject() {
Expand Down Expand Up @@ -275,10 +277,10 @@ public void draw(Graphics g) {
if (won && eventData == null) {
int sellPrice = Current.player().cardSellPrice(card);
buttons = sellPrice > 0
? ImmutableList.of(Forge.getLocalizer().getMessage("lblOK"), "Auto-Sell (" + sellPrice + " gold)")
: ImmutableList.of(Forge.getLocalizer().getMessage("lblOK"));
? ImmutableList.of(localizer.getMessage("lblOK"), "Auto-Sell (" + sellPrice + " gold)")
: ImmutableList.of(localizer.getMessage("lblOK"));
} else {
buttons = ImmutableList.of(Forge.getLocalizer().getMessage("lblOK"));
buttons = ImmutableList.of(localizer.getMessage("lblOK"));
}

FOptionPane popup = new FOptionPane(message, null, title, null, cardDisplay, buttons, 0, result -> {
Expand Down Expand Up @@ -321,6 +323,7 @@ public void setDungeonEffect(EffectData E) {

@Override
public void enter() {
Localizer localizer = Forge.getLocalizer();
SoundSystem.instance.stopBackgroundMusic();
GameType mainGameType;
boolean isDeckMissing = false;
Expand Down Expand Up @@ -437,7 +440,8 @@ public void enter() {
if (deck == null) {
isDeckMissing = true;
boolean canUseGeneticAI = Config.instance().getConfigData().enableGeneticAI;
isDeckMissingMsg = "Deck for " + currentEnemy.getName() + " is missing! " + (this.eventData == null ? (canUseGeneticAI ? "Genetic AI deck will be used." : "Player deck will be used.") : "Player deck will be used.");
isDeckMissingMsg = localizer.getMessage("advDeckMissingForEnemy", currentEnemy.getName())
+ (this.eventData == null ? (canUseGeneticAI ? localizer.getMessage("advGeneticAiDeckWillBeUsed") : localizer.getMessage("advPlayerDeckWillBeUsed")) : localizer.getMessage("advPlayerDeckWillBeUsed"));
System.err.println(isDeckMissingMsg);
deck = this.eventData == null && canUseGeneticAI ? Aggregates.random(DeckProxy.getAllGeneticAIDecks()).getDeck() : this.playerDeck;
}
Expand Down Expand Up @@ -523,7 +527,7 @@ public void enter() {
bossDialogue = createFOption((Intro), enemy.getName(), fb, fb::dispose);
}
else {
bossDialogue = createFOption(isDeckMissing ? isDeckMissingMsg : Forge.getLocalizer().getMessage("AdvBossIntro" + Aggregates.randomInt(1, 35)),
bossDialogue = createFOption(isDeckMissing ? isDeckMissingMsg : localizer.getMessage("AdvBossIntro" + Aggregates.randomInt(1, 35)),
enemy.getName(), fb, fb::dispose);
}
matchOverlay = new LoadingOverlay(() -> FThreads.delayInEDT(300, () -> FThreads.invokeInEdtNowOrLater(() ->
Expand Down
11 changes: 6 additions & 5 deletions forge-gui-mobile/src/forge/adventure/scene/EventScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import forge.deck.DeckSection;
import forge.gui.FThreads;
import forge.screens.TransitionScreen;
import forge.util.Localizer;
import forge.util.MyRandom;

import java.util.Arrays;
Expand Down Expand Up @@ -58,6 +59,7 @@ public class EventScene extends MenuScene implements IAfterMatch {

private EventScene() {
super(Forge.isLandscapeMode() ? "ui/event.json" : "ui/event_portrait.json");
Localizer localizer = Forge.getLocalizer();
// TODO: Add translation
float townPriceModifier = changes == null ? 1f : changes.getTownPriceModifier();
DialogData introDialog = new DialogData();
Expand All @@ -78,7 +80,7 @@ private EventScene() {
enterWithShards.condition = new DialogData.ConditionData[]{hasShards};

if (currentEvent.eventRules.acceptsChallengeCoin) {
enterWithCoin.name = "Redeem a Challenge Coin [+ChallengeCoin]";
enterWithCoin.name = localizer.getMessage("advRedeemChallengeCoin");

DialogData.ConditionData hasCoin = new DialogData.ConditionData();
hasCoin.item = "Challenge Coin";
Expand All @@ -88,7 +90,7 @@ private EventScene() {
giveCoin.removeItem = hasCoin.item;
enterWithCoin.action = new DialogData.ActionData[]{giveCoin};
} else if (currentEvent.eventRules.acceptsSilverChallengeCoin) {
enterWithCoin.name = "Redeem a Challenge Coin [+SilverChallengeCoin]";
enterWithCoin.name = localizer.getMessage("advRedeemSilverChallengeCoin");
DialogData.ConditionData hasCoin = new DialogData.ConditionData();
hasCoin.item = "Silver Challenge Coin";
enterWithCoin.condition = new DialogData.ConditionData[]{hasCoin};
Expand All @@ -97,7 +99,7 @@ private EventScene() {
giveCoin.removeItem = hasCoin.item;
enterWithCoin.action = new DialogData.ActionData[]{giveCoin};
} else if (currentEvent.eventRules.acceptsBronzeChallengeCoin) {
enterWithCoin.name = "Redeem a Challenge Coin [+BronzeChallengeCoin]";
enterWithCoin.name = localizer.getMessage("advRedeemBronzeChallengeCoin");
DialogData.ConditionData hasCoin = new DialogData.ConditionData();
hasCoin.item = "Bronze Challenge Coin";
enterWithCoin.condition = new DialogData.ConditionData[]{hasCoin};
Expand Down Expand Up @@ -246,8 +248,7 @@ private void refresh() {
List<AdventureEventData.AdventureEventMatch> matches = currentEvent.getMatches(i + 1);

if (matches == null) {
//todo: add translation
round.add(Controls.newTextraLabel("Pairings not yet generated"));
round.add(Controls.newTextraLabel(Forge.getLocalizer().getMessage("advPairingsNotGenerated")));
} else {
Table roundScrollContainer = new Table(Controls.getSkin());
for (AdventureEventData.AdventureEventMatch match : matches) {
Expand Down
Loading
Loading