| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488 |
- import QtQml 2.15
- import QtQuick 2.15
- import QtQuick.Controls 2.15
- import QtQuick.Layouts 1.3
- import StandardOfIron 1.0
- Item {
- id: root
- signal cancelled()
- anchors.fill: parent
- z: 25
- Keys.onPressed: function(event) {
- if (event.key === Qt.Key_Escape) {
- root.cancelled();
- event.accepted = true;
- }
- }
- Component.onCompleted: {
- forceActiveFocus();
- }
- Rectangle {
- anchors.fill: parent
- color: Theme.dim
- }
- Rectangle {
- id: container
- width: Math.min(parent.width * 0.6, 700)
- height: Math.min(parent.height * 0.8, 600)
- anchors.centerIn: parent
- radius: Theme.radiusPanel
- color: Theme.panelBase
- border.color: Theme.panelBr
- border.width: 1
- opacity: 0.98
- ColumnLayout {
- anchors.fill: parent
- anchors.margins: Theme.spacingXLarge
- spacing: Theme.spacingLarge
- RowLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingMedium
- Label {
- text: qsTr("Settings")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeHero
- font.bold: true
- Layout.fillWidth: true
- }
- StyledButton {
- text: qsTr("Close")
- buttonStyle: "secondary"
- onClicked: root.cancelled()
- }
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 1
- color: Theme.border
- }
- ScrollView {
- Layout.fillWidth: true
- Layout.fillHeight: true
- clip: true
- ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
- ScrollBar.vertical.policy: ScrollBar.AsNeeded
- ColumnLayout {
- width: container.width - Theme.spacingXLarge * 2
- spacing: Theme.spacingLarge
- ColumnLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingMedium
- Label {
- text: qsTr("Audio Settings")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeLarge
- font.bold: true
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 2
- color: Theme.border
- opacity: 0.5
- }
- GridLayout {
- Layout.fillWidth: true
- columns: 2
- rowSpacing: Theme.spacingMedium
- columnSpacing: Theme.spacingMedium
- Label {
- text: qsTr("Master Volume:")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- }
- RowLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingSmall
- Slider {
- id: masterVolumeSlider
- Layout.fillWidth: true
- from: 0
- to: 100
- value: 100
- stepSize: 1
- onValueChanged: {
- if (typeof game !== 'undefined' && game.audioSystem)
- game.audioSystem.setMasterVolume(value / 100);
- }
- }
- Label {
- text: Math.round(masterVolumeSlider.value) + "%"
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- Layout.minimumWidth: 45
- }
- }
- Label {
- text: qsTr("Music Volume:")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- }
- RowLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingSmall
- Slider {
- id: musicVolumeSlider
- Layout.fillWidth: true
- from: 0
- to: 100
- value: 100
- stepSize: 1
- onValueChanged: {
- if (typeof game !== 'undefined' && game.audioSystem)
- game.audioSystem.setMusicVolume(value / 100);
- }
- }
- Label {
- text: Math.round(musicVolumeSlider.value) + "%"
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- Layout.minimumWidth: 45
- }
- }
- Label {
- text: qsTr("SFX Volume:")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- }
- RowLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingSmall
- Slider {
- id: sfxVolumeSlider
- Layout.fillWidth: true
- from: 0
- to: 100
- value: 100
- stepSize: 1
- onValueChanged: {
- if (typeof game !== 'undefined' && game.audioSystem)
- game.audioSystem.setSoundVolume(value / 100);
- }
- }
- Label {
- text: Math.round(sfxVolumeSlider.value) + "%"
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- Layout.minimumWidth: 45
- }
- }
- Label {
- text: qsTr("Voice Volume:")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- }
- RowLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingSmall
- Slider {
- id: voiceVolumeSlider
- Layout.fillWidth: true
- from: 0
- to: 100
- value: 100
- stepSize: 1
- onValueChanged: {
- if (typeof game !== 'undefined' && game.audioSystem)
- game.audioSystem.setVoiceVolume(value / 100);
- }
- }
- Label {
- text: Math.round(voiceVolumeSlider.value) + "%"
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- Layout.minimumWidth: 45
- }
- }
- }
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 1
- color: Theme.border
- }
- ColumnLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingMedium
- Label {
- text: qsTr("Graphics Settings")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeLarge
- font.bold: true
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 2
- color: Theme.border
- opacity: 0.5
- }
- GridLayout {
- Layout.fillWidth: true
- columns: 2
- rowSpacing: Theme.spacingMedium
- columnSpacing: Theme.spacingMedium
- Label {
- text: qsTr("Graphics Quality:")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- }
- StyledComboBox {
- id: graphicsQualityComboBox
- Layout.fillWidth: true
- model: typeof graphicsSettings !== 'undefined' ? graphicsSettings.quality_options : ["Low", "Medium", "High", "Ultra"]
- currentIndex: typeof graphicsSettings !== 'undefined' ? graphicsSettings.quality_level : 1
- onActivated: function(index) {
- if (typeof graphicsSettings !== 'undefined')
- graphicsSettings.quality_level = index;
- }
- }
- Label {
- text: typeof graphicsSettings !== 'undefined' ? graphicsSettings.get_quality_description() : ""
- color: Theme.textSub
- font.pointSize: Theme.fontSizeSmall
- opacity: 0.7
- wrapMode: Text.WordWrap
- Layout.columnSpan: 2
- Layout.fillWidth: true
- }
- }
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 1
- color: Theme.border
- }
- ColumnLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingMedium
- Label {
- text: qsTr("Language")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeLarge
- font.bold: true
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 2
- color: Theme.border
- opacity: 0.5
- }
- GridLayout {
- Layout.fillWidth: true
- columns: 2
- rowSpacing: Theme.spacingMedium
- columnSpacing: Theme.spacingMedium
- Label {
- text: qsTr("Select Language:")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeMedium
- }
- StyledComboBox {
- id: languageComboBox
- Layout.fillWidth: true
- model: typeof languageManager !== 'undefined' ? languageManager.availableLanguages : []
- currentIndex: {
- if (typeof languageManager === 'undefined')
- return 0;
- var idx = languageManager.availableLanguages.indexOf(languageManager.currentLanguage);
- return idx >= 0 ? idx : 0;
- }
- displayText: {
- if (typeof languageManager === 'undefined' || !currentText)
- return "";
- return languageManager.languageDisplayName(currentText);
- }
- onActivated: function(index) {
- if (typeof languageManager !== 'undefined' && currentText)
- languageManager.setLanguage(currentText);
- }
- delegateText: function(data) {
- return typeof languageManager !== 'undefined' ? languageManager.languageDisplayName(data) : data;
- }
- }
- Label {
- text: qsTr("Language changes apply immediately")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeSmall
- opacity: 0.7
- Layout.columnSpan: 2
- }
- }
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 1
- color: Theme.border
- }
- ColumnLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingMedium
- Label {
- text: qsTr("About")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeLarge
- font.bold: true
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 2
- color: Theme.border
- opacity: 0.5
- }
- ColumnLayout {
- Layout.fillWidth: true
- spacing: Theme.spacingSmall
- Label {
- text: qsTr("Standard of Iron - RTS Game")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeMedium
- font.bold: true
- }
- Label {
- text: qsTr("Version 1.0.0")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeSmall
- }
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 1
- color: Theme.border
- opacity: 0.3
- Layout.topMargin: Theme.spacingSmall
- Layout.bottomMargin: Theme.spacingSmall
- }
- Label {
- text: qsTr("Third-Party Software")
- color: Theme.textMain
- font.pointSize: Theme.fontSizeMedium
- font.bold: true
- }
- Label {
- text: qsTr("This game uses the Qt framework, licensed under the GNU Lesser General Public License v3 (LGPL v3).")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeSmall
- wrapMode: Text.WordWrap
- Layout.fillWidth: true
- }
- Label {
- text: qsTr("Qt is dynamically linked, allowing you to replace Qt libraries with your own versions.")
- color: Theme.textSub
- font.pointSize: Theme.fontSizeSmall
- wrapMode: Text.WordWrap
- Layout.fillWidth: true
- }
- Label {
- text: "<a href='https://www.gnu.org/licenses/lgpl-3.0.html'>LGPL v3 License</a> | <a href='https://www.qt.io'>Qt Website</a>"
- color: Theme.textSub
- font.pointSize: Theme.fontSizeSmall
- textFormat: Text.RichText
- onLinkActivated: function(link) {
- Qt.openUrlExternally(link);
- }
- MouseArea {
- anchors.fill: parent
- acceptedButtons: Qt.NoButton
- cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
- }
- }
- }
- }
- }
- }
- }
- }
- }
|