mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-14 19:49:55 +00:00
Changed: #1302 Added world edit mode toolbar.
--HG-- branch : gsoc2011-worldeditorqt
This commit is contained in:
parent
c5dbe3cc82
commit
14272b5e79
9 changed files with 220 additions and 2 deletions
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
|
@ -1,5 +1,10 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>icons/ic_nel_select.png</file>
|
||||
<file>icons/ic_nel_scale.png</file>
|
||||
<file>icons/ic_nel_rotate.png</file>
|
||||
<file>icons/ic_nel_move.png</file>
|
||||
<file>icons/ic_nel_turn.png</file>
|
||||
<file>icons/ic_nel_world_editor.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
// Qt includes
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QSignalMapper>
|
||||
#include <QtGui/QFileDialog>
|
||||
|
||||
namespace WorldEditor
|
||||
|
@ -54,12 +55,28 @@ WorldEditorWindow::WorldEditorWindow(QWidget *parent)
|
|||
m_ui.setupUi(this);
|
||||
m_undoStack = new QUndoStack(this);
|
||||
|
||||
QActionGroup *sceneModeGroup = new QActionGroup(this);
|
||||
sceneModeGroup->addAction(m_ui.selectAction);
|
||||
sceneModeGroup->addAction(m_ui.moveAction);
|
||||
sceneModeGroup->addAction(m_ui.rotateAction);
|
||||
sceneModeGroup->addAction(m_ui.scaleAction);
|
||||
sceneModeGroup->addAction(m_ui.turnAction);
|
||||
sceneModeGroup->addAction(m_ui.radiusAction);
|
||||
m_ui.selectAction->setChecked(true);
|
||||
|
||||
m_ui.newWorldEditAction->setIcon(QIcon(Core::Constants::ICON_NEW));
|
||||
m_ui.saveWorldEditAction->setIcon(QIcon(Core::Constants::ICON_SAVE));
|
||||
|
||||
m_primitivesModel = new PrimitivesTreeModel();
|
||||
m_ui.treePrimitivesView->setModel(m_primitivesModel);
|
||||
|
||||
createMenus();
|
||||
createToolBars();
|
||||
readSettings();
|
||||
|
||||
connect(m_ui.newWorldEditAction, SIGNAL(triggered()), this, SLOT(newWorldEditFile()));
|
||||
connect(m_ui.saveWorldEditAction, SIGNAL(triggered()), this, SLOT(saveAllWorldEditFiles()));
|
||||
|
||||
}
|
||||
|
||||
WorldEditorWindow::~WorldEditorWindow()
|
||||
|
@ -96,6 +113,14 @@ void WorldEditorWindow::loadPrimitive(const QString &fileName)
|
|||
m_primitivesModel->loadPrimitive(fileName);
|
||||
}
|
||||
|
||||
void WorldEditorWindow::newWorldEditFile()
|
||||
{
|
||||
}
|
||||
|
||||
void WorldEditorWindow::saveAllWorldEditFiles()
|
||||
{
|
||||
}
|
||||
|
||||
void WorldEditorWindow::openProjectSettings()
|
||||
{
|
||||
/*
|
||||
|
@ -119,8 +144,11 @@ void WorldEditorWindow::createToolBars()
|
|||
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager();
|
||||
//QAction *action = menuManager->action(Core::Constants::NEW);
|
||||
//m_ui.fileToolBar->addAction(action);
|
||||
|
||||
m_ui.fileToolBar->addAction(m_ui.newWorldEditAction);
|
||||
QAction *action = menuManager->action(Core::Constants::OPEN);
|
||||
m_ui.fileToolBar->addAction(action);
|
||||
m_ui.fileToolBar->addAction(m_ui.saveWorldEditAction);
|
||||
m_ui.fileToolBar->addSeparator();
|
||||
|
||||
action = menuManager->action(Core::Constants::UNDO);
|
||||
|
|
|
@ -43,6 +43,8 @@ public Q_SLOTS:
|
|||
void open();
|
||||
|
||||
private Q_SLOTS:
|
||||
void newWorldEditFile();
|
||||
void saveAllWorldEditFiles();
|
||||
void openProjectSettings();
|
||||
|
||||
private:
|
||||
|
|
|
@ -45,10 +45,19 @@
|
|||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="newPrimitiveAction"/>
|
||||
<addaction name="loadPrimitiveAction"/>
|
||||
<addaction name="selectAction"/>
|
||||
<addaction name="moveAction"/>
|
||||
<addaction name="rotateAction"/>
|
||||
<addaction name="scaleAction"/>
|
||||
<addaction name="turnAction"/>
|
||||
<addaction name="radiusAction"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="pointsAction"/>
|
||||
</widget>
|
||||
<widget class="QDockWidget" name="treePrimitivesDockWidget">
|
||||
<property name="windowTitle">
|
||||
<string>Primitives</string>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>2</number>
|
||||
</attribute>
|
||||
|
@ -82,6 +91,23 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="shToolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="visibleLandAction"/>
|
||||
<addaction name="visiblePrimitivesAction"/>
|
||||
<addaction name="visibleLayersAction"/>
|
||||
<addaction name="visibleDetailsAction"/>
|
||||
<addaction name="visibleGridAction"/>
|
||||
<addaction name="visibleGridPointsAction"/>
|
||||
</widget>
|
||||
<action name="loadPrimitiveAction">
|
||||
<property name="text">
|
||||
<string>loadPrimitive</string>
|
||||
|
@ -92,6 +118,162 @@
|
|||
<string>newPrimitive</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="loadLandAction">
|
||||
<property name="icon">
|
||||
<iconset resource="../landscape_editor/landscape_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_zonel.png</normaloff>:/icons/ic_nel_zonel.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>loadLand</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="landSettingsAction">
|
||||
<property name="icon">
|
||||
<iconset resource="../landscape_editor/landscape_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_landscape_settings.png</normaloff>:/icons/ic_nel_landscape_settings.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>LandSettings</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="visibleLandAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S/H Land</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="visiblePrimitivesAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S/H Primitives</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="visibleLayersAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S/H Layers</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="visibleDetailsAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S/H Details</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="visibleGridAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../landscape_editor/landscape_editor.qrc">
|
||||
<normaloff>:/icons/ic_grid.png</normaloff>:/icons/ic_grid.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S/H Grid</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="visibleGridPointsAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>S/H Grid points</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="newWorldEditAction">
|
||||
<property name="text">
|
||||
<string>New World Edit file</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="saveWorldEditAction">
|
||||
<property name="text">
|
||||
<string>Save World Edit file</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="selectAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="world_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_select.png</normaloff>:/icons/ic_nel_select.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="moveAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="world_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_move.png</normaloff>:/icons/ic_nel_move.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Move</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="rotateAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="world_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_rotate.png</normaloff>:/icons/ic_nel_rotate.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rotate</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="scaleAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="world_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_scale.png</normaloff>:/icons/ic_nel_scale.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Scale</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="turnAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="world_editor.qrc">
|
||||
<normaloff>:/icons/ic_nel_turn.png</normaloff>:/icons/ic_nel_turn.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Turn</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="radiusAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Radius</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="pointsAction">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit points</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
@ -107,6 +289,7 @@
|
|||
</customwidgets>
|
||||
<resources>
|
||||
<include location="world_editor.qrc"/>
|
||||
<include location="../landscape_editor/landscape_editor.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in a new issue