]> Shamusworld >> Repos - warehouse-man-deluxe/blobdiff - src/editorwindow.cpp
Added/fixed editor, added play level functionality.
[warehouse-man-deluxe] / src / editorwindow.cpp
index 9c95ba17accfafabfa3e5c1d9875301d0eed83ad..713dc740caebea5e0eb2721f00b42a140c95a4e4 100644 (file)
@@ -23,6 +23,7 @@ EditorWindow::EditorWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Window)
        down = new QPushButton("v");
        add = new QPushButton("+");
        remove = new QPushButton("-");
+       play = new QPushButton(">");
        editor = new EditorWidget(parent);
 
        list->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
@@ -44,6 +45,7 @@ EditorWindow::EditorWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Window)
        buttonBox->addWidget(down);
        buttonBox->addWidget(add);
        buttonBox->addWidget(remove);
+       buttonBox->addWidget(play);
 
        listBox->addWidget(list);
        listBox->addLayout(buttonBox);
@@ -61,6 +63,7 @@ EditorWindow::EditorWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Window)
        connect(down, SIGNAL(clicked()), this, SLOT(MoveLevelDown()));
        connect(add, SIGNAL(clicked()), this, SLOT(AddLevel()));
        connect(remove, SIGNAL(clicked()), this, SLOT(DeleteLevel()));
+       connect(play, SIGNAL(clicked()), this, SLOT(PlayLevel()));
 }
 
 
@@ -160,3 +163,9 @@ void EditorWindow::DeleteLevel(void)
        SetEditorLevel(currentRow);
 }
 
+
+void EditorWindow::PlayLevel(void)
+{
+       emit SetupLevel(&(editor->levelStorage[editor->currentLevel]));
+}
+