Further work on missions editor
authorunc0rr
Sun, 25 Oct 2009 18:16:40 +0000
changeset 2589 4329597c85c8
parent 2588 da9e986713d4
child 2590 e7e87e3c67db
Further work on missions editor
share/hedgewars/Data/Trainings/001_Shotgun.txt
tools/MissionsEditor/MissionsEditor.pro
tools/MissionsEditor/editor.ui
tools/MissionsEditor/teamedit.cpp
tools/MissionsEditor/teamedit.h
tools/MissionsEditor/teamedit.ui
--- a/share/hedgewars/Data/Trainings/001_Shotgun.txt	Sun Oct 25 16:51:20 2009 +0000
+++ b/share/hedgewars/Data/Trainings/001_Shotgun.txt	Sun Oct 25 18:16:40 2009 +0000
@@ -1,5 +1,5 @@
 seed 0
-$gmflags 268435458
+$gmflags 4098
 $turntime 90000
 $casefreq 0
 $landadds 0
@@ -8,12 +8,12 @@
 theme nature
 ammstore 00009000000000000000000000000000000000000000000000000000000000000000000000000000
 
-addteam 14483456 Team
+addteam 14483456 Shotgun Team
 <binds>
 grave Simple
 fort Island
 voicepack Default
-addhh 0 100 hedgehog 0
+addhh 0 1 Hunter
 hat NoHat
 hhcoords 2334 1254
 
--- a/tools/MissionsEditor/MissionsEditor.pro	Sun Oct 25 16:51:20 2009 +0000
+++ b/tools/MissionsEditor/MissionsEditor.pro	Sun Oct 25 18:16:40 2009 +0000
@@ -1,16 +1,12 @@
-#-------------------------------------------------
-#
+# -------------------------------------------------
 # Project created by QtCreator 2009-10-21T19:51:57
-#
-#-------------------------------------------------
-
+# -------------------------------------------------
 TARGET = MissionsEditor
 TEMPLATE = app
-
-
-SOURCES += main.cpp\
-        editor.cpp
-
-HEADERS  += editor.h
-
-FORMS    += editor.ui
+SOURCES += main.cpp \
+    editor.cpp \
+    teamedit.cpp
+HEADERS += editor.h \
+    teamedit.h
+FORMS += editor.ui \
+    teamedit.ui
--- a/tools/MissionsEditor/editor.ui	Sun Oct 25 16:51:20 2009 +0000
+++ b/tools/MissionsEditor/editor.ui	Sun Oct 25 18:16:40 2009 +0000
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>601</width>
-    <height>526</height>
+    <width>419</width>
+    <height>476</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -18,7 +18,7 @@
     <item row="0" column="0">
      <widget class="QTabWidget" name="tabWidget">
       <property name="currentIndex">
-       <number>0</number>
+       <number>2</number>
       </property>
       <widget class="QWidget" name="tab_4">
        <attribute name="title">
@@ -283,6 +283,11 @@
        <attribute name="title">
         <string>Teams</string>
        </attribute>
+       <layout class="QGridLayout" name="gridLayout_4">
+        <item row="0" column="0">
+         <widget class="TeamEdit" name="widget" native="true"/>
+        </item>
+       </layout>
       </widget>
       <widget class="QWidget" name="tab_2">
        <attribute name="title">
@@ -298,7 +303,7 @@
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>601</width>
+     <width>419</width>
      <height>28</height>
     </rect>
    </property>
@@ -331,6 +336,14 @@
   </action>
  </widget>
  <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+  <customwidget>
+   <class>TeamEdit</class>
+   <extends>QWidget</extends>
+   <header>teamedit.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
  <resources/>
  <connections/>
 </ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/MissionsEditor/teamedit.cpp	Sun Oct 25 18:16:40 2009 +0000
@@ -0,0 +1,26 @@
+#include "teamedit.h"
+#include "ui_teamedit.h"
+
+TeamEdit::TeamEdit(QWidget *parent) :
+    QWidget(parent),
+    m_ui(new Ui::TeamEdit)
+{
+    m_ui->setupUi(this);
+}
+
+TeamEdit::~TeamEdit()
+{
+    delete m_ui;
+}
+
+void TeamEdit::changeEvent(QEvent *e)
+{
+    QWidget::changeEvent(e);
+    switch (e->type()) {
+    case QEvent::LanguageChange:
+        m_ui->retranslateUi(this);
+        break;
+    default:
+        break;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/MissionsEditor/teamedit.h	Sun Oct 25 18:16:40 2009 +0000
@@ -0,0 +1,23 @@
+#ifndef TEAMEDIT_H
+#define TEAMEDIT_H
+
+#include <QtGui/QWidget>
+
+namespace Ui {
+    class TeamEdit;
+}
+
+class TeamEdit : public QWidget {
+    Q_OBJECT
+public:
+    TeamEdit(QWidget *parent = 0);
+    ~TeamEdit();
+
+protected:
+    void changeEvent(QEvent *e);
+
+private:
+    Ui::TeamEdit *m_ui;
+};
+
+#endif // TEAMEDIT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/MissionsEditor/teamedit.ui	Sun Oct 25 18:16:40 2009 +0000
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TeamEdit</class>
+ <widget class="QWidget" name="TeamEdit">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>437</width>
+    <height>354</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <widget class="QPushButton" name="pbAddTeam">
+     <property name="text">
+      <string>Add Team</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>331</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="0" colspan="2">
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>Team</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="0" colspan="2">
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Team name</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="leTeamName"/>
+         </item>
+        </layout>
+       </item>
+       <item row="1" column="0" rowspan="4">
+        <widget class="QTreeWidget" name="treeWidget">
+         <column>
+          <property name="text">
+           <string>Name</string>
+          </property>
+         </column>
+         <column>
+          <property name="text">
+           <string>Health</string>
+          </property>
+         </column>
+         <column>
+          <property name="text">
+           <string>Spawn pos</string>
+          </property>
+         </column>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QPushButton" name="pbAddHedgehog">
+         <property name="text">
+          <string>Add hedgehog</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="1">
+        <widget class="QPushButton" name="pbDeleteHedgehog">
+         <property name="text">
+          <string>Delete hedgehog</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="1">
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>117</width>
+           <height>102</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="4" column="1">
+        <widget class="QPushButton" name="pbDeleteTeam">
+         <property name="text">
+          <string>Delete team</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>