Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Done button correctly updates in Move and Fire phases #4489

Merged
merged 3 commits into from
Jun 7, 2023
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
1 change: 1 addition & 0 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2460,6 +2460,7 @@ MovementDisplay.FlyOffDialog.message=Do you want to fly off the map?
MovementDisplay.FlyOffDialog.title=Fly Away?
MovementDisplay.IceLanding=Landing on ice will break through on 4+ on 1d6.\n
MovementDisplay.IceMoving=Crossing ice will break through on 6+ on 1d6.\n
MovementDisplay.IllegalMove=Illegal Move
MovementDisplay.its_others_turn=It''s {0}''s turn to move.
MovementDisplay.its_your_turn=It's your turn to move.
MovementDisplay.loadUnitBayNumberDialog.message=Which of {0}'s bays do you wish to load into?
Expand Down
6 changes: 4 additions & 2 deletions megamek/src/megamek/client/ui/swing/ActionPhaseDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@ protected void updateDonePanelButtons(String doneButtonLabel, String skipButtonL
}
butSkipTurn.setText("<html><b>" + skipButtonLabel + "</b></html>");

// enable/disable
if (this.isDoingAction || ignoreNoActionNag) {
if (!clientgui.getClient().isMyTurn()) {
butDone.setEnabled(false);
butSkipTurn.setEnabled(false);
} else if (this.isDoingAction || ignoreNoActionNag) {
butDone.setEnabled(true);
butSkipTurn.setEnabled(false);
} else {
Expand Down
7 changes: 6 additions & 1 deletion megamek/src/megamek/client/ui/swing/AttackPhaseDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ protected AttackPhaseDisplay(ClientGUI cg) {
@Override
protected void updateDonePanel()
{
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), !attacks.isEmpty());
if (attacks.isEmpty() || (attacks.size() == 1 && attacks.firstElement() instanceof TorsoTwistAction)){
// a torso twist alone should not trigger Done button
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), false);
} else {
updateDonePanelButtons(getDoneButtonLabel(), getSkipTurnButtonLabel(), true);
}
}

protected void removeAttack(Object o)
Expand Down
Loading