qml.qml 2.96 KB
Newer Older
1 2 3
import QtQuick
// import QtQuick.VirtualKeyboard

4 5
// Import all components from folder
import "scenes"
6
import "constants/scene.js" as SceneConstants
7

8
Window {
9 10
    property string scene: SceneConstants.homeScene

11 12 13 14 15
    Loader{
         id : ld
         anchors.fill: parent;
    }

16 17 18
    Connections {
        target: core_app
        function onGameStarted(done) {
19
            console.log("core_app: gameStarted");
20 21 22
            window.scene = SceneConstants.runningScene;
        }
        function onGameEnded(done) {
23
            console.log("core_app: gameEnded");
24 25
            window.scene = SceneConstants.gameInfoScene;
        }
26
        function onGamepadClickedLB(done){
Georgiy Yankovskiy's avatar
Georgiy Yankovskiy committed
27
            // console.log("core_app: onGamepadClickedLB");
28 29
        }
        function onGamepadClickedRB(done){
Georgiy Yankovskiy's avatar
Georgiy Yankovskiy committed
30
            // console.log("core_app: onGamepadClickedRB");
31
        }
32 33 34 35 36 37 38 39 40
        function onGamepadAxisLeft(done){
            // console.log("core_app: onGamepadAxisLeft");
        }
        function onGamepadAxisRight(done){
            // console.log("core_app: onGamepadAxisRight");
        }
        function onGamepadClickedApply(done){
            // console.log("core_app: onGamepadClickedApply");
        }
41 42
    }

43 44 45 46
    Component.onDestruction: {
        console.log("Desctructing window");
    }

47 48 49 50
    id: window
    width: 640
    height: 480
    visible: true
51 52
    title: qsTr("Launcher")

53 54

    // Решение бага с изменением положений кнопок вкладок через opacity и enabled - ЭТО КОСТЫЛЬ!!!
55
    HomeScene {
56
        // visible: scene == SceneConstants.homeScene
57 58 59
        opacity: scene == SceneConstants.homeScene
        enabled: scene == SceneConstants.homeScene

60
        id: homeScene
61 62
        anchors.fill: parent
    }
63

64
    GameInfoScene {
65
        // visible: scene == SceneConstants.gameInfoScene
66 67 68
        opacity: scene == SceneConstants.gameInfoScene
        enabled: scene == SceneConstants.gameInfoScene

69 70 71 72 73
        id: gameInfoScene
        anchors.fill: parent
    }

    RunningScene {
74
        // visible: scene == SceneConstants.runningScene
75 76 77
        opacity: scene == SceneConstants.runningScene
        enabled: scene == SceneConstants.runningScene

78 79 80 81 82 83
        id: runningScene
        anchors.fill: parent
    }



84
    /* InputPanelHomeScene {
85 86 87 88 89 90
        id: inputPanel
        z: 99
        x: 0
        y: window.height
        width: window.width

91
        states: StateHomeScene {
92 93
            name: "visible"
            when: inputPanel.active
94
            PropertyChangesHomeScene {
95 96 97 98
                target: inputPanel
                y: window.height - inputPanel.height
            }
        }
99
        transitions: TransitionHomeScene {
100 101 102
            from: ""
            to: "visible"
            reversible: true
103 104
            ParallelAnimationHomeScene {
                NumberAnimationHomeScene {
105 106 107 108 109 110 111 112
                    properties: "y"
                    duration: 250
                    easing.type: Easing.InOutQuad
                }
            }
        }
    } */
}