diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.cpp index 9ae8d9bbd..2027831ae 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_scene_base.cpp @@ -283,7 +283,7 @@ QString LandscapeSceneBase::zoneNameFromMousePos() const (m_posX < 0) || (m_posX > MAX_SCENE_WIDTH)) return "NOT A VALID ZONE"; - return QString("%1_%2%3 %4 %5 ").arg(-m_posY).arg(QChar('A' + (m_posX/26))). + return QString("%1_%2%3 %4 %5 ").arg(-m_posY+1).arg(QChar('A' + (m_posX/26))). arg(QChar('A' + (m_posX%26))).arg(m_mouseX, 0,'f',2).arg(-m_mouseY, 0,'f',2); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt index 07d7fa5d1..7b9387c44 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/CMakeLists.txt @@ -16,10 +16,12 @@ SET(OVQT_PLUGIN_WORLD_EDITOR_HDR world_editor_plugin.h primitives_model.h primitives_view.h project_settings_dialog.h + world_editor_settings_page.h ) SET(OVQT_PLUGIN_WORLD_EDITOR_UIS world_editor_window.ui project_settings_dialog.ui + world_editor_settings_page.ui ) SET(OVQT_PLUGIN_WORLD_EDITOR_RCS world_editor.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/colors_workspace_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/colors_workspace_settings_page.ui new file mode 100644 index 000000000..de6e77901 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/colors_workspace_settings_page.ui @@ -0,0 +1,44 @@ + + + WorldEditorSettingsPage + + + + 0 + 0 + 329 + 239 + + + + Form + + + + + + Colors + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp index 90d2de6d6..051d403ea 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_plugin.cpp @@ -18,6 +18,7 @@ // Project includes #include "world_editor_plugin.h" #include "world_editor_window.h" +#include "world_editor_settings_page.h" #include "../core/icore.h" #include "../core/core_constants.h" @@ -47,6 +48,10 @@ WorldEditorPlugin::~WorldEditorPlugin() bool WorldEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { m_plugMan = pluginManager; + + WorldEditorSettingsPage *weSettings = new WorldEditorSettingsPage(this); + addAutoReleasedObject(weSettings); + QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup(Constants::WORLD_EDITOR_SECTION); m_ligoConfig.CellSize = settings->value(Constants::WORLD_EDITOR_CELL_SIZE, "160").toFloat(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.cpp new file mode 100644 index 000000000..f3b3e6551 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.cpp @@ -0,0 +1,71 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "world_editor_settings_page.h" +#include "world_editor_constants.h" + +// Qt includes +#include + +// NeL includes + +namespace WorldEditor +{ + +WorldEditorSettingsPage::WorldEditorSettingsPage(QObject *parent) + : IOptionsPage(parent), + m_currentPage(NULL) +{ +} + +QString WorldEditorSettingsPage::id() const +{ + return QLatin1String(Constants::WORLD_EDITOR_PLUGIN); +} + +QString WorldEditorSettingsPage::trName() const +{ + return tr("General"); +} + +QString WorldEditorSettingsPage::category() const +{ + return QLatin1String(Constants::WORLD_EDITOR_PLUGIN); +} + +QString WorldEditorSettingsPage::trCategory() const +{ + return tr("World Editor"); +} + +QIcon WorldEditorSettingsPage::categoryIcon() const +{ + return QIcon(); +} + +QWidget *WorldEditorSettingsPage::createPage(QWidget *parent) +{ + m_currentPage = new QWidget(parent); + m_ui.setupUi(m_currentPage); + return m_currentPage; +} + +void WorldEditorSettingsPage::apply() +{ +} + +} /* namespace WorldEditor */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.h new file mode 100644 index 000000000..27cda963e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.h @@ -0,0 +1,59 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef WORLD_EDITOR_SETTINGS_PAGE_H +#define WORLD_EDITOR_SETTINGS_PAGE_H + +#include + +#include "../core/ioptions_page.h" + +#include "ui_world_editor_settings_page.h" + +class QWidget; + +namespace WorldEditor +{ + +/** +@class WorldEditorSettingsPage +*/ +class WorldEditorSettingsPage : public Core::IOptionsPage +{ + Q_OBJECT +public: + WorldEditorSettingsPage(QObject *parent = 0); + virtual ~WorldEditorSettingsPage() {} + + virtual QString id() const; + virtual QString trName() const; + virtual QString category() const; + virtual QString trCategory() const; + QIcon categoryIcon() const; + virtual QWidget *createPage(QWidget *parent); + + virtual void apply(); + virtual void finish() {} + +private: + QWidget *m_currentPage; + Ui::WorldEditorSettingsPage m_ui; +}; + +} // namespace WorldEditor + +#endif // WORLD_EDITOR_SETTINGS_PAGE_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.ui new file mode 100644 index 000000000..9219da6c4 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_settings_page.ui @@ -0,0 +1,137 @@ + + + WorldEditorSettingsPage + + + false + + + + 0 + 0 + 329 + 239 + + + + Form + + + + 6 + + + 3 + + + + + Workspace + + + + + + Top Left + + + + + + + + + + + + + Bottom Right + + + + + + + + + + + + + Use OpenGL + + + + + + + + + + Ligoscape + + + + + + Cell size + + + + + + + + + + Snap + + + + + + + + + + Ligo class + + + + + + + + + + + + ... + + + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp index ac46491f3..52c4cd460 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.cpp @@ -37,6 +37,7 @@ // Qt includes #include #include +#include namespace WorldEditor { @@ -54,7 +55,7 @@ WorldEditorWindow::WorldEditorWindow(QWidget *parent) m_worldEditorScene->setZoneBuilder(m_zoneBuilderBase); m_ui.graphicsView->setScene(m_worldEditorScene); - m_ui.graphicsView->setVisibleText(false); + //m_ui.graphicsView->setVisibleText(false); QActionGroup *sceneModeGroup = new QActionGroup(this); sceneModeGroup->addAction(m_ui.selectAction); @@ -100,6 +101,14 @@ WorldEditorWindow::WorldEditorWindow(QWidget *parent) connect(m_ui.settingsAction, SIGNAL(triggered()), this, SLOT(openProjectSettings())); connect(m_ui.newWorldEditAction, SIGNAL(triggered()), this, SLOT(newWorldEditFile())); connect(m_ui.saveWorldEditAction, SIGNAL(triggered()), this, SLOT(saveWorldEditFile())); + connect(m_ui.visibleGridAction, SIGNAL(toggled(bool)), m_ui.graphicsView, SLOT(setVisibleGrid(bool))); + + m_statusBarTimer = new QTimer(this); + connect(m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar())); + + m_statusInfo = new QLabel(this); + m_statusInfo->hide(); + Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo); } WorldEditorWindow::~WorldEditorWindow() @@ -215,20 +224,25 @@ void WorldEditorWindow::setMode(int value) } } +void WorldEditorWindow::updateStatusBar() +{ + m_statusInfo->setText(m_worldEditorScene->zoneNameFromMousePos()); +} + void WorldEditorWindow::showEvent(QShowEvent *showEvent) { QMainWindow::showEvent(showEvent); if (m_oglWidget != 0) m_oglWidget->makeCurrent(); - //m_statusInfo->show(); - //m_statusBarTimer->start(100); + m_statusInfo->show(); + m_statusBarTimer->start(100); } void WorldEditorWindow::hideEvent(QHideEvent *hideEvent) { QMainWindow::hideEvent(hideEvent); - //m_statusInfo->hide(); - //m_statusBarTimer->stop(); + m_statusInfo->hide(); + m_statusBarTimer->stop(); } void WorldEditorWindow::createMenus() diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h index 321c46c3e..65d39ac58 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.h @@ -22,6 +22,8 @@ // Qt includes #include +#include +#include #include #include @@ -55,6 +57,7 @@ private Q_SLOTS: void openProjectSettings(); void setMode(int value); + void updateStatusBar(); protected: virtual void showEvent(QShowEvent *showEvent); @@ -71,6 +74,9 @@ private: QString m_lastDir; + QLabel *m_statusInfo; + QTimer *m_statusBarTimer; + PrimitivesTreeModel *m_primitivesModel; QUndoStack *m_undoStack; WorldEditorScene *m_worldEditorScene; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.ui index 37f56ca11..f5dc5f408 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/world_editor_window.ui @@ -205,8 +205,11 @@ true + + true + - false + true