Skip to content

Commit

Permalink
Prevent selecting other shapes while a brush is active
Browse files Browse the repository at this point in the history
You can now only select shapes using the "Select" tool in the toolbar,
or the regular tree control.
  • Loading branch information
ousnius committed Aug 12, 2016
1 parent cc241f5 commit 0c22859
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/program/OutfitStudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ void OutfitStudio::UpdateActiveShapeUI() {
glView->ShowVertexEdit(false);

CreateSegmentTree();
outfitBones->UnselectAll();
}
else {
mesh* m = glView->GetMesh(activeItem->shapeName);
Expand All @@ -577,6 +578,13 @@ void OutfitStudio::UpdateActiveShapeUI() {
}

CreateSegmentTree(activeItem->shapeName);

wxArrayTreeItemIds selItems;
outfitBones->GetSelections(selItems);
if (!selItems.empty()) {
wxTreeEvent treeEvent(wxEVT_TREE_SEL_CHANGED, outfitBones, selItems.front());
OnBoneSelect(treeEvent);
}
}
}

Expand All @@ -599,7 +607,6 @@ void OutfitStudio::SelectShape(const string& shapeName) {
}
item = outfitShapes->GetNextSibling(item);
}
UpdateActiveShapeUI();
}

vector<string> OutfitStudio::GetShapeList() {
Expand Down Expand Up @@ -4633,7 +4640,7 @@ void OutfitStudio::OnDeleteBone(wxCommandEvent& WXUNUSED(event)) {

outfitBones->GetSelections(selItems);
if (!selItems.empty()) {
wxTreeEvent treeEvent(wxEVT_TREE_SEL_CHANGED, outfitBones, selItems[0]);
wxTreeEvent treeEvent(wxEVT_TREE_SEL_CHANGED, outfitBones, selItems.front());
OnBoneSelect(treeEvent);
}
}
Expand All @@ -4650,7 +4657,7 @@ void OutfitStudio::OnDeleteBoneFromSelected(wxCommandEvent& WXUNUSED(event)) {
}

if (!selItems.empty()) {
wxTreeEvent treeEvent(wxEVT_TREE_SEL_CHANGED, outfitBones, selItems[0]);
wxTreeEvent treeEvent(wxEVT_TREE_SEL_CHANGED, outfitBones, selItems.front());
OnBoneSelect(treeEvent);
}
}
Expand Down Expand Up @@ -4836,9 +4843,9 @@ void OutfitStudio::OnNPWizChangeSliderSetFile(wxFileDirPickerEvent& event) {
for (auto &sn : setNames)
setNameChoice->AppendString(sn);

if (setNames.size() > 0) {
if (!setNames.empty()) {
setNameChoice->SetSelection(0);
ssf.SetShapes(setNames[0], shapes);
ssf.SetShapes(setNames.front(), shapes);
for (auto &rsn : shapes)
refShapeChoice->AppendString(rsn);

Expand Down Expand Up @@ -5890,7 +5897,7 @@ void wxGLPanel::OnLeftUp(wxMouseEvent& event) {
if (GetCapture() == this)
ReleaseMouse();

if (!isLDragging && !isPainting) {
if (!isLDragging && !isPainting && !activeBrush) {
int x, y;
event.GetPosition(&x, &y);
wxPoint p = event.GetPosition();
Expand Down

0 comments on commit 0c22859

Please sign in to comment.