File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ struct TeamLoadout {
3535 skipValidation = false ;
3636 }
3737
38- int startingShipCount; // TODO: Make sure this gets pop everywhere
38+ int startingShipCount;
3939 int largestPrimaryBankCount;
4040 int largestSecondaryCapacity;
4141 SCP_vector<LoadoutItem> ships;
Original file line number Diff line number Diff line change 55#include < qlist.h>
66#include < qtablewidget.h>
77#include < QListWidget>
8+ #include < QMessageBox>
89
910constexpr int TABLE_MODE = 0 ;
1011constexpr int VARIABLE_MODE = 1 ;
@@ -253,7 +254,6 @@ void LoadoutDialog::onSwitchViewButtonPressed()
253254 }
254255 else {
255256 ui->tableVarLabel ->setText (" Loadout Editor: Loadout View" );
256- // TODO! FIXME! Some of the labels are missing from this function. Please check QT Creator
257257 ui->listShipsNotUsedLabel ->setText (" Ships Not in Loadout" );
258258 ui->listWeaponsNotUsedLabel ->setText (" Weapons Not In Loadout" );
259259 ui->startingShipsLabel ->setText (" Ships in Loadout" );
@@ -446,8 +446,23 @@ void LoadoutDialog::onCurrentTeamSpinboxUpdated()
446446
447447void LoadoutDialog::onCopyLoadoutToOtherTeamsButtonPressed ()
448448{
449- // TODO! Add confirmation button
450- _model->copyToOtherTeam ();
449+ QMessageBox msgBox;
450+ msgBox.setText (" Are you sure that you want to overwrite the other team's loadout with this team's loadout?" );
451+ msgBox.setInformativeText (" This can't be undone." );
452+ msgBox.setStandardButtons (QMessageBox::Yes | QMessageBox::Cancel);
453+ msgBox.setDefaultButton (QMessageBox::Cancel);
454+ int ret = msgBox.exec ();
455+
456+ switch (ret) {
457+ case QMessageBox::Yes:
458+ _model->copyToOtherTeam ();
459+ break ;
460+ case QMessageBox::Cancel:
461+ break ;
462+ default :
463+ UNREACHABLE (" Bad return value from confirmation message box in the Loadout dialog editor." );
464+ break ;
465+ }
451466}
452467
453468
You can’t perform that action at this time.
0 commit comments