diff --git a/build/android/app/build.gradle b/build/android/app/build.gradle index 68506c28..f6f3efaa 100644 --- a/build/android/app/build.gradle +++ b/build/android/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId 'com.multicraft.game' minSdkVersion 19 targetSdkVersion 31 - versionCode 170 - versionName "1.16.0" + versionCode 200 + versionName "1.19.0" } // load properties @@ -66,10 +66,10 @@ dependencies { implementation project(':native') /* Third-party libraries */ - implementation 'androidx.appcompat:appcompat:1.3.1' - implementation 'androidx.appcompat:appcompat-resources:1.3.1' + implementation 'androidx.appcompat:appcompat:1.4.0' + implementation 'androidx.appcompat:appcompat-resources:1.4.0' implementation 'com.google.android.material:material:1.4.0' implementation 'io.reactivex.rxjava3:rxjava:3.0.13' implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' - implementation 'net.lingala.zip4j:zip4j:2.9.0' + implementation 'net.lingala.zip4j:zip4j:2.9.1' } diff --git a/build/android/app/src/main/java/com/multicraft/game/MainActivity.kt b/build/android/app/src/main/java/com/multicraft/game/MainActivity.kt index 7ad2bd5d..90c7b3c2 100644 --- a/build/android/app/src/main/java/com/multicraft/game/MainActivity.kt +++ b/build/android/app/src/main/java/com/multicraft/game/MainActivity.kt @@ -59,7 +59,6 @@ import io.reactivex.rxjava3.disposables.Disposable import io.reactivex.rxjava3.schedulers.Schedulers import java.io.File import java.io.IOException -import java.util.* class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding diff --git a/build/android/app/src/main/java/com/multicraft/game/UnzipService.kt b/build/android/app/src/main/java/com/multicraft/game/UnzipService.kt index e1e86775..aa4cc586 100644 --- a/build/android/app/src/main/java/com/multicraft/game/UnzipService.kt +++ b/build/android/app/src/main/java/com/multicraft/game/UnzipService.kt @@ -34,7 +34,6 @@ import net.lingala.zip4j.model.LocalFileHeader import java.io.File import java.io.FileInputStream import java.io.IOException -import java.util.* class UnzipService : JobIntentService() { private val id = 1 diff --git a/build/android/build.gradle b/build/android/build.gradle index 6c158f25..54f3c4ec 100644 --- a/build/android/build.gradle +++ b/build/android/build.gradle @@ -7,9 +7,9 @@ buildscript { maven { url 'https://plugins.gradle.org/m2/' } } dependencies { - classpath 'com.android.tools.build:gradle:7.0.3' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31' - classpath 'de.undercouch:gradle-download-task:4.1.1' + classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10' + classpath 'de.undercouch:gradle-download-task:4.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/build/android/gradle/wrapper/gradle-wrapper.properties b/build/android/gradle/wrapper/gradle-wrapper.properties index d68e949a..c5f111d5 100644 --- a/build/android/gradle/wrapper/gradle-wrapper.properties +++ b/build/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Sep 13 14:41:51 CEST 2021 +#Mon Dec 27 10:51:18 CET 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/build/android/native/jni/Android.mk b/build/android/native/jni/Android.mk index d4bb2ce3..6104df01 100644 --- a/build/android/native/jni/Android.mk +++ b/build/android/native/jni/Android.mk @@ -249,7 +249,7 @@ LOCAL_SRC_FILES += ../../../lib/luautf8/lutf8lib.c LOCAL_STATIC_LIBRARIES += Curl Gettext Freetype Irrlicht LevelDB OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT android_native_app_glue $(PROFILER_LIBS) -LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES +LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES -lz include $(BUILD_SHARED_LIBRARY) diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index c98960a8..acaae4e1 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -103,6 +103,11 @@ local function get_formspec() menu_render_worldlist() .. ";" .. index .. "]" +if PLATFORM == "Android" then + retval = retval .. "image_button[10.6,-0.1;1.5,1.5;" .. + core.formspec_escape(defaulttexturedir) .. "gift_btn.png;upgrade;;true;false;" .. + core.formspec_escape(defaulttexturedir) .. "gift_btn_pressed.png]" +end if PLATFORM ~= "Android" and PLATFORM ~= "iOS" then retval = retval .. @@ -245,6 +250,10 @@ local function main_button_handler(this, fields, name) return true end + if fields["upgrade"] then + core.upgrade("") + end + --[[if fields["world_configure"] ~= nil then local selected = core.get_table_index("sp_worlds") if selected ~= nil then diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp index f27a24dc..8614354a 100644 --- a/src/client/inputhandler.cpp +++ b/src/client/inputhandler.cpp @@ -109,12 +109,6 @@ bool MyEventReceiver::OnEvent(const SEvent &event) if (event.MouseInput.Event == EMIE_RMOUSE_LEFT_UP) { rightreleased = true; } -#if defined(__MACH__) && defined(__APPLE__) && !defined(__IOS__) - if (event.MouseInput.Event == EMIE_MOUSE_WHEEL_X) { - mouse_wheel -= event.MouseInput.Wheel; - return true; - } -#endif if (event.MouseInput.Event == EMIE_MOUSE_WHEEL) { mouse_wheel += event.MouseInput.Wheel; } diff --git a/src/config.h b/src/config.h index b3d2e895..72d32e09 100644 --- a/src/config.h +++ b/src/config.h @@ -17,7 +17,7 @@ #define PROJECT_NAME_C "MultiCraft" #define STATIC_SHAREDIR "" #define VERSION_MAJOR 1 - #define VERSION_MINOR 17 + #define VERSION_MINOR 19 #define VERSION_PATCH 0 #define VERSION_STRING STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR(VERSION_PATCH) #endif diff --git a/src/guiTable.cpp b/src/guiTable.cpp index f3838fb0..8ef330c6 100644 --- a/src/guiTable.cpp +++ b/src/guiTable.cpp @@ -884,19 +884,9 @@ bool GUITable::OnEvent(const SEvent &event) core::position2d p(event.MouseInput.X, event.MouseInput.Y); if (event.MouseInput.Event == EMIE_MOUSE_WHEEL) { -#if defined(__MACH__) && defined(__APPLE__) && !defined(__IOS__) - // looks awful, works same - float wheel = event.MouseInput.Wheel; - if (wheel > 0.01) wheel = 2; - else if (wheel < -0.01) wheel = -2; - m_scrollbar->setPos(m_scrollbar->getPos() + - (s32) wheel * - - (s32) m_rowheight / 2); -#else m_scrollbar->setPos(m_scrollbar->getPos() + (event.MouseInput.Wheel < 0 ? -3 : 3) * - (s32) m_rowheight / 2); -#endif return true; } diff --git a/textures/base/gift_btn.png b/textures/base/gift_btn.png new file mode 100644 index 00000000..240ca4f8 Binary files /dev/null and b/textures/base/gift_btn.png differ diff --git a/textures/base/gift_btn_pressed.png b/textures/base/gift_btn_pressed.png new file mode 100644 index 00000000..240ca4f8 Binary files /dev/null and b/textures/base/gift_btn_pressed.png differ