mirror of
https://github.com/QuasarApp/Hanoi-Towers.git
synced 2025-04-26 09:44:32 +00:00
fix android
This commit is contained in:
parent
7a32b3da50
commit
25d8728785
@ -1,5 +1,5 @@
|
||||
[Desktop Entry]
|
||||
Version=1.4
|
||||
Version=1.5
|
||||
Name=Hanoi Towers
|
||||
Comment=Hanoi Towers Game.
|
||||
Exec=hanoi-towers
|
||||
@ -10,5 +10,5 @@ Categories=Games;Application;
|
||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||
X-GNOME-Bugzilla-Product=hanoi-towers
|
||||
X-GNOME-Bugzilla-Component=General
|
||||
X-GNOME-Bugzilla-Version=1.4
|
||||
X-GNOME-Bugzilla-Version=1.5
|
||||
StartupNotify=true
|
||||
|
77
source/AndroidManifest.xml
Normal file
77
source/AndroidManifest.xml
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0"?>
|
||||
<manifest package="df.mobily.hanoi_towers" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.0" android:versionCode="10" android:installLocation="auto">
|
||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:icon="@drawable/icon">
|
||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="landscape" android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
|
||||
<!-- Application arguments -->
|
||||
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
|
||||
<!-- Application arguments -->
|
||||
|
||||
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
|
||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||
<meta-data android:name="android.app.repository" android:value="default"/>
|
||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||
<!-- Deploy Qt libs as part of package -->
|
||||
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||
<!-- Run with local libs -->
|
||||
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
|
||||
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
|
||||
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
|
||||
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
|
||||
<!-- Messages maps -->
|
||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||
<!-- Messages maps -->
|
||||
|
||||
<!-- Splash screen -->
|
||||
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
|
||||
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
|
||||
<!-- Splash screen -->
|
||||
|
||||
<!-- Background running -->
|
||||
<!-- Warning: changing this value to true may cause unexpected crashes if the
|
||||
application still try to draw after
|
||||
"applicationStateChanged(Qt::ApplicationSuspended)"
|
||||
signal is sent! -->
|
||||
<meta-data android:name="android.app.background_running" android:value="false"/>
|
||||
<!-- Background running -->
|
||||
|
||||
<!-- auto screen scale factor -->
|
||||
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
|
||||
<!-- auto screen scale factor -->
|
||||
|
||||
<!-- extract android style -->
|
||||
<!-- available android:values :
|
||||
* full - useful QWidget & Quick Controls 1 apps
|
||||
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
|
||||
* none - useful for apps that don't use any of the above Qt modules
|
||||
-->
|
||||
<meta-data android:name="android.app.extract_android_style" android:value="full"/>
|
||||
<!-- extract android style -->
|
||||
</activity>
|
||||
|
||||
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
|
||||
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21"/>
|
||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||
Remove the comment if you do not require these default permissions. -->
|
||||
<!-- %%INSERT_PERMISSIONS -->
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
|
||||
Remove the comment if you do not require these default features. -->
|
||||
<!-- %%INSERT_FEATURES -->
|
||||
|
||||
</manifest>
|
@ -63,6 +63,8 @@ Rectangle {
|
||||
tumbler.visible = false;
|
||||
start(spin.value);
|
||||
}
|
||||
height: width * 0.6
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.bottom: parent.bottom
|
||||
|
@ -44,7 +44,7 @@ Item {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
ab.parent.source = "game.qml"
|
||||
ab.parent.source = "menu/MainMenu.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<manifest package="df.mobily.hanoi_towers" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.4.5" android:versionCode="9" android:installLocation="auto">
|
||||
<manifest package="df.mobily.hanoi_towers" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.5.0" android:versionCode="11" android:installLocation="auto">
|
||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:icon="@drawable/icon">
|
||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="landscape" android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
@ -63,7 +63,7 @@
|
||||
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22"/>
|
||||
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26"/>
|
||||
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
|
||||
|
||||
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
|
||||
|
@ -4,7 +4,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:1.1.0'
|
||||
classpath 'com.android.tools.build:gradle:2.2.3'
|
||||
}
|
||||
}
|
||||
|
||||
|
BIN
source/android/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
source/android/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
#Wed Apr 10 15:27:10 PDT 2013
|
||||
#Mon Feb 20 10:43:22 EST 2017
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
|
||||
|
74
source/android/gradlew
vendored
74
source/android/gradlew
vendored
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@ -6,12 +6,30 @@
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS="-Xmx1024m -Dfile.encoding=UTF-8"
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
@ -30,6 +48,7 @@ die ( ) {
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
@ -40,31 +59,11 @@ case "`uname`" in
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@ -90,7 +89,7 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
@ -114,6 +113,7 @@ fi
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
@ -154,11 +154,19 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
174
source/android/gradlew.bat
vendored
174
source/android/gradlew.bat
vendored
@ -1,90 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=-Xmx1024m -Dfile.encoding=UTF-8
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
<array name="qt_sources">
|
||||
<item>https://download.qt.io/ministro/android/qt5/qt-5.8</item>
|
||||
<item>https://download.qt.io/ministro/android/qt5/qt-5.9</item>
|
||||
</array>
|
||||
|
||||
<!-- The following is handled automatically by the deployment tool. It should
|
||||
|
30
source/base/BaseRadioButton.qml
Normal file
30
source/base/BaseRadioButton.qml
Normal file
@ -0,0 +1,30 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
RadioButton {
|
||||
Theme{
|
||||
id: theme;
|
||||
}
|
||||
|
||||
id: radioButton
|
||||
|
||||
contentItem: Text {
|
||||
text: parent.text
|
||||
font.pixelSize: parent.height * 0.7
|
||||
opacity: enabled ? 1.0 : 0.3
|
||||
color: parent.down ? theme.buttonsTextColor : theme.buttonsTextColorPresed
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
indicator.height: height * 0.8
|
||||
indicator.width: height * 0.8
|
||||
|
||||
indicator.implicitHeight: height * 0.8
|
||||
indicator.implicitWidth: height * 0.8
|
||||
|
||||
width: theme.buttonsWidth
|
||||
height: theme.buttonsHeight
|
||||
}
|
||||
|
23
source/base/BoseCheckBox.qml
Normal file
23
source/base/BoseCheckBox.qml
Normal file
@ -0,0 +1,23 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
CheckBox {
|
||||
Theme{
|
||||
id: theme;
|
||||
}
|
||||
contentItem: Text {
|
||||
text: parent.text
|
||||
font.pixelSize: parent.height * 0.8
|
||||
opacity: enabled ? 1.0 : 0.3
|
||||
color: parent.down ? theme.buttonsTextColor : theme.buttonsTextColorPresed
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
indicator.height: height
|
||||
indicator.width: height
|
||||
|
||||
width: theme.buttonsWidth
|
||||
height: theme.buttonsHeight
|
||||
}
|
151
source/game.qml
151
source/game.qml
@ -28,85 +28,102 @@ Rectangle {
|
||||
id: mouse
|
||||
}
|
||||
|
||||
Item {
|
||||
id: mouseContener
|
||||
property var mouseObj: null
|
||||
width: parent.width * 0.13
|
||||
height: parent.height * 0.08
|
||||
|
||||
RowLayout{
|
||||
height: gameWindow.height * 0.1
|
||||
Item {
|
||||
id: mouseContener
|
||||
property var mouseObj: null
|
||||
width: parent.width * 0.13
|
||||
height: parent.height
|
||||
|
||||
function clear() {
|
||||
if (mouseObj) {
|
||||
mouseObj.destroy()
|
||||
}
|
||||
}
|
||||
function push(obj) {
|
||||
mouseObj = obj
|
||||
obj.parent = this
|
||||
return true
|
||||
}
|
||||
function top() {
|
||||
return mouseObj
|
||||
}
|
||||
function pop() {
|
||||
mouseObj = null
|
||||
function clear() {
|
||||
if (mouseObj) {
|
||||
mouseObj.destroy()
|
||||
}
|
||||
}
|
||||
function push(obj) {
|
||||
mouseObj = obj
|
||||
obj.parent = this
|
||||
return true
|
||||
}
|
||||
function top() {
|
||||
return mouseObj
|
||||
}
|
||||
function pop() {
|
||||
mouseObj = null
|
||||
}
|
||||
|
||||
Base.BaseText {
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.leftMargin: mouseContener.width * 0.2
|
||||
|
||||
}
|
||||
|
||||
Base.BaseText {
|
||||
id: towerheight
|
||||
font.bold: true
|
||||
font.pointSize: height / text.length * 2
|
||||
horizontalAlignment: Text.AlignCenter
|
||||
height: mouseContener.height
|
||||
|
||||
styleColor: "#973c3c"
|
||||
verticalAlignment: Text.AlignCenter
|
||||
text: qsTr("Tower height:")
|
||||
|
||||
anchors.left: mouseContener.right
|
||||
anchors.top: parent.top
|
||||
anchors.leftMargin: mouseContener.width * 0.2
|
||||
|
||||
}
|
||||
|
||||
Base.BaseButton {
|
||||
id: frame
|
||||
|
||||
text: qsTr("lvl ") + (tumbler.spin.currentIndex + 1)
|
||||
width: mouseContener.width * 1
|
||||
height: mouseContener.height
|
||||
|
||||
onClicked: {
|
||||
tumbler.visible = true;
|
||||
}
|
||||
anchors.left: towerheight.right
|
||||
anchors.top: parent.top
|
||||
anchors.leftMargin: mouseContener.width * 0.2
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: step
|
||||
property int ste: 0
|
||||
width: mouseContener.width * 0.8
|
||||
height: mouseContener.height
|
||||
Text {
|
||||
font.bold: true
|
||||
font.pointSize: height / text.length * 2
|
||||
font.pointSize: 14
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
styleColor: "#973c3c"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("Tower height:")
|
||||
}
|
||||
|
||||
Base.BaseButton {
|
||||
id: frame
|
||||
|
||||
text: qsTr("lvl ") + (tumbler.spin.currentIndex + 1)
|
||||
width: parent.width / 2.2
|
||||
height: parent.height
|
||||
|
||||
onClicked: {
|
||||
tumbler.visible = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: step
|
||||
property int ste: 0
|
||||
width: parent.width *0.05
|
||||
height: mouseContener.height
|
||||
Text {
|
||||
font.bold: true
|
||||
font.pointSize: 14
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
styleColor: "#973c3c"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: qsTr("step ") + step.ste
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Base.BaseButton {
|
||||
id: b_exit
|
||||
text: qsTr("Return to main menu")
|
||||
|
||||
onClicked: {
|
||||
gameWindow.parent.source = "menu/MainMenu.qml"
|
||||
}
|
||||
text: qsTr("step ") + step.ste
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
anchors.left: frame.right
|
||||
anchors.leftMargin: mouseContener.width * 0.2
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
Base.BaseButton {
|
||||
id: b_exit
|
||||
text: qsTr("Return to main menu")
|
||||
height: mouseContener.height
|
||||
width: mouseContener.width * 2
|
||||
|
||||
onClicked: {
|
||||
gameWindow.parent.source = "menu/MainMenu.qml"
|
||||
}
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: parent.width * 0.05;
|
||||
anchors.top: parent.top
|
||||
|
||||
}
|
||||
|
||||
function launch(){
|
||||
|
@ -40,7 +40,14 @@ DISTFILES += \
|
||||
android/build.gradle \
|
||||
android/gradle/wrapper/gradle-wrapper.properties \
|
||||
android/gradlew.bat \
|
||||
import.qml
|
||||
import.qml \
|
||||
android/AndroidManifest.xml \
|
||||
android/gradle/wrapper/gradle-wrapper.jar \
|
||||
android/gradlew \
|
||||
android/res/values/libs.xml \
|
||||
android/build.gradle \
|
||||
android/gradle/wrapper/gradle-wrapper.properties \
|
||||
android/gradlew.bat
|
||||
|
||||
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
|
||||
|
||||
|
@ -37,6 +37,8 @@ bool initLocale(const QString &locale, QApplication& app, QTranslator &translato
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // <--
|
||||
|
||||
QApplication app(argc, argv);
|
||||
setFont(app);
|
||||
|
||||
|
@ -5,7 +5,7 @@ import QtQuick.Extras 1.4
|
||||
import "./../base" as Base
|
||||
import BackEnd 1.0
|
||||
|
||||
Page {
|
||||
Item {
|
||||
id:menuPage
|
||||
|
||||
Base.Theme{
|
||||
@ -16,7 +16,8 @@ Page {
|
||||
id: backEnd
|
||||
}
|
||||
|
||||
header: Rectangle {
|
||||
Rectangle {
|
||||
id: head
|
||||
color: "#800af587"
|
||||
height: parent.height * 0.15;
|
||||
RowLayout {
|
||||
@ -42,59 +43,75 @@ Page {
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
id: content;
|
||||
RowLayout {
|
||||
Row {
|
||||
|
||||
Image {
|
||||
id: colorsView
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: (backEnd.randomColor)? "../img/random":"../img/standart"
|
||||
width: (content.width * 0.3 > height)? height: content.width * 0.3
|
||||
height: content.height
|
||||
}
|
||||
Image {
|
||||
id: colorsView
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: (backEnd.randomColor)? "../img/random":"../img/standart"
|
||||
height: width
|
||||
width: menuPage.width * 0.5
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
id: colors
|
||||
width: parent.width * 0.5
|
||||
|
||||
RadioButton {
|
||||
id: r1
|
||||
checked: !backEnd.randomColor
|
||||
text: qsTr("Standart color")
|
||||
|
||||
onCheckedChanged: {
|
||||
backEnd.randomColor = false;
|
||||
}
|
||||
}
|
||||
|
||||
RadioButton {
|
||||
id:r2
|
||||
checked: backEnd.randomColor
|
||||
text: qsTr("Random color")
|
||||
|
||||
onCheckedChanged: {
|
||||
backEnd.randomColor = true;
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox{
|
||||
|
||||
text: qsTr("Animation")
|
||||
checked: backEnd.animation
|
||||
onCheckedChanged: {
|
||||
backEnd.animation = checked;
|
||||
}
|
||||
}
|
||||
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Column {
|
||||
|
||||
id: colors
|
||||
width: colorsView.width
|
||||
height: colorsView.height
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: parent.width * 0.1
|
||||
anchors.left: colorsView.right
|
||||
|
||||
|
||||
RadioButton {
|
||||
id: r1
|
||||
checked: !backEnd.randomColor
|
||||
text: qsTr("Standart color")
|
||||
|
||||
height: colorsView.height * 0.3;
|
||||
width: colorsView.width;
|
||||
onCheckedChanged: {
|
||||
backEnd.randomColor = false;
|
||||
}
|
||||
}
|
||||
|
||||
RadioButton {
|
||||
id:r2
|
||||
checked: backEnd.randomColor
|
||||
text: qsTr("Random color")
|
||||
height: theme.buttonsHeight;
|
||||
width: theme.buttonsHeight;
|
||||
onCheckedChanged: {
|
||||
backEnd.randomColor = true;
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox {
|
||||
height: theme.buttonsHeight;
|
||||
width: theme.buttonsHeight;
|
||||
text: qsTr("Animation")
|
||||
checked: backEnd.animation
|
||||
onCheckedChanged: {
|
||||
backEnd.animation = checked;
|
||||
}
|
||||
}
|
||||
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
}
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.top: head.bottom
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,33 @@ Page {
|
||||
|
||||
contentItem: Item {
|
||||
id: content;
|
||||
|
||||
// Image {
|
||||
// id: backleft
|
||||
// source: "/img/standart"
|
||||
// width: parent.width * 0.5
|
||||
// height: width
|
||||
// fillMode: Image.PreserveAspectFit
|
||||
// anchors.left: parent.left
|
||||
// anchors.bottom: parent.bottom
|
||||
// anchors.bottomMargin: width * -0.1
|
||||
// anchors.leftMargin: height * -0.5
|
||||
|
||||
// }
|
||||
|
||||
// Image {
|
||||
// id: backright
|
||||
// source: "/img/standart"
|
||||
// width: parent.width * 0.5
|
||||
// height: width
|
||||
// fillMode: Image.PreserveAspectFit
|
||||
// anchors.right: parent.right
|
||||
// anchors.bottom: parent.bottom
|
||||
// anchors.bottomMargin: width * -0.1
|
||||
// anchors.rightMargin: height * -0.5
|
||||
|
||||
// }
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
<file>menu/Header.qml</file>
|
||||
<file>menu/Config.qml</file>
|
||||
<file>SwitchLvl.qml</file>
|
||||
<file>base/BaseRadioButton.qml</file>
|
||||
<file>base/BoseCheckBox.qml</file>
|
||||
</qresource>
|
||||
<qresource prefix="/textures">
|
||||
<file>res/wood.png</file>
|
||||
|
BIN
source/res/iconInstall.png
Normal file
BIN
source/res/iconInstall.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
Loading…
x
Reference in New Issue
Block a user