Sfoglia il codice sorgente

Removed GUI class, all scenes are fullscreen now

Ivan Arkhipov 6 anni fa
parent
commit
e94ad12908

BIN
assets/common/char_1.png


BIN
assets/common/char_2.png


BIN
assets/common/town.jpg


BIN
assets/window/button1.png


BIN
assets/window/button2.png


+ 6 - 9
client.pro

@@ -57,7 +57,7 @@ exists($$DESTDIR/res) {
     }
     }
 
 
 win32 {
 win32 {
-    guiRes.commands += rcc.exe -binary $$PWD/res/hotseatgame/game_ui.qrc -o $$DESTDIR/res/gui_data.gtr $$escape_expand(\n\t) \
+    guiRes.commands += rcc.exe -binary $$PWD/res/hotseatgame/game_ui.qrc -o $$DESTDIR/res/game_ui_data.gtr $$escape_expand(\n\t) \
                        rcc.exe -binary $$PWD/res/hotseatgame/units.qrc -o $$DESTDIR/res/unit_data.gtr $$escape_expand(\n\t) \
                        rcc.exe -binary $$PWD/res/hotseatgame/units.qrc -o $$DESTDIR/res/unit_data.gtr $$escape_expand(\n\t) \
                        rcc.exe -binary $$PWD/res/hotseatgame/effects.qrc -o $$DESTDIR/res/effect_data.gtr $$escape_expand(\n\t) \
                        rcc.exe -binary $$PWD/res/hotseatgame/effects.qrc -o $$DESTDIR/res/effect_data.gtr $$escape_expand(\n\t) \
                        rcc.exe -binary $$PWD/res/hotseatgame/spells.qrc -o $$DESTDIR/res/spell_data.gtr
                        rcc.exe -binary $$PWD/res/hotseatgame/spells.qrc -o $$DESTDIR/res/spell_data.gtr
@@ -77,7 +77,6 @@ PRE_TARGETDEPS += BuildResources
 SOURCES += \
 SOURCES += \
     source/main.cpp \
     source/main.cpp \
     source/effects/effect.cpp \
     source/effects/effect.cpp \
-    source/gui/gui.cpp \
     source/gui/guiscenemanager.cpp \
     source/gui/guiscenemanager.cpp \
     source/gui/loadingform.cpp \
     source/gui/loadingform.cpp \
     source/gui/mainmenu.cpp \
     source/gui/mainmenu.cpp \
@@ -100,7 +99,6 @@ SOURCES += \
 
 
 HEADERS += \
 HEADERS += \
     include/effects/effect.h \
     include/effects/effect.h \
-    include/gui/gui.h \
     include/gui/guiscenemanager.h \
     include/gui/guiscenemanager.h \
     include/gui/loadingform.h \
     include/gui/loadingform.h \
     include/gui/mainmenu.h \
     include/gui/mainmenu.h \
@@ -124,7 +122,6 @@ HEADERS += \
     include/racemanager.h
     include/racemanager.h
 
 
 FORMS += \
 FORMS += \
-    include/gui/gui.ui \
     include/gui/loadingform.ui \
     include/gui/loadingform.ui \
     include/gui/mainmenu.ui \
     include/gui/mainmenu.ui \
     include/hotseatgame/gui/hotseatgame.ui \
     include/hotseatgame/gui/hotseatgame.ui \
@@ -133,10 +130,10 @@ FORMS += \
     include/hotseatgame/gui/recruitmentscene.ui
     include/hotseatgame/gui/recruitmentscene.ui
 
 
 RESOURCES += \
 RESOURCES += \
-     res/GUI.qrc
-     #res/hotseatgame/game_ui.qrc \
-     #res/hotseatgame/units.qrc \
-     #res/hotseatgame/spells.qrc \
-     #res/hotseatgame/effects.qrc
+     res/GUI.qrc \
+     res/hotseatgame/game_ui.qrc \
+     res/hotseatgame/units.qrc \
+     res/hotseatgame/spells.qrc \
+     res/hotseatgame/effects.qrc
 
 
 RC_ICONS = $$PWD/assets/common/icon.ico
 RC_ICONS = $$PWD/assets/common/icon.ico

+ 0 - 33
include/gui/gui.h

@@ -1,33 +0,0 @@
-#ifndef GUI_H
-#define GUI_H
-
-#include <QMainWindow>
-#include <QGraphicsScene>
-#include <QMouseEvent>
-
-namespace Ui {
-class GUI;
-}
-
-class GUI : public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    explicit GUI(QWidget *parent = 0);
-    ~GUI();
-    QWidget* mainContentScene();
-
-private:
-    Ui::GUI *ui_;
-
-protected:
-    void mouseMoveEvent( QMouseEvent* e );
-    void mousePressEvent( QMouseEvent* e );
-    void mouseReleaseEvent( QMouseEvent* e );
-private:
-    int dx_;
-    int dy_;
-};
-
-#endif // GUI_H

+ 0 - 215
include/gui/gui.ui

@@ -1,215 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>GUI</class>
- <widget class="QMainWindow" name="GUI">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1024</width>
-    <height>800</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>GUI</string>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <layout class="QGridLayout" name="gridLayout">
-    <property name="leftMargin">
-     <number>0</number>
-    </property>
-    <property name="topMargin">
-     <number>0</number>
-    </property>
-    <property name="rightMargin">
-     <number>0</number>
-    </property>
-    <property name="bottomMargin">
-     <number>0</number>
-    </property>
-    <property name="spacing">
-     <number>0</number>
-    </property>
-    <item row="0" column="0">
-     <widget class="QWidget" name="window_topleft_border_" native="true">
-      <property name="minimumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-topleft.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="1">
-     <widget class="QWidget" name="window_top_border_" native="true">
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-top.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="0" column="2">
-     <widget class="QWidget" name="window_topright_border_" native="true">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-topright.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="1" column="0">
-     <widget class="QWidget" name="window_left_border_" native="true">
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-left.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="1" column="1">
-     <widget class="QWidget" name="main_content_" native="true">
-      <property name="autoFillBackground">
-       <bool>false</bool>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background: url(:/assets/window/thick_opaque-background.png);</string>
-      </property>
-      <layout class="QGridLayout" name="content_">
-       <property name="leftMargin">
-        <number>0</number>
-       </property>
-       <property name="topMargin">
-        <number>0</number>
-       </property>
-       <property name="rightMargin">
-        <number>0</number>
-       </property>
-       <property name="bottomMargin">
-        <number>0</number>
-       </property>
-       <property name="spacing">
-        <number>0</number>
-       </property>
-      </layout>
-     </widget>
-    </item>
-    <item row="1" column="2">
-     <widget class="QWidget" name="window_right_border_" native="true">
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-right.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="0">
-     <widget class="QWidget" name="window_botleft_border_" native="true">
-      <property name="minimumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-botleft.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="1">
-     <widget class="QWidget" name="window_bottom_border_" native="true">
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-bottom.png);</string>
-      </property>
-     </widget>
-    </item>
-    <item row="2" column="2">
-     <widget class="QWidget" name="window_botright_border_" native="true">
-      <property name="sizePolicy">
-       <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-        <horstretch>0</horstretch>
-        <verstretch>0</verstretch>
-       </sizepolicy>
-      </property>
-      <property name="minimumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="maximumSize">
-       <size>
-        <width>45</width>
-        <height>45</height>
-       </size>
-      </property>
-      <property name="cursor">
-       <cursorShape>SizeAllCursor</cursorShape>
-      </property>
-      <property name="styleSheet">
-       <string notr="true">background-image: url(:/assets/window/thick_opaque-border-botright.png);</string>
-      </property>
-     </widget>
-    </item>
-   </layout>
-   <zorder>main_content_</zorder>
-   <zorder>window_topleft_border_</zorder>
-   <zorder>window_top_border_</zorder>
-   <zorder>window_topright_border_</zorder>
-   <zorder>window_left_border_</zorder>
-   <zorder>window_right_border_</zorder>
-   <zorder>window_botleft_border_</zorder>
-   <zorder>window_bottom_border_</zorder>
-   <zorder>window_botright_border_</zorder>
-  </widget>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources/>
- <connections/>
-</ui>

+ 4 - 10
include/gui/guiscenemanager.h

@@ -2,10 +2,11 @@
 #define INCLUDEGUIGUISCENEMANAGER_H
 #define INCLUDEGUIGUISCENEMANAGER_H
 
 
 #include <QObject>
 #include <QObject>
+#include <QMainWindow>
+#include <QGridLayout>
 
 
 #include <map>
 #include <map>
 
 
-class GUI;
 class Scene;
 class Scene;
 
 
 class GuiSceneManager : public QObject
 class GuiSceneManager : public QObject
@@ -25,19 +26,12 @@ public:
 
 
     bool changeScene(QString scene_name, QString args = "");
     bool changeScene(QString scene_name, QString args = "");
 
 
-    bool showDetachedScene(QString scene_name, QString args = "");
-
-    bool hideDetachedScene(QString scene_name);
-
-    bool hideMainWindow();
-
-    bool showMainWindow();
-
 private:
 private:
     std::map<QString, Scene*> scenes_;
     std::map<QString, Scene*> scenes_;
 
 
     QString current_scene_;
     QString current_scene_;
-    GUI* gui_;
+    QMainWindow* window_;
+    QGridLayout* window_layout_;
 
 
 signals:
 signals:
 
 

+ 438 - 50
include/gui/mainmenu.ui

@@ -6,66 +6,454 @@
    <rect>
    <rect>
     <x>0</x>
     <x>0</x>
     <y>0</y>
     <y>0</y>
-    <width>940</width>
-    <height>720</height>
+    <width>1145</width>
+    <height>702</height>
    </rect>
    </rect>
   </property>
   </property>
   <property name="windowTitle">
   <property name="windowTitle">
    <string>Form</string>
    <string>Form</string>
   </property>
   </property>
-  <widget class="QLabel" name="title_">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>60</y>
-     <width>941</width>
-     <height>101</height>
-    </rect>
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="leftMargin">
+    <number>0</number>
    </property>
    </property>
-   <property name="styleSheet">
-    <string notr="true">font: 14pt &quot;Barocco Initial&quot;;</string>
+   <property name="topMargin">
+    <number>0</number>
    </property>
    </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:18pt; color:#b12d2d;&quot;&gt;Супер-мега-крутая-игрушка-название-которой-мы-еще-не-придумали&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+   <property name="rightMargin">
+    <number>0</number>
    </property>
    </property>
-   <property name="wordWrap">
-    <bool>true</bool>
+   <property name="bottomMargin">
+    <number>0</number>
    </property>
    </property>
-  </widget>
-  <widget class="QPushButton" name="pvp_local_battle_button">
-   <property name="geometry">
-    <rect>
-     <x>200</x>
-     <y>190</y>
-     <width>481</width>
-     <height>251</height>
-    </rect>
+   <property name="spacing">
+    <number>0</number>
    </property>
    </property>
-   <property name="styleSheet">
-    <string notr="true">font: 16pt &quot;Viking Cyr&quot;;
-color: rgb(255, 255, 0);</string>
-   </property>
-   <property name="text">
-    <string>Игрок против игрока</string>
-   </property>
-  </widget>
-  <widget class="QPushButton" name="exit_button">
-   <property name="geometry">
-    <rect>
-     <x>200</x>
-     <y>470</y>
-     <width>481</width>
-     <height>221</height>
-    </rect>
-   </property>
-   <property name="styleSheet">
-    <string notr="true">font: 16pt &quot;Viking Cyr&quot;;
-color: rgb(255, 255, 0);</string>
-   </property>
-   <property name="text">
-    <string>Выйти из игры</string>
-   </property>
-  </widget>
+   <item row="0" column="0">
+    <widget class="QWidget" name="topleft_border_" native="true">
+     <property name="minimumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">border-image: url(:/assets/window/thick_opaque-border-topleft.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QWidget" name="top_border_" native="true">
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-top.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QWidget" name="topright_border_" native="true">
+     <property name="minimumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-topright.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QWidget" name="left_border_" native="true">
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-left.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="1">
+    <widget class="QWidget" name="content_" native="true">
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-background.png);</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="2" column="0">
+       <widget class="QWidget" name="menu_" native="true">
+        <property name="maximumSize">
+         <size>
+          <width>400</width>
+          <height>200</height>
+         </size>
+        </property>
+        <layout class="QVBoxLayout" name="verticalLayout">
+         <item>
+          <widget class="QPushButton" name="pvp_local_battle_button">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>700</width>
+             <height>200</height>
+            </size>
+           </property>
+           <property name="font">
+            <font>
+             <family>Viking Cyr</family>
+             <pointsize>10</pointsize>
+             <weight>50</weight>
+             <italic>false</italic>
+             <bold>false</bold>
+            </font>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">font: 10pt &quot;Viking Cyr&quot;;
+color: rgb(255, 255, 0);
+border-image: url(:/assets/window/button1.png);
+</string>
+           </property>
+           <property name="text">
+            <string>Игрок против игрока</string>
+           </property>
+           <property name="checkable">
+            <bool>false</bool>
+           </property>
+           <property name="flat">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QPushButton" name="exit_button">
+           <property name="sizePolicy">
+            <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+             <horstretch>0</horstretch>
+             <verstretch>0</verstretch>
+            </sizepolicy>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>700</width>
+             <height>200</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">font: 10pt &quot;Viking Cyr&quot;;
+color: rgb(255, 255, 0);
+border-image: url(:/assets/window/button1.png);
+</string>
+           </property>
+           <property name="text">
+            <string>Выйти из игры</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+      <item row="3" column="0">
+       <spacer name="verticalSpacer">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>40</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="0" column="0" colspan="2">
+       <widget class="QLabel" name="title_">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Ignored" vsizetype="Fixed">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="styleSheet">
+         <string notr="true">font: 14pt &quot;Barocco Initial&quot;;</string>
+        </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:18pt; color:#b12d2d;&quot;&gt;Супер-мега-крутая-игрушка-название-которой-мы-еще-не-придумали&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="wordWrap">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="0">
+       <spacer name="verticalSpacer_2">
+        <property name="orientation">
+         <enum>Qt::Vertical</enum>
+        </property>
+        <property name="sizeType">
+         <enum>QSizePolicy::MinimumExpanding</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>20</width>
+          <height>40</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item row="1" column="1" rowspan="3">
+       <widget class="QWidget" name="image" native="true">
+        <property name="minimumSize">
+         <size>
+          <width>600</width>
+          <height>400</height>
+         </size>
+        </property>
+        <layout class="QGridLayout" name="gridLayout_3">
+         <property name="leftMargin">
+          <number>0</number>
+         </property>
+         <property name="topMargin">
+          <number>0</number>
+         </property>
+         <property name="rightMargin">
+          <number>0</number>
+         </property>
+         <property name="bottomMargin">
+          <number>0</number>
+         </property>
+         <property name="spacing">
+          <number>0</number>
+         </property>
+         <item row="0" column="0">
+          <widget class="QWidget" name="widget" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-topleft.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QWidget" name="widget_2" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>0</width>
+             <height>5</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>5</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-top.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="2">
+          <widget class="QWidget" name="widget_3" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-topright.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QWidget" name="widget_4" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>5</width>
+             <height>0</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>5</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-left.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QWidget" name="widget_5" native="true">
+           <property name="styleSheet">
+            <string notr="true">border-image: url(:/assets/common/town.jpg);</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="2">
+          <widget class="QWidget" name="widget_6" native="true">
+           <property name="maximumSize">
+            <size>
+             <width>8</width>
+             <height>16777215</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-right.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0">
+          <widget class="QWidget" name="widget_8" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-botleft.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QWidget" name="widget_9" native="true">
+           <property name="maximumSize">
+            <size>
+             <width>16777215</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-bottom.png)</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="2">
+          <widget class="QWidget" name="widget_7" native="true">
+           <property name="minimumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="maximumSize">
+            <size>
+             <width>8</width>
+             <height>8</height>
+            </size>
+           </property>
+           <property name="styleSheet">
+            <string notr="true">background:url(:/assets/window/opaque-border-botright.png)</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="2">
+    <widget class="QWidget" name="right_border_" native="true">
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-right.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0">
+    <widget class="QWidget" name="botleft_border_" native="true">
+     <property name="minimumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-botleft.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="1">
+    <widget class="QWidget" name="bottom_border_" native="true">
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-bottom.png);</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QWidget" name="botright_border_" native="true">
+     <property name="minimumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="maximumSize">
+      <size>
+       <width>45</width>
+       <height>45</height>
+      </size>
+     </property>
+     <property name="styleSheet">
+      <string notr="true">background-image: url(:/assets/window/thick_opaque-border-botright.png);</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+  <zorder>content_</zorder>
+  <zorder>top_border_</zorder>
+  <zorder>topleft_border_</zorder>
+  <zorder>left_border_</zorder>
+  <zorder>botleft_border_</zorder>
+  <zorder>bottom_border_</zorder>
+  <zorder>botright_border_</zorder>
+  <zorder>right_border_</zorder>
+  <zorder>topright_border_</zorder>
  </widget>
  </widget>
  <customwidgets>
  <customwidgets>
   <customwidget>
   <customwidget>

+ 4 - 0
res/GUI.qrc

@@ -11,5 +11,9 @@
         <file>../assets/window/thick_opaque-border-topright.png</file>
         <file>../assets/window/thick_opaque-border-topright.png</file>
         <file>../assets/fonts/viking-cyr.ttf</file>
         <file>../assets/fonts/viking-cyr.ttf</file>
         <file>../assets/fonts/barocco-initial.ttf</file>
         <file>../assets/fonts/barocco-initial.ttf</file>
+        <file>../assets/window/button1.png</file>
+        <file>../assets/window/button2.png</file>
+        <file>../assets/common/char_1.png</file>
+        <file>../assets/common/town.jpg</file>
     </qresource>
     </qresource>
 </RCC>
 </RCC>

+ 0 - 62
source/gui/gui.cpp

@@ -1,62 +0,0 @@
-#include <gui/gui.h>
-#include <ui_gui.h>
-#include <QDebug>
-
-GUI::GUI(QWidget *parent) :
-    QMainWindow(parent, Qt::Window | Qt::FramelessWindowHint),
-    ui_(new Ui::GUI), dx_(-100000), dy_(-100000)
-{
-    ui_->setupUi(this);
-    setWindowTitle("Супер-мега-клёвая-игрушка-название-которой-мы-ещё-не-придумали");
-}
-
-GUI::~GUI()
-{
-    delete ui_;
-}
-
-QWidget* GUI::mainContentScene() {
-    return ui_->main_content_;
-}
-
-
-void GUI::mouseMoveEvent( QMouseEvent* e ) {
-    if( e->buttons() | Qt::LeftButton ) {
-        QPoint pt=mapFromGlobal(QCursor::pos());
-
-        if (dx_ != -100000 && dy_ != -100000)
-            setGeometry(pos().x() + ( pt.x() - dx_ ), pos().y() + ( pt.y() - dy_ ), width(), height());
-    }
-}
-
-void GUI::mousePressEvent( QMouseEvent* e ) {
-    if(e->button() == Qt::LeftButton) {
-        QPoint pt = mapFromGlobal(QCursor::pos());
-        QWidget* child=childAt(pt);
-
-        if (child == 0) {
-            dx_ = -100000;
-            dy_ = -100000;
-            return;
-        }
-
-        QString cname = child->objectName();
-        if (cname == "window_top_border_" || cname == "window_bottom_border_"
-                || cname == "window_topleft_border_" || cname == "window_topright_border_"
-                || cname == "window_right_border_" || cname == "window_left_border_"
-                || cname == "window_botright_border_" || cname == "window_botleft_border_") {
-            dx_ = pt.x();
-            dy_ = pt.y();
-        } else {
-            dx_ = -100000;
-            dy_ = -100000;
-        }
-    }
-}
-
-void GUI::mouseReleaseEvent( QMouseEvent* e ) {
-    if( e->button() == Qt::LeftButton ) {
-        dx_ = -100000;
-        dy_ = -100000;
-    }
-}

+ 13 - 34
source/gui/guiscenemanager.cpp

@@ -1,5 +1,4 @@
 #include "gui/guiscenemanager.h"
 #include "gui/guiscenemanager.h"
-#include "gui/gui.h"
 #include "gui/mainmenu.h"
 #include "gui/mainmenu.h"
 
 
 #include "hotseatgame/gui/recruitmentscene.h"
 #include "hotseatgame/gui/recruitmentscene.h"
@@ -12,8 +11,11 @@
 #include <QFontDatabase>
 #include <QFontDatabase>
 
 
 GuiSceneManager::GuiSceneManager(QObject *parent) : QObject(parent) {
 GuiSceneManager::GuiSceneManager(QObject *parent) : QObject(parent) {
-    gui_ = new GUI();
-    gui_->show();
+    window_ = new QMainWindow(nullptr, Qt::Window | Qt::FramelessWindowHint);
+    window_->setWindowTitle("Супер-мега-клёвая-игрушка-название-которой-мы-ещё-не-придумали");
+    window_->setWindowState(Qt::WindowFullScreen);
+    window_->show();
+
     current_scene_ = "none";
     current_scene_ = "none";
 
 
     QResource::registerResource(QApplication::applicationDirPath() + "/res/game_ui_data.gtr");
     QResource::registerResource(QApplication::applicationDirPath() + "/res/game_ui_data.gtr");
@@ -24,10 +26,10 @@ GuiSceneManager::GuiSceneManager(QObject *parent) : QObject(parent) {
     QFontDatabase::addApplicationFont(":/assets/fonts/barocco-initial.ttf");
     QFontDatabase::addApplicationFont(":/assets/fonts/barocco-initial.ttf");
     QFontDatabase::addApplicationFont(":/assets/fonts/viking-cyr.ttf");
     QFontDatabase::addApplicationFont(":/assets/fonts/viking-cyr.ttf");
 
 
-    registerScene("main_menu", new MainMenu(gui_->mainContentScene()));
-    registerScene("pvp_intro", new PlayerVsPlayerIntro(gui_->mainContentScene()));
-    registerScene("recruit_army", new RecruitmentScene(gui_->mainContentScene()));
-    registerScene("prebattle", new PreBattleScene(gui_->mainContentScene()));
+    registerScene("main_menu", new MainMenu());
+    registerScene("pvp_intro", new PlayerVsPlayerIntro());
+    registerScene("recruit_army", new RecruitmentScene());
+    registerScene("prebattle", new PreBattleScene());
     registerScene("hotseatgame", new HotSeatGame());
     registerScene("hotseatgame", new HotSeatGame());
 
 
     changeScene("main_menu");
     changeScene("main_menu");
@@ -54,38 +56,15 @@ bool GuiSceneManager::changeScene(QString scene_name, QString args) {
         return false;
         return false;
     }
     }
 
 
-    if (current_scene_ != "none")
+    if (current_scene_ != "none") {
         scenes_[current_scene_]->hide();
         scenes_[current_scene_]->hide();
+        window_->takeCentralWidget();
+    }
 
 
     scenes_[scene_name]->parseArgs(args);
     scenes_[scene_name]->parseArgs(args);
     scenes_[scene_name]->init();
     scenes_[scene_name]->init();
+    window_->setCentralWidget(scenes_[scene_name]);
     scenes_[scene_name]->show();
     scenes_[scene_name]->show();
     current_scene_ = scene_name;
     current_scene_ = scene_name;
     return true;
     return true;
 }
 }
-
-bool GuiSceneManager::hideMainWindow() {
-    gui_->hide();
-    return true;
-}
-
-bool GuiSceneManager::showMainWindow() {
-    gui_->show();
-    return true;
-}
-
-bool GuiSceneManager::hideDetachedScene(QString scene_name) {
-    if (scenes_.count(scene_name) == 0 || !scenes_[scene_name])
-        return false;
-    scenes_[scene_name]->hide();
-    return true;
-}
-
-bool GuiSceneManager::showDetachedScene(QString scene_name, QString args) {
-    if (scenes_.count(scene_name) == 0 || !scenes_[scene_name])
-        return false;
-    scenes_[scene_name]->parseArgs(args);
-    scenes_[scene_name]->init();
-    scenes_[scene_name]->show();
-    return true;
-}

+ 2 - 4
source/hotseatgame/gui/hotseatgame.cpp

@@ -10,11 +10,9 @@ HotSeatGame::HotSeatGame(QWidget *parent) :
 {
 {
     qDebug() << "Initialising game";
     qDebug() << "Initialising game";
     ui->setupUi(this);
     ui->setupUi(this);
-    setWindowState(Qt::WindowFullScreen);
 }
 }
 
 
 void HotSeatGame::init() {
 void HotSeatGame::init() {
-    GuiSceneManager::getInstance().hideMainWindow();
 }
 }
 
 
 
 
@@ -25,8 +23,8 @@ HotSeatGame::~HotSeatGame()
 
 
 void HotSeatGame::on_surrender_button__clicked()
 void HotSeatGame::on_surrender_button__clicked()
 {
 {
-    GuiSceneManager::getInstance().showMainWindow();
-    GuiSceneManager::getInstance().hideDetachedScene("hotseatgame");
+    //GuiSceneManager::getInstance().showMainWindow();
+    //GuiSceneManager::getInstance().hideDetachedScene("hotseatgame");
     //GuiSceneManager::getInstance().changeScene("hotseatgame_results");
     //GuiSceneManager::getInstance().changeScene("hotseatgame_results");
     GuiSceneManager::getInstance().changeScene("main_menu");
     GuiSceneManager::getInstance().changeScene("main_menu");
 }
 }

+ 3 - 5
source/hotseatgame/gui/prebattlescene.cpp

@@ -66,9 +66,7 @@ void PreBattleScene::init() {
 
 
 void PreBattleScene::on_start_battle_clicked()
 void PreBattleScene::on_start_battle_clicked()
 {
 {
-    //QMessageBox msg(QMessageBox::Information, "Нельзя сотворить здесь!", "Не ну имейте терпение! Всё будет! Но попозже... :)");
-    //msg.exec();
-
-    //GuiSceneManager::getInstance().changeScene("main_menu");
-    GuiSceneManager::getInstance().showDetachedScene("hotseatgame");
+    QMessageBox msg(QMessageBox::Information, "Нельзя сотворить здесь!", "Не ну имейте терпение! Всё будет! Но попозже... :)");
+    msg.exec();
+    GuiSceneManager::getInstance().changeScene("hotseatgame");
 }
 }