mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
update
This commit is contained in:
@@ -100,14 +100,10 @@ public class ArenaScene extends UIScene implements IAfterMatch {
|
|||||||
|
|
||||||
private void showAreYouSure() {
|
private void showAreYouSure() {
|
||||||
if (concedeDialog == null) {
|
if (concedeDialog == null) {
|
||||||
concedeDialog = new Dialog(Forge.getLocalizer().getMessage("lblConcedeTitle"), Controls.getSkin());
|
concedeDialog = createGenericDialog(Forge.getLocalizer().getMessage("lblConcedeTitle"), "\n" + Forge.getLocalizer().getMessage("lblConcedeCurrentGame"), () -> {
|
||||||
concedeDialog.text("\n" + Forge.getLocalizer().getMessage("lblConcedeCurrentGame"));
|
|
||||||
TextraButton yes = Controls.newTextButton(Forge.getLocalizer().getMessage("lblYes"), () -> {
|
|
||||||
loose();
|
loose();
|
||||||
removeDialog();
|
removeDialog();
|
||||||
});
|
}, this::removeDialog);
|
||||||
TextraButton no = Controls.newTextButton(Forge.getLocalizer().getMessage("lblNo"), this::removeDialog);
|
|
||||||
concedeDialog.button(yes).button(no);
|
|
||||||
}
|
}
|
||||||
showDialog(concedeDialog);
|
showDialog(concedeDialog);
|
||||||
}
|
}
|
||||||
@@ -121,14 +117,10 @@ public class ArenaScene extends UIScene implements IAfterMatch {
|
|||||||
|
|
||||||
private void startDialog() {
|
private void startDialog() {
|
||||||
if (startDialog == null) {
|
if (startDialog == null) {
|
||||||
startDialog = new Dialog(Forge.getLocalizer().getMessage("lblStart"), Controls.getSkin());
|
startDialog = createGenericDialog(Forge.getLocalizer().getMessage("lblStart"), Forge.getLocalizer().getMessage("lblStartArena"), () -> {
|
||||||
startDialog.text(Forge.getLocalizer().getMessage("lblStartArena"));
|
|
||||||
TextraButton yes = Controls.newTextButton(Forge.getLocalizer().getMessage("lblYes"), () -> {
|
|
||||||
startArena();
|
startArena();
|
||||||
removeDialog();
|
removeDialog();
|
||||||
});
|
}, this::removeDialog);
|
||||||
TextraButton no = Controls.newTextButton(Forge.getLocalizer().getMessage("lblNo"), this::removeDialog);
|
|
||||||
startDialog.button(yes).button(no);
|
|
||||||
}
|
}
|
||||||
showDialog(startDialog);
|
showDialog(startDialog);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.badlogic.gdx.utils.Null;
|
|||||||
import com.badlogic.gdx.utils.Scaling;
|
import com.badlogic.gdx.utils.Scaling;
|
||||||
import com.badlogic.gdx.utils.Timer;
|
import com.badlogic.gdx.utils.Timer;
|
||||||
import com.badlogic.gdx.utils.viewport.ScalingViewport;
|
import com.badlogic.gdx.utils.viewport.ScalingViewport;
|
||||||
|
import com.github.tommyettinger.textra.TextraButton;
|
||||||
import com.github.tommyettinger.textra.TextraLabel;
|
import com.github.tommyettinger.textra.TextraLabel;
|
||||||
import forge.Forge;
|
import forge.Forge;
|
||||||
import forge.adventure.stage.GameHUD;
|
import forge.adventure.stage.GameHUD;
|
||||||
@@ -270,6 +271,15 @@ public class UIScene extends Scene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Dialog createGenericDialog(String title, String label, Runnable runnableYes, Runnable runnableNo) {
|
||||||
|
Dialog dialog = new Dialog(title, Controls.getSkin());
|
||||||
|
dialog.text(label);
|
||||||
|
TextraButton yes = Controls.newTextButton(Forge.getLocalizer().getMessage("lblYes"), runnableYes);
|
||||||
|
TextraButton no = Controls.newTextButton(Forge.getLocalizer().getMessage("lblNo"), runnableNo);
|
||||||
|
dialog.button(yes).button(no);
|
||||||
|
return dialog;
|
||||||
|
}
|
||||||
|
|
||||||
static float timeOfDay = 8.0f;
|
static float timeOfDay = 8.0f;
|
||||||
float targetTime = 8.0f;
|
float targetTime = 8.0f;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user