mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-10 16:14:26 +00:00
splitting new game and new addon functions (new game currently not working)
This commit is contained in:
parent
f7940d7d1a
commit
ecedb60169
@ -43,7 +43,7 @@ opencs_units_noqt (model/tools
|
|||||||
|
|
||||||
|
|
||||||
opencs_units (view/doc
|
opencs_units (view/doc
|
||||||
viewmanager view operations operation subview startup filedialog
|
viewmanager view operations operation subview startup filedialog newgame
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,12 +12,13 @@ CS::Editor::Editor() : mViewManager (mDocumentManager)
|
|||||||
{
|
{
|
||||||
mIpcServerName = "org.openmw.OpenCS";
|
mIpcServerName = "org.openmw.OpenCS";
|
||||||
|
|
||||||
connect (&mViewManager, SIGNAL (newDocumentRequest ()), this, SLOT (createDocument ()));
|
connect (&mViewManager, SIGNAL (newGameRequest ()), this, SLOT (createGame ()));
|
||||||
|
connect (&mViewManager, SIGNAL (newAddonRequest ()), this, SLOT (createAddon ()));
|
||||||
connect (&mViewManager, SIGNAL (loadDocumentRequest ()), this, SLOT (loadDocument ()));
|
connect (&mViewManager, SIGNAL (loadDocumentRequest ()), this, SLOT (loadDocument ()));
|
||||||
connect (&mViewManager, SIGNAL (editSettingsRequest()), this, SLOT (showSettings ()));
|
connect (&mViewManager, SIGNAL (editSettingsRequest()), this, SLOT (showSettings ()));
|
||||||
|
|
||||||
connect (&mStartup, SIGNAL (createGame()), this, SLOT (createDocument ())); /// \todo split
|
connect (&mStartup, SIGNAL (createGame()), this, SLOT (createGame ()));
|
||||||
connect (&mStartup, SIGNAL (createAddon()), this, SLOT (createDocument ()));
|
connect (&mStartup, SIGNAL (createAddon()), this, SLOT (createAddon ()));
|
||||||
connect (&mStartup, SIGNAL (loadDocument()), this, SLOT (loadDocument ()));
|
connect (&mStartup, SIGNAL (loadDocument()), this, SLOT (loadDocument ()));
|
||||||
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ()));
|
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ()));
|
||||||
|
|
||||||
@ -75,7 +76,18 @@ void CS::Editor::setupDataFiles()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CS::Editor::createDocument()
|
void CS::Editor::createGame()
|
||||||
|
{
|
||||||
|
mStartup.hide();
|
||||||
|
|
||||||
|
if (mNewGame.isHidden())
|
||||||
|
mNewGame.show();
|
||||||
|
|
||||||
|
mNewGame.raise();
|
||||||
|
mNewGame.activateWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CS::Editor::createAddon()
|
||||||
{
|
{
|
||||||
mStartup.hide();
|
mStartup.hide();
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "view/doc/viewmanager.hpp"
|
#include "view/doc/viewmanager.hpp"
|
||||||
#include "view/doc/startup.hpp"
|
#include "view/doc/startup.hpp"
|
||||||
#include "view/doc/filedialog.hpp"
|
#include "view/doc/filedialog.hpp"
|
||||||
|
#include "view/doc/newgame.hpp"
|
||||||
|
|
||||||
#include "view/settings/usersettingsdialog.hpp"
|
#include "view/settings/usersettingsdialog.hpp"
|
||||||
|
|
||||||
@ -29,6 +30,7 @@ namespace CS
|
|||||||
CSMDoc::DocumentManager mDocumentManager;
|
CSMDoc::DocumentManager mDocumentManager;
|
||||||
CSVDoc::ViewManager mViewManager;
|
CSVDoc::ViewManager mViewManager;
|
||||||
CSVDoc::StartupDialogue mStartup;
|
CSVDoc::StartupDialogue mStartup;
|
||||||
|
CSVDoc::NewGameDialogue mNewGame;
|
||||||
CSVSettings::UserSettingsDialog mSettings;
|
CSVSettings::UserSettingsDialog mSettings;
|
||||||
FileDialog mFileDialog;
|
FileDialog mFileDialog;
|
||||||
|
|
||||||
@ -51,7 +53,8 @@ namespace CS
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void createDocument();
|
void createGame();
|
||||||
|
void createAddon();
|
||||||
|
|
||||||
void loadDocument();
|
void loadDocument();
|
||||||
void openFiles();
|
void openFiles();
|
||||||
|
14
apps/opencs/view/doc/newgame.cpp
Normal file
14
apps/opencs/view/doc/newgame.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
#include "newgame.hpp"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
|
CSVDoc::NewGameDialogue::NewGameDialogue()
|
||||||
|
{
|
||||||
|
setWindowTitle ("Create New Game");
|
||||||
|
|
||||||
|
QRect scr = QApplication::desktop()->screenGeometry();
|
||||||
|
QRect rect = geometry();
|
||||||
|
move (scr.center().x() - rect.center().x(), scr.center().y() - rect.center().y());
|
||||||
|
}
|
18
apps/opencs/view/doc/newgame.hpp
Normal file
18
apps/opencs/view/doc/newgame.hpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef CSV_DOC_NEWGAME_H
|
||||||
|
#define CSV_DOC_NEWGAME_H
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
namespace CSVDoc
|
||||||
|
{
|
||||||
|
class NewGameDialogue : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
NewGameDialogue();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -27,9 +27,13 @@ void CSVDoc::View::setupFileMenu()
|
|||||||
{
|
{
|
||||||
QMenu *file = menuBar()->addMenu (tr ("&File"));
|
QMenu *file = menuBar()->addMenu (tr ("&File"));
|
||||||
|
|
||||||
QAction *new_ = new QAction (tr ("New"), this);
|
QAction *newGame = new QAction (tr ("New Game"), this);
|
||||||
connect (new_, SIGNAL (triggered()), this, SIGNAL (newDocumentRequest()));
|
connect (newGame, SIGNAL (triggered()), this, SIGNAL (newGameRequest()));
|
||||||
file->addAction (new_);
|
file->addAction (newGame);
|
||||||
|
|
||||||
|
QAction *newAddon = new QAction (tr ("New Addon"), this);
|
||||||
|
connect (newAddon, SIGNAL (triggered()), this, SIGNAL (newAddonRequest()));
|
||||||
|
file->addAction (newAddon);
|
||||||
|
|
||||||
QAction *open = new QAction (tr ("&Open"), this);
|
QAction *open = new QAction (tr ("&Open"), this);
|
||||||
connect (open, SIGNAL (triggered()), this, SIGNAL (loadDocumentRequest()));
|
connect (open, SIGNAL (triggered()), this, SIGNAL (loadDocumentRequest()));
|
||||||
|
@ -106,7 +106,9 @@ namespace CSVDoc
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void newDocumentRequest();
|
void newGameRequest();
|
||||||
|
|
||||||
|
void newAddonRequest();
|
||||||
|
|
||||||
void loadDocumentRequest();
|
void loadDocumentRequest();
|
||||||
|
|
||||||
|
@ -107,12 +107,12 @@ CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document)
|
|||||||
|
|
||||||
View *view = new View (*this, document, countViews (document)+1);
|
View *view = new View (*this, document, countViews (document)+1);
|
||||||
|
|
||||||
|
|
||||||
mViews.push_back (view);
|
mViews.push_back (view);
|
||||||
|
|
||||||
view->show();
|
view->show();
|
||||||
|
|
||||||
connect (view, SIGNAL (newDocumentRequest ()), this, SIGNAL (newDocumentRequest()));
|
connect (view, SIGNAL (newGameRequest ()), this, SIGNAL (newGameRequest()));
|
||||||
|
connect (view, SIGNAL (newAddonRequest ()), this, SIGNAL (newAddonRequest()));
|
||||||
connect (view, SIGNAL (loadDocumentRequest ()), this, SIGNAL (loadDocumentRequest()));
|
connect (view, SIGNAL (loadDocumentRequest ()), this, SIGNAL (loadDocumentRequest()));
|
||||||
connect (view, SIGNAL (editSettingsRequest()), this, SIGNAL (editSettingsRequest()));
|
connect (view, SIGNAL (editSettingsRequest()), this, SIGNAL (editSettingsRequest()));
|
||||||
|
|
||||||
|
@ -55,7 +55,9 @@ namespace CSVDoc
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void newDocumentRequest();
|
void newGameRequest();
|
||||||
|
|
||||||
|
void newAddonRequest();
|
||||||
|
|
||||||
void loadDocumentRequest();
|
void loadDocumentRequest();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user