mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
fix: Add Cards toolbar submenu initial load content (fixes twanvl#153)
This commit is what broke it, but it did so while referencing some cross platform incompatibility. I hope the method done by this fix avoids that compatibility issue.
This commit is contained in:
@@ -7,6 +7,9 @@ HEAD: new items added as changes are made
|
||||
|
||||
Features:
|
||||
|
||||
Bug fixes:
|
||||
* Fix Add Cards toolbar not showing script multi-add functions on initial load (twanvl#153)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
version 2.2.0 (Unofficial), 2022-07-16
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@@ -153,8 +153,10 @@ void CardsPanel::onChangeSet() {
|
||||
menuCard->Remove(ID_CARD_ADD_MULT);
|
||||
((wxMenu*)menuCard)->Insert(4,insertManyCardsMenu); // HACK: the position is hardcoded
|
||||
// also for the toolbar dropdown menu
|
||||
if (toolAddCard) {
|
||||
toolAddCard->SetDropdownMenu(makeAddCardsSubmenu(true));
|
||||
if (toolAddCard) {
|
||||
// Originally this was using the menu directly, but there are compatibility issues apparently.
|
||||
// At this point it might be possible to just store a reference to the toolbar directly instead.
|
||||
toolAddCard->GetToolBar()->SetDropdownMenu(ID_CARD_ADD, makeAddCardsSubmenu(true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +188,7 @@ void CardsPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
add_tool_tr(tb, ID_FORMAT_SYMBOL, "symbol", "symbols", false, wxITEM_CHECK);
|
||||
add_tool_tr(tb, ID_FORMAT_REMINDER, "reminder", "reminder_text", false, wxITEM_CHECK);
|
||||
tb->AddSeparator();
|
||||
add_tool_tr(tb, ID_CARD_ADD, "card_add", "add_card", false, wxITEM_DROPDOWN);
|
||||
toolAddCard = add_tool_tr(tb, ID_CARD_ADD, "card_add", "add_card", false, wxITEM_DROPDOWN);
|
||||
tb->SetDropdownMenu(ID_CARD_ADD, makeAddCardsSubmenu(true));
|
||||
add_tool_tr(tb, ID_CARD_REMOVE, "card_del", "remove_card");
|
||||
tb->AddSeparator();
|
||||
@@ -492,4 +494,4 @@ void CardsPanel::selectFirstCard() {
|
||||
|
||||
void CardsPanel::getCardLists(vector<CardListBase*>& out) {
|
||||
out.push_back(card_list);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user