mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-17 19:25:23 +00:00
lots of split and join functionality added
This commit is contained in:
@@ -50,9 +50,9 @@ class RootView : public View
|
||||
InteractiveSplit,
|
||||
InteractiveJoin,
|
||||
} m_phase = Phase::Inactive;
|
||||
bool m_draw = false;
|
||||
int m_interactiveSlot = 0;
|
||||
float m_interactiveSplit = 0.5;
|
||||
bool m_interactiveDown = false;
|
||||
|
||||
VertexBufferBinding m_vertsBinding;
|
||||
ViewBlock m_viewBlock;
|
||||
@@ -84,10 +84,6 @@ class RootView : public View
|
||||
bool m_deferredSplit = false;
|
||||
bool m_deferredJoin = false;
|
||||
|
||||
void beginSplit();
|
||||
void beginJoin();
|
||||
void cancelAction();
|
||||
|
||||
struct SplitActionNode : IMenuNode
|
||||
{
|
||||
SplitMenuSystem& m_smn;
|
||||
@@ -174,6 +170,11 @@ public:
|
||||
{
|
||||
m_activeDragView = dragView;
|
||||
}
|
||||
void unsetActiveDragView(View* dragView)
|
||||
{
|
||||
if (dragView == m_activeDragView)
|
||||
m_activeDragView = nullptr;
|
||||
}
|
||||
void setActiveMenuButton(Button* button)
|
||||
{
|
||||
m_activeMenuButton = button;
|
||||
@@ -219,6 +220,13 @@ public:
|
||||
void resetTooltip(ViewResources& res);
|
||||
void displayTooltip(const std::string& name, const std::string& help);
|
||||
|
||||
void beginInteractiveJoin(SplitView* sv, const boo::SWindowCoord& coord)
|
||||
{
|
||||
m_splitMenuSystem.m_phase = SplitMenuSystem::Phase::InteractiveJoin;
|
||||
m_splitMenuSystem.m_splitView = sv;
|
||||
m_splitMenuSystem.mouseMove(coord);
|
||||
}
|
||||
|
||||
private:
|
||||
void _updateCursor()
|
||||
{
|
||||
|
||||
@@ -14,17 +14,18 @@ struct ISpaceController
|
||||
{
|
||||
virtual bool spaceSplitAllowed() const {return false;}
|
||||
virtual ISplitSpaceController* spaceSplit(SplitView::Axis axis, int thisSlot) {return nullptr;}
|
||||
virtual ISpaceController* spaceJoin(int keepSlot) {return nullptr;}
|
||||
};
|
||||
|
||||
struct ISplitSpaceController
|
||||
{
|
||||
virtual SplitView* splitView()=0;
|
||||
virtual void updateSplit(float split)=0;
|
||||
virtual void joinViews(SplitView* thisSplit, int thisSlot, SplitView* otherSplit, int otherSlot)=0;
|
||||
};
|
||||
|
||||
class Space : public View
|
||||
{
|
||||
friend class RootView;
|
||||
ISpaceController& m_controller;
|
||||
Toolbar::Position m_tbPos;
|
||||
ViewChild<std::unique_ptr<Toolbar>> m_toolbar;
|
||||
@@ -62,6 +63,8 @@ public:
|
||||
void resized(const boo::SWindowRect& rootView, const boo::SWindowRect& sub);
|
||||
void draw(boo::IGraphicsCommandQueue* gfxQ);
|
||||
|
||||
SplitView* findSplitViewOnSide(SplitView::Axis axis, int side);
|
||||
|
||||
void setMultiplyColor(const Zeus::CColor& color)
|
||||
{
|
||||
View::setMultiplyColor(color);
|
||||
|
||||
@@ -10,6 +10,7 @@ struct ISplitSpaceController;
|
||||
class SplitView : public View
|
||||
{
|
||||
friend class RootView;
|
||||
friend class Space;
|
||||
public:
|
||||
class Resources
|
||||
{
|
||||
@@ -82,7 +83,9 @@ public:
|
||||
Axis axis() const {return m_axis;}
|
||||
float split() const {return m_slide;}
|
||||
bool testSplitHover(const boo::SWindowCoord& coord);
|
||||
bool testJoinArrowHover(const boo::SWindowCoord& coord, int& slotOut, boo::SWindowRect& rectOut, ArrowDir& dirOut);
|
||||
bool testJoinArrowHover(const boo::SWindowCoord& coord, int& origSlotOut,
|
||||
SplitView*& splitOut, int& slotOut,
|
||||
boo::SWindowRect& rectOut, ArrowDir& dirOut, int forceSlot=-1);
|
||||
void getJoinArrowHover(int slot, boo::SWindowRect& rectOut, ArrowDir& dirOut);
|
||||
bool testSplitLineHover(const boo::SWindowCoord& coord, int& slotOut, boo::SWindowRect& rectOut, float& splitOut, Axis& axisOut);
|
||||
void getSplitLineHover(int slot, boo::SWindowRect& rectOut, Axis& axisOut);
|
||||
|
||||
Reference in New Issue
Block a user