- Reworked Qt frontend to be fully based on QML (Qtmain.cpp still contains most of the old code as I need to perform additional tests on Maemo/Meego and Linux)
- Modified the download of resources to happen on every platform - Resources are now stored based on the home directory
This commit is contained in:
@@ -1,42 +1,143 @@
|
||||
import QtQuick 1.0
|
||||
import CustomComponents 1.0
|
||||
import QtQuick 1.1
|
||||
|
||||
Rectangle {
|
||||
id: main
|
||||
width: 360
|
||||
height: 360
|
||||
scale: 1
|
||||
width: 480
|
||||
height: 272
|
||||
state: "DOWNLOADING"
|
||||
color: "black"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "DOWNLOADING"
|
||||
PropertyChanges {
|
||||
target: column1; visible: true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: wagic; visible: false
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "NORMAL"
|
||||
when: (fileDownloader.done == true)
|
||||
PropertyChanges {
|
||||
target: column1; visible: false
|
||||
}
|
||||
PropertyChanges {
|
||||
target: wagic; visible: true; focus: true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Column{
|
||||
id: column1
|
||||
x: -48
|
||||
y: 0
|
||||
width: 457
|
||||
height: 374
|
||||
width: 480
|
||||
height: 272
|
||||
anchors.horizontalCenterOffset: 1
|
||||
scale: 1
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 35
|
||||
spacing: 15
|
||||
Image {
|
||||
id: logo
|
||||
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
source: "http://wololo.net/forum/styles/prosilver/imageset/site_logo.gif"
|
||||
source: "http://wagic.googlecode.com/svn/trunk/projects/mtg/bin/Res/graphics/menutitle.png"
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Downloading resources")
|
||||
font.bold: true
|
||||
color: "white"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
ProgressBar {
|
||||
id: progressbar
|
||||
height: 40
|
||||
value: fileDownloader.received
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WagicCore {
|
||||
id: wagic
|
||||
anchors.fill: parent
|
||||
visible: false
|
||||
active: Qt.WindowActive
|
||||
}
|
||||
/*
|
||||
Rectangle {
|
||||
id: wagic
|
||||
anchors.fill: parent
|
||||
color: "red"
|
||||
visible: false
|
||||
}
|
||||
*/
|
||||
MouseArea {
|
||||
id: mousearea
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
|
||||
onPositionChanged: {
|
||||
wagic.pixelInput(
|
||||
(mouse.x*wagic.nominalWidth)/width,
|
||||
(mouse.y*wagic.nominalHeight)/height)
|
||||
}
|
||||
|
||||
onPressed: {
|
||||
if(mouse.button == Qt.LeftButton)
|
||||
wagic.doOK()
|
||||
else if(mouse.button == Qt.MiddleButton)
|
||||
wagic.doCancel()
|
||||
else if(mouse.button == Qt.RightButton)
|
||||
wagic.doNext()
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
if(mouse.button == Qt.LeftButton)
|
||||
wagic.done()
|
||||
else if(mouse.button == Qt.MiddleButton)
|
||||
wagic.done()
|
||||
else if(mouse.button == Qt.RightButton)
|
||||
wagic.done()
|
||||
}
|
||||
|
||||
onPressAndHold: {
|
||||
wagic.doMenu()
|
||||
}
|
||||
}
|
||||
function resize(){
|
||||
if(width/height <= wagic.nominalRatio)
|
||||
{
|
||||
mousearea.x = 0
|
||||
mousearea.y = -((width/wagic.nominalRatio)-height)/2
|
||||
mousearea.width = width
|
||||
mousearea.height = width / wagic.nominalRatio
|
||||
}
|
||||
else
|
||||
{
|
||||
mousearea.x = -(height*wagic.nominalRatio-width)/2
|
||||
mousearea.y = 0
|
||||
mousearea.width = height * wagic.nominalRatio
|
||||
mousearea.height = height
|
||||
}
|
||||
}
|
||||
|
||||
onWidthChanged: {
|
||||
mousearea.anchors.fill = undefined
|
||||
resize()
|
||||
}
|
||||
onHeightChanged: {
|
||||
mousearea.anchors.fill = undefined
|
||||
resize()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ INCLUDEPATH += ../../JGE/include
|
||||
INCLUDEPATH += ../../JGE/src/zipFS
|
||||
INCLUDEPATH += ../../Boost
|
||||
INCLUDEPATH += include
|
||||
!symbian:DESTDIR = bin
|
||||
#!symbian:DESTDIR = bin
|
||||
|
||||
unix:!symbian:LIBS += -lz
|
||||
PRECOMPILED_HEADER = include/PrecompiledHeader.h
|
||||
@@ -148,7 +148,6 @@ SOURCES += \
|
||||
src/WFont.cpp\
|
||||
src/WGui.cpp\
|
||||
src/WResourceManager.cpp \
|
||||
src/GameSerializer.cpp \
|
||||
src/AIPlayerBakaB.cpp
|
||||
|
||||
CONFIG(debug, debug|release):
|
||||
@@ -267,12 +266,12 @@ HEADERS += \
|
||||
include/DeckManager.h\
|
||||
include/SimplePopup.h\
|
||||
include/SimpleMenu.h\
|
||||
include/ObjectAnalytics.h \
|
||||
include/GameSerializer.h
|
||||
include/ObjectAnalytics.h
|
||||
|
||||
# JGE, could probably be moved outside
|
||||
SOURCES += \
|
||||
../../JGE/src/qt/filedownloader.cpp\
|
||||
../../JGE/src/qt/corewrapper.cpp\
|
||||
../../JGE/src/Qtmain.cpp\
|
||||
../../JGE/src/Encoding.cpp\
|
||||
../../JGE/src/JAnimator.cpp\
|
||||
@@ -312,6 +311,7 @@ SOURCES += \
|
||||
|
||||
HEADERS += \
|
||||
../../JGE/include/qt/filedownloader.h\
|
||||
../../JGE/include/qt/corewrapper.h\
|
||||
../../JGE/include/Threading.h\
|
||||
../../JGE/include/decoder_prx.h\
|
||||
../../JGE/include/DebugRoutines.h\
|
||||
@@ -416,18 +416,7 @@ maemo5: {
|
||||
INSTALLS += target \
|
||||
desktop \
|
||||
icon \
|
||||
policy \
|
||||
res_ai \
|
||||
res_campaigns \
|
||||
res_graphics \
|
||||
res_lang \
|
||||
res_packs \
|
||||
res_player \
|
||||
res_rules \
|
||||
res_sets \
|
||||
res_settings \
|
||||
res_sound \
|
||||
res_themes \
|
||||
policy
|
||||
|
||||
target.path = $$BINDIR
|
||||
|
||||
@@ -440,39 +429,6 @@ maemo5: {
|
||||
policy.files = debian_harmattan/wagic.conf
|
||||
policy.path = /usr/share/policy/etc/syspart.conf.d
|
||||
|
||||
res_ai.path = $$RESDIR/ai
|
||||
res_ai.files += bin/Res/ai/*
|
||||
|
||||
res_campaigns.path = $$RESDIR/campaigns
|
||||
res_campaigns.files += bin/Res/campaigns/*
|
||||
|
||||
res_graphics.path = $$RESDIR/graphics
|
||||
res_graphics.files += bin/Res/graphics/*
|
||||
|
||||
res_lang.path = $$RESDIR/lang
|
||||
res_lang.files += bin/Res/lang/*
|
||||
|
||||
res_packs.path = $$RESDIR/packs
|
||||
res_packs.files += bin/Res/packs/*
|
||||
|
||||
res_player.path = $$RESDIR/player
|
||||
res_player.files += bin/Res/player/*
|
||||
|
||||
res_rules.path = $$RESDIR/rules
|
||||
res_rules.files += bin/Res/rules/*
|
||||
|
||||
res_sets.path = $$RESDIR/sets
|
||||
res_sets.files += bin/Res/sets/*
|
||||
|
||||
res_settings.path = $$RESDIR/settings
|
||||
res_settings.files += bin/Res/settings/*
|
||||
|
||||
res_sound.path = $$RESDIR/sound
|
||||
res_sound.files += bin/Res/sound/*
|
||||
|
||||
res_themes.path = $$RESDIR/themes
|
||||
res_themes.files += bin/Res/themes/*
|
||||
|
||||
} else:symbian {
|
||||
TARGET.UID3 = 0xE1D807D3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user