qmlfrontend/Page1Form.ui.qml
author unC0Rr
Mon, 16 Sep 2024 16:57:11 +0200
branchtransitional_engine
changeset 16063 09beeec033ba
parent 16041 caba603f461f
permissions -rw-r--r--
Sanitize maze mapgen code a bit
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16041
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
     1
import QtQuick
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
     2
import QtQuick.Controls
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
     3
import QtQuick.Layouts
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
     4
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
     5
import Hedgewars.Engine 1.0
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
     6
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
     7
Item {
14936
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
     8
  id: element
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
     9
  property alias button1: button1
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    10
  property alias previewImage: previewImage
16041
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
    11
  property alias preview: preview
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    12
  property alias gameButton: gameButton
14936
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    13
  property alias netButton: netButton
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    14
  property alias tickButton: tickButton
14315
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14175
diff changeset
    15
  property alias gameView: gameView
16041
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
    16
  property alias gameMouseArea: gameMouseArea
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    17
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    18
  ColumnLayout {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    19
    anchors.fill: parent
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
    20
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
    21
    RowLayout {
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    22
      Layout.alignment: Qt.AlignHCenter
16039
a73b9770467a Port QML frontend to Qt6, use rendering to framebuffer object
unC0Rr
parents: 14936
diff changeset
    23
      Layout.fillHeight: false
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
    24
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    25
      Button {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    26
        id: button1
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    27
        text: qsTr("Preview")
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    28
      }
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
    29
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    30
      Button {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    31
        id: gameButton
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    32
        text: qsTr("Game")
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    33
      }
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
    34
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    35
      Button {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    36
        id: tickButton
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    37
        text: qsTr("Tick")
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    38
      }
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
    39
    }
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
    40
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    41
    Rectangle {
16041
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
    42
      id: preview
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    43
      border.color: "orange"
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    44
      border.width: 5
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    45
      radius: 5
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    46
14319
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    47
      Layout.minimumHeight: 256
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    48
      Layout.fillWidth: true
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    49
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    50
      gradient: Gradient {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    51
        GradientStop {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    52
          position: 0
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    53
          color: "lightblue"
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    54
        }
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    55
        GradientStop {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    56
          position: 0.9
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    57
          color: "blue"
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    58
        }
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    59
        GradientStop {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    60
          position: 0.9
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    61
          color: "darkblue"
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    62
        }
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    63
        GradientStop {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    64
          position: 1.0
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    65
          color: "darkblue"
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    66
        }
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    67
      }
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    68
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    69
      Image {
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
    70
        id: previewImage
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    71
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    72
        anchors.fill: parent
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    73
        anchors.margins: parent.radius
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
    74
        source: "qrc:/res/iconTime.png"
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    75
        fillMode: Image.PreserveAspectFit
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
    76
        cache: false
14175
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents: 14164
diff changeset
    77
      }
14164
745c73e0e644 Start working on frontend to rust engine rewrite
unC0Rr
parents: 12854
diff changeset
    78
    }
14319
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    79
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    80
    GameView {
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    81
      id: gameView
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    82
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    83
      Layout.fillWidth: true
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    84
      Layout.fillHeight: true
16039
a73b9770467a Port QML frontend to Qt6, use rendering to framebuffer object
unC0Rr
parents: 14936
diff changeset
    85
a73b9770467a Port QML frontend to Qt6, use rendering to framebuffer object
unC0Rr
parents: 14936
diff changeset
    86
      MouseArea {
16041
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
    87
        id: gameMouseArea
16039
a73b9770467a Port QML frontend to Qt6, use rendering to framebuffer object
unC0Rr
parents: 14936
diff changeset
    88
        anchors.fill: parent
16041
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
    89
caba603f461f Allow to move camera by dragging mouse cursor over game field
unC0Rr
parents: 16039
diff changeset
    90
        property point lastPoint
16039
a73b9770467a Port QML frontend to Qt6, use rendering to framebuffer object
unC0Rr
parents: 14936
diff changeset
    91
      }
14319
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14315
diff changeset
    92
    }
14315
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14175
diff changeset
    93
  }
14936
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    94
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    95
  Button {
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    96
    id: netButton
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    97
    text: qsTr("Net")
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    98
    anchors.bottom: parent.bottom
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
    99
    anchors.bottomMargin: 8
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
   100
    anchors.left: parent.left
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
   101
    anchors.leftMargin: 8
a3ad06ac390e Proof of concept for new net game client
unc0rr
parents: 14319
diff changeset
   102
  }
12854
28cb18c5e712 Add new qmlfrontend project template
unc0rr
parents:
diff changeset
   103
}