From 8680766a2e19e723a28b4825d6b8545c5f420e17 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Tue, 31 May 2011 18:37:04 +0300 Subject: [PATCH 01/88] Changed: #1193 Added new actions. Added fullscreen mode. --- .../src/plugins/core/core_constants.h | 22 ++- .../src/plugins/core/main_window.cpp | 168 +++++++++++++++++- .../src/plugins/core/main_window.h | 24 +++ 3 files changed, 204 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h index 7f0b5cd15..2acf4f731 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h @@ -23,10 +23,10 @@ namespace Core namespace Constants { -const char * const OVQT_VERSION_LONG = "0.0.1"; +const char * const OVQT_VERSION_LONG = "0.1"; const char * const OVQT_VENDOR = "Ryzom Core"; const char * const OVQT_YEAR = "2010, 2011"; -const char * const OVQT_CORE_PLUGIN = "Core"; +const char * const OVQT_CORE_PLUGIN = "Core"; //mainwindow const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; @@ -43,12 +43,26 @@ const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; const char * const M_HELP = "ObjectViewerQt.Menu.Help"; +const char * const M_FILE_RECENTFILES = "ObjectViewerQt.Menu.File.RecentFiles"; const char * const M_SHEET = "ObjectViewerQt.Menu.Sheet"; //actions const char * const NEW = "ObjectViewerQt.New"; -const char * const OPEN = "ObjectViewerQt.Open"; -const char * const EXIT = "ObjectViewerQt.Exit"; +const char * const OPEN = "ObjectViewerQt.Open"; +const char * const SAVE = "ObjectViewerQt.Save"; +const char * const SAVE_AS = "ObjectViewerQt.SaveAs"; +const char * const SAVE_ALL = "ObjectViewerQt.SaveAll"; +const char * const EXIT = "ObjectViewerQt.Exit"; + +const char * const UNDO = "ObjectViewerQt.Undo"; +const char * const REDO = "ObjectViewerQt.Redo"; +const char * const CUT = "ObjectViewerQt.Cut"; +const char * const COPY = "ObjectViewerQt.Copy"; +const char * const PASTE = "ObjectViewerQt.Paste"; +const char * const DEL = "ObjectViewerQt.Del"; +const char * const FIND = "ObjectViewerQt.Find"; +const char * const SELECT_ALL = "ObjectViewerQt.SelectAll"; +const char * const GOTO_POS = "ObjectViewerQt.Goto"; const char * const SETTINGS = "ObjectViewerQt.Settings"; const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 79316424a..86237cb51 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -98,11 +98,11 @@ bool MainWindow::initialize(QString *errorString) void MainWindow::extensionsInitialized() { - readSettings(); - connect(m_contextManager, SIGNAL(currentContextChanged(Core::IContext*)), - this, SLOT(updateContext(Core::IContext*))); - if (m_contextManager->currentContext() != NULL) - updateContext(m_contextManager->currentContext()); + readSettings(); + connect(m_contextManager, SIGNAL(currentContextChanged(Core::IContext*)), + this, SLOT(updateContext(Core::IContext*))); + if (m_contextManager->currentContext() != NULL) + updateContext(m_contextManager->currentContext()); show(); } @@ -141,6 +141,56 @@ void MainWindow::open() m_contextManager->currentContext()->open(); } +void MainWindow::newFile() +{ +} + +void MainWindow::save() +{ +} + +void MainWindow::saveAs() +{ +} + +void MainWindow::saveAll() +{ +} + +void MainWindow::cut() +{ +} + +void MainWindow::copy() +{ +} + +void MainWindow::paste() +{ +} + +void MainWindow::del() +{ +} + +void MainWindow::find() +{ +} + +void MainWindow::gotoPos() +{ +} + +void MainWindow::setFullScreen(bool enabled) +{ + if (bool(windowState() & Qt::WindowFullScreen) == enabled) + return; + if (enabled) + setWindowState(windowState() | Qt::WindowFullScreen); + else + setWindowState(windowState() & ~Qt::WindowFullScreen); +} + bool MainWindow::showOptionsDialog(const QString &group, const QString &page, QWidget *parent) @@ -186,6 +236,13 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::createActions() { + m_newAction = new QAction(tr("&New"), this); + m_newAction->setIcon(QIcon(Constants::ICON_NEW)); + m_newAction->setShortcut(QKeySequence::New); + menuManager()->registerAction(m_newAction, Constants::NEW); + connect(m_newAction, SIGNAL(triggered()), this, SLOT(newFile())); + m_newAction->setEnabled(false); + m_openAction = new QAction(tr("&Open..."), this); m_openAction->setIcon(QIcon(Constants::ICON_OPEN)); m_openAction->setShortcut(QKeySequence::Open); @@ -193,15 +250,92 @@ void MainWindow::createActions() menuManager()->registerAction(m_openAction, Constants::OPEN); connect(m_openAction, SIGNAL(triggered()), this, SLOT(open())); + m_saveAction = new QAction(tr("&Save"), this); + m_saveAction->setIcon(QIcon(Constants::ICON_SAVE)); + m_saveAction->setShortcut(QKeySequence::Save); + menuManager()->registerAction(m_saveAction, Constants::SAVE); + connect(m_saveAction, SIGNAL(triggered()), this, SLOT(save())); + m_saveAction->setEnabled(false); + + m_saveAsAction = new QAction(tr("Save &As..."), this); + m_saveAsAction->setIcon(QIcon(Constants::ICON_SAVE_AS)); + m_saveAsAction->setShortcut(QKeySequence::SaveAs); + menuManager()->registerAction(m_saveAsAction, Constants::SAVE_AS); + connect(m_saveAsAction, SIGNAL(triggered()), this, SLOT(saveAs())); + m_saveAsAction->setEnabled(false); + + m_saveAllAction = new QAction(tr("&Save A&ll"), this); + m_saveAllAction->setShortcut(QKeySequence::SelectAll); +#ifdef Q_WS_MAC + m_saveAllAction->setShortcut(QKeySequence(tr("Ctrl+Shift+S"))); +#endif + menuManager()->registerAction(m_saveAllAction, Constants::SAVE_ALL); + connect(m_saveAllAction, SIGNAL(triggered()), this, SLOT(saveAll())); + m_saveAllAction->setEnabled(false); + m_exitAction = new QAction(tr("E&xit"), this); m_exitAction->setShortcut(QKeySequence(tr("Ctrl+Q"))); m_exitAction->setStatusTip(tr("Exit the application")); menuManager()->registerAction(m_exitAction, Constants::EXIT); connect(m_exitAction, SIGNAL(triggered()), this, SLOT(close())); + m_cutAction = new QAction(tr("Cu&t"), this); + m_cutAction->setShortcut(QKeySequence::Cut); + menuManager()->registerAction(m_cutAction, Constants::CUT); + connect(m_cutAction, SIGNAL(triggered()), this, SLOT(cut())); + m_cutAction->setEnabled(false); + + m_copyAction = new QAction(tr("&Copy"), this); + m_copyAction->setShortcut(QKeySequence::Copy); + menuManager()->registerAction(m_copyAction, Constants::COPY); + connect(m_copyAction, SIGNAL(triggered()), this, SLOT(copy())); + m_copyAction->setEnabled(false); + + m_pasteAction = new QAction(tr("&Paste"), this); + m_pasteAction->setShortcut(QKeySequence::Paste); + menuManager()->registerAction(m_pasteAction, Constants::PASTE); + connect(m_pasteAction, SIGNAL(triggered()), this, SLOT(paste())); + m_pasteAction->setEnabled(false); + + m_delAction = new QAction(tr("&Delete"), this); + m_delAction->setShortcut(QKeySequence::Delete); + menuManager()->registerAction(m_delAction, Constants::DEL); + connect(m_delAction, SIGNAL(triggered()), this, SLOT(del())); + m_delAction->setEnabled(false); + + m_selectAllAction = new QAction(tr("Select &All"), this); + m_selectAllAction->setShortcut(QKeySequence::SelectAll); + menuManager()->registerAction(m_selectAllAction, Constants::SELECT_ALL); + connect(m_selectAllAction, SIGNAL(triggered()), this, SLOT(selectAll())); + m_selectAllAction->setEnabled(false); + + m_findAction = new QAction(tr("&Find"), this); + m_findAction->setShortcut(QKeySequence::Find); + menuManager()->registerAction(m_findAction, Constants::FIND); + connect(m_findAction, SIGNAL(triggered()), this, SLOT(find())); + m_findAction->setEnabled(false); + + m_gotoAction = new QAction(tr("&Go To.."), this); + m_gotoAction->setShortcut(QKeySequence(tr("Ctrl+G"))); + menuManager()->registerAction(m_gotoAction, Constants::GOTO_POS); + connect(m_gotoAction, SIGNAL(triggered()), this, SLOT(gotoPos())); + m_gotoAction->setEnabled(false); + +#ifndef Q_WS_MAC + m_fullscreenAction = new QAction(tr("Fullscreen"), this); + m_fullscreenAction->setCheckable(true); + m_fullscreenAction->setShortcut(QKeySequence(tr("Ctrl+Shift+F11"))); + menuManager()->registerAction(m_fullscreenAction, Constants::SETTINGS); + connect(m_fullscreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); +#endif + m_settingsAction = new QAction(tr("&Settings"), this); m_settingsAction->setIcon(QIcon(":/images/preferences.png")); m_settingsAction->setShortcut(QKeySequence::Preferences); +#ifdef Q_WS_MAC + m_settingsAction->setShortcut(QKeySequence("Ctrl+,")); + m_settingsAction->setMenuRole(QAction::PreferencesRole); +#endif m_settingsAction->setStatusTip(tr("Open the settings dialog")); menuManager()->registerAction(m_settingsAction, Constants::SETTINGS); connect(m_settingsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog())); @@ -223,7 +357,6 @@ void MainWindow::createActions() #ifdef Q_WS_MAC m_exitAction->setMenuRole(QAction::QuitRole); - m_settingsAction->setMenuRole(QAction::PreferencesRole); m_aboutAction->setMenuRole(QAction::AboutRole); m_aboutQtAction->setMenuRole(QAction::AboutQtRole); m_pluginViewAction->setMenuRole(QAction::ApplicationSpecificRole); @@ -234,7 +367,18 @@ void MainWindow::createMenus() { m_fileMenu = menuBar()->addMenu(tr("&File")); menuManager()->registerMenu(m_fileMenu, Constants::M_FILE); + m_fileMenu->addAction(m_newAction); m_fileMenu->addAction(m_openAction); + m_fileMenu->addSeparator(); + m_fileMenu->addAction(m_saveAction); + m_fileMenu->addAction(m_saveAsAction); + m_fileMenu->addAction(m_saveAllAction); + m_fileMenu->addSeparator(); + + m_recentFilesMenu = m_fileMenu->addMenu(tr("Recent &Files")); + m_recentFilesMenu->setEnabled(false); + menuManager()->registerMenu(m_recentFilesMenu, Constants::M_FILE_RECENTFILES); + m_fileMenu->addSeparator(); m_fileMenu->addAction(m_exitAction); @@ -242,9 +386,21 @@ void MainWindow::createMenus() m_editMenu->addAction(m_undoGroup->createUndoAction(this)); m_editMenu->addAction(m_undoGroup->createRedoAction(this)); m_editMenu->addSeparator(); + m_editMenu->addAction(m_cutAction); + m_editMenu->addAction(m_copyAction); + m_editMenu->addAction(m_pasteAction); + m_editMenu->addAction(m_delAction); + m_editMenu->addSeparator(); + m_editMenu->addAction(m_selectAllAction); + m_editMenu->addSeparator(); + m_editMenu->addAction(m_findAction); + m_editMenu->addAction(m_gotoAction); menuManager()->registerMenu(m_editMenu, Constants::M_EDIT); m_viewMenu = menuBar()->addMenu(tr("&View")); +#ifndef Q_WS_MAC + m_viewMenu->addAction(m_fullscreenAction); +#endif menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW); m_toolsMenu = menuBar()->addMenu(tr("&Tools")); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index 74ec08957..85ebad22e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -66,6 +66,17 @@ public Q_SLOTS: private Q_SLOTS: void open(); + void newFile(); + void save(); + void saveAs(); + void saveAll(); + void cut(); + void copy(); + void paste(); + void del(); + void find(); + void gotoPos(); + void setFullScreen(bool enabled); void about(); void updateContext(Core::IContext *context); @@ -99,6 +110,7 @@ private: QTabWidget *m_tabWidget; QMenu *m_fileMenu; + QMenu *m_recentFilesMenu; QMenu *m_editMenu; QMenu *m_viewMenu; QMenu *m_toolsMenu; @@ -106,8 +118,20 @@ private: QMenu *m_sheetMenu; + QAction *m_newAction; QAction *m_openAction; + QAction *m_saveAction; + QAction *m_saveAsAction; + QAction *m_saveAllAction; QAction *m_exitAction; + QAction *m_cutAction; + QAction *m_copyAction; + QAction *m_pasteAction; + QAction *m_delAction; + QAction *m_selectAllAction; + QAction *m_findAction; + QAction *m_gotoAction; + QAction *m_fullscreenAction; QAction *m_settingsAction; QAction *m_pluginViewAction; QAction *m_aboutAction; From 1457deeb5e8951edd491c256c3a5c43b83a87580 Mon Sep 17 00:00:00 2001 From: rti Date: Tue, 31 May 2011 18:10:32 +0200 Subject: [PATCH 02/88] Fixed: #1006 On Mac OS X, do glFinish() after vertex program upload to ensure program is ready to use. --- .../src/3d/driver/opengl/driver_opengl_vertex_program.cpp | 8 ++++++++ code/ryzom/client/src/main_loop.cpp | 4 ---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp index 4c255e1d9..befcb7b9b 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex_program.cpp @@ -1440,6 +1440,14 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra nlassert(0); return false; } + +#ifdef NL_OS_MAC + // Wait for GPU to finish program upload, else draw comands might crash. + // Happened to CVegetableBlendLayerModel (glDrawElements()). + // For more information, see http://dev.ryzom.com/issues/1006 + glFinish(); +#endif + return true; } diff --git a/code/ryzom/client/src/main_loop.cpp b/code/ryzom/client/src/main_loop.cpp index f8ff5ae89..2a513244a 100644 --- a/code/ryzom/client/src/main_loop.cpp +++ b/code/ryzom/client/src/main_loop.cpp @@ -700,9 +700,6 @@ void updateFromClientCfg() //--------------------------------------------------- if (Landscape) { -#ifdef NL_OS_MAC - Landscape->enableVegetable(false); -#else if (ClientCfg.MicroVeget != LastClientCfg.MicroVeget) { if(ClientCfg.MicroVeget) @@ -722,7 +719,6 @@ void updateFromClientCfg() Landscape->enableVegetable(false); } } -#endif } //--------------------------------------------------- From 589fd30e8a2f0d6a067eeb96e74202b909e060cb Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Tue, 31 May 2011 19:50:16 +0300 Subject: [PATCH 03/88] Fixed: #1193 Updated mac menu stuff. --- .../src/plugins/core/main_window.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index 86237cb51..f4f5b9419 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -266,9 +266,6 @@ void MainWindow::createActions() m_saveAllAction = new QAction(tr("&Save A&ll"), this); m_saveAllAction->setShortcut(QKeySequence::SelectAll); -#ifdef Q_WS_MAC - m_saveAllAction->setShortcut(QKeySequence(tr("Ctrl+Shift+S"))); -#endif menuManager()->registerAction(m_saveAllAction, Constants::SAVE_ALL); connect(m_saveAllAction, SIGNAL(triggered()), this, SLOT(saveAll())); m_saveAllAction->setEnabled(false); @@ -321,21 +318,17 @@ void MainWindow::createActions() connect(m_gotoAction, SIGNAL(triggered()), this, SLOT(gotoPos())); m_gotoAction->setEnabled(false); -#ifndef Q_WS_MAC +//#ifndef Q_WS_MAC m_fullscreenAction = new QAction(tr("Fullscreen"), this); m_fullscreenAction->setCheckable(true); m_fullscreenAction->setShortcut(QKeySequence(tr("Ctrl+Shift+F11"))); menuManager()->registerAction(m_fullscreenAction, Constants::SETTINGS); connect(m_fullscreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); -#endif +//#endif m_settingsAction = new QAction(tr("&Settings"), this); m_settingsAction->setIcon(QIcon(":/images/preferences.png")); m_settingsAction->setShortcut(QKeySequence::Preferences); -#ifdef Q_WS_MAC - m_settingsAction->setShortcut(QKeySequence("Ctrl+,")); - m_settingsAction->setMenuRole(QAction::PreferencesRole); -#endif m_settingsAction->setStatusTip(tr("Open the settings dialog")); menuManager()->registerAction(m_settingsAction, Constants::SETTINGS); connect(m_settingsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog())); @@ -359,6 +352,7 @@ void MainWindow::createActions() m_exitAction->setMenuRole(QAction::QuitRole); m_aboutAction->setMenuRole(QAction::AboutRole); m_aboutQtAction->setMenuRole(QAction::AboutQtRole); + m_settingsAction->setMenuRole(QAction::PreferencesRole); m_pluginViewAction->setMenuRole(QAction::ApplicationSpecificRole); #endif } @@ -398,9 +392,9 @@ void MainWindow::createMenus() menuManager()->registerMenu(m_editMenu, Constants::M_EDIT); m_viewMenu = menuBar()->addMenu(tr("&View")); -#ifndef Q_WS_MAC +//#ifndef Q_WS_MAC m_viewMenu->addAction(m_fullscreenAction); -#endif +//#endif menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW); m_toolsMenu = menuBar()->addMenu(tr("&Tools")); From f9f2ccb2a2b98e625d2c65271e95353fd74f8c93 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Tue, 31 May 2011 21:46:19 +0300 Subject: [PATCH 04/88] Changed: #1193 Updated mac menu stuff. --- .../src/plugins/core/main_window.cpp | 27 ++++++++++--------- .../src/plugins/core/main_window.h | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index f4f5b9419..ccad041de 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -57,8 +57,15 @@ MainWindow::MainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget * m_settings = m_pluginManager->settings(); m_coreImpl = new CoreImpl(this); +#ifdef Q_WS_MAC + m_menuBar = new QMenuBar(0); +#else + m_menuBar = new QMenuBar(this); + setMenuBar(m_menuBar); +#endif + m_menuManager = new MenuManager(this); - m_menuManager->setMenuBar(menuBar()); + m_menuManager->setMenuBar(m_menuBar); m_tabWidget = new QTabWidget(this); m_tabWidget->setTabPosition(QTabWidget::South); @@ -318,13 +325,11 @@ void MainWindow::createActions() connect(m_gotoAction, SIGNAL(triggered()), this, SLOT(gotoPos())); m_gotoAction->setEnabled(false); -//#ifndef Q_WS_MAC m_fullscreenAction = new QAction(tr("Fullscreen"), this); m_fullscreenAction->setCheckable(true); m_fullscreenAction->setShortcut(QKeySequence(tr("Ctrl+Shift+F11"))); menuManager()->registerAction(m_fullscreenAction, Constants::SETTINGS); connect(m_fullscreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); -//#endif m_settingsAction = new QAction(tr("&Settings"), this); m_settingsAction->setIcon(QIcon(":/images/preferences.png")); @@ -350,16 +355,16 @@ void MainWindow::createActions() #ifdef Q_WS_MAC m_exitAction->setMenuRole(QAction::QuitRole); + m_settingsAction->setMenuRole(QAction::PreferencesRole); m_aboutAction->setMenuRole(QAction::AboutRole); m_aboutQtAction->setMenuRole(QAction::AboutQtRole); - m_settingsAction->setMenuRole(QAction::PreferencesRole); m_pluginViewAction->setMenuRole(QAction::ApplicationSpecificRole); #endif } void MainWindow::createMenus() { - m_fileMenu = menuBar()->addMenu(tr("&File")); + m_fileMenu = m_menuBar->addMenu(tr("&File")); menuManager()->registerMenu(m_fileMenu, Constants::M_FILE); m_fileMenu->addAction(m_newAction); m_fileMenu->addAction(m_openAction); @@ -376,7 +381,7 @@ void MainWindow::createMenus() m_fileMenu->addSeparator(); m_fileMenu->addAction(m_exitAction); - m_editMenu = menuBar()->addMenu(tr("&Edit")); + m_editMenu = m_menuBar->addMenu(tr("&Edit")); m_editMenu->addAction(m_undoGroup->createUndoAction(this)); m_editMenu->addAction(m_undoGroup->createRedoAction(this)); m_editMenu->addSeparator(); @@ -391,13 +396,11 @@ void MainWindow::createMenus() m_editMenu->addAction(m_gotoAction); menuManager()->registerMenu(m_editMenu, Constants::M_EDIT); - m_viewMenu = menuBar()->addMenu(tr("&View")); -//#ifndef Q_WS_MAC + m_viewMenu = m_menuBar->addMenu(tr("&View")); m_viewMenu->addAction(m_fullscreenAction); -//#endif menuManager()->registerMenu(m_viewMenu, Constants::M_VIEW); - m_toolsMenu = menuBar()->addMenu(tr("&Tools")); + m_toolsMenu = m_menuBar->addMenu(tr("&Tools")); menuManager()->registerMenu(m_toolsMenu, Constants::M_TOOLS); m_sheetMenu = m_toolsMenu->addMenu(tr("&Sheet")); @@ -407,9 +410,9 @@ void MainWindow::createMenus() m_toolsMenu->addAction(m_settingsAction); - menuBar()->addSeparator(); + m_menuBar->addSeparator(); - m_helpMenu = menuBar()->addMenu(tr("&Help")); + m_helpMenu = m_menuBar->addMenu(tr("&Help")); menuManager()->registerMenu(m_helpMenu, Constants::M_HELP); m_helpMenu->addAction(m_aboutAction); m_helpMenu->addAction(m_aboutQtAction); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h index 85ebad22e..ce439b885 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -115,7 +115,7 @@ private: QMenu *m_viewMenu; QMenu *m_toolsMenu; QMenu *m_helpMenu; - + QMenuBar *m_menuBar; QMenu *m_sheetMenu; QAction *m_newAction; From a945ad784dbeee25e218a361a9b4d6b6c1261d46 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Tue, 31 May 2011 22:06:58 +0300 Subject: [PATCH 05/88] Changed: #1193 Updated menu stuff. --- .../src/plugins/core/main_window.cpp | 2 +- .../src/plugins/example/plugin1.cpp | 1 - .../src/plugins/object_viewer/main_window.cpp | 17 ++--------------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp index ccad041de..21334f7ea 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -328,7 +328,7 @@ void MainWindow::createActions() m_fullscreenAction = new QAction(tr("Fullscreen"), this); m_fullscreenAction->setCheckable(true); m_fullscreenAction->setShortcut(QKeySequence(tr("Ctrl+Shift+F11"))); - menuManager()->registerAction(m_fullscreenAction, Constants::SETTINGS); + menuManager()->registerAction(m_fullscreenAction, Constants::TOGGLE_FULLSCREEN); connect(m_fullscreenAction, SIGNAL(triggered(bool)), this, SLOT(setFullScreen(bool))); m_settingsAction = new QAction(tr("&Settings"), this); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index cde1ca199..f218c3230 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -90,7 +90,6 @@ QStringList MyPlugin::dependencies() const { QStringList list; list.append(Core::Constants::OVQT_CORE_PLUGIN); - list.append("ObjectViewer"); return list; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp index dd8a4bb1e..e1962cf5b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/main_window.cpp @@ -239,12 +239,6 @@ void CMainWindow::updateStatusBar() void CMainWindow::createActions() { - _openAction = new QAction(tr("&Open..."), this); - _openAction->setIcon(QIcon(Core::Constants::ICON_OPEN)); - _openAction->setShortcut(QKeySequence::Open); - _openAction->setStatusTip(tr("Open an existing file")); - connect(_openAction, SIGNAL(triggered()), this, SLOT(open())); - _setBackColorAction = _GraphicsViewport->createSetBackgroundColor(this); _setBackColorAction->setText(tr("Set &background color")); _setBackColorAction->setIcon(QIcon(Constants::ICON_BGCOLOR)); @@ -259,7 +253,7 @@ void CMainWindow::createActions() connect(_reloadTexturesAction, SIGNAL(triggered()), this, SLOT(reloadTextures())); _saveScreenshotAction = _GraphicsViewport->createSaveScreenshotAction(this); - _saveScreenshotAction->setText(tr("Save &Screenshot")); + _saveScreenshotAction->setText(tr("Save Screenshot")); _saveScreenshotAction->setStatusTip(tr("Make a screenshot of the current viewport and save")); } @@ -267,14 +261,7 @@ void CMainWindow::createMenus() { Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); - // register actions for file menu - menuManager->registerAction(_openAction, "ObjectViewer.File.Open"); - - // add actions in file menu - QMenu *fileMenu = menuManager->menu(Core::Constants::M_FILE); - QAction *exitAction = menuManager->action(Core::Constants::EXIT); - //fileMenu->insertAction(exitAction, _openAction); - //fileMenu->insertSeparator(exitAction); + _openAction = menuManager->action(Core::Constants::OPEN); // register actions for view menu menuManager->registerAction(_setBackColorAction, "ObjectViewer.View.SetBackgroundColor"); From 89197ae54fa540b71b537515e630e73b238e6af3 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 31 May 2011 21:51:26 +0200 Subject: [PATCH 06/88] Changed: Merge changes from next patch --- code/ryzom/client/src/character_cl.cpp | 8 + .../src/interface_v3/action_handler_game.cpp | 4 +- .../src/interface_v3/action_handler_help.cpp | 3 +- .../client/src/interface_v3/dbctrl_sheet.cpp | 6 +- .../client/src/interface_v3/group_html.cpp | 23 +- .../src/interface_v3/group_html_webig.cpp | 2 +- .../interface_v3/item_consumable_effect.cpp | 14 +- .../src/interface_v3/sphrase_manager.cpp | 8 +- .../data_shard/client_commands_privileges.txt | 33 +- .../server/src/ai_service/ai_instance.cpp | 65 +- code/ryzom/server/src/ai_service/nf_grp.cpp | 37 +- .../server/src/ai_service/nf_grp_npc.cpp | 207 +++- .../src/entities_game_service/admin.cpp | 966 +++++++++++++++++- .../building_manager/room_instance.cpp | 4 +- .../entities_game_service/client_messages.cpp | 6 +- .../creature_manager/creature.cpp | 6 +- .../creature_manager/creature.h | 2 + .../egs_sheets/egs_static_brick.cpp | 30 + .../egs_sheets/egs_static_brick.cpp.h | 148 ++- .../mission_manager/mission_event.cpp | 23 +- .../mission_manager/mission_event.h | 13 + .../mission_manager/mission_step_kill.cpp | 206 +++- .../modules/character_control.cpp | 2 +- .../phrase_manager/aura_effect.cpp | 22 +- .../phrase_manager/aura_effect.h | 4 + .../phrase_manager/combat_phrase.cpp | 5 + .../phrase_manager/faber_action.cpp | 15 +- .../phrase_manager/magic_phrase.cpp | 20 +- .../phrase_manager/s_effect.h | 19 +- .../phrase_manager/special_power.cpp | 7 +- .../phrase_manager/special_power.h | 14 +- .../special_power_basic_aura.cpp | 9 +- .../phrase_manager/special_power_phrase.cpp | 70 +- .../phrase_manager/timed_actions.cpp | 11 + .../player_manager/character.cpp | 168 ++- .../player_manager/character.h | 18 +- .../character_inventory_manipulation.cpp | 102 +- .../player_manager/player_manager.cpp | 2 +- .../progression/progression_pve.cpp | 35 +- .../progression/progression_pve.h | 5 +- .../progression/progression_pvp.cpp | 3 + .../pvp_manager/pvp_manager_2.cpp | 104 +- .../pvp_manager/pvp_manager_2.h | 8 + 43 files changed, 2325 insertions(+), 132 deletions(-) diff --git a/code/ryzom/client/src/character_cl.cpp b/code/ryzom/client/src/character_cl.cpp index 87332f42d..37c1d0a24 100644 --- a/code/ryzom/client/src/character_cl.cpp +++ b/code/ryzom/client/src/character_cl.cpp @@ -9006,6 +9006,14 @@ void CCharacterCL::setAuraFX(uint index, const CAnimationFX *sheet) if (sheet == NULL) { + std::list::iterator itAttachedFxToStart = _AttachedFXListToStart.begin(); + while(itAttachedFxToStart != _AttachedFXListToStart.end()) + { + if ((*itAttachedFxToStart).MaxNumAnimCount == index) + itAttachedFxToStart = _AttachedFXListToStart.erase(itAttachedFxToStart); + else + ++itAttachedFxToStart; + } // if there's already an aura attached, and if it is not already shutting down if (_AuraFX[index] && _AuraFX[index]->TimeOutDate == 0.f) { diff --git a/code/ryzom/client/src/interface_v3/action_handler_game.cpp b/code/ryzom/client/src/interface_v3/action_handler_game.cpp index 16e4c427c..f358fa3fd 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_game.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_game.cpp @@ -2497,7 +2497,9 @@ class CAHAddShape : public IActionHandler { shape = sShape.substr(0, index); sShape = sShape.substr(index+1); - } else { + } + else + { shape = sShape; have_shapes = false; } diff --git a/code/ryzom/client/src/interface_v3/action_handler_help.cpp b/code/ryzom/client/src/interface_v3/action_handler_help.cpp index f6271f355..4c92fe6e0 100644 --- a/code/ryzom/client/src/interface_v3/action_handler_help.cpp +++ b/code/ryzom/client/src/interface_v3/action_handler_help.cpp @@ -2052,7 +2052,8 @@ void getItemText (CDBCtrlSheet *item, ucstring &itemText, const CItemSheet*pIS) case ITEMFAMILY::CONSUMABLE : { strFindReplace(itemText, "%consumption_time", toString(pIS->Consumable.ConsumptionTime)); - strFindReplace(itemText, "%overdose_timer", toString(pIS->Consumable.OverdoseTimer/60)); + strFindReplace(itemText, "%overdose_timer_min", toString(pIS->Consumable.OverdoseTimer/60)); + strFindReplace(itemText, "%overdose_timer_sec", toString(pIS->Consumable.OverdoseTimer % 60)); // Get Item Consumable infos CItemConsumableEffectHelper::getInstance()->getItemConsumableEffectText(pIS, itemText, item->getQuality()); } diff --git a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp index e328816a9..42f438202 100644 --- a/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp +++ b/code/ryzom/client/src/interface_v3/dbctrl_sheet.cpp @@ -2095,13 +2095,13 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti rVR.draw11RotFlipBitmap (_RenderLayer, x, y, 0, false, _DispOverBmpId, armourCol); // decal layer because must drawn after Items/Brick in DXTC // NB: use OverColor, not Over2Color here. Because of hack in updateArmourColor() - rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOverColor)); + rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOverColor)); } else { // decal layer because must drawn after Items/Brick in DXTC - rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, _DispOverBmpId, fastMulRGB(curSheetColor, _IconOverColor)); - rVR.draw11RotFlipBitmap (_RenderLayer+2, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color)); + rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOverBmpId, fastMulRGB(curSheetColor, _IconOverColor)); + rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color)); } // Draw Quality. -1 for lookandfeel. Draw it with global color diff --git a/code/ryzom/client/src/interface_v3/group_html.cpp b/code/ryzom/client/src/interface_v3/group_html.cpp index dda2250a8..b0e94ca6c 100644 --- a/code/ryzom/client/src/interface_v3/group_html.cpp +++ b/code/ryzom/client/src/interface_v3/group_html.cpp @@ -871,6 +871,13 @@ void CGroupHTML::beginElement (uint element_number, const BOOL *present, const c { _TextColor.push_back(_TextColor.empty() ? CRGBA::White : _TextColor.back()); } + + if (present[HTML_FONT_SIZE] && value[HTML_FONT_SIZE]) + { + uint fontsize; + fromString(value[HTML_FONT_SIZE], fontsize); + _FontSize.push_back(fontsize); + } } break; case HTML_BR: @@ -1407,6 +1414,7 @@ void CGroupHTML::endElement (uint element_number) { case HTML_FONT: popIfNotEmpty (_TextColor); + popIfNotEmpty (_FontSize); break; case HTML_A: popIfNotEmpty (_TextColor); @@ -2251,8 +2259,9 @@ void CGroupHTML::addImage(const char *img, bool globalColor) else*/ getParagraph()->addChild(newImage); paragraphChange (); - } else { - + } + else + { // // 2/ if it doesn't work, try to load the image in cache // @@ -3394,7 +3403,8 @@ int CGroupHTML::luaInsertText(CLuaState &ls) ucstring text; text.fromUtf8(ls.toString(2)); - if (!_Forms.empty()) { + if (!_Forms.empty()) + { for (uint i=0; i<_Forms.back().Entries.size(); i++) { if (_Forms.back().Entries[i].TextArea && _Forms.back().Entries[i].Name == name) @@ -3438,11 +3448,14 @@ int CGroupHTML::luaAddImage(CLuaState &ls) paragraphChange(); } string url = getLink(); - if (!url.empty()) { + if (!url.empty()) + { string params = "name=" + getId() + "|url=" + getLink (); addButton(CCtrlButton::PushButton, ls.toString(1), ls.toString(1), ls.toString(1), "", ls.toBoolean(2), "browse", params.c_str(), ""); - } else { + } + else + { addImage(ls.toString(1), ls.toBoolean(2)); } diff --git a/code/ryzom/client/src/interface_v3/group_html_webig.cpp b/code/ryzom/client/src/interface_v3/group_html_webig.cpp index ac866830b..7e1781289 100644 --- a/code/ryzom/client/src/interface_v3/group_html_webig.cpp +++ b/code/ryzom/client/src/interface_v3/group_html_webig.cpp @@ -277,7 +277,7 @@ string CGroupHTMLWebIG::home () void CGroupHTMLWebIG::handle () { - Home = "http://atys.ryzom.com/start/index.php"; +// Home = "http://atys.ryzom.com/start/index.php"; CGroupHTML::handle (); } diff --git a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp index 35afeb618..3c1e958f8 100644 --- a/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp +++ b/code/ryzom/client/src/interface_v3/item_consumable_effect.cpp @@ -133,8 +133,8 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * strFindReplace(result, "%minutes", toString(duration/60)); strFindReplace(result, "%secondes", toString(duration%60)); strFindReplace(result, "%radius", toString(radius)); - strFindReplace(result, "%targetDisableTime", toString(targetDisableTime)); - strFindReplace(result, "%userDisableTime", toString(userDisableTime)); + strFindReplace(result, "%targetDisableTime", "0"); + strFindReplace(result, "%userDisableTime", "0"); effects += result; effects += "\n"; @@ -183,12 +183,12 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * fromString(params[4].c_str(), userDisableTime); ucstring result = CI18N::get("uiItemConsumableEffectStaminaAura"); - strFindReplace(result, "%modifier", toString(regenMod)); + strFindReplace(result, "%modifier", toString(bonus)); strFindReplace(result, "%minutes", toString(duration/60)); strFindReplace(result, "%secondes", toString(duration%60)); strFindReplace(result, "%radius", toString(radius)); - strFindReplace(result, "%targetDisableTime", toString(targetDisableTime)); - strFindReplace(result, "%userDisableTime", toString(userDisableTime)); + strFindReplace(result, "%targetDisableTime", "0"); + strFindReplace(result, "%userDisableTime", "0"); effects += result; effects += "\n"; @@ -240,8 +240,8 @@ void CItemConsumableEffectHelper::getItemConsumableEffectText(const CItemSheet * strFindReplace(result, "%minutes", toString(duration/60)); strFindReplace(result, "%secondes", toString(duration%60)); strFindReplace(result, "%radius", toString(radius)); - strFindReplace(result, "%targetDisableTime", toString(targetDisableTime)); - strFindReplace(result, "%userDisableTime", toString(userDisableTime)); + strFindReplace(result, "%targetDisableTime", "0"); + strFindReplace(result, "%userDisableTime", "0"); effects += result; effects += "\n"; diff --git a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp index 6820a10e8..dc12a391f 100644 --- a/code/ryzom/client/src/interface_v3/sphrase_manager.cpp +++ b/code/ryzom/client/src/interface_v3/sphrase_manager.cpp @@ -503,7 +503,6 @@ void CSPhraseManager::updateMemoryDBAll() for(uint i=0;isetValue32(0); - _MemoryAltDbLeaves[i]->setValue32(0); } } else @@ -515,7 +514,14 @@ void CSPhraseManager::updateMemoryDBAll() _MemoryDbLeaves[i]->setValue32(0); else _MemoryDbLeaves[i]->setValue32(slot.Id); + } + } + if(_SelectedMemoryDB != -1 && (sint32)_Memories.size() > 0) + { + // Always update alt gestionsets + for(uint i=0;isetValue32(0); diff --git a/code/ryzom/server/data_shard/client_commands_privileges.txt b/code/ryzom/server/data_shard/client_commands_privileges.txt index 0ab0e8e9f..c61537dfa 100644 --- a/code/ryzom/server/data_shard/client_commands_privileges.txt +++ b/code/ryzom/server/data_shard/client_commands_privileges.txt @@ -15,10 +15,10 @@ addSkillPoints :DEV:SGM:GM:EM: // Add skill points of given type (Fight=0, M addXPToSkill :DEV:SGM:GM:EM: // Gain experience in the given skill: [] broadcast :DEV:SGM:GM:EM:VG: // Broadcast a message: [repeat= or during=