Minor: New Game Yu-Gi-Oh! Bandai (#22)

This commit is contained in:
Sebastian Dine
2026-07-30 14:51:53 +02:00
committed by GitHub
parent 7cf25d671f
commit 2eb7c59f78
65 changed files with 4142 additions and 75 deletions
@@ -136,6 +136,10 @@ protected:
// controls cannot outlive the lookup identity.
virtual void onCardLookupContextChanged() {}
// Extra validation after name/set checks and writeFromControls(). Return
// false to block OK (subclass should show its own themed dialog).
[[nodiscard]] virtual bool validateExtraFields() { return true; }
// Common helpers ----------------------------------------------------------
void appendRow(wxFlexGridSizer* grid, const wxString& label, wxWindow* ctrl) {
@@ -148,6 +152,8 @@ protected:
[[nodiscard]] const TCard& constCard() const noexcept { return card_; }
void syncCardFromControls() { writeFromControls(); }
[[nodiscard]] wxComboBox* setComboControl() const noexcept { return setCombo_; }
[[nodiscard]] wxTextCtrl* nameControl() const noexcept { return nameCtrl_; }
[[nodiscard]] wxChoice* languageChoiceControl() const noexcept { return languageChoice_; }
[[nodiscard]] const Set* selectedSetFromControls() const {
const auto& available = availableSets();
@@ -471,6 +477,7 @@ private:
"Add card", wxOK | wxICON_INFORMATION);
return;
}
if (!validateExtraFields()) return;
if (mode_ == EditMode::Edit && !(card_ == openingSnapshot_)) {
if (showThemedConfirmDialog(
this,