diff --git a/install/input.xml b/install/input.xml index 8d21db5479..a1baf35ad5 100644 --- a/install/input.xml +++ b/install/input.xml @@ -33,7 +33,7 @@ - + diff --git a/radiant/eventmanager/MouseToolGroup.cpp b/radiant/eventmanager/MouseToolGroup.cpp index 3addd53f4f..fedf6044be 100644 --- a/radiant/eventmanager/MouseToolGroup.cpp +++ b/radiant/eventmanager/MouseToolGroup.cpp @@ -23,6 +23,8 @@ std::string MouseToolGroup::getDisplayName() return _("XY View"); case Type::CameraView: return _("Camera View"); + case Type::TextureTool: + return _("Texture Tool"); default: return _("Unknown"); }; diff --git a/radiant/selection/SelectionMouseTools.h b/radiant/selection/SelectionMouseTools.h index b854cca641..1c96de616f 100644 --- a/radiant/selection/SelectionMouseTools.h +++ b/radiant/selection/SelectionMouseTools.h @@ -54,7 +54,6 @@ class SelectMouseTool: public MouseTool class BasicSelectionTool: public SelectMouseTool { private: - Vector2 _start; // Position at mouseDown Vector2 _current; // Position during mouseMove @@ -79,7 +78,7 @@ class BasicSelectionTool: public SelectMouseTool } // Performs a drag- or point-selection test - void testSelect(Event& ev) override; + virtual void testSelect(Event& ev) override; // Recalculates the rectangle used to draw the GUI overlay void updateDragSelectionRectangle(Event& ev); diff --git a/radiant/textool/TexTool.cpp b/radiant/textool/TexTool.cpp index 146dc1bd68..e5463524ec 100644 --- a/radiant/textool/TexTool.cpp +++ b/radiant/textool/TexTool.cpp @@ -52,7 +52,9 @@ TexTool::TexTool() : MouseToolHandler(IMouseToolGroup::Type::TextureTool), _glWidget(new wxutil::GLWidget(this, std::bind(&TexTool::onGLDraw, this), "TexTool")), _selectionInfo(GlobalSelectionSystem().getSelectionInfo()), +#if 0 _dragRectangle(false), +#endif _manipulatorMode(false), _grid(GRID_DEFAULT), _gridActive(registry::getValue(RKEY_GRID_STATE)), @@ -570,7 +572,7 @@ void TexTool::doMouseUp(const Vector2& coords, wxMouseEvent& event) // Finish the undo recording, store the accumulated undomementos endOperation("TexToolDrag"); } - +#if 0 // If we are in selection mode, end the selection if ((event.LeftUp() && event.ShiftDown()) && _dragRectangle) @@ -599,18 +601,21 @@ void TexTool::doMouseUp(const Vector2& coords, wxMouseEvent& event) selectables[i]->toggle(); } } - +#endif draw(); } void TexTool::doMouseMove(const Vector2& coords, wxMouseEvent& event) { +#if 0 if (_dragRectangle) { _selectionRectangle.bottomRight = coords; draw(); } - else if (_manipulatorMode) + else +#endif + if (_manipulatorMode) { Vector2 delta = coords - _manipulateRectangle.topLeft; @@ -660,7 +665,9 @@ void TexTool::doMouseMove(const Vector2& coords, wxMouseEvent& event) void TexTool::doMouseDown(const Vector2& coords, wxMouseEvent& event) { _manipulatorMode = false; +#if 0 _dragRectangle = false; +#endif if (event.LeftDown() && !event.HasAnyModifiers()) { @@ -679,6 +686,7 @@ void TexTool::doMouseDown(const Vector2& coords, wxMouseEvent& event) beginOperation(); } } +#if 0 else if (event.LeftDown() && event.ShiftDown()) { // Start a drag or click operation @@ -686,6 +694,7 @@ void TexTool::doMouseDown(const Vector2& coords, wxMouseEvent& event) _selectionRectangle.topLeft = coords; _selectionRectangle.bottomRight = coords; } +#endif } void TexTool::selectRelatedItems() { @@ -964,7 +973,7 @@ bool TexTool::onGLDraw() } } -#if 1 +#if 0 if (_dragRectangle) { // Create a working reference to save typing textool::Rectangle& rectangle = _selectionRectangle; diff --git a/radiant/textool/TexTool.h b/radiant/textool/TexTool.h index 014a76e102..97c98224f0 100644 --- a/radiant/textool/TexTool.h +++ b/radiant/textool/TexTool.h @@ -69,14 +69,17 @@ class TexTool : // The currently active objects in the textool window textool::TexToolItemVec _items; +#if 0 // The draggable selection rectangle textool::Rectangle _selectionRectangle; - +#endif // The rectangle defining the manipulation's start and end point textool::Rectangle _manipulateRectangle; +#if 0 // TRUE if we are in selection mode bool _dragRectangle; +#endif // TRUE if a manipulation is currently ongoing bool _manipulatorMode; diff --git a/radiant/textool/tools/TextureToolSelectionTool.h b/radiant/textool/tools/TextureToolSelectionTool.h new file mode 100644 index 0000000000..1e2e864bbe --- /dev/null +++ b/radiant/textool/tools/TextureToolSelectionTool.h @@ -0,0 +1,39 @@ +#pragma once + +#include "i18n.h" +#include "math/Vector2.h" +#include "selection/SelectionMouseTools.h" + +namespace ui +{ + +class TextureToolSelectionTool : + public BasicSelectionTool +{ +private: + Vector2 _start; // Position at mouseDown + Vector2 _current; // Position during mouseMove + +public: + TextureToolSelectionTool() + {} + + virtual const std::string& getName() override + { + static std::string name("TextureToolSelectionTool"); + return name; + } + + virtual const std::string& getDisplayName() override + { + static std::string displayName(_("Select")); + return displayName; + } + + virtual void testSelect(Event& ev) override + { + int i = 6; + } +}; + +} diff --git a/radiant/ui/mousetool/RegistrationHelper.h b/radiant/ui/mousetool/RegistrationHelper.h index 6cf4f830e5..9ced1b6b8f 100644 --- a/radiant/ui/mousetool/RegistrationHelper.h +++ b/radiant/ui/mousetool/RegistrationHelper.h @@ -5,6 +5,7 @@ #include "selection/ManipulateMouseTool.h" #include "xyview/tools/MoveViewTool.h" #include "xyview/tools/ZoomTool.h" +#include "textool/tools/TextureToolSelectionTool.h" namespace ui { @@ -34,6 +35,7 @@ class MouseToolRegistrationHelper texToolGroup.registerMouseTool(std::make_shared()); texToolGroup.registerMouseTool(std::make_shared()); + texToolGroup.registerMouseTool(std::make_shared()); } }; diff --git a/tools/msvc/DarkRadiant.vcxproj b/tools/msvc/DarkRadiant.vcxproj index bb7483dac2..a197ca1654 100644 --- a/tools/msvc/DarkRadiant.vcxproj +++ b/tools/msvc/DarkRadiant.vcxproj @@ -418,6 +418,7 @@ + diff --git a/tools/msvc/DarkRadiant.vcxproj.filters b/tools/msvc/DarkRadiant.vcxproj.filters index 4b0f039abc..185b8e898d 100644 --- a/tools/msvc/DarkRadiant.vcxproj.filters +++ b/tools/msvc/DarkRadiant.vcxproj.filters @@ -1416,6 +1416,9 @@ src\textool\tools + + src\textool\tools +