mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:23:51 +00:00
Move the Button enum to WorldSpaceWidget
This commit is contained in:
parent
41c571d4f4
commit
18320b2cd0
6 changed files with 23 additions and 20 deletions
|
@ -126,8 +126,8 @@ void CSVRender::PagedWorldspaceWidget::addVisibilitySelectorButtons (
|
||||||
CSVWidget::SceneToolToggle2 *tool)
|
CSVWidget::SceneToolToggle2 *tool)
|
||||||
{
|
{
|
||||||
WorldspaceWidget::addVisibilitySelectorButtons (tool);
|
WorldspaceWidget::addVisibilitySelectorButtons (tool);
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Terrain, Mask_Terrain, "Terrain");
|
tool->addButton (Button_Terrain, Mask_Terrain, "Terrain");
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Fog, Mask_Fog, "Fog", "", true);
|
tool->addButton (Button_Fog, Mask_Fog, "Fog", "", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons (
|
void CSVRender::PagedWorldspaceWidget::addEditModeSelectorButtons (
|
||||||
|
|
|
@ -171,8 +171,8 @@ void CSVRender::UnpagedWorldspaceWidget::addVisibilitySelectorButtons (
|
||||||
CSVWidget::SceneToolToggle2 *tool)
|
CSVWidget::SceneToolToggle2 *tool)
|
||||||
{
|
{
|
||||||
WorldspaceWidget::addVisibilitySelectorButtons (tool);
|
WorldspaceWidget::addVisibilitySelectorButtons (tool);
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Terrain, Mask_Terrain, "Terrain", "", true);
|
tool->addButton (Button_Terrain, Mask_Terrain, "Terrain", "", true);
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Fog, Mask_Fog, "Fog");
|
tool->addButton (Button_Fog, Mask_Fog, "Fog");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CSVRender::UnpagedWorldspaceWidget::getStartupInstruction()
|
std::string CSVRender::UnpagedWorldspaceWidget::getStartupInstruction()
|
||||||
|
|
|
@ -296,9 +296,9 @@ void CSVRender::WorldspaceWidget::setEditLock (bool locked)
|
||||||
void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons (
|
void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons (
|
||||||
CSVWidget::SceneToolToggle2 *tool)
|
CSVWidget::SceneToolToggle2 *tool)
|
||||||
{
|
{
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Reference, Mask_Reference, "Instances");
|
tool->addButton (Button_Reference, Mask_Reference, "Instances");
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Water, Mask_Water, "Water");
|
tool->addButton (Button_Water, Mask_Water, "Water");
|
||||||
tool->addButton (CSVWidget::SceneToolToggle2::Button_Pathgrid, Mask_Pathgrid, "Pathgrid");
|
tool->addButton (Button_Pathgrid, Mask_Pathgrid, "Pathgrid");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVRender::WorldspaceWidget::addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool)
|
void CSVRender::WorldspaceWidget::addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool)
|
||||||
|
|
|
@ -142,6 +142,17 @@ namespace CSVRender
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
/// Visual elements in a scene
|
||||||
|
/// @note do not change the enumeration values, they are used in pre-existing button file names!
|
||||||
|
enum ButtonId
|
||||||
|
{
|
||||||
|
Button_Reference = 0x1,
|
||||||
|
Button_Pathgrid = 0x2,
|
||||||
|
Button_Water = 0x4,
|
||||||
|
Button_Fog = 0x8,
|
||||||
|
Button_Terrain = 0x10
|
||||||
|
};
|
||||||
|
|
||||||
virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool);
|
virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool);
|
||||||
|
|
||||||
virtual void addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool);
|
virtual void addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool);
|
||||||
|
|
|
@ -77,11 +77,11 @@ void CSVWidget::SceneToolToggle2::showPanel (const QPoint& position)
|
||||||
mFirst->setFocus (Qt::OtherFocusReason);
|
mFirst->setFocus (Qt::OtherFocusReason);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSVWidget::SceneToolToggle2::addButton (ButtonId id, unsigned int mask,
|
void CSVWidget::SceneToolToggle2::addButton (unsigned int id, unsigned int mask,
|
||||||
const QString& name, const QString& tooltip, bool disabled)
|
const QString& name, const QString& tooltip, bool disabled)
|
||||||
{
|
{
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
stream << mSingleIcon << static_cast<unsigned int>(id);
|
stream << mSingleIcon << id;
|
||||||
|
|
||||||
PushButton *button = new PushButton (QIcon (QPixmap (stream.str().c_str())),
|
PushButton *button = new PushButton (QIcon (QPixmap (stream.str().c_str())),
|
||||||
PushButton::Type_Toggle, tooltip.isEmpty() ? name: tooltip, mPanel);
|
PushButton::Type_Toggle, tooltip.isEmpty() ? name: tooltip, mPanel);
|
||||||
|
|
|
@ -54,19 +54,11 @@ namespace CSVWidget
|
||||||
|
|
||||||
virtual void showPanel (const QPoint& position);
|
virtual void showPanel (const QPoint& position);
|
||||||
|
|
||||||
/// Visual elements in a scene
|
/// \param buttonId used to compose the icon filename
|
||||||
/// @note do not change the enumeration values, they are used in pre-existing button file names!
|
/// \param mask used for the reported getSelectionMask() / setSelectionMask()
|
||||||
enum ButtonId
|
|
||||||
{
|
|
||||||
Button_Reference = 0x1,
|
|
||||||
Button_Pathgrid = 0x2,
|
|
||||||
Button_Water = 0x4,
|
|
||||||
Button_Fog = 0x8,
|
|
||||||
Button_Terrain = 0x10
|
|
||||||
};
|
|
||||||
/// \attention After the last button has been added, setSelection must be called at
|
/// \attention After the last button has been added, setSelection must be called at
|
||||||
/// least once to finalise the layout.
|
/// least once to finalise the layout.
|
||||||
void addButton (ButtonId buttonId, unsigned int mask,
|
void addButton (unsigned int buttonId, unsigned int mask,
|
||||||
const QString& name, const QString& tooltip = "", bool disabled = false);
|
const QString& name, const QString& tooltip = "", bool disabled = false);
|
||||||
|
|
||||||
unsigned int getSelectionMask() const;
|
unsigned int getSelectionMask() const;
|
||||||
|
|
Loading…
Reference in a new issue