Prechádzať zdrojové kódy

Modified base gui recruitment scene structure

Ivan Arkhipov 7 rokov pred
rodič
commit
f0bc47df8f

BIN
assets/recruitscene/divider.png


BIN
assets/recruitscene/gold-divider-badass-book-reviews-ohOybC-clipart.jpg


+ 6 - 2
client.pro

@@ -26,11 +26,15 @@ DEFINES += QT_DEPRECATED_WARNINGS
 SOURCES += \
         main.cpp \
         gui.cpp \
-    recruitmentscene.cpp
+    recruitmentscene.cpp \
+    unitfactory.cpp \
+    unit.cpp
 
 HEADERS += \
         gui.h \
-    recruitmentscene.h
+    recruitmentscene.h \
+    unitfactory.h \
+    unit.h
 
 FORMS += \
         gui.ui \

+ 0 - 1
gui.cpp

@@ -27,7 +27,6 @@ void GUI::mouseMoveEvent( QMouseEvent* e ) {
             return;
         }
         QString cname = child->metaObject()->className();
-        qDebug() << cname;
         if (cname != "QPushButton" && cname != "QComboBox"){ // отключаем перетягивание при наведение на активные элементы
             setGeometry(pos().x() + ( e->x() - dx_ ), pos().y() + ( e->y() - dy_ ), width(), height());
         } else {

+ 1 - 0
gui.qrc

@@ -9,5 +9,6 @@
         <file>assets/window/thick_opaque-border-top.png</file>
         <file>assets/window/thick_opaque-border-topleft.png</file>
         <file>assets/window/thick_opaque-border-topright.png</file>
+        <file>assets/recruitscene/divider.png</file>
     </qresource>
 </RCC>

+ 2 - 2
gui.ui

@@ -142,8 +142,8 @@
      <rect>
       <x>40</x>
       <y>40</y>
-      <width>941</width>
-      <height>721</height>
+      <width>940</width>
+      <height>720</height>
      </rect>
     </property>
     <layout class="QGridLayout" name="content_"/>

+ 150 - 20
recruitmentscene.ui

@@ -6,55 +6,185 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>1024</width>
-    <height>800</height>
+    <width>940</width>
+    <height>720</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <widget class="QPushButton" name="pushButton">
+  <widget class="QLabel" name="chosenRaceText_">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>120</y>
+     <width>191</width>
+     <height>91</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt; color:#b58a1e;&quot;&gt;Выбранная раса:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="chosenRaceImage_">
    <property name="geometry">
     <rect>
-     <x>250</x>
-     <y>40</y>
-     <width>211</width>
-     <height>151</height>
+     <x>200</x>
+     <y>110</y>
+     <width>128</width>
+     <height>128</height>
     </rect>
    </property>
-   <property name="cursor">
-    <cursorShape>PointingHandCursor</cursorShape>
+   <property name="text">
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;div  style=&quot;background: purple&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="availableRacesText_">
+   <property name="geometry">
+    <rect>
+     <x>550</x>
+     <y>110</y>
+     <width>201</width>
+     <height>31</height>
+    </rect>
    </property>
    <property name="text">
-    <string>PushButton</string>
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; color:#b89822;&quot;&gt;Доступные расы:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   </property>
+  </widget>
+  <widget class="QWidget" name="horizontalLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>380</x>
+     <y>150</y>
+     <width>521</width>
+     <height>91</height>
+    </rect>
+   </property>
+   <layout class="QHBoxLayout" name="availableRacesLayout_">
+    <property name="leftMargin">
+     <number>5</number>
+    </property>
+    <property name="topMargin">
+     <number>5</number>
+    </property>
+    <property name="rightMargin">
+     <number>5</number>
+    </property>
+    <property name="bottomMargin">
+     <number>5</number>
+    </property>
+   </layout>
+  </widget>
+  <widget class="QLabel" name="divider_">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>45</y>
+     <width>940</width>
+     <height>91</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/assets/recruitscene/divider.png&quot; width=&quot;940&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="title_">
+   <property name="geometry">
+    <rect>
+     <x>-3</x>
+     <y>0</y>
+     <width>941</width>
+     <height>71</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:24pt; color:#b8481c;&quot;&gt;Набор юнитов&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="chosenUnitsLabel_">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>420</y>
+     <width>221</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:14pt; color:#b5982e;&quot;&gt;Выбранные юниты:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
    </property>
   </widget>
   <widget class="QLabel" name="label">
    <property name="geometry">
     <rect>
-     <x>460</x>
-     <y>10</y>
-     <width>111</width>
+     <x>10</x>
+     <y>300</y>
+     <width>201</width>
      <height>31</height>
     </rect>
    </property>
    <property name="text">
-    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#fff560;&quot;&gt;Выберите расу:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+    <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:14pt; color:#9e9531;&quot;&gt;Доступные юниты:&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   </property>
+  </widget>
+  <widget class="QWidget" name="gridWidget" native="true">
+   <property name="geometry">
+    <rect>
+     <x>230</x>
+     <y>280</y>
+     <width>680</width>
+     <height>64</height>
+    </rect>
+   </property>
+   <layout class="QGridLayout" name="gridLayout"/>
+  </widget>
+  <widget class="QWidget" name="gridWidget_2" native="true">
+   <property name="geometry">
+    <rect>
+     <x>230</x>
+     <y>370</y>
+     <width>680</width>
+     <height>125</height>
+    </rect>
    </property>
+   <layout class="QGridLayout" name="gridLayout_2"/>
   </widget>
-  <widget class="QPushButton" name="pushButton_2">
+  <widget class="QPushButton" name="pushButton">
    <property name="geometry">
     <rect>
-     <x>520</x>
-     <y>40</y>
-     <width>211</width>
-     <height>151</height>
+     <x>260</x>
+     <y>610</y>
+     <width>371</width>
+     <height>51</height>
     </rect>
    </property>
    <property name="text">
-    <string>PushButton</string>
+    <string>Завершить выбор</string>
+   </property>
+  </widget>
+  <widget class="QWidget" name="widget" native="true">
+   <property name="geometry">
+    <rect>
+     <x>710</x>
+     <y>480</y>
+     <width>191</width>
+     <height>211</height>
+    </rect>
    </property>
   </widget>
+  <zorder>divider_</zorder>
+  <zorder>chosenRaceText_</zorder>
+  <zorder>chosenRaceImage_</zorder>
+  <zorder>availableRacesText_</zorder>
+  <zorder>horizontalLayoutWidget</zorder>
+  <zorder>title_</zorder>
+  <zorder>chosenUnitsLabel_</zorder>
+  <zorder>label</zorder>
+  <zorder>gridWidget</zorder>
+  <zorder>gridWidget_2</zorder>
+  <zorder>pushButton</zorder>
+  <zorder>widget</zorder>
  </widget>
  <resources/>
  <connections/>

+ 6 - 0
unit.cpp

@@ -0,0 +1,6 @@
+#include "unit.h"
+
+Unit::Unit(QObject *parent) : QObject(parent)
+{
+
+}

+ 17 - 0
unit.h

@@ -0,0 +1,17 @@
+#ifndef UNIT_H
+#define UNIT_H
+
+#include <QObject>
+
+class Unit : public QObject
+{
+    Q_OBJECT
+public:
+    explicit Unit(QObject *parent = nullptr);
+
+signals:
+
+public slots:
+};
+
+#endif // UNIT_H

+ 6 - 0
unitfactory.cpp

@@ -0,0 +1,6 @@
+#include "unitfactory.h"
+
+UnitFactory::UnitFactory(QObject *parent) : QObject(parent)
+{
+
+}

+ 20 - 0
unitfactory.h

@@ -0,0 +1,20 @@
+#ifndef UNITFACTORY_H
+#define UNITFACTORY_H
+
+#include <QObject>
+#include <QImage>
+
+class UnitFactory : public QObject
+{
+    Q_OBJECT
+public:
+    explicit UnitFactory(QObject *parent = nullptr);
+private:
+    QImage race_icon_;
+
+signals:
+
+public slots:
+};
+
+#endif // UNITFACTORY_H