Skip to content

Commit

Permalink
Fix exporting with multiple textureX entries (#965)
Browse files Browse the repository at this point in the history
* Fix exporting with multiple textureX entries

Check to see whether the TextureXPanel is the current page in the notebook.
Also, fix a lot of assertions from the SLADE debug build by using the correct type in PatchTableListView::getItemText.

* Use TabControl instead of wxNotebook
  • Loading branch information
Talon1024 authored and sirjuddington committed Nov 25, 2018
1 parent 66879ff commit a253284
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/MainEditor/UI/TextureXEditor/PatchTablePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ string PatchTableListView::getItemText(long item, long column, long index) const
patch_t& patch = patch_table_->patch(index);

if (column == 0) // Index column
return S_FMT("%04d", index);
return S_FMT("%04ld", index);
else if (column == 1) // Name column
return patch.name;
else if (column == 2) // Usage count column
Expand Down
3 changes: 2 additions & 1 deletion src/MainEditor/UI/TextureXEditor/TextureXPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,8 @@ void TextureXPanel::onRedo(string action)
bool TextureXPanel::handleAction(string id)
{
// Don't handle if hidden
if (!tx_editor_->IsShown() || !IsShown())
TabControl* parent = dynamic_cast<TabControl*>(GetParent());
if (parent->GetCurrentPage() != this)
return false;

// Only interested in "txed_" events
Expand Down

0 comments on commit a253284

Please sign in to comment.