From c3d9a501c6a8fb417d8b0f32c0f681c3ff338cba Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 8 Nov 2022 21:44:47 -0500 Subject: [PATCH] Campaign completion text in bundle --- core/assets/bundles/bundle.properties | 3 +++ .../ui/dialogs/CampaignCompleteDialog.java | 14 +++++++++++--- gradle.properties | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 34336515c2..e802a99fcf 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -681,6 +681,9 @@ weather.sandstorm.name = Sandstorm weather.sporestorm.name = Sporestorm weather.fog.name = Fog +campaign.playtime = \uF129 [lightgray]Sector Playtime: {0} +campaign.complete = [accent]Congratulations.\n\nThe enemy on {0} has been defeated.\n[lightgray]The final sector has been conquered. + sectorlist = Sectors sectorlist.attacked = {0} under attack sectors.unexplored = [lightgray]Unexplored diff --git a/core/src/mindustry/ui/dialogs/CampaignCompleteDialog.java b/core/src/mindustry/ui/dialogs/CampaignCompleteDialog.java index ed5e2d21ee..2a6dc57084 100644 --- a/core/src/mindustry/ui/dialogs/CampaignCompleteDialog.java +++ b/core/src/mindustry/ui/dialogs/CampaignCompleteDialog.java @@ -1,10 +1,15 @@ package mindustry.ui.dialogs; +import arc.*; +import arc.math.*; +import arc.scene.actions.*; import mindustry.*; import mindustry.core.*; import mindustry.gen.*; import mindustry.type.*; +import static arc.scene.actions.Actions.*; + public class CampaignCompleteDialog extends BaseDialog{ public CampaignCompleteDialog(){ @@ -26,13 +31,16 @@ public class CampaignCompleteDialog extends BaseDialog{ //TODO obviously needs different text. cont.clear(); - cont.add("[accent]Congratulations.\nThe enemy on " + planet.localizedName + " has been defeated.\n\nThe final sector has been conquered.").row(); + cont.add(Core.bundle.format("campaign.complete", "[#" + planet.iconColor + "]" + planet.localizedName + "[]")).row(); float playtime = planet.sectors.sumf(s -> s.hasSave() ? s.save.meta.timePlayed : 0) / 1000f; //TODO needs more info - cont.add("Total Playtime: " + UI.formatTime(playtime)).left().row(); + cont.add(Core.bundle.format("campaign.playtime", UI.formatTime(playtime))).left().row(); - show(); + setTranslation(0f, -Core.graphics.getHeight()); + color.a = 0f; + + show(Core.scene, Actions.sequence(parallel(fadeIn(1.1f, Interp.fade), translateBy(0f, Core.graphics.getHeight(), 6f, Interp.pow5Out)))); } } diff --git a/gradle.properties b/gradle.properties index ccf6105d7c..bb7a6c3fe7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=2b9b7c4a1d +archash=c8ce6b0a76