mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 12:39:53 +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/idtable.hpp"
|
||||
|
||||
#include "../widget/scenetooltoggle.hpp"
|
||||
|
||||
#include "elements.hpp"
|
||||
|
||||
bool CSVRender::PagedWorldspaceWidget::adjustCells()
|
||||
{
|
||||
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,
|
||||
const QModelIndex& bottomRight)
|
||||
{
|
||||
|
@ -18,6 +18,7 @@ namespace CSVRender
|
||||
CSMWorld::CellSelection mSelection;
|
||||
std::map<CSMWorld::CellCoordinates, Cell *> mCells;
|
||||
std::string mWorldspace;
|
||||
CSVWidget::SceneToolToggle *mControlElements;
|
||||
|
||||
private:
|
||||
|
||||
@ -58,6 +59,13 @@ namespace CSVRender
|
||||
|
||||
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:
|
||||
|
||||
void cellSelectionChanged (const CSMWorld::CellSelection& selection);
|
||||
|
@ -112,18 +112,15 @@ CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::Worldsp
|
||||
widget->makeSceneVisibilitySelector (toolbar);
|
||||
toolbar->addTool (sceneVisibilityTool);
|
||||
|
||||
/* Add buttons specific to the type. For now no need for it.
|
||||
*
|
||||
switch (type)
|
||||
if (type==widget_Paged)
|
||||
{
|
||||
case widget_Paged:
|
||||
break;
|
||||
|
||||
case widget_Unpaged:
|
||||
break;
|
||||
CSVWidget::SceneToolToggle *controlVisibilityTool =
|
||||
dynamic_cast<CSVRender::PagedWorldspaceWidget&> (*widget).
|
||||
makeControlVisibilitySelector (toolbar);
|
||||
|
||||
toolbar->addTool (controlVisibilityTool);
|
||||
}
|
||||
*/
|
||||
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user