Merge pull request #3257 from kevlahnota/newmaster2

Update Winlose
This commit is contained in:
Anthony Calosa
2023-06-13 01:55:39 +08:00
committed by GitHub
3 changed files with 28 additions and 67 deletions

View File

@@ -24,6 +24,7 @@ public class AdventureWinLose extends ControlWinLose {
} }
v.getBtnRestart().setVisible(false); v.getBtnRestart().setVisible(false);
v.getBtnRestart().setEnabled(false); v.getBtnRestart().setEnabled(false);
v.getLabelShowBattlefield().setVisible(false);
//v.getBtnQuit().setText(Forge.getLocalizer().getMessage("lblBackToAdventure")); //v.getBtnQuit().setText(Forge.getLocalizer().getMessage("lblBackToAdventure"));
Forge.setCursor(null, "0"); Forge.setCursor(null, "0");
} }

View File

@@ -64,6 +64,33 @@ public class ViewWinLose extends FOverlay implements IWinLoseView<FButton> {
btnQuit.setFont(btnContinue.getFont()); btnQuit.setFont(btnContinue.getFont());
btnContinue.setEnabled(!game0.isMatchOver()); btnContinue.setEnabled(!game0.isMatchOver());
lblLog = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblGameLog")).align(Align.center).font(FSkinFont.get(18)).build());
txtLog = add(new FTextArea(true, StringUtils.join(game.getGameLog().getLogEntries(null), "\r\n").replace("[COMPUTER]", "[AI]")) {
@Override
public boolean tap(float x, float y, int count) {
if (txtLog.getMaxScrollTop() > 0) {
FMagnifyView.show(txtLog, txtLog.getText(), txtLog.getTextColor(), ViewWinLose.this.getBackColor(), txtLog.getFont(), true);
}
return true;
}
});
txtLog.setFont(FSkinFont.get(12));
btnCopyLog = add(new FLabel.ButtonBuilder().text(Forge.getLocalizer().getMessage("btnCopyToClipboard")).selectable().command(new FEventHandler() {
@Override
public void handleEvent(FEvent e) {
Forge.getClipboard().setContents(txtLog.getText());
}
}).build());
btnShowBattlefield = add(new FLabel.ButtonBuilder().text(Forge.getLocalizer().getMessage("lblShowBattlefield")).font(FSkinFont.get(12)).selectable().command(new FEventHandler() {
@Override
public void handleEvent(FEvent e) {
hide();
}
}).build());
lblTitle.setText(composeTitle(game0));
// Control of the win/lose is handled differently for various game // Control of the win/lose is handled differently for various game
// modes. // modes.
ControlWinLose control = null; ControlWinLose control = null;
@@ -101,33 +128,6 @@ public class ViewWinLose extends FOverlay implements IWinLoseView<FButton> {
control = new ControlWinLose(this, game0); control = new ControlWinLose(this, game0);
} }
lblLog = add(new FLabel.Builder().text(Forge.getLocalizer().getMessage("lblGameLog")).align(Align.center).font(FSkinFont.get(18)).build());
txtLog = add(new FTextArea(true, StringUtils.join(game.getGameLog().getLogEntries(null), "\r\n").replace("[COMPUTER]", "[AI]")) {
@Override
public boolean tap(float x, float y, int count) {
if (txtLog.getMaxScrollTop() > 0) {
FMagnifyView.show(txtLog, txtLog.getText(), txtLog.getTextColor(), ViewWinLose.this.getBackColor(), txtLog.getFont(), true);
}
return true;
}
});
txtLog.setFont(FSkinFont.get(12));
btnCopyLog = add(new FLabel.ButtonBuilder().text(Forge.getLocalizer().getMessage("btnCopyToClipboard")).selectable().command(new FEventHandler() {
@Override
public void handleEvent(FEvent e) {
Forge.getClipboard().setContents(txtLog.getText());
}
}).build());
btnShowBattlefield = add(new FLabel.ButtonBuilder().text(Forge.getLocalizer().getMessage("lblShowBattlefield")).font(FSkinFont.get(12)).selectable().command(new FEventHandler() {
@Override
public void handleEvent(FEvent e) {
hide();
}
}).build());
lblTitle.setText(composeTitle(game0));
showGameOutcomeSummary(); showGameOutcomeSummary();
showPlayerScores(); showPlayerScores();
control.showRewards(); control.showRewards();

View File

@@ -4865,14 +4865,6 @@
<object id="1" x="10" y="0" width="6" height="16"/> <object id="1" x="10" y="0" width="6" height="16"/>
</objectgroup> </objectgroup>
</tile> </tile>
<tile id="2413">
<animation>
<frame tileid="7179" duration="100"/>
<frame tileid="7180" duration="100"/>
<frame tileid="7181" duration="100"/>
<frame tileid="7182" duration="100"/>
</animation>
</tile>
<tile id="2475"> <tile id="2475">
<objectgroup draworder="index" id="2"> <objectgroup draworder="index" id="2">
<object id="1" x="2" y="1" width="12" height="13"/> <object id="1" x="2" y="1" width="12" height="13"/>
@@ -10508,30 +10500,6 @@
<object id="2" x="11" y="0" width="5" height="9"/> <object id="2" x="11" y="0" width="5" height="9"/>
</objectgroup> </objectgroup>
</tile> </tile>
<tile id="7175">
<animation>
<frame tileid="7175" duration="200"/>
<frame tileid="7176" duration="200"/>
<frame tileid="7177" duration="200"/>
<frame tileid="7178" duration="200"/>
</animation>
</tile>
<tile id="7179">
<animation>
<frame tileid="7179" duration="200"/>
<frame tileid="7180" duration="200"/>
<frame tileid="7181" duration="200"/>
<frame tileid="7182" duration="200"/>
</animation>
</tile>
<tile id="7183">
<animation>
<frame tileid="7183" duration="200"/>
<frame tileid="7184" duration="200"/>
<frame tileid="7185" duration="200"/>
<frame tileid="7186" duration="200"/>
</animation>
</tile>
<tile id="7235"> <tile id="7235">
<objectgroup draworder="index" id="2"> <objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="16" height="16"/> <object id="1" x="0" y="0" width="16" height="16"/>
@@ -10633,14 +10601,6 @@
<object id="1" x="0" y="0" width="5" height="16"/> <object id="1" x="0" y="0" width="5" height="16"/>
</objectgroup> </objectgroup>
</tile> </tile>
<tile id="7531">
<animation>
<frame tileid="7531" duration="100"/>
<frame tileid="7532" duration="100"/>
<frame tileid="7533" duration="100"/>
<frame tileid="7534" duration="100"/>
</animation>
</tile>
<tile id="7584"> <tile id="7584">
<objectgroup draworder="index" id="2"> <objectgroup draworder="index" id="2">
<object id="1" x="11" y="0" width="5" height="16"/> <object id="1" x="11" y="0" width="5" height="16"/>