mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 21:40:11 +00:00
added control element selector toolbar button
This commit is contained in:
parent
612202a7a5
commit
f381451ae0
@ -10,6 +10,10 @@
|
|||||||
#include "../../model/world/tablemimedata.hpp"
|
#include "../../model/world/tablemimedata.hpp"
|
||||||
#include "../../model/world/idtable.hpp"
|
#include "../../model/world/idtable.hpp"
|
||||||
|
|
||||||
|
#include "../widget/scenetooltoggle.hpp"
|
||||||
|
|
||||||
|
#include "elements.hpp"
|
||||||
|
|
||||||
bool CSVRender::PagedWorldspaceWidget::adjustCells()
|
bool CSVRender::PagedWorldspaceWidget::adjustCells()
|
||||||
{
|
{
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
@ -237,6 +241,31 @@ CSVRender::WorldspaceWidget::dropRequirments CSVRender::PagedWorldspaceWidget::g
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned int CSVRender::PagedWorldspaceWidget::getElementMask() const
|
||||||
|
{
|
||||||
|
return WorldspaceWidget::getElementMask() | mControlElements->getSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
CSVWidget::SceneToolToggle *CSVRender::PagedWorldspaceWidget::makeControlVisibilitySelector (
|
||||||
|
CSVWidget::SceneToolbar *parent)
|
||||||
|
{
|
||||||
|
mControlElements = new CSVWidget::SceneToolToggle (parent,
|
||||||
|
"Controls & Guides Visibility", ":door.png");
|
||||||
|
|
||||||
|
mControlElements->addButton (":activator.png", Element_CellMarker, ":activator.png",
|
||||||
|
"Cell marker");
|
||||||
|
mControlElements->addButton (":armor.png", Element_CellArrow, ":armor.png", "Cell arrows");
|
||||||
|
mControlElements->addButton (":armor.png", Element_CellBorder, ":armor.png", "Cell border");
|
||||||
|
|
||||||
|
mControlElements->setSelection (0xffffffff);
|
||||||
|
|
||||||
|
connect (mControlElements, SIGNAL (selectionChanged()),
|
||||||
|
this, SLOT (elementSelectionChanged()));
|
||||||
|
|
||||||
|
return mControlElements;
|
||||||
|
}
|
||||||
|
|
||||||
void CSVRender::PagedWorldspaceWidget::cellDataChanged (const QModelIndex& topLeft,
|
void CSVRender::PagedWorldspaceWidget::cellDataChanged (const QModelIndex& topLeft,
|
||||||
const QModelIndex& bottomRight)
|
const QModelIndex& bottomRight)
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@ namespace CSVRender
|
|||||||
CSMWorld::CellSelection mSelection;
|
CSMWorld::CellSelection mSelection;
|
||||||
std::map<CSMWorld::CellCoordinates, Cell *> mCells;
|
std::map<CSMWorld::CellCoordinates, Cell *> mCells;
|
||||||
std::string mWorldspace;
|
std::string mWorldspace;
|
||||||
|
CSVWidget::SceneToolToggle *mControlElements;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -58,6 +59,13 @@ namespace CSVRender
|
|||||||
|
|
||||||
virtual dropRequirments getDropRequirements(dropType type) const;
|
virtual dropRequirments getDropRequirements(dropType type) const;
|
||||||
|
|
||||||
|
/// \attention The created tool is not added to the toolbar (via addTool). Doing
|
||||||
|
/// that is the responsibility of the calling function.
|
||||||
|
virtual CSVWidget::SceneToolToggle *makeControlVisibilitySelector (
|
||||||
|
CSVWidget::SceneToolbar *parent);
|
||||||
|
|
||||||
|
virtual unsigned int getElementMask() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void cellSelectionChanged (const CSMWorld::CellSelection& selection);
|
void cellSelectionChanged (const CSMWorld::CellSelection& selection);
|
||||||
|
@ -112,18 +112,15 @@ CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::Worldsp
|
|||||||
widget->makeSceneVisibilitySelector (toolbar);
|
widget->makeSceneVisibilitySelector (toolbar);
|
||||||
toolbar->addTool (sceneVisibilityTool);
|
toolbar->addTool (sceneVisibilityTool);
|
||||||
|
|
||||||
/* Add buttons specific to the type. For now no need for it.
|
if (type==widget_Paged)
|
||||||
*
|
|
||||||
switch (type)
|
|
||||||
{
|
{
|
||||||
case widget_Paged:
|
CSVWidget::SceneToolToggle *controlVisibilityTool =
|
||||||
break;
|
dynamic_cast<CSVRender::PagedWorldspaceWidget&> (*widget).
|
||||||
|
makeControlVisibilitySelector (toolbar);
|
||||||
case widget_Unpaged:
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
toolbar->addTool (controlVisibilityTool);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return toolbar;
|
return toolbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user