- Merged QWidget and QML Qt frontends, just define QT_WIDGET to select the QWidget one
- Coded a resource package download GUI based on QWidget - Removed compilation warning on unused variable - Updated Maemo desktop file to start directly the binary - Updated .pro file - Updated version macros to be able to compose the resource package file - Updated QML interface for Android - Updated QML interface to not contain the name of the resource package - Updated the file downloader class to be able to get the resource package hash from the google code server - Updated the file downloaded class to verify the resource package hash from the remote server at each startup to be able to perform automatic update - Defined several JGE operation as static to clean up the wagic wrapper
This commit is contained in:
@@ -32,12 +32,16 @@
|
||||
#define WAGIC_VERSION_MINOR 1
|
||||
|
||||
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
|
||||
#define VERSION(a, b, c) VERSION_DOT(a, b, c)
|
||||
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
|
||||
#define VERSION_GAME(a, b, c) VERSION_DOT(a, b, c)
|
||||
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
|
||||
#define VERSION_TOSTRING(a) #a
|
||||
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
|
||||
|
||||
#define WAGIC_VERSION VERSION(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
||||
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
|
||||
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
||||
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR)
|
||||
#define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
|
||||
#define WAGIC_RESOURCE_NAME "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) ".zip"
|
||||
|
||||
class Rules;
|
||||
class MTGAllCards;
|
||||
|
||||
@@ -5,28 +5,30 @@ Rectangle {
|
||||
id: main
|
||||
width: 480
|
||||
height: 272
|
||||
state: "DOWNLOADING"
|
||||
state: fileDownloader.state_string
|
||||
color: "black"
|
||||
property url resource: "http://wagic.googlecode.com/files/core_017.zip"
|
||||
property string hash: "cc6f9415f747acea500cdce190f0df6ee41db7cb"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "DOWNLOADING"
|
||||
when: (fileDownloader.hash != hash)
|
||||
name: "DOWNLOADING_HASH"
|
||||
PropertyChanges {
|
||||
target: column1; visible: false
|
||||
}
|
||||
PropertyChanges {
|
||||
target: wagic; visible: false
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "DOWNLOADING_FILE"
|
||||
PropertyChanges {
|
||||
target: column1; visible: true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: wagic; visible: false
|
||||
}
|
||||
PropertyChanges {
|
||||
target:fileDownloader; url: resource
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "NORMAL"
|
||||
when: (fileDownloader.hash == hash)
|
||||
name: "DOWNLOADED"
|
||||
PropertyChanges {
|
||||
target: column1; visible: false
|
||||
}
|
||||
|
||||
@@ -102,7 +102,11 @@ QmlApplicationViewer *QmlApplicationViewer::create()
|
||||
void QmlApplicationViewer::setMainQmlFile(const QString &file)
|
||||
{
|
||||
d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
|
||||
#ifndef Q_OS_ANDROID
|
||||
setSource(QUrl::fromLocalFile(d->mainQmlFile));
|
||||
#else
|
||||
setSource(QUrl::fromLocalFile(file));
|
||||
#endif
|
||||
}
|
||||
|
||||
void QmlApplicationViewer::addImportPath(const QString &path)
|
||||
@@ -155,7 +159,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
|
||||
|
||||
void QmlApplicationViewer::showExpanded()
|
||||
{
|
||||
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
|
||||
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR) || defined(Q_OS_ANDROID)
|
||||
showFullScreen();
|
||||
#elif defined(Q_WS_MAEMO_5)
|
||||
showMaximized();
|
||||
|
||||
@@ -723,7 +723,7 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter
|
||||
{
|
||||
MTGCardInstance * copy = player->game->putInZone(card, card->currentZone, player->game->stack);
|
||||
copy->alternateCostPaid[alternateCostType] = 1;
|
||||
Spell * spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, spellCost, alternateCostType, 0);
|
||||
game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, spellCost, alternateCostType, 0);
|
||||
game->targetChooser = NULL;
|
||||
|
||||
if (card->has(Constants::STORM))
|
||||
|
||||
+43
-21
@@ -6,7 +6,7 @@ DEPLOYMENTFOLDERS = folder_01
|
||||
TARGET = wagic
|
||||
|
||||
QT += core gui opengl network
|
||||
!android:QT += phonon
|
||||
!android:!symbian:QT += phonon
|
||||
maemo5:QT += dbus
|
||||
|
||||
TARGET = wagic
|
||||
@@ -20,8 +20,10 @@ windows:DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
unix|macx:DEFINES += LINUX
|
||||
CONFIG(debug, debug|release):DEFINES += _DEBUG
|
||||
DEFINES += QT_CONFIG
|
||||
!android:DEFINES += USE_PHONON
|
||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
!android:!symbian:DEFINES += USE_PHONON
|
||||
android:INCLUDEPATH += $$ANDROID_NDK_ROOT/platforms/android-9/arch-arm/usr/include
|
||||
#DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
DEFINES += QT_WIDGET
|
||||
|
||||
windows:INCLUDEPATH += ../../JGE/Dependencies/include
|
||||
windows:INCLUDEPATH += extra
|
||||
@@ -39,7 +41,7 @@ PRECOMPILED_HEADER = include/PrecompiledHeader.h
|
||||
|
||||
#DEFINES += TESTSUITE
|
||||
#DEFINES += TRACK_OBJECT_USAGE
|
||||
DEFINES += AI_CHANGE_TESTING
|
||||
#DEFINES += AI_CHANGE_TESTING
|
||||
#DEFINES += ACTION_LOGGING_TESTING
|
||||
|
||||
SOURCES += \
|
||||
@@ -365,13 +367,13 @@ HEADERS += \
|
||||
../../JGE/include/vram.h
|
||||
|
||||
# Please do not modify the following two lines. Required for deployment.
|
||||
include(qml/qmlapplicationviewer/qmlapplicationviewer.pri)
|
||||
qtcAddDeployment()
|
||||
!maemo5:include(qml/qmlapplicationviewer/qmlapplicationviewer.pri)
|
||||
!maemo5:qtcAddDeployment()
|
||||
|
||||
# maemo 5 packaging
|
||||
maemo5: {
|
||||
# Variables
|
||||
BINDIR = /opt/wagic
|
||||
BINDIR = /opt/wagic/bin
|
||||
RESDIR = /home/user/wagic/Res
|
||||
USERDIR = MyDocs/.Wagic
|
||||
ICONDIR = /usr/share
|
||||
@@ -381,10 +383,7 @@ maemo5: {
|
||||
|
||||
INSTALLS += target \
|
||||
desktop \
|
||||
icon \
|
||||
restxt \
|
||||
launcher \
|
||||
res \
|
||||
icon
|
||||
|
||||
target.path = $$BINDIR
|
||||
|
||||
@@ -394,16 +393,6 @@ maemo5: {
|
||||
icon.path = $$ICONDIR/icons/hicolor/64x64/apps
|
||||
icon.files += wagic-64x64.png
|
||||
|
||||
res.path = $$RESDIR
|
||||
res.files += bin/Res/*
|
||||
# res.extra = tar -C ../../../../src/projects/mtg/bin -czf Res.tgz Res
|
||||
|
||||
restxt.path = $$BINDIR
|
||||
restxt.files += debian/Res.txt
|
||||
|
||||
launcher.path = $$BINDIR
|
||||
launcher.files += debian/launcher
|
||||
|
||||
# Meego/maemo 6 packaging (no launcher)
|
||||
} else:contains(MEEGO_EDITION,harmattan): {
|
||||
|
||||
@@ -500,7 +489,40 @@ OTHER_FILES += \
|
||||
android/src/org/kde/necessitas/origo/QtApplication.java \
|
||||
android/src/org/kde/necessitas/origo/QtActivity.java \
|
||||
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
|
||||
android/src/org/kde/necessitas/ministro/IMinistro.aidl \
|
||||
android/AndroidManifest.xml \
|
||||
android/res/layout/splash.xml \
|
||||
android/res/values-ru/strings.xml \
|
||||
android/res/values-es/strings.xml \
|
||||
android/res/values-it/strings.xml \
|
||||
android/res/values/strings.xml \
|
||||
android/res/values/libs.xml \
|
||||
android/res/values-id/strings.xml \
|
||||
android/res/values-rs/strings.xml \
|
||||
android/res/values-nl/strings.xml \
|
||||
android/res/values-zh-rCN/strings.xml \
|
||||
android/res/values-ro/strings.xml \
|
||||
android/res/drawable-ldpi/icon.png \
|
||||
android/res/drawable-mdpi/icon.png \
|
||||
android/res/values-et/strings.xml \
|
||||
android/res/values-fr/strings.xml \
|
||||
android/res/values-ja/strings.xml \
|
||||
android/res/values-el/strings.xml \
|
||||
android/res/values-pt-rBR/strings.xml \
|
||||
android/res/values-fa/strings.xml \
|
||||
android/res/drawable/logo.png \
|
||||
android/res/drawable/icon.png \
|
||||
android/res/values-nb/strings.xml \
|
||||
android/res/values-ms/strings.xml \
|
||||
android/res/values-de/strings.xml \
|
||||
android/res/values-zh-rTW/strings.xml \
|
||||
android/res/values-pl/strings.xml \
|
||||
android/res/drawable-hdpi/icon.png \
|
||||
android/src/org/kde/necessitas/origo/QtApplication.java \
|
||||
android/src/org/kde/necessitas/origo/QtActivity.java \
|
||||
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
|
||||
android/src/org/kde/necessitas/ministro/IMinistro.aidl
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Encoding=UTF-8
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Wagic
|
||||
Exec=/opt/wagic/launcher
|
||||
Exec=/opt/wagic/bin/wagic
|
||||
Icon=wagic-64x64
|
||||
StartupWMClass=wagic
|
||||
X-HildonDesk-ShowInToolbar=true
|
||||
|
||||
Reference in New Issue
Block a user