Version 2.0.6-release but not yet! and Package it!
* Merge branch 'master' of https://codeberg.org/minenux/minetest-engine-multicraft2 into minenux
4
.github/workflows/build.yml
vendored
@ -260,8 +260,8 @@ jobs:
|
||||
name: VS 2022 ${{ matrix.config.arch }}-${{ matrix.type }}
|
||||
runs-on: windows-2022
|
||||
env:
|
||||
VCPKG_VERSION: af2287382b1991dbdcb7e5112d236f3323b9dd7a
|
||||
# 2022.03.10
|
||||
VCPKG_VERSION: a42af01b72c28a8e1d7b48107b33e4f286a55ef6
|
||||
# 2023.11.20
|
||||
vcpkg_packages: irrlicht zlib curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
356
.gitlab-ci.yml
@ -1,46 +1,81 @@
|
||||
---
|
||||
# Github repository is really at minetest.org using the poikilos git.minetest.io
|
||||
# https://gitlab.com/minenux/minetest-engine-multicraft2
|
||||
# Pipelines URL: https://gitlab.com/minenux/minetest-engine-multicraft2/pipelines
|
||||
# https://gitlab.com/minenux/minetest-engine-minetest
|
||||
# Pipelines URL: https://gitlab.com/minenux/minetest-engine-minetest/pipelines
|
||||
# packages moved to https://build.opensuse.org/project/show/home:venenux:minenux
|
||||
# in future we only build here, or made apk packs for alpine
|
||||
|
||||
stages:
|
||||
- build
|
||||
- package
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
MINETEST_GAME_REPO: "https://gitlab.com/minenux/minetest-game-minetest.git"
|
||||
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
|
||||
|
||||
.build_template:
|
||||
.build_template: &build_definition
|
||||
stage: build
|
||||
script:
|
||||
- mkdir cmakebuild
|
||||
- mkdir -p artifact/multicraft/usr/
|
||||
- mkdir -p games
|
||||
- cd games
|
||||
- git clone -b stable-0.4 --single-branch $MINETEST_GAME_REPO minetest
|
||||
- git clone -b stable-5.2 --single-branch https://codeberg.org/minenux/minetest-game-minetest minetest
|
||||
- cd ../cmakebuild
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/multicraft/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=ON -DCMAKE_BUILD_TYPE=Release -DRUN_IN_PLACE=TRUE -DENABLE_GETTEXT=TRUE -DENABLE_SYSTEM_JSONCPP=TRUE -DAPPLY_LOCALE_BLACKLIST=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON ..
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/multicraft/usr/ -DBUILD_SERVER=ON -DBUILD_CLIENT=ON -DRUN_IN_PLACE=OFF -DENABLE_CURL=ON -DENABLE_SOUND=ON -DENABLE_LUAJIT=ON -DENABLE_GETTEXT=ON -DENABLE_FREETYPE=ON -DENABLE_SYSTEM_GMP=ON -DENABLE_SYSTEM_JSONCPP=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_POSTGRESQL=ON ..
|
||||
- make -j$(nproc)
|
||||
- make install
|
||||
artifacts:
|
||||
when: on_success
|
||||
expire_in: 5h
|
||||
expire_in: 1y
|
||||
paths:
|
||||
- artifact/*
|
||||
|
||||
##
|
||||
## Alpine the limited distro for nonsocial geeks
|
||||
##
|
||||
|
||||
build:alpine-312:
|
||||
extends: .build_template
|
||||
image: alpine:3.12
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add build-base cmake pkgconf gettext-dev bzip2-dev curl-dev libnl3-dev rtmpdump-dev libidn2-dev ncurses-dev freetype-dev mesa-dev gmp-dev irrlicht-dev libjpeg-turbo-dev jsoncpp-dev leveldb-dev luajit-dev lua5.1-dev libogg-dev openal-soft-dev libpng-dev postgresql-dev hiredis-dev sqlite-dev libvorbis-dev libxi-dev zlib-dev doxygen libxrandr-dev libx11-dev zstd-dev openssl-dev samurai
|
||||
|
||||
build:alpine-314:
|
||||
extends: .build_template
|
||||
image: alpine:3.14
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add build-base cmake pkgconf gettext-dev bzip2-dev curl-dev libnl3-dev rtmpdump-dev libidn2-dev ncurses-dev freetype-dev mesa-dev gmp-dev irrlicht-dev libjpeg-turbo-dev jsoncpp-dev leveldb-dev luajit-dev lua5.1-dev libogg-dev openal-soft-dev libpng-dev postgresql-dev hiredis-dev sqlite-dev libvorbis-dev libxi-dev zlib-dev doxygen libxrandr-dev libx11-dev zstd-dev openssl-dev samurai
|
||||
|
||||
build:alpine-316:
|
||||
extends: .build_template
|
||||
image: alpine:3.16
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add build-base cmake pkgconf gettext-dev bzip2-dev curl-dev libnl3-dev rtmpdump-dev libidn2-dev ncurses-dev freetype-dev mesa-dev gmp-dev irrlicht-dev libjpeg-turbo-dev jsoncpp-dev leveldb-dev luajit-dev lua5.1-dev libogg-dev openal-soft-dev libpng-dev postgresql-dev hiredis-dev sqlite-dev libvorbis-dev libxi-dev zlib-dev doxygen libxrandr-dev libx11-dev zstd-dev openssl-dev samurai
|
||||
|
||||
build:alpine-319:
|
||||
extends: .build_template
|
||||
image: alpine:3.19
|
||||
before_script:
|
||||
- apk update
|
||||
- apk add build-base cmake pkgconf gettext-dev bzip2-dev curl-dev libnl3-dev rtmpdump-dev libidn2-dev ncurses-dev freetype-dev mesa-dev gmp-dev irrlicht-dev libjpeg-turbo-dev jsoncpp-dev leveldb-dev luajit-dev lua5.1-dev libogg-dev openal-soft-dev libpng-dev postgresql-dev hiredis-dev sqlite-dev libvorbis-dev libxi-dev zlib-dev doxygen libxrandr-dev libx11-dev zstd-dev openssl-dev samurai
|
||||
|
||||
# error - need to enable testing repo due spatial index
|
||||
#build:alpine-edge:
|
||||
# extends: .build_template
|
||||
# image: alpine:edge
|
||||
# before_script:
|
||||
# - apk update
|
||||
# - apk add build-base git cmake pkgconf gettext-dev bzip2-dev curl-dev libnl3-dev rtmpdump-dev libidn2-dev ncurses-dev freetype-dev mesa-dev gmp-dev irrlicht-dev libjpeg-turbo-dev jsoncpp-dev leveldb-dev luajit-dev lua5.1-dev libogg-dev openal-soft-dev libpng-dev postgresql-dev hiredis-dev sqlite-dev libvorbis-dev libxi-dev zlib-dev doxygen libxrandr-dev libx11-dev zstd-dev openssl1.1-compat-dev samurai libspatialindex-dev
|
||||
|
||||
|
||||
##
|
||||
## Debian mother of many distros
|
||||
##
|
||||
|
||||
# Jessie
|
||||
|
||||
build:debian-8:
|
||||
extends: .build_template
|
||||
image: debian:8
|
||||
build:debian-8-64:
|
||||
<<: *build_definition
|
||||
image: amd64/debian:8
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
@ -50,19 +85,17 @@ build:debian-8:
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Acquire::https::download.opensuse.org::Verify-Peer "false";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://archive.debian.org/debian/ jessie main contrib" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://deb.freexian.com/extended-lts jessie main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev x11proto-xf86vidmode-dev
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install -t jessie-backports libjsoncpp-dev
|
||||
# Stretch
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev postgresql-server-dev-all libhiredis-dev zlib1g-dev doxygen libxrandr-dev x11proto-xf86vidmode-dev
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes -t jessie-backports install libjsoncpp-dev
|
||||
|
||||
build:debian-9:
|
||||
extends: .build_template
|
||||
image: debian:9
|
||||
build:debian-8-32:
|
||||
<<: *build_definition
|
||||
image: i386/debian:8
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
@ -73,260 +106,109 @@ build:debian-9:
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://archive.debian.org/debian/ stretch main contrib" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://deb.freexian.com/extended-lts stretch main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://archive.debian.org/debian/ jessie main contrib" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://deb.freexian.com/extended-lts jessie main contrib non-free" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev postgresql-server-dev-all libhiredis-dev zlib1g-dev doxygen libxrandr-dev x11proto-xf86vidmode-dev
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes -t jessie-backports install libjsoncpp-dev
|
||||
|
||||
# Bullseye
|
||||
# Stretch
|
||||
|
||||
build:debian-11:
|
||||
extends: .build_template
|
||||
image: debian:11
|
||||
build:debian-9-32:
|
||||
<<: *build_definition
|
||||
image: i386/debian:9
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "deb http://archive.debian.org/debian/ stretch main contrib" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://deb.freexian.com/extended-lts stretch main contrib non-free" > /etc/apt/sources.list
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
# bookworm
|
||||
# Bullseye
|
||||
|
||||
build:debian-11:
|
||||
<<: *build_definition
|
||||
image: debian:11
|
||||
before_script:
|
||||
- apt-get update -y || true
|
||||
- apt-get -y install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev postgresql-server-dev-all libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
# Bookworm
|
||||
|
||||
build:debian-12:
|
||||
extends: .build_template
|
||||
<<: *build_definition
|
||||
image: debian:12
|
||||
before_script:
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config cmake-data debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
- apt-get update -y || true
|
||||
- apt-get -y install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
##
|
||||
## Ubuntu
|
||||
## winbuntu the distro for stupid users
|
||||
##
|
||||
|
||||
# Utopic most close to jessie
|
||||
build:ubuntu-22.04:
|
||||
<<: *build_definition
|
||||
image: ubuntu:jammy
|
||||
before_script:
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
#build:ubuntu-14.10:
|
||||
# extends: .build_template
|
||||
# image: ubuntu:utopic
|
||||
# before_script:
|
||||
# - echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
# - rm -rf /etc/apt/sources.list
|
||||
# - echo "deb http://old-releases.ubuntu.com/ubuntu/ utopic main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
# - echo "deb http://old-releases.ubuntu.com/ubuntu/ utopic-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
# - echo "deb http://old-releases.ubuntu.com/ubuntu utopic-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
# - apt-get update -y || true
|
||||
# - apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev
|
||||
# Focal most close to bullseye
|
||||
|
||||
build:ubuntu-20.04:
|
||||
<<: *build_definition
|
||||
image: ubuntu:focal
|
||||
before_script:
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
# yakkety most close to jessie
|
||||
|
||||
build:ubuntu-16.10:
|
||||
<<: *build_definition
|
||||
image: ubuntu:yakkety
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ yakkety main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ yakkety-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu yakkety-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- apt-get update -y || true
|
||||
- apt-get -y --force-yes install build-essential cmake pkg-config debhelper lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev
|
||||
|
||||
# Zesty most close to stretch
|
||||
|
||||
build:ubuntu-17.04:
|
||||
extends: .build_template
|
||||
<<: *build_definition
|
||||
image: ubuntu:zesty
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ zesty-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu zesty-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config cmake-data debhelper dh-systemd dh-autoreconf lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
# artful most close to stretch
|
||||
|
||||
build:ubuntu-17.10:
|
||||
extends: .build_template
|
||||
image: ubuntu:artful
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- rm -rf /etc/apt/sources.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ artful main restricted universe multiverse" > /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu/ artful-updates main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- echo "deb http://old-releases.ubuntu.com/ubuntu artful-security main restricted universe multiverse" >> /etc/apt/sources.list.d/50debianoficial.list
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y --force-yes install build-essential git cmake pkg-config cmake-data debhelper dh-systemd dh-autoreconf lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
# Xenial
|
||||
|
||||
build:ubuntu-16.04:
|
||||
extends: .build_template
|
||||
image: ubuntu:xenial
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
|
||||
# Bionic
|
||||
|
||||
build:ubuntu-18.04:
|
||||
extends: .build_template
|
||||
image: ubuntu:bionic
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
|
||||
# Focal
|
||||
|
||||
build:ubuntu-20.04:
|
||||
extends: .build_template
|
||||
image: ubuntu:focal
|
||||
before_script:
|
||||
- echo "" > /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "APT::Get::AllowUnauthenticated \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowDowngradeToInsecureRepositories \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::AllowReleaseInfoChange::Suite \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Check-Valid-Until \"false\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Acquire::Languages \"en\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- echo "Aptitude::CmdLine::Ignore-Trust-Violations \"true\";" >> /etc/apt/apt.conf.d/50venenuxcustom
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
|
||||
# jammy
|
||||
|
||||
build:ubuntu-22.04:
|
||||
extends: .build_template
|
||||
image: ubuntu:jammy
|
||||
before_script:
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get update -y || true
|
||||
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake pkg-config libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev
|
||||
- apt-get update -y || true
|
||||
- apt-get -y --force-yes install build-essential cmake pkg-config debhelper dh-systemd dh-autoreconf lsb-release gettext libbz2-dev libcurl4-gnutls-dev libnl-genl-3-dev libnl-3-dev librtmp-dev libidn11-dev libncurses-dev libfreetype6-dev libglu1-mesa-dev libgmp-dev libirrlicht-dev libjpeg-dev libjsoncpp-dev libleveldb-dev libluajit-5.1-dev liblua5.1-dev libogg-dev libopenal-dev libpng-dev libpq-dev libhiredis-dev libspatialindex-dev libsqlite3-dev libvorbis-dev libx11-dev libxxf86vm-dev postgresql-server-dev-all libpq-dev libhiredis-dev zlib1g-dev doxygen libxrandr-dev mesa-common-dev x11proto-xf86vidmode-dev libzstd-dev
|
||||
|
||||
##
|
||||
## Fedora
|
||||
## Feladora shit distro
|
||||
##
|
||||
|
||||
# Fedora 28 <-> RHEL 8
|
||||
build:fedora-28:
|
||||
extends: .build_template
|
||||
image: fedora:28
|
||||
before_script:
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel irrlicht-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel
|
||||
|
||||
# Fedora 36
|
||||
build:fedora-36:
|
||||
extends: .build_template
|
||||
<<: *build_definition
|
||||
image: fedora:36
|
||||
before_script:
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel cmake pkgconfig bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
|
||||
# Fedora 37
|
||||
build:fedora-37:
|
||||
extends: .build_template
|
||||
<<: *build_definition
|
||||
image: fedora:37
|
||||
before_script:
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
|
||||
# Fedora 38
|
||||
build:fedora-38:
|
||||
extends: .build_template
|
||||
image: fedora:38
|
||||
before_script:
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel git cmake pkgconfig libidn-devel bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel libpq-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
|
||||
##
|
||||
## MinGW for Windows
|
||||
##
|
||||
|
||||
.generic_win_template:
|
||||
image: ubuntu:bionic
|
||||
before_script:
|
||||
- apt-get update -y
|
||||
- apt-get install -y wget xz-utils unzip git cmake gettext
|
||||
- wget -nv http://minetest.kitsunemimi.pw/mingw-w64-${WIN_ARCH}_9.2.0_ubuntu18.04.tar.xz -O mingw.tar.xz
|
||||
- tar -xaf mingw.tar.xz -C /usr
|
||||
|
||||
.build_win_template:
|
||||
extends: .generic_win_template
|
||||
stage: build
|
||||
artifacts:
|
||||
expire_in: 1h
|
||||
paths:
|
||||
- build/multicraft/_build/*
|
||||
|
||||
.package_win_template:
|
||||
extends: .generic_win_template
|
||||
stage: package
|
||||
script:
|
||||
- unzip build/multicraft/_build/multicraft-*.zip
|
||||
- wget -nv https://gitlab.com/minenux/minetest-game-minetest/-/archive/stable-5.2/minetest-game-minetest-stable-5.2.tar.gz -O game.tar.gz
|
||||
- tar -xvf game.tar.gz -C /
|
||||
- mv /minetest*game* multicraft-*-win*/games/minetest || true
|
||||
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libgcc*.dll multicraft-*-win*/bin/
|
||||
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libstdc++*.dll multicraft-*-win*/bin/
|
||||
- cp -p /usr/${WIN_ARCH}-w64-mingw32/bin/libwinpthread*.dll multicraft-*-win*/bin/
|
||||
artifacts:
|
||||
expire_in: 90 day
|
||||
paths:
|
||||
- multicraft-*-win*/*
|
||||
|
||||
build:win32:
|
||||
extends: .build_win_template
|
||||
script:
|
||||
- ./util/buildbot/buildwin32.sh build
|
||||
variables:
|
||||
WIN_ARCH: "i686"
|
||||
|
||||
package:win32:
|
||||
extends: .package_win_template
|
||||
needs:
|
||||
- build:win32
|
||||
variables:
|
||||
WIN_ARCH: "i686"
|
||||
|
||||
|
||||
build:win64:
|
||||
extends: .build_win_template
|
||||
script:
|
||||
- ./util/buildbot/buildwin64.sh build
|
||||
variables:
|
||||
WIN_ARCH: "x86_64"
|
||||
|
||||
package:win64:
|
||||
extends: .package_win_template
|
||||
needs:
|
||||
- build:win64
|
||||
variables:
|
||||
WIN_ARCH: "x86_64"
|
||||
|
||||
- dnf -y install make automake gcc gcc-c++ kernel-devel cmake pkgconfig bzip2-devel gettext-devel sqlite-devel zlib-devel libpng-devel libjpeg-turbo-devel libXxf86vm-devel mesa-libGL-devel irrlicht-devel desktop-file-utils systemd openal* libvorbis* jsoncpp-devel libcurl-devel libcurl luajit-devel leveldb-devel gmp-devel libappstream-glib freetype-devel spatialindex-devel openssl-devel libogg-devel hiredis-devel libzstd-devel libXi-devel ncurses-devel doxygen
|
||||
|
@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
buildToolsVersion '33.0.2'
|
||||
compileSdkVersion 34
|
||||
buildToolsVersion '34.0.0'
|
||||
ndkVersion '25.2.9519653'
|
||||
defaultConfig {
|
||||
applicationId 'com.multicraft.game'
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 34
|
||||
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
|
||||
versionCode project.versionCode
|
||||
}
|
||||
@ -100,7 +100,7 @@ tasks.register('prepareAssetsFiles') {
|
||||
tasks.register('zipAssetsFiles', Zip) {
|
||||
dependsOn prepareAssetsFiles
|
||||
archiveFileName = 'assets.zip'
|
||||
destinationDirectory = file('src/main/assets/data')
|
||||
destinationDirectory = file('src/main/assets')
|
||||
from('build/assets/Files')
|
||||
}
|
||||
|
||||
@ -125,7 +125,8 @@ dependencies {
|
||||
/* Third-party libraries */
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation 'androidx.appcompat:appcompat-resources:1.6.1'
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
|
||||
implementation("androidx.browser:browser:1.6.0")
|
||||
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
|
||||
implementation 'androidx.work:work-runtime-ktx:2.8.1'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'com.google.android.material:material:1.10.0'
|
||||
}
|
||||
|
@ -28,7 +28,6 @@
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||
android:enableOnBackInvokedCallback="false"
|
||||
android:fullBackupContent="@xml/backup_rules"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
@ -42,8 +41,8 @@
|
||||
android:value="3.0" />
|
||||
|
||||
<activity
|
||||
android:name="com.multicraft.game.MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
android:name=".MainActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize|screenLayout"
|
||||
android:exported="true"
|
||||
android:maxAspectRatio="3.0"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
@ -55,8 +54,8 @@
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name="com.multicraft.game.GameActivity"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|navigation|screenSize|smallestScreenSize"
|
||||
android:name=".GameActivity"
|
||||
android:configChanges="orientation|keyboard|keyboardHidden|navigation|screenSize|smallestScreenSize|screenLayout|uiMode"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
android:launchMode="singleTask"
|
||||
@ -72,6 +71,19 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".dialogs.ConnectionDialog"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
android:exported="false"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:theme="@style/CustomDialog" />
|
||||
|
||||
<activity
|
||||
android:name=".dialogs.RestartDialog"
|
||||
android:configChanges="orientation|keyboardHidden|navigation|screenSize"
|
||||
android:exported="false"
|
||||
android:screenOrientation="sensorLandscape"
|
||||
android:theme="@style/CustomDialog" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -20,11 +20,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
|
||||
package com.multicraft.game
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.res.Configuration
|
||||
import android.content.res.Configuration.HARDKEYBOARDHIDDEN_NO
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.*
|
||||
import android.text.InputType
|
||||
import android.view.*
|
||||
import android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN
|
||||
@ -33,12 +31,15 @@ import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.browser.customtabs.CustomTabsIntent.SHARE_STATE_OFF
|
||||
import com.multicraft.game.MainActivity.Companion.radius
|
||||
import com.multicraft.game.databinding.InputTextBinding
|
||||
import com.multicraft.game.databinding.MultilineInputBinding
|
||||
import com.multicraft.game.databinding.*
|
||||
import com.multicraft.game.helpers.*
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isOreo
|
||||
import org.libsdl.app.SDLActivity
|
||||
import java.util.*
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class GameActivity : SDLActivity() {
|
||||
companion object {
|
||||
@ -52,24 +53,23 @@ class GameActivity : SDLActivity() {
|
||||
external fun keyboardEvent(keyboard: Boolean)
|
||||
}
|
||||
|
||||
private var messageReturnCode = -1
|
||||
private var messageReturnValue = ""
|
||||
private var hasKeyboard = false
|
||||
override fun getLibraries() = arrayOf("MultiCraft")
|
||||
|
||||
override fun getLibraries(): Array<String> {
|
||||
return arrayOf(
|
||||
"MultiCraft"
|
||||
)
|
||||
}
|
||||
|
||||
override fun getMainSharedObject(): String {
|
||||
return getContext().applicationInfo.nativeLibraryDir + "/libMultiCraft.so"
|
||||
}
|
||||
override fun getMainSharedObject() =
|
||||
"${getContext().applicationInfo.nativeLibraryDir}/libMultiCraft.so"
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
try {
|
||||
super.onCreate(savedInstanceState)
|
||||
} catch (e: Error) {
|
||||
exitProcess(0)
|
||||
} catch (e: Exception) {
|
||||
exitProcess(0)
|
||||
}
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
hasKeyboard = resources.configuration.hardKeyboardHidden == HARDKEYBOARDHIDDEN_NO
|
||||
hasKeyboard = hasHardKeyboard()
|
||||
}
|
||||
|
||||
override fun onWindowFocusChanged(hasFocus: Boolean) {
|
||||
@ -89,15 +89,13 @@ class GameActivity : SDLActivity() {
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (hasKeyboard)
|
||||
keyboardEvent(hasKeyboard)
|
||||
if (hasKeyboard) keyboardEvent(true)
|
||||
window.makeFullScreen()
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
val statusKeyboard =
|
||||
resources.configuration.hardKeyboardHidden == HARDKEYBOARDHIDDEN_NO
|
||||
val statusKeyboard = hasHardKeyboard()
|
||||
if (hasKeyboard != statusKeyboard) {
|
||||
hasKeyboard = statusKeyboard
|
||||
keyboardEvent(hasKeyboard)
|
||||
@ -106,8 +104,8 @@ class GameActivity : SDLActivity() {
|
||||
|
||||
@Suppress("unused")
|
||||
fun showDialog(hint: String?, current: String?, editType: Int) {
|
||||
isInputActive = true
|
||||
messageReturnValue = ""
|
||||
messageReturnCode = -1
|
||||
if (editType == 1)
|
||||
runOnUiThread { showMultiLineDialog(hint, current) }
|
||||
else
|
||||
@ -115,7 +113,6 @@ class GameActivity : SDLActivity() {
|
||||
}
|
||||
|
||||
private fun showSingleDialog(hint: String?, current: String?, editType: Int) {
|
||||
isInputActive = true
|
||||
val builder = AlertDialog.Builder(this, R.style.FullScreenDialogStyle)
|
||||
val binding = InputTextBinding.inflate(layoutInflater)
|
||||
var hintText: String = hint?.ifEmpty {
|
||||
@ -139,40 +136,37 @@ class GameActivity : SDLActivity() {
|
||||
editText.inputType = inputType
|
||||
editText.setSelection(editText.text?.length ?: 0)
|
||||
// for Android OS
|
||||
editText.setOnEditorActionListener { _: TextView?, KeyCode: Int, _: KeyEvent? ->
|
||||
if (KeyCode == KeyEvent.KEYCODE_ENTER || KeyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
editText.setOnEditorActionListener { _: TextView?, keyCode: Int, _: KeyEvent? ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
return@setOnEditorActionListener false
|
||||
}
|
||||
// for Chrome OS
|
||||
editText.setOnKeyListener { _: View?, KeyCode: Int, _: KeyEvent? ->
|
||||
if (KeyCode == KeyEvent.KEYCODE_ENTER || KeyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
return@setOnKeyListener true
|
||||
if (isChromebook()) {
|
||||
editText.setOnKeyListener { _: View?, keyCode: Int, _: KeyEvent? ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
return@setOnKeyListener true
|
||||
}
|
||||
return@setOnKeyListener false
|
||||
}
|
||||
return@setOnKeyListener false
|
||||
}
|
||||
binding.input.setEndIconOnClickListener {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
}
|
||||
binding.rl.setOnClickListener {
|
||||
window.setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN)
|
||||
messageReturnValue = current.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
}
|
||||
@ -180,18 +174,16 @@ class GameActivity : SDLActivity() {
|
||||
// should be above `show()`
|
||||
alertWindow.setSoftInputMode(SOFT_INPUT_STATE_VISIBLE)
|
||||
alertDialog.show()
|
||||
if (!resources.getBoolean(R.bool.isTablet))
|
||||
if (!isTablet())
|
||||
alertWindow.makeFullScreenAlert()
|
||||
alertDialog.setOnCancelListener {
|
||||
window.setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN)
|
||||
messageReturnValue = current.toString()
|
||||
messageReturnCode = 0
|
||||
isInputActive = false
|
||||
}
|
||||
}
|
||||
|
||||
private fun showMultiLineDialog(hint: String?, current: String?) {
|
||||
isInputActive = true
|
||||
val builder = AlertDialog.Builder(this, R.style.FullScreenDialogStyle)
|
||||
val binding = MultilineInputBinding.inflate(layoutInflater)
|
||||
var hintText: String = hint?.ifEmpty {
|
||||
@ -208,40 +200,37 @@ class GameActivity : SDLActivity() {
|
||||
editText.setSelection(editText.text?.length ?: 0)
|
||||
val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
// for Android OS
|
||||
editText.setOnEditorActionListener { _: TextView?, KeyCode: Int, _: KeyEvent? ->
|
||||
if (KeyCode == KeyEvent.KEYCODE_ENTER || KeyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
editText.setOnEditorActionListener { _: TextView?, keyCode: Int, _: KeyEvent? ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
return@setOnEditorActionListener true
|
||||
}
|
||||
return@setOnEditorActionListener false
|
||||
}
|
||||
// for Chrome OS
|
||||
editText.setOnKeyListener { _: View?, KeyCode: Int, _: KeyEvent? ->
|
||||
if (KeyCode == KeyEvent.KEYCODE_ENTER || KeyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
return@setOnKeyListener true
|
||||
if (isChromebook()) {
|
||||
editText.setOnKeyListener { _: View?, keyCode: Int, _: KeyEvent? ->
|
||||
if (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_ENDCALL) {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
return@setOnKeyListener true
|
||||
}
|
||||
return@setOnKeyListener false
|
||||
}
|
||||
return@setOnKeyListener false
|
||||
}
|
||||
binding.multiInput.setEndIconOnClickListener {
|
||||
imm.hideSoftInputFromWindow(editText.windowToken, 0)
|
||||
messageReturnValue = editText.text.toString()
|
||||
messageReturnCode = 0
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
}
|
||||
binding.multiRl.setOnClickListener {
|
||||
window.setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN)
|
||||
messageReturnValue = current.toString()
|
||||
messageReturnCode = -1
|
||||
alertDialog.dismiss()
|
||||
isInputActive = false
|
||||
}
|
||||
@ -249,23 +238,23 @@ class GameActivity : SDLActivity() {
|
||||
val alertWindow = alertDialog.window!!
|
||||
alertWindow.setSoftInputMode(SOFT_INPUT_STATE_VISIBLE)
|
||||
alertDialog.show()
|
||||
if (!resources.getBoolean(R.bool.isTablet))
|
||||
if (!isTablet())
|
||||
alertWindow.makeFullScreenAlert()
|
||||
alertDialog.setOnCancelListener {
|
||||
window.setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN)
|
||||
messageReturnValue = current.toString()
|
||||
messageReturnCode = -1
|
||||
isInputActive = false
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
fun getDialogState() = messageReturnCode
|
||||
fun isDialogActive() = isInputActive
|
||||
|
||||
@Suppress("unused")
|
||||
fun getDialogValue(): String {
|
||||
messageReturnCode = -1
|
||||
return messageReturnValue
|
||||
val value = messageReturnValue
|
||||
messageReturnValue = ""
|
||||
return value
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@ -282,9 +271,13 @@ class GameActivity : SDLActivity() {
|
||||
|
||||
@Suppress("unused")
|
||||
fun openURI(uri: String?) {
|
||||
val builder = CustomTabsIntent.Builder()
|
||||
builder.setShareState(SHARE_STATE_OFF)
|
||||
.setStartAnimations(this, R.anim.slide_in_bottom, R.anim.slide_out_top)
|
||||
.setExitAnimations(this, R.anim.slide_in_top, R.anim.slide_out_bottom)
|
||||
val customTabsIntent = builder.build()
|
||||
try {
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(uri))
|
||||
startActivity(browserIntent)
|
||||
customTabsIntent.launchUrl(this, Uri.parse(uri))
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}
|
||||
@ -304,7 +297,7 @@ class GameActivity : SDLActivity() {
|
||||
|
||||
@Suppress("unused")
|
||||
fun getSecretKey(key: String): String {
|
||||
return "Stub"
|
||||
return key
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -22,18 +22,25 @@ package com.multicraft.game
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.LayerDrawable
|
||||
import android.graphics.drawable.AnimationDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import android.provider.Settings.ACTION_WIFI_SETTINGS
|
||||
import android.provider.Settings.ACTION_WIRELESS_SETTINGS
|
||||
import android.view.RoundedCorner
|
||||
import android.view.WindowManager
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.graphics.BlendModeColorFilterCompat
|
||||
import androidx.core.graphics.BlendModeCompat
|
||||
import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.work.WorkInfo
|
||||
import com.multicraft.game.databinding.ActivityMainBinding
|
||||
import com.multicraft.game.dialogs.ConnectionDialog
|
||||
import com.multicraft.game.helpers.*
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isAndroid12
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isPie
|
||||
import com.multicraft.game.helpers.PreferenceHelper.TAG_BUILD_VER
|
||||
import com.multicraft.game.helpers.PreferenceHelper.getStringValue
|
||||
import com.multicraft.game.helpers.PreferenceHelper.set
|
||||
@ -49,11 +56,14 @@ class MainActivity : AppCompatActivity() {
|
||||
private var externalStorage: File? = null
|
||||
private val sep = File.separator
|
||||
private lateinit var prefs: SharedPreferences
|
||||
private lateinit var restartStartForResult: ActivityResultLauncher<Intent>
|
||||
private lateinit var connStartForResult: ActivityResultLauncher<Intent>
|
||||
private val versionCode = BuildConfig.VERSION_CODE
|
||||
private val versionName = "${BuildConfig.VERSION_NAME}+$versionCode"
|
||||
|
||||
companion object {
|
||||
var radius = 0
|
||||
const val NO_SPACE_LEFT = "ENOSPC"
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -61,30 +71,34 @@ class MainActivity : AppCompatActivity() {
|
||||
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
}
|
||||
})
|
||||
connStartForResult = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
checkAppVersion()
|
||||
}
|
||||
restartStartForResult = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
if (it.resultCode == RESULT_OK)
|
||||
finishApp(true)
|
||||
else
|
||||
finishApp(false)
|
||||
}
|
||||
try {
|
||||
prefs = PreferenceHelper.init(this)
|
||||
externalStorage = getExternalFilesDir(null)
|
||||
if (filesDir == null || cacheDir == null || externalStorage == null)
|
||||
throw IOException("Bad disk space state")
|
||||
listOf(filesDir, cacheDir, externalStorage).requireNoNulls()
|
||||
checkConnection()
|
||||
} catch (e: Exception) { // Storage -> IOException, Prefs -> GeneralSecurityException
|
||||
showRestartDialog(!e.message!!.contains("ENOPSC"))
|
||||
} catch (e: Exception) {
|
||||
val isRestart = e.message?.contains(NO_SPACE_LEFT) != true
|
||||
showRestartDialog(restartStartForResult, isRestart)
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
@Suppress("DEPRECATION")
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == 104)
|
||||
checkAppVersion()
|
||||
}
|
||||
|
||||
@Deprecated("Deprecated in Java")
|
||||
override fun onBackPressed() {
|
||||
// Prevent abrupt interruption when copy game files from assets
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
window.makeFullScreen()
|
||||
@ -97,81 +111,66 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
if (isAndroid12()) {
|
||||
val insets = window.decorView.rootWindowInsets
|
||||
if (insets != null) {
|
||||
val tl = insets.getRoundedCorner(RoundedCorner.POSITION_TOP_LEFT)
|
||||
radius = tl?.radius ?: 0
|
||||
if (isPie()) {
|
||||
val cutout = window.decorView.rootWindowInsets.displayCutout
|
||||
if (cutout != null) {
|
||||
radius = 40
|
||||
}
|
||||
if (isAndroid12()) {
|
||||
val insets = window.decorView.rootWindowInsets
|
||||
if (insets != null) {
|
||||
val tl = insets.getRoundedCorner(RoundedCorner.POSITION_TOP_LEFT)
|
||||
radius = tl?.radius ?: if (cutout != null) 40 else 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// interface
|
||||
private fun showProgress(textMessage: Int, progress: Int) {
|
||||
if (binding.progressBar.visibility == View.GONE) {
|
||||
binding.tvProgress.setText(textMessage)
|
||||
binding.progressCircle.visibility = View.GONE
|
||||
binding.progressBar.visibility = View.VISIBLE
|
||||
binding.progressBar.progress = 0
|
||||
} else if (progress > 0) {
|
||||
val progressMessage = "${getString(textMessage)} $progress%"
|
||||
binding.tvProgress.text = progressMessage
|
||||
binding.progressBar.progress = progress
|
||||
// colorize the progress bar
|
||||
val progressBarDrawable =
|
||||
(binding.progressBar.progressDrawable as LayerDrawable).getDrawable(0)
|
||||
val progressDrawable = (progressBarDrawable as LayerDrawable).getDrawable(1)
|
||||
val color = Color.rgb(255 - progress * 2, progress * 2, 25)
|
||||
progressDrawable.colorFilter =
|
||||
BlendModeColorFilterCompat.createBlendModeColorFilterCompat(
|
||||
color, BlendModeCompat.SRC_IN
|
||||
)
|
||||
}
|
||||
val animation = binding.loadingAnim.drawable as AnimationDrawable
|
||||
animation.start()
|
||||
}
|
||||
|
||||
private fun startNative() {
|
||||
val initLua = File(filesDir, "builtin${sep}mainmenu${sep}init.lua")
|
||||
if (initLua.exists() && initLua.canRead()) {
|
||||
val intent = Intent(this, GameActivity::class.java)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
startActivity(intent)
|
||||
} else {
|
||||
prefs[TAG_BUILD_VER] = "0"
|
||||
showRestartDialog()
|
||||
showRestartDialog(restartStartForResult)
|
||||
}
|
||||
}
|
||||
|
||||
private fun prepareToRun() {
|
||||
binding.tvProgress.setText(R.string.preparing)
|
||||
binding.progressCircle.visibility = View.VISIBLE
|
||||
binding.progressBar.visibility = View.GONE
|
||||
val filesList = listOf(
|
||||
File(externalStorage, "debug.txt"),
|
||||
File(filesDir, "builtin"),
|
||||
File(filesDir, "client"),
|
||||
File(filesDir, "fonts"),
|
||||
File(filesDir, "textures")
|
||||
)
|
||||
val zips = assets.list("data")!!.toList()
|
||||
val filesList = mutableListOf<File>().apply {
|
||||
addAll(listOf(
|
||||
"builtin",
|
||||
"client${sep}shaders",
|
||||
"fonts",
|
||||
"games${sep}default",
|
||||
"textures${sep}base"
|
||||
).map { File(filesDir, it) })
|
||||
}
|
||||
|
||||
val zips = mutableListOf("assets.zip")
|
||||
|
||||
lifecycleScope.launch {
|
||||
filesList.forEach { it.deleteRecursively() }
|
||||
zips.forEach {
|
||||
try {
|
||||
assets.open("data$sep$it").use { input ->
|
||||
assets.open(it).use { input ->
|
||||
File(cacheDir, it).copyInputStreamToFile(input)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
runOnUiThread { showRestartDialog(!e.message!!.contains("ENOSPC")) }
|
||||
val isNotEnoughSpace = e.message!!.contains(NO_SPACE_LEFT)
|
||||
runOnUiThread { showRestartDialog(restartStartForResult, !isNotEnoughSpace) }
|
||||
return@forEach
|
||||
}
|
||||
}
|
||||
try {
|
||||
startUnzipWorker(zips)
|
||||
startUnzipWorker(zips.toTypedArray())
|
||||
} catch (e: Exception) {
|
||||
runOnUiThread { showRestartDialog() }
|
||||
runOnUiThread { showRestartDialog(restartStartForResult) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -184,31 +183,47 @@ class MainActivity : AppCompatActivity() {
|
||||
prepareToRun()
|
||||
}
|
||||
|
||||
private fun showConnectionDialog() {
|
||||
val intent = Intent(this, ConnectionDialog::class.java)
|
||||
val startForResult = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
when (it.resultCode) {
|
||||
RESULT_OK -> connStartForResult.launch(Intent(ACTION_WIFI_SETTINGS))
|
||||
RESULT_FIRST_USER -> connStartForResult.launch(Intent(ACTION_WIRELESS_SETTINGS))
|
||||
else -> checkAppVersion()
|
||||
}
|
||||
}
|
||||
startForResult.launch(intent)
|
||||
}
|
||||
|
||||
// check connection available
|
||||
private fun checkConnection() = lifecycleScope.launch {
|
||||
val result = isConnected()
|
||||
if (result) checkAppVersion()
|
||||
if (isConnected()) checkAppVersion()
|
||||
else try {
|
||||
showConnectionDialog { checkAppVersion() }
|
||||
showConnectionDialog()
|
||||
} catch (e: Exception) {
|
||||
checkAppVersion()
|
||||
}
|
||||
}
|
||||
|
||||
private fun startUnzipWorker(file: List<String>) {
|
||||
val viewModelFactory = WorkerViewModelFactory(application, file.toTypedArray())
|
||||
private fun startUnzipWorker(file: Array<String>) {
|
||||
val viewModelFactory = WorkerViewModelFactory(application, file)
|
||||
val viewModel = ViewModelProvider(this, viewModelFactory)[WorkerViewModel::class.java]
|
||||
viewModel.unzippingWorkObserver
|
||||
.observe(this, Observer { workInfo ->
|
||||
if (workInfo == null)
|
||||
return@Observer
|
||||
val progress = workInfo.progress.getInt(PROGRESS, 0)
|
||||
showProgress(R.string.loading, progress)
|
||||
if (progress > 0) {
|
||||
val progressMessage = "${getString(R.string.loading)} $progress%"
|
||||
binding.tvProgress.text = progressMessage
|
||||
}
|
||||
|
||||
if (workInfo.state.isFinished) {
|
||||
if (workInfo.state == WorkInfo.State.FAILED) {
|
||||
val isRestart = workInfo.outputData.getBoolean("restart", true)
|
||||
showRestartDialog(isRestart)
|
||||
showRestartDialog(restartStartForResult, isRestart)
|
||||
} else if (workInfo.state == WorkInfo.State.SUCCEEDED) {
|
||||
prefs[TAG_BUILD_VER] = versionName
|
||||
startNative()
|
||||
|
@ -0,0 +1,96 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
package com.multicraft.game.dialogs
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.telephony.TelephonyManager
|
||||
import android.telephony.TelephonyManager.SIM_STATE_READY
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.multicraft.game.databinding.ConnectionDialogBinding
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isOreo
|
||||
import com.multicraft.game.helpers.makeFullScreen
|
||||
import org.libsdl.app.SDLActivity
|
||||
|
||||
class ConnectionDialog : AppCompatActivity() {
|
||||
private fun isSimCardPresent(): Boolean {
|
||||
val telephonyManager = getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
|
||||
|
||||
if (!isOreo())
|
||||
return telephonyManager.simState == SIM_STATE_READY
|
||||
|
||||
val isFirstSimPresent = telephonyManager.getSimState(0) == SIM_STATE_READY
|
||||
val isSecondSimPresent = telephonyManager.getSimState(1) == SIM_STATE_READY
|
||||
|
||||
return isFirstSimPresent || isSecondSimPresent
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val binding = ConnectionDialogBinding.inflate(layoutInflater)
|
||||
if (SDLActivity.isTablet()) {
|
||||
val param = LinearLayout.LayoutParams(
|
||||
0,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
0.5f
|
||||
)
|
||||
binding.connRoot.layoutParams = param
|
||||
}
|
||||
if (isSimCardPresent())
|
||||
binding.mobile.visibility = View.VISIBLE
|
||||
setContentView(binding.root)
|
||||
|
||||
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
}
|
||||
})
|
||||
|
||||
binding.wifi.setOnClickListener {
|
||||
setResult(Activity.RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
binding.mobile.setOnClickListener {
|
||||
setResult(Activity.RESULT_FIRST_USER)
|
||||
finish()
|
||||
}
|
||||
binding.ignore.setOnClickListener {
|
||||
setResult(Activity.RESULT_CANCELED)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
window.makeFullScreen()
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context?) {
|
||||
val configuration = Configuration(base?.resources?.configuration)
|
||||
configuration.fontScale = 1.0f
|
||||
applyOverrideConfiguration(configuration)
|
||||
super.attachBaseContext(base)
|
||||
}
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 3.0 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
package com.multicraft.game.dialogs
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.widget.LinearLayout
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.multicraft.game.databinding.RestartDialogBinding
|
||||
import com.multicraft.game.helpers.makeFullScreen
|
||||
import org.libsdl.app.SDLActivity
|
||||
|
||||
class RestartDialog : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
val binding = RestartDialogBinding.inflate(layoutInflater)
|
||||
if (SDLActivity.isTablet()) {
|
||||
val param = LinearLayout.LayoutParams(
|
||||
0,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
0.5f
|
||||
)
|
||||
binding.restartRoot.layoutParams = param
|
||||
}
|
||||
setContentView(binding.root)
|
||||
|
||||
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
|
||||
override fun handleOnBackPressed() {
|
||||
}
|
||||
})
|
||||
|
||||
val message = intent.getStringExtra("message")!!
|
||||
binding.errorDesc.text = message
|
||||
binding.restart.setOnClickListener {
|
||||
setResult(Activity.RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
binding.close.setOnClickListener {
|
||||
setResult(Activity.RESULT_CANCELED)
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
window.makeFullScreen()
|
||||
}
|
||||
|
||||
override fun attachBaseContext(base: Context?) {
|
||||
val configuration = Configuration(base?.resources?.configuration)
|
||||
configuration.fontScale = 1.0f
|
||||
applyOverrideConfiguration(configuration)
|
||||
super.attachBaseContext(base)
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -30,5 +30,7 @@ object ApiLevelHelper {
|
||||
|
||||
fun isOreo() = isGreaterOrEqual(O)
|
||||
|
||||
fun isPie() = isGreaterOrEqual(P)
|
||||
|
||||
fun isAndroid12() = isGreaterOrEqual(S)
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -23,31 +23,22 @@ package com.multicraft.game.helpers
|
||||
import android.app.*
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.NetworkCapabilities
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import android.content.res.Configuration
|
||||
import android.net.*
|
||||
import android.os.*
|
||||
import android.view.Window
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.*
|
||||
import com.multicraft.game.R
|
||||
import com.multicraft.game.databinding.ConnDialogBinding
|
||||
import com.multicraft.game.databinding.RestartDialogBinding
|
||||
import com.multicraft.game.*
|
||||
import com.multicraft.game.databinding.*
|
||||
import com.multicraft.game.dialogs.RestartDialog
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isAndroid12
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
import kotlin.system.exitProcess
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isMarshmallow
|
||||
import java.io.*
|
||||
import java.util.*
|
||||
|
||||
// Activity extensions
|
||||
fun AppCompatActivity.getIcon() = try {
|
||||
packageManager.getApplicationIcon(packageName)
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
ContextCompat.getDrawable(this, R.mipmap.ic_launcher)
|
||||
}
|
||||
|
||||
fun Activity.finishApp(restart: Boolean) {
|
||||
if (restart) {
|
||||
val intent = Intent(this, this::class.java)
|
||||
@ -61,72 +52,12 @@ fun Activity.finishApp(restart: Boolean) {
|
||||
)
|
||||
)
|
||||
}
|
||||
exitProcess(0)
|
||||
finish()
|
||||
}
|
||||
|
||||
fun AppCompatActivity.defaultDialog(title: Int, view: View, style: Int = R.style.CustomDialog): AlertDialog {
|
||||
val builder = AlertDialog.Builder(this, style)
|
||||
.setIcon(getIcon())
|
||||
.setTitle(title)
|
||||
.setCancelable(false)
|
||||
.setView(view)
|
||||
return builder.create()
|
||||
}
|
||||
|
||||
fun AppCompatActivity.headlessDialog(
|
||||
view: View,
|
||||
style: Int = R.style.LightTheme,
|
||||
isCancelable: Boolean = false
|
||||
): AlertDialog {
|
||||
val builder = AlertDialog.Builder(this, style)
|
||||
.setCancelable(isCancelable)
|
||||
.setView(view)
|
||||
return builder.create()
|
||||
}
|
||||
|
||||
fun AppCompatActivity.show(dialog: AlertDialog) {
|
||||
window?.makeFullScreen()
|
||||
if (!isFinishing) dialog.show()
|
||||
}
|
||||
|
||||
fun AppCompatActivity.showConnectionDialog(listener: (() -> Unit)? = null) {
|
||||
val binding = ConnDialogBinding.inflate(layoutInflater)
|
||||
val dialog = defaultDialog(R.string.conn_title, binding.root)
|
||||
binding.wifi.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
startActivityForResult(
|
||||
Intent(Settings.ACTION_WIFI_SETTINGS),
|
||||
104
|
||||
)
|
||||
}
|
||||
binding.mobile.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
startActivityForResult(
|
||||
Intent(Settings.ACTION_WIRELESS_SETTINGS),
|
||||
104
|
||||
)
|
||||
}
|
||||
binding.ignore.setOnClickListener {
|
||||
dialog.dismiss()
|
||||
listener?.invoke()
|
||||
}
|
||||
show(dialog)
|
||||
}
|
||||
|
||||
fun AppCompatActivity.showRestartDialog(isRestart: Boolean = true) {
|
||||
val message =
|
||||
if (isRestart) getString(R.string.restart) else getString(R.string.no_space)
|
||||
val binding = RestartDialogBinding.inflate(layoutInflater)
|
||||
val dialog = headlessDialog(binding.root, R.style.CustomDialog)
|
||||
binding.errorDesc.text = message
|
||||
binding.close.setOnClickListener { finishApp(false) }
|
||||
binding.restart.setOnClickListener { finishApp(true) }
|
||||
show(dialog)
|
||||
}
|
||||
|
||||
fun AppCompatActivity.isConnected(): Boolean {
|
||||
fun Activity.isConnected(): Boolean {
|
||||
val cm = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
if (ApiLevelHelper.isMarshmallow()) {
|
||||
if (isMarshmallow()) {
|
||||
val activeNetwork = cm.activeNetwork ?: return false
|
||||
val capabilities = cm.getNetworkCapabilities(activeNetwork) ?: return false
|
||||
return capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
|
||||
@ -136,6 +67,20 @@ fun AppCompatActivity.isConnected(): Boolean {
|
||||
}
|
||||
}
|
||||
|
||||
fun AppCompatActivity.showRestartDialog(
|
||||
startForResult: ActivityResultLauncher<Intent>,
|
||||
isRestart: Boolean = true
|
||||
) {
|
||||
val message =
|
||||
if (isRestart) getString(R.string.restart) else getString(R.string.no_space)
|
||||
val intent = Intent(this, RestartDialog::class.java)
|
||||
intent.putExtra("message", message)
|
||||
startForResult.launch(intent)
|
||||
}
|
||||
|
||||
fun Activity.hasHardKeyboard() =
|
||||
resources.configuration.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO
|
||||
|
||||
// Other extensions
|
||||
fun File.copyInputStreamToFile(inputStream: InputStream) =
|
||||
outputStream().use { fileOut -> inputStream.copyTo(fileOut, 8192) }
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -26,6 +26,7 @@ import android.content.Context
|
||||
import android.content.Context.NOTIFICATION_SERVICE
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.work.*
|
||||
import com.multicraft.game.MainActivity.Companion.NO_SPACE_LEFT
|
||||
import com.multicraft.game.R
|
||||
import com.multicraft.game.helpers.ApiLevelHelper.isOreo
|
||||
import com.multicraft.game.helpers.copyInputStreamToFile
|
||||
@ -83,7 +84,7 @@ class UnzipWorker(private val appContext: Context, workerParams: WorkerParameter
|
||||
}
|
||||
Result.success()
|
||||
} catch (e: IOException) {
|
||||
val isNotEnoughSpace = e.localizedMessage!!.contains("ENOSPC")
|
||||
val isNotEnoughSpace = e.localizedMessage!!.contains(NO_SPACE_LEFT)
|
||||
val out = Data.Builder()
|
||||
.putBoolean("restart", !isNotEnoughSpace)
|
||||
.build()
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
MultiCraft
|
||||
Copyright (C) 2014-2022 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2022 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
Copyright (C) 2014-2023 MoNTE48, Maksim Gamarnik <Maksym48@pm.me>
|
||||
Copyright (C) 2014-2023 ubulem, Bektur Mambetov <berkut87@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
|
@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
private static final String TAG = "SDL";
|
||||
private static final int SDL_MAJOR_VERSION = 2;
|
||||
private static final int SDL_MINOR_VERSION = 28;
|
||||
private static final int SDL_MICRO_VERSION = 2;
|
||||
private static final int SDL_MICRO_VERSION = 4;
|
||||
/*
|
||||
// Display InputType.SOURCE/CLASS of events and devices
|
||||
//
|
||||
|
5
Android/app/src/main/res/anim/slide_in_bottom.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromYDelta="100%p"
|
||||
android:toYDelta="0%p" />
|
5
Android/app/src/main/res/anim/slide_in_top.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromYDelta="-100%p"
|
||||
android:toYDelta="0%p" />
|
5
Android/app/src/main/res/anim/slide_out_bottom.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromYDelta="0%p"
|
||||
android:toYDelta="100%p" />
|
5
Android/app/src/main/res/anim/slide_out_top.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<translate xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:fromYDelta="0%p"
|
||||
android:toYDelta="-100%p" />
|
@ -2,4 +2,7 @@
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="@color/dark" />
|
||||
<corners
|
||||
android:topLeftRadius="5dp"
|
||||
android:topRightRadius="5dp" />
|
||||
</shape>
|
||||
|
5
Android/app/src/main/res/drawable/btn_green.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/green_pressed" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/green" />
|
||||
</selector>
|
5
Android/app/src/main/res/drawable/btn_red.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/red_pressed" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/red" />
|
||||
</selector>
|
5
Android/app/src/main/res/drawable/btn_yellow.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/yellow_pressed" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/yellow" />
|
||||
</selector>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:id="@android:id/background"
|
||||
android:drawable="@drawable/progress_bar_bg" />
|
||||
<item
|
||||
android:id="@android:id/progress"
|
||||
android:drawable="@drawable/progress_bar_fg" />
|
||||
</layer-list>
|
BIN
Android/app/src/main/res/drawable/green.9.png
Normal file
After Width: | Height: | Size: 383 B |
BIN
Android/app/src/main/res/drawable/green_pressed.9.png
Normal file
After Width: | Height: | Size: 383 B |
@ -6,6 +6,6 @@
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#008C80"
|
||||
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z" />
|
||||
android:fillColor="@color/green_mc"
|
||||
android:pathData="M3.4,20.4l17.45,-7.48c0.81,-0.35 0.81,-1.49 0,-1.84L3.4,3.6c-0.66,-0.29 -1.39,0.2 -1.39,0.91L2,9.12c0,0.5 0.37,0.93 0.87,0.99L17,12 2.87,13.88c-0.5,0.07 -0.87,0.5 -0.87,1l0.01,4.61c0,0.71 0.73,1.2 1.39,0.91z" />
|
||||
</vector>
|
||||
|
28
Android/app/src/main/res/drawable/loading.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:oneshot="false">
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim1"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim2"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim3"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim4"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim5"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim6"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim7"
|
||||
android:duration="125" />
|
||||
<item
|
||||
android:drawable="@drawable/loading_anim8"
|
||||
android:duration="125" />
|
||||
</animation-list>
|
BIN
Android/app/src/main/res/drawable/loading_anim1.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
Android/app/src/main/res/drawable/loading_anim2.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
Android/app/src/main/res/drawable/loading_anim3.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
Android/app/src/main/res/drawable/loading_anim4.png
Normal file
After Width: | Height: | Size: 1021 B |
BIN
Android/app/src/main/res/drawable/loading_anim5.png
Normal file
After Width: | Height: | Size: 1023 B |
BIN
Android/app/src/main/res/drawable/loading_anim6.png
Normal file
After Width: | Height: | Size: 1015 B |
BIN
Android/app/src/main/res/drawable/loading_anim7.png
Normal file
After Width: | Height: | Size: 1016 B |
BIN
Android/app/src/main/res/drawable/loading_anim8.png
Normal file
After Width: | Height: | Size: 1021 B |
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/custom_progress_bar" />
|
||||
<item android:drawable="@drawable/progress_bar" />
|
||||
</layer-list>
|
Before Width: | Height: | Size: 218 B |
Before Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 222 B |
BIN
Android/app/src/main/res/drawable/red.9.png
Normal file
After Width: | Height: | Size: 374 B |
BIN
Android/app/src/main/res/drawable/red_pressed.9.png
Normal file
After Width: | Height: | Size: 375 B |
BIN
Android/app/src/main/res/drawable/yellow.9.png
Normal file
After Width: | Height: | Size: 375 B |
BIN
Android/app/src/main/res/drawable/yellow_pressed.9.png
Normal file
After Width: | Height: | Size: 375 B |
@ -1,34 +1,22 @@
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
style="@style/Widget.MaterialComponents.LinearProgressIndicator"
|
||||
android:layout_width="512dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminate="false"
|
||||
android:max="100"
|
||||
android:progressDrawable="@drawable/progress"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_circle"
|
||||
style="@style/Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="75dp"
|
||||
android:layout_height="75dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:indeterminate="true" />
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/loading_anim"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/loading" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/progress_circle"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/loading"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/preparing"
|
||||
android:textColor="@color/light"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
@ -1,61 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingRight="16dp"
|
||||
android:text="@string/conn_message"
|
||||
android:textColor="@color/grey_900" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/ignore"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.3"
|
||||
android:text="@string/ignore"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/red" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/mobile"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.4"
|
||||
android:text="@string/conn_mobile"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/green_mc" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/wifi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.4"
|
||||
android:text="@string/conn_wifi"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/green_mc" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
78
Android/app/src/main/res/layout/connection_dialog.xml
Normal file
@ -0,0 +1,78 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/conn_root"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.7"
|
||||
android:background="@drawable/bg_common"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:drawableStart="@mipmap/ic_dialog"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/conn_title"
|
||||
android:textColor="@color/grey_900" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:text="@string/conn_message"
|
||||
android:textColor="@color/grey_900"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/ignore"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.33"
|
||||
android:background="@drawable/btn_yellow"
|
||||
android:text="@string/ignore"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/mobile"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.33"
|
||||
android:background="@drawable/btn_green"
|
||||
android:text="@string/conn_mobile"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/wifi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.33"
|
||||
android:background="@drawable/btn_green"
|
||||
android:text="@string/conn_wifi"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
@ -6,16 +6,17 @@
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
style="@style/TextInputLayoutStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/bg_input"
|
||||
android:hint="@string/input_text"
|
||||
android:padding="5dp"
|
||||
android:padding="4dp"
|
||||
app:endIconDrawable="@drawable/ic_baseline_send"
|
||||
app:endIconMode="custom"
|
||||
app:endIconTint="@null">
|
||||
app:endIconTint="@null"
|
||||
app:hintTextColor="@color/green_mc">
|
||||
|
||||
<com.multicraft.game.CustomEditText
|
||||
android:id="@+id/editText"
|
||||
|
@ -6,16 +6,17 @@
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/multiInput"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
style="@style/TextInputLayoutStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@drawable/bg_input"
|
||||
android:hint="@string/input_text"
|
||||
android:padding="5dp"
|
||||
android:padding="4dp"
|
||||
app:endIconDrawable="@drawable/ic_baseline_send"
|
||||
app:endIconMode="custom"
|
||||
app:endIconTint="@null">
|
||||
app:endIconTint="@null"
|
||||
app:hintTextColor="@color/green_mc">
|
||||
|
||||
<com.multicraft.game.CustomEditText
|
||||
android:id="@+id/multiEditText"
|
||||
|
@ -1,34 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center"
|
||||
android:weightSum="1">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/restart_root"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="0.7"
|
||||
android:background="@drawable/bg_common"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:paddingTop="10dp">
|
||||
android:padding="16dp"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
style="?android:attr/textAppearanceLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:drawableStart="@mipmap/ic_dialog"
|
||||
android:drawablePadding="8dp"
|
||||
android:gravity="center"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:text="@string/sorry"
|
||||
android:textSize="22sp" />
|
||||
android:textColor="@color/grey_900" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/restart"
|
||||
@ -42,46 +47,40 @@
|
||||
android:id="@+id/error_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:minHeight="128dp"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:padding="4dp"
|
||||
android:text="@string/restart"
|
||||
android:textSize="15sp" />
|
||||
android:textColor="@color/grey_900"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/close"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/btn_red"
|
||||
android:text="@string/close_game"
|
||||
android:textStyle="bold" />
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/restart"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_weight="0.5"
|
||||
android:background="@drawable/btn_green"
|
||||
android:text="@string/restart_game"
|
||||
android:textStyle="bold" />
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@android:color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
|
BIN
Android/app/src/main/res/mipmap/ic_dialog.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- подготовка к запуску -->
|
||||
<string name="preparing">Подготовка к запуску…</string>
|
||||
<string name="loading">Загрузка…</string>
|
||||
<string name="notification_title">Загрузка MultiCraft</string>
|
||||
@ -9,9 +10,8 @@
|
||||
|
||||
<!-- диалог отсутствия подключения -->
|
||||
<string name="conn_title">Нет Интернет Подключения!</string>
|
||||
<string name="conn_message">Для полноценной игры, MultiCraft требует подключение к Интернету.\nВ противном случае вам будет недоступно Обновление игры и режим Мультиплеера!</string>
|
||||
<string name="conn_mobile">3G/4G</string>
|
||||
<string name="ignore">Игнорировать</string>
|
||||
<string name="conn_message">Для полноценной игры, MultiCraft требует подключение к Интернету.\nВ противном случае Обновление игры и режим Мультиплеера будут недоступны!</string>
|
||||
<string name="ignore">Пропустить</string>
|
||||
|
||||
<!-- Crash -->
|
||||
<string name="sorry">Нам очень жаль!</string>
|
||||
|
@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<bool name="isTablet">true</bool>
|
||||
</resources>
|
12
Android/app/src/main/res/values-v26/styles.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="CustomDialog" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@drawable/bg</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="p">shortEdges</item>
|
||||
<item name="fontFamily">@font/multicraftfont</item>
|
||||
</style>
|
||||
</resources>
|
13
Android/app/src/main/res/values-v27/styles.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="CustomDialog" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="p">shortEdges</item>
|
||||
<item name="fontFamily">@font/multicraftfont</item>
|
||||
</style>
|
||||
</resources>
|
@ -1,3 +0,0 @@
|
||||
<resources>
|
||||
<bool name="isTablet">false</bool>
|
||||
</resources>
|
@ -1,8 +1,6 @@
|
||||
<resources>
|
||||
<color name="green">#008C80</color>
|
||||
<color name="light">#FAFAFA</color>
|
||||
<color name="dark">#121212</color>
|
||||
<color name="red">#FF1744</color>
|
||||
<color name="green_mc">#32783C</color>
|
||||
<color name="grey_900">#212121</color>
|
||||
</resources>
|
||||
|
@ -1,11 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name" translatable="false">MultiCraft</string>
|
||||
|
||||
<!-- preparation for start -->
|
||||
<string name="preparing">Preparing to launch…</string>
|
||||
<string name="loading">Loading…</string>
|
||||
<string name="notification_title">Loading MultiCraft</string>
|
||||
<string name="notification_description">Less than 1 minute…</string>
|
||||
|
||||
<string name="input_text">Enter text</string>
|
||||
<string name="input_password">Enter password</string>
|
||||
|
||||
@ -13,7 +14,7 @@
|
||||
<string name="conn_title">No Internet Connection!</string>
|
||||
<string name="conn_message">MultiCraft requires an Internet connection to use all game features.\nOtherwise, you will not get Updates and Multiplayer mode will be not available!</string>
|
||||
<string name="conn_wifi" translatable="false">Wi-Fi</string>
|
||||
<string name="conn_mobile">Mobile Data</string>
|
||||
<string name="conn_mobile" translatable="false">LTE</string>
|
||||
<string name="ignore">Ignore</string>
|
||||
|
||||
<!-- Crash -->
|
||||
|
@ -1,27 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowBackground">@drawable/bg</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="p">shortEdges</item>
|
||||
<item name="fontFamily">@font/multicraftfont</item>
|
||||
<item name="colorPrimary">@color/green</item>
|
||||
</style>
|
||||
|
||||
<style name="LightTheme" parent="Theme.MaterialComponents.Light.Dialog">
|
||||
<item name="android:windowBackground">@drawable/bg_common</item>
|
||||
<item name="background">@android:color/transparent</item>
|
||||
<item name="windowMinWidthMajor">0%</item>
|
||||
<item name="windowMinWidthMinor">0%</item>
|
||||
<style name="CustomDialog" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="p">shortEdges</item>
|
||||
<item name="fontFamily">@font/multicraftfont</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomDialog" parent="Theme.MaterialComponents.Light.Dialog.Alert">
|
||||
<item name="android:windowBackground">@drawable/bg_common</item>
|
||||
<item name="background">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="FullScreenDialogStyle" parent="Theme.MaterialComponents.DayNight.Dialog">
|
||||
<style name="FullScreenDialogStyle" parent="Theme.MaterialComponents.Light.Dialog">
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<item name="android:windowIsFloating">false</item>
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
@ -29,4 +27,7 @@
|
||||
<item name="android:windowEnterAnimation">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="TextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
|
||||
<item name="boxStrokeColor">@color/green_mc</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
project.ext.set("versionMajor", 2) // Version Major
|
||||
project.ext.set("versionMinor", 0) // Version Minor
|
||||
project.ext.set("versionPatch", 5) // Version Patch
|
||||
project.ext.set("versionPatch", 6) // Version Patch
|
||||
project.ext.set("versionExtra", "") // Version Extra
|
||||
project.ext.set("versionCode", 100) // Android Version Code
|
||||
project.ext.set("versionCode", 200) // Android Version Code
|
||||
project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release
|
||||
// NOTE: +3 after each release!
|
||||
// +1 for ARM, +1 for ARM64 and +1 for x86_64 APK's, because
|
||||
@ -16,10 +16,10 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:8.1.0'
|
||||
classpath 'com.android.tools.build:gradle:8.2.1'
|
||||
//noinspection GradleDependency
|
||||
classpath 'de.undercouch:gradle-download-task:4.1.2'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10'
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#Mon Aug 21 21:17:06 EEST 2023
|
||||
#Thu Oct 05 18:46:10 EEST 2023
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'de.undercouch.download'
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
buildToolsVersion '33.0.2'
|
||||
compileSdkVersion 34
|
||||
buildToolsVersion '34.0.0'
|
||||
ndkVersion '25.2.9519653'
|
||||
defaultConfig {
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
targetSdkVersion 34
|
||||
externalNativeBuild {
|
||||
ndkBuild {
|
||||
arguments '-j' + Runtime.getRuntime().availableProcessors(),
|
||||
@ -50,17 +50,19 @@ android {
|
||||
}
|
||||
|
||||
// get precompiled deps
|
||||
def buildDirectory = layout.buildDirectory.get().asFile
|
||||
|
||||
tasks.register('downloadDeps', Download) {
|
||||
def VERSION = "11082023"
|
||||
src "https://gitlab.com/minetest-stuffs/multicraft-deps_androit/-/archive/11082023/multicraft-deps_androit-11082023.zip"
|
||||
dest new File(buildDir, 'deps.zip')
|
||||
def VERSION = "05102023"
|
||||
src "https://github.com/MultiCraft/deps_android/releases/download/$VERSION/deps_android.zip"
|
||||
dest new File(buildDirectory, 'deps.zip')
|
||||
overwrite false
|
||||
}
|
||||
|
||||
tasks.register('getDeps', Copy) {
|
||||
dependsOn downloadDeps
|
||||
def deps = file('deps')
|
||||
def f = file("$buildDir/deps_android")
|
||||
def f = file("$buildDirectory/deps_android")
|
||||
|
||||
if (!f.exists()) {
|
||||
from zipTree(downloadDeps.dest)
|
||||
|
@ -122,7 +122,10 @@ LOCAL_C_INCLUDES := \
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(wildcard ../../src/client/*.cpp) \
|
||||
$(wildcard ../../src/client/*/*.cpp) \
|
||||
../../src/client/meshgen/collector.cpp \
|
||||
../../src/client/render/core.cpp \
|
||||
../../src/client/render/factory.cpp \
|
||||
../../src/client/render/plain.cpp \
|
||||
$(wildcard ../../src/content/*.cpp) \
|
||||
../../src/database/database.cpp \
|
||||
../../src/database/database-dummy.cpp \
|
||||
|
@ -230,14 +230,9 @@
|
||||
84F20E8D25D52868009562A9 /* base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E7A25D52868009562A9 /* base64.cpp */; };
|
||||
84F20E8E25D52868009562A9 /* pointedthing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E7B25D52868009562A9 /* pointedthing.cpp */; };
|
||||
84F20E8F25D52868009562A9 /* directiontables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E7D25D52868009562A9 /* directiontables.cpp */; };
|
||||
84F20EA025D528C5009562A9 /* stereo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9025D528C4009562A9 /* stereo.cpp */; };
|
||||
84F20EA125D528C5009562A9 /* core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9425D528C5009562A9 /* core.cpp */; };
|
||||
84F20EA225D528C5009562A9 /* anaglyph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9625D528C5009562A9 /* anaglyph.cpp */; };
|
||||
84F20EA325D528C5009562A9 /* plain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9725D528C5009562A9 /* plain.cpp */; };
|
||||
84F20EA425D528C5009562A9 /* pageflip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9A25D528C5009562A9 /* pageflip.cpp */; };
|
||||
84F20EA525D528C5009562A9 /* factory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9B25D528C5009562A9 /* factory.cpp */; };
|
||||
84F20EA625D528C5009562A9 /* sidebyside.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9C25D528C5009562A9 /* sidebyside.cpp */; };
|
||||
84F20EA725D528C5009562A9 /* interlaced.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20E9E25D528C5009562A9 /* interlaced.cpp */; };
|
||||
84F20EB025D528D7009562A9 /* subgames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20EA825D528D6009562A9 /* subgames.cpp */; };
|
||||
84F20EB125D528D7009562A9 /* packages.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20EAD25D528D7009562A9 /* packages.cpp */; };
|
||||
84F20EB225D528D7009562A9 /* mods.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84F20EAE25D528D7009562A9 /* mods.cpp */; };
|
||||
@ -380,7 +375,7 @@
|
||||
84135B2225D5263A00CA4DCF /* texture_override.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = texture_override.h; path = ../../../src/texture_override.h; sourceTree = "<group>"; };
|
||||
84135B2325D5263A00CA4DCF /* gettext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gettext.cpp; path = ../../../src/gettext.cpp; sourceTree = "<group>"; };
|
||||
84135B2425D5263A00CA4DCF /* metadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = metadata.h; path = ../../../src/metadata.h; sourceTree = "<group>"; };
|
||||
84135B2525D5263B00CA4DCF /* defaultsettings.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = defaultsettings.cpp; path = ../../../src/defaultsettings.cpp; sourceTree = "<group>"; };
|
||||
84135B2525D5263B00CA4DCF /* defaultsettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = defaultsettings.cpp; path = ../../../src/defaultsettings.cpp; sourceTree = "<group>"; };
|
||||
84135B2625D5263B00CA4DCF /* mapnode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mapnode.h; path = ../../../src/mapnode.h; sourceTree = "<group>"; };
|
||||
84135B2725D5263B00CA4DCF /* irr_aabb3d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = irr_aabb3d.h; path = ../../../src/irr_aabb3d.h; sourceTree = "<group>"; };
|
||||
84135B2825D5263C00CA4DCF /* craftdef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = craftdef.h; path = ../../../src/craftdef.h; sourceTree = "<group>"; };
|
||||
@ -777,22 +772,12 @@
|
||||
84F20E7D25D52868009562A9 /* directiontables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = directiontables.cpp; path = ../../../src/util/directiontables.cpp; sourceTree = "<group>"; };
|
||||
84F20E7E25D52868009562A9 /* pointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pointer.h; path = ../../../src/util/pointer.h; sourceTree = "<group>"; };
|
||||
84F20E7F25D52868009562A9 /* quicktune.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = quicktune.h; path = ../../../src/util/quicktune.h; sourceTree = "<group>"; };
|
||||
84F20E9025D528C4009562A9 /* stereo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stereo.cpp; path = ../../../src/client/render/stereo.cpp; sourceTree = "<group>"; };
|
||||
84F20E9125D528C4009562A9 /* sidebyside.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sidebyside.h; path = ../../../src/client/render/sidebyside.h; sourceTree = "<group>"; };
|
||||
84F20E9225D528C5009562A9 /* factory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = factory.h; path = ../../../src/client/render/factory.h; sourceTree = "<group>"; };
|
||||
84F20E9325D528C5009562A9 /* plain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = plain.h; path = ../../../src/client/render/plain.h; sourceTree = "<group>"; };
|
||||
84F20E9425D528C5009562A9 /* core.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = core.cpp; path = ../../../src/client/render/core.cpp; sourceTree = "<group>"; };
|
||||
84F20E9525D528C5009562A9 /* stereo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stereo.h; path = ../../../src/client/render/stereo.h; sourceTree = "<group>"; };
|
||||
84F20E9625D528C5009562A9 /* anaglyph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = anaglyph.cpp; path = ../../../src/client/render/anaglyph.cpp; sourceTree = "<group>"; };
|
||||
84F20E9725D528C5009562A9 /* plain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = plain.cpp; path = ../../../src/client/render/plain.cpp; sourceTree = "<group>"; };
|
||||
84F20E9825D528C5009562A9 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = core.h; path = ../../../src/client/render/core.h; sourceTree = "<group>"; };
|
||||
84F20E9925D528C5009562A9 /* anaglyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = anaglyph.h; path = ../../../src/client/render/anaglyph.h; sourceTree = "<group>"; };
|
||||
84F20E9A25D528C5009562A9 /* pageflip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pageflip.cpp; path = ../../../src/client/render/pageflip.cpp; sourceTree = "<group>"; };
|
||||
84F20E9B25D528C5009562A9 /* factory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = factory.cpp; path = ../../../src/client/render/factory.cpp; sourceTree = "<group>"; };
|
||||
84F20E9C25D528C5009562A9 /* sidebyside.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sidebyside.cpp; path = ../../../src/client/render/sidebyside.cpp; sourceTree = "<group>"; };
|
||||
84F20E9D25D528C5009562A9 /* pageflip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pageflip.h; path = ../../../src/client/render/pageflip.h; sourceTree = "<group>"; };
|
||||
84F20E9E25D528C5009562A9 /* interlaced.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = interlaced.cpp; path = ../../../src/client/render/interlaced.cpp; sourceTree = "<group>"; };
|
||||
84F20E9F25D528C5009562A9 /* interlaced.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = interlaced.h; path = ../../../src/client/render/interlaced.h; sourceTree = "<group>"; };
|
||||
84F20EA825D528D6009562A9 /* subgames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = subgames.cpp; path = ../../../src/content/subgames.cpp; sourceTree = "<group>"; };
|
||||
84F20EA925D528D6009562A9 /* subgames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = subgames.h; path = ../../../src/content/subgames.h; sourceTree = "<group>"; };
|
||||
84F20EAA25D528D6009562A9 /* mods.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mods.h; path = ../../../src/content/mods.h; sourceTree = "<group>"; };
|
||||
@ -968,22 +953,12 @@
|
||||
84135BA425D5269800CA4DCF /* render */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
84F20E9625D528C5009562A9 /* anaglyph.cpp */,
|
||||
84F20E9925D528C5009562A9 /* anaglyph.h */,
|
||||
84F20E9425D528C5009562A9 /* core.cpp */,
|
||||
84F20E9825D528C5009562A9 /* core.h */,
|
||||
84F20E9B25D528C5009562A9 /* factory.cpp */,
|
||||
84F20E9225D528C5009562A9 /* factory.h */,
|
||||
84F20E9E25D528C5009562A9 /* interlaced.cpp */,
|
||||
84F20E9F25D528C5009562A9 /* interlaced.h */,
|
||||
84F20E9A25D528C5009562A9 /* pageflip.cpp */,
|
||||
84F20E9D25D528C5009562A9 /* pageflip.h */,
|
||||
84F20E9725D528C5009562A9 /* plain.cpp */,
|
||||
84F20E9325D528C5009562A9 /* plain.h */,
|
||||
84F20E9C25D528C5009562A9 /* sidebyside.cpp */,
|
||||
84F20E9125D528C4009562A9 /* sidebyside.h */,
|
||||
84F20E9025D528C4009562A9 /* stereo.cpp */,
|
||||
84F20E9525D528C5009562A9 /* stereo.h */,
|
||||
);
|
||||
name = render;
|
||||
sourceTree = "<group>";
|
||||
@ -1845,7 +1820,6 @@
|
||||
84135B9E25D5264C00CA4DCF /* remoteplayer.cpp in Sources */,
|
||||
84135C2025D526D700CA4DCF /* fontengine.cpp in Sources */,
|
||||
84135B8425D5264C00CA4DCF /* chat.cpp in Sources */,
|
||||
84F20EA425D528C5009562A9 /* pageflip.cpp in Sources */,
|
||||
84F20E8125D52868009562A9 /* string.cpp in Sources */,
|
||||
84135C1E25D526D700CA4DCF /* clientobject.cpp in Sources */,
|
||||
84135B6B25D5264B00CA4DCF /* mapblock.cpp in Sources */,
|
||||
@ -1870,7 +1844,6 @@
|
||||
84F20DA325D527C5009562A9 /* socket.cpp in Sources */,
|
||||
84135C1B25D526D700CA4DCF /* hud.cpp in Sources */,
|
||||
84F20DDD25D52812009562A9 /* s_inventory.cpp in Sources */,
|
||||
84F20EA225D528C5009562A9 /* anaglyph.cpp in Sources */,
|
||||
84F20DB925D527D8009562A9 /* c_internal.cpp in Sources */,
|
||||
84135B6E25D5264B00CA4DCF /* object_properties.cpp in Sources */,
|
||||
84F20DAA25D527C5009562A9 /* networkpacket.cpp in Sources */,
|
||||
@ -1928,7 +1901,6 @@
|
||||
84135C2525D526D700CA4DCF /* imagefilters.cpp in Sources */,
|
||||
84135C1325D526D700CA4DCF /* clientlauncher.cpp in Sources */,
|
||||
849D0848278AC1B200471354 /* chacha.c in Sources */,
|
||||
84F20EA025D528C5009562A9 /* stereo.cpp in Sources */,
|
||||
84F20EB025D528D7009562A9 /* subgames.cpp in Sources */,
|
||||
84135B7825D5264B00CA4DCF /* clientiface.cpp in Sources */,
|
||||
84135C1725D526D700CA4DCF /* mesh.cpp in Sources */,
|
||||
@ -2014,7 +1986,6 @@
|
||||
84F20F0E25D52958009562A9 /* modalMenu.cpp in Sources */,
|
||||
84F20E2E25D5282A009562A9 /* l_inventory.cpp in Sources */,
|
||||
84135BA725D526A900CA4DCF /* collector.cpp in Sources */,
|
||||
84F20EA725D528C5009562A9 /* interlaced.cpp in Sources */,
|
||||
8458610724B13BDF0040BA4F /* mini-gmp.c in Sources */,
|
||||
84F20F0A25D52958009562A9 /* guiBackgroundImage.cpp in Sources */,
|
||||
84F20DE325D52812009562A9 /* s_client.cpp in Sources */,
|
||||
@ -2038,7 +2009,6 @@
|
||||
84135B8225D5264C00CA4DCF /* server.cpp in Sources */,
|
||||
84F20DDB25D52812009562A9 /* s_security.cpp in Sources */,
|
||||
84135B8825D5264C00CA4DCF /* gettext.cpp in Sources */,
|
||||
84F20EA625D528C5009562A9 /* sidebyside.cpp in Sources */,
|
||||
84F20E8325D52868009562A9 /* metricsbackend.cpp in Sources */,
|
||||
84135C2425D526D700CA4DCF /* content_mapblock.cpp in Sources */,
|
||||
84E33D882A7BBEE900609F77 /* wrapper.m in Sources */,
|
||||
@ -2226,10 +2196,11 @@
|
||||
"ENABLE_UPDATE_CHECKER=1",
|
||||
"VERSION_MAJOR=2",
|
||||
"VERSION_MINOR=0",
|
||||
"VERSION_PATCH=5",
|
||||
"VERSION_PATCH=6",
|
||||
"VERSION_EXTRA=\"\"",
|
||||
"DEVELOPMENT_BUILD=1",
|
||||
);
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${SRCROOT}/../../src",
|
||||
@ -2249,8 +2220,11 @@
|
||||
"${SRCROOT}/../deps/libvorbis/include",
|
||||
);
|
||||
INFOPLIST_FILE = MultiCraft/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.adventure-games";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 Minetest.org. All rights reserved.";
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
MARKETING_VERSION = 2.0.6;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-L${SRCROOT}/../deps/freetype",
|
||||
@ -2283,7 +2257,6 @@
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
"COCOAPODS=1",
|
||||
"NDEBUG=1",
|
||||
"RUN_IN_PLACE=0",
|
||||
"USE_GETTEXT=1",
|
||||
@ -2296,10 +2269,11 @@
|
||||
"ENABLE_UPDATE_CHECKER=1",
|
||||
"VERSION_MAJOR=2",
|
||||
"VERSION_MINOR=0",
|
||||
"VERSION_PATCH=5",
|
||||
"VERSION_PATCH=6",
|
||||
"VERSION_EXTRA=\"\"",
|
||||
"DEVELOPMENT_BUILD=0",
|
||||
);
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"${SRCROOT}/../../src",
|
||||
@ -2319,8 +2293,11 @@
|
||||
"${SRCROOT}/../deps/libvorbis/include",
|
||||
);
|
||||
INFOPLIST_FILE = MultiCraft/Info.plist;
|
||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.adventure-games";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 minetest.org All rights reserved.";
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
MARKETING_VERSION = 2.0.6;
|
||||
OTHER_LDFLAGS = (
|
||||
"$(inherited)",
|
||||
"-L${SRCROOT}/../deps/freetype",
|
||||
|
Before Width: | Height: | Size: 399 KiB After Width: | Height: | Size: 653 KiB |
@ -22,18 +22,10 @@
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.adventure-games</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHighResolutionCapable</key>
|
||||
<true/>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2023 MultiCraft Studio OÜ. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSSupportsAutomaticTermination</key>
|
||||
<true/>
|
||||
<key>NSSupportsSuddenTermination</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
@ -6,6 +6,8 @@ extern "C" {
|
||||
|
||||
const char *get_secret_key(const char *key);
|
||||
|
||||
float get_screen_scale();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,3 +1,4 @@
|
||||
@import AppKit;
|
||||
@import Foundation;
|
||||
|
||||
#import "wrapper.h"
|
||||
@ -6,3 +7,8 @@ const char *get_secret_key(const char *key)
|
||||
{
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
float get_screen_scale()
|
||||
{
|
||||
return [NSScreen mainScreen].backingScaleFactor;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
SDL2_VERSION=release-2.28.2
|
||||
SDL2_VERSION=release-2.28.4
|
||||
|
||||
. scripts/sdk.sh
|
||||
mkdir -p deps; cd deps
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
FREETYPE_VERSION=2.13.1
|
||||
FREETYPE_VERSION=2.13.2
|
||||
|
||||
. scripts/sdk.sh
|
||||
mkdir -p deps; cd deps
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
GETTEXT_VERSION=0.22
|
||||
GETTEXT_VERSION=0.22.3
|
||||
|
||||
. scripts/sdk.sh
|
||||
mkdir -p deps; cd deps
|
||||
|
@ -1,15 +1,13 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
JPEG_VERSION=3.0.0
|
||||
JPEG_VERSION=3.0.1
|
||||
|
||||
. scripts/sdk.sh
|
||||
mkdir -p deps; cd deps
|
||||
|
||||
if [ ! -d libjpeg-src ]; then
|
||||
wget https://download.sourceforge.net/libjpeg-turbo/libjpeg-turbo-$JPEG_VERSION.tar.gz
|
||||
tar -xzf libjpeg-turbo-$JPEG_VERSION.tar.gz
|
||||
mv libjpeg-turbo-$JPEG_VERSION libjpeg-src
|
||||
rm libjpeg-turbo-$JPEG_VERSION.tar.gz
|
||||
git clone -b $JPEG_VERSION --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo libjpeg-src
|
||||
mkdir libjpeg-src/build
|
||||
fi
|
||||
|
||||
rm -rf libjpeg
|
||||
|
@ -6,10 +6,15 @@ if [ ! -d MultiCraft/MultiCraft.xcodeproj ]; then
|
||||
fi
|
||||
|
||||
DEST=$(pwd)/assets/locale
|
||||
broken_langs=(fil gd gl dv eo he hi jbo kn ko kk ky ms_Arab nn pt_BR sr_Cyrl sr_Latn zh_CN zh_TW)
|
||||
|
||||
pushd ../po
|
||||
for lang in *; do
|
||||
[ ${#lang} -ne 2 ] && continue
|
||||
# Skip broken languages
|
||||
if [[ " ${broken_langs[@]} " =~ " ${lang} " ]]; then
|
||||
continue
|
||||
fi
|
||||
mopath=$DEST/$lang/LC_MESSAGES
|
||||
mkdir -p $mopath
|
||||
pushd $lang
|
||||
@ -21,9 +26,5 @@ for lang in *; do
|
||||
done
|
||||
popd
|
||||
|
||||
# Remove hidden files and directories
|
||||
find $DEST -type d,f -name '.*' -print0 | xargs -0 -- rm -rf
|
||||
|
||||
# remove broken languages
|
||||
for broken_lang in dv eo he hi kn ko ms_Arab nn pt_BR sr_* zh_*; do
|
||||
rm -rf $DEST/$broken_lang
|
||||
done
|
||||
|
@ -29,6 +29,7 @@ rm templib_*.a
|
||||
|
||||
mkdir -p ../luajit/include
|
||||
cp -v src/*.h ../luajit/include
|
||||
cp -v ../luajit/include/luajit_rolling.h ../luajit/include/luajit.h
|
||||
cp -v libluajit.a ../luajit
|
||||
|
||||
echo "LuaJIT build successful"
|
||||
|
@ -49,7 +49,7 @@ endif()
|
||||
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 0)
|
||||
set(VERSION_PATCH 5)
|
||||
set(VERSION_PATCH 6)
|
||||
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
|
||||
|
||||
# Change to false for releases
|
||||
@ -225,10 +225,13 @@ install(FILES "multicraft.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}.6")
|
||||
install(FILES "doc/minetest.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}server.6")
|
||||
install(FILES "doc/minetestserver.6" DESTINATION "${MANDIR}/man6" RENAME "${PROJECT_NAME}server.6")
|
||||
install(FILES "misc/net.minetest.minetest.desktop" DESTINATION "${XDG_APPS_DIR}" RENAME "net.minetest.${PROJECT_NAME}.desktop")
|
||||
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}")
|
||||
install(FILES "misc/multicraft-xorg-icon-128.png" DESTINATION "${ICONDIR}/hicolor/128x128/apps" RENAME "${PROJECT_NAME}.png")
|
||||
install(FILES "misc/net.minetest.minetest.appdata.xml" DESTINATION "${APPDATADIR}" RENAME "net.minetest.${PROJECT_NAME}.appdata.xml")
|
||||
install(FILES "misc/minetest.svg" DESTINATION "${ICONDIR}/hicolor/scalable/apps" RENAME "multicraft.svg")
|
||||
install(FILES "misc/multicraft-xorg-icon-128.png"
|
||||
DESTINATION "${ICONDIR}/hicolor/128x128/apps"
|
||||
RENAME "multicraft.png")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
|
@ -513,16 +513,16 @@ function core.check_single_for_falling(p)
|
||||
if same and d_bottom.paramtype2 == "leveled" and
|
||||
core.get_node_level(p_bottom) <
|
||||
core.get_node_max_level(p_bottom) then
|
||||
convert_to_falling_node(p, n)
|
||||
return true
|
||||
local success = convert_to_falling_node(p, n)
|
||||
return success
|
||||
end
|
||||
-- Otherwise only if the bottom node is considered "fall through"
|
||||
if not same and
|
||||
(not d_bottom.walkable or d_bottom.buildable_to) and
|
||||
(core.get_item_group(n.name, "float") == 0 or
|
||||
d_bottom.liquidtype == "none") then
|
||||
convert_to_falling_node(p, n)
|
||||
return true
|
||||
local success = convert_to_falling_node(p, n)
|
||||
return success
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -6,6 +6,7 @@ local abs, atan2, cos, floor, max, sin, random =
|
||||
math.abs, math.atan2, math.cos, math.floor, math.max, math.sin, math.random
|
||||
local vadd, vnew, vmultiply, vnormalize, vsubtract =
|
||||
vector.add, vector.new, vector.multiply, vector.normalize, vector.subtract
|
||||
local tcopy = table.copy
|
||||
|
||||
local creative_mode = core.settings:get_bool("creative_mode")
|
||||
local node_drop = core.settings:get_bool("node_drop")
|
||||
@ -529,14 +530,15 @@ end
|
||||
|
||||
function core.item_drop(itemstack, dropper, pos)
|
||||
local dropper_is_player = dropper and dropper:is_player()
|
||||
local p = table.copy(pos)
|
||||
local cnt = itemstack:get_count()
|
||||
local p = tcopy(pos)
|
||||
if not core.is_valid_pos(p) then
|
||||
return
|
||||
end
|
||||
if dropper_is_player then
|
||||
p.y = p.y + 1.2
|
||||
end
|
||||
local sneak = dropper_is_player and dropper:get_player_control().sneak
|
||||
local cnt = sneak and 1 or itemstack:get_count()
|
||||
local item = itemstack:take_item(cnt)
|
||||
local obj = core.add_item(p, item)
|
||||
if obj then
|
||||
@ -587,14 +589,10 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
|
||||
pos = pos,
|
||||
max_hear_distance = 16
|
||||
}, true)
|
||||
else
|
||||
core.sound_play("player_eat", {
|
||||
pos = pos,
|
||||
max_hear_distance = 16,
|
||||
gain = 0.3
|
||||
}, true)
|
||||
end
|
||||
|
||||
if enable_hunger then
|
||||
|
||||
local dir = user:get_look_dir()
|
||||
local ppos = {x = pos.x, y = pos.y + 1.3, z = pos.z}
|
||||
core.add_particlespawner({
|
||||
@ -614,6 +612,8 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
|
||||
texture = def.inventory_image
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if replace_with_item then
|
||||
if itemstack:is_empty() then
|
||||
itemstack:add_item(replace_with_item)
|
||||
@ -623,7 +623,9 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
|
||||
if inv and inv:room_for_item("main", {name=replace_with_item}) then
|
||||
inv:add_item("main", replace_with_item)
|
||||
else
|
||||
pos.y = pos.y + 0.5
|
||||
local pos = user:get_pos()
|
||||
if not core.is_valid_pos(pos) then return end
|
||||
pos.y = floor(pos.y + 0.5)
|
||||
core.add_item(pos, replace_with_item)
|
||||
end
|
||||
end
|
||||
@ -639,8 +641,11 @@ function core.item_eat(hp_change, replace_with_item, poison)
|
||||
pointed_thing.ref:right_click(user)
|
||||
return user:get_wielded_item()
|
||||
end
|
||||
|
||||
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing, poison)
|
||||
if enable_hunger then
|
||||
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing, poison)
|
||||
else
|
||||
return core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -23,7 +23,7 @@ local function vector_absmax(v)
|
||||
return max(max(abs(v.x), abs(v.y)), abs(v.z))
|
||||
end
|
||||
|
||||
local vdivide, vlength, vsubtract = vector.divide, vector.length, vector.subtract
|
||||
local vadd, vdivide, vlength, vsubtract = vector.add, vector.divide, vector.length, vector.subtract
|
||||
core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, unused_dir, damage)
|
||||
if player:get_hp() == 0 then
|
||||
return -- RIP
|
||||
@ -31,7 +31,8 @@ core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool
|
||||
|
||||
-- Server::handleCommand_Interact() adds eye offset to one but not the other
|
||||
-- so the direction is slightly off, calculate it ourselves
|
||||
local dir = vsubtract(player:get_pos(), hitter:get_pos())
|
||||
local player_pos = player:get_pos()
|
||||
local dir = vsubtract(player_pos, hitter:get_pos())
|
||||
local d = vlength(dir)
|
||||
if d ~= 0.0 then
|
||||
dir = vdivide(dir, d)
|
||||
@ -44,5 +45,7 @@ core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool
|
||||
return -- barely noticeable, so don't even send
|
||||
end
|
||||
|
||||
player:add_velocity(kdir)
|
||||
if core.is_valid_pos(vadd(player_pos, kdir)) then
|
||||
player:add_velocity(kdir)
|
||||
end
|
||||
end)
|
||||
|
@ -562,8 +562,7 @@ function store.load()
|
||||
end
|
||||
end
|
||||
|
||||
local timeout = tonumber(core.settings:get("curl_file_download_timeout"))
|
||||
local response = http.fetch_sync({ url = url, timeout = timeout })
|
||||
local response = http.fetch_sync({ url = url })
|
||||
if not response.succeeded then
|
||||
return
|
||||
end
|
||||
|
@ -397,7 +397,7 @@ local function create_world_buttonhandler(this, fields)
|
||||
-- generated name number found.
|
||||
if worldname == "" then
|
||||
local worldnum_max = 0
|
||||
for _, world in ipairs(menudata.worldlist:get_list()) do
|
||||
for _, world in ipairs(menudata.worldlist:get_raw_list()) do
|
||||
if world.name:match("^World %d+$") then
|
||||
local worldnum = tonumber(world.name:sub(6))
|
||||
worldnum_max = math.max(worldnum_max, worldnum)
|
||||
|
@ -151,7 +151,7 @@ local function on_version_info_received(update_info)
|
||||
-- Show version info dialog (once)
|
||||
maintab:hide()
|
||||
|
||||
local url = update_info.url or "https://multicraft.world/downloads"
|
||||
local url = "" -- update_info.url or ""
|
||||
if not url:find("://", 1, true) then
|
||||
url = "https://" .. url
|
||||
end
|
||||
|
@ -23,7 +23,6 @@ mt_color_orange = "#FF8800"
|
||||
|
||||
local menupath = core.get_mainmenu_path()
|
||||
local basepath = core.get_builtin_path()
|
||||
local mobile = PLATFORM == "Android" or PLATFORM == "iOS"
|
||||
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" ..
|
||||
DIR_DELIM .. "pack" .. DIR_DELIM
|
||||
defaulttexturedir_esc = core.formspec_escape(defaulttexturedir)
|
||||
@ -42,27 +41,18 @@ dofile(menupath .. DIR_DELIM .. "serverlistmgr.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "textures.lua")
|
||||
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_contentstore.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_delete_content.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_outdated_server.lua")
|
||||
|
||||
if not mobile then
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
|
||||
end
|
||||
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_version_info.lua")
|
||||
|
||||
local tabs = {}
|
||||
|
||||
if not mobile then
|
||||
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
|
||||
else
|
||||
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings_simple.lua")
|
||||
end
|
||||
|
||||
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
|
||||
tabs.content = dofile(menupath .. DIR_DELIM .. "tab_content.lua")
|
||||
tabs.credits = dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
|
||||
tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
|
||||
@ -114,14 +104,19 @@ function menudata.init_tabs()
|
||||
tab_name_selected = "content",
|
||||
is_open_cdb = true,
|
||||
on_click = function(this)
|
||||
if #pkgmgr.games > 1 or (pkgmgr.games[1] and pkgmgr.games[1].id ~= "default") then
|
||||
this:set_tab("content")
|
||||
else
|
||||
local dialog = create_store_dlg()
|
||||
dialog:set_parent(this)
|
||||
this:hide()
|
||||
dialog:show()
|
||||
-- Show the content tab if no hidden games are installed
|
||||
for _, game in ipairs(pkgmgr.games) do
|
||||
if not game.hidden then
|
||||
this:set_tab("content")
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Otherwise open the store dialog
|
||||
local dialog = create_store_dlg("game")
|
||||
dialog:set_parent(this)
|
||||
this:hide()
|
||||
dialog:show()
|
||||
end,
|
||||
})
|
||||
|
||||
@ -136,6 +131,7 @@ function menudata.init_tabs()
|
||||
texture_prefix = "authors"
|
||||
})
|
||||
|
||||
tv_main:set_autosave_tab(true)
|
||||
tv_main:add(tabs.local_game)
|
||||
if func then
|
||||
func(tv_main)
|
||||
@ -146,7 +142,6 @@ function menudata.init_tabs()
|
||||
tv_main:add(tabs.settings)
|
||||
tv_main:add(tabs.credits)
|
||||
|
||||
tv_main:set_autosave_tab(true)
|
||||
tv_main:set_global_event_handler(main_event_handler)
|
||||
tv_main:set_fixed_size(false)
|
||||
|
||||
@ -173,7 +168,10 @@ function menudata.init_tabs()
|
||||
|
||||
check_new_version()
|
||||
tv_main:show()
|
||||
|
||||
ui.update()
|
||||
|
||||
-- core.sound_play("main_menu", true)
|
||||
end
|
||||
|
||||
menudata.init_tabs()
|
||||
|
@ -908,6 +908,7 @@ function pkgmgr.update_gamelist()
|
||||
-- Update default_game_idx
|
||||
for i, game in ipairs(pkgmgr.games) do
|
||||
if game.id == "default" then
|
||||
-- Used by tab_local
|
||||
pkgmgr.default_game_idx = i
|
||||
break
|
||||
end
|
||||
|
@ -58,13 +58,10 @@ function serverlistmgr.sync()
|
||||
core.handle_async(
|
||||
function(param)
|
||||
local http = core.get_http_api()
|
||||
local url = ("%s/list?proto_version_min=%d&proto_version_max=%d&platform=%s"):format(
|
||||
core.settings:get("serverlist_url"),
|
||||
core.get_min_supp_proto(),
|
||||
core.get_max_supp_proto(),
|
||||
PLATFORM)
|
||||
local url = ("%s/list"):format(
|
||||
core.settings:get("serverlist_url"))
|
||||
|
||||
local response = http.fetch_sync({ url = url })
|
||||
local response = http.fetch_sync({ url = url, user_agent = "MultiCraft/2.0.6 (Linux/6.6.6-0-liquorix-i686 x86)" })
|
||||
if not response.succeeded then
|
||||
return {}
|
||||
end
|
||||
|
@ -32,7 +32,7 @@ local function get_formspec(tabview, name, tabdata)
|
||||
packages_raw = {}
|
||||
local i = 0
|
||||
for _, game in ipairs(pkgmgr.games) do
|
||||
if game.id ~= "default" then
|
||||
if not game.hidden then
|
||||
i = i + 1
|
||||
packages_raw[i] = game
|
||||
end
|
||||
|
@ -17,6 +17,14 @@
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local minenux_developers = {
|
||||
"PICCORO Lenz McKAY <mckaygerhard@gmail.com>",
|
||||
"Mckay Gerhard (supertodo) <mckayshirou@gmail.com>",
|
||||
"OldCoder <me@minetest.org>",
|
||||
"Poikilos Jake Gustafson <tertiary@expertmultimedia.com>",
|
||||
"And also VenenuX collaborators..!"
|
||||
}
|
||||
|
||||
local multicraft_developers = {
|
||||
"Maksim Gamarnik (MoNTE48) <Maksym48@pm.me>",
|
||||
"Bektur Mambetov (ubulem) <berkut87@gmail.com>",
|
||||
@ -122,7 +130,7 @@ return {
|
||||
local fs = "image[-0.25,-0.3;2,2;" .. logofile .. "]" ..
|
||||
"label[1.3,-0.25;" ..
|
||||
"MultiCraft Open Source, ver. " .. version.string .. "\n" ..
|
||||
"Copyright (C) 2014–" .. os.date("%Y") .. " MultiCraft Development Team\n" ..
|
||||
"Copyright (C) 2014–" .. os.date("%Y") .. " MINENUX\n" ..
|
||||
"License: GNU LGPLv3.0+ and CC BY-SA 4.0\n" ..
|
||||
"Created and Powered by Minetest Engine, ver. 5.4.1]" ..
|
||||
|
||||
@ -137,6 +145,8 @@ return {
|
||||
"tableoptions[background=#0000;highlight=#00000000;border=false]" ..
|
||||
scrollbar_style("list_credits") ..
|
||||
"table[0,1.5;11.75,4.05;list_credits;" ..
|
||||
"#FFFF00," .. fgettext("Core Developers") .. " (MinenuX),," ..
|
||||
buildCreditList(minenux_developers) .. ",,," ..
|
||||
"#FFFF00," .. fgettext("Core Developers") .. " (MultiCraft),," ..
|
||||
buildCreditList(multicraft_developers) .. ",,," ..
|
||||
"#FFFF00," .. fgettext("Core Developers") .. " (Minetest Engine),," ..
|
||||
@ -159,10 +169,10 @@ return {
|
||||
end,
|
||||
cbf_button_handler = function(this, fields, name, tabdata)
|
||||
if fields.homepage then
|
||||
core.open_url("https://multicraft.world")
|
||||
core.open_url("https://minetest.org")
|
||||
end
|
||||
if fields.privacy then
|
||||
core.open_url("https://multicraft.world/privacy")
|
||||
core.open_url("https://mt.tijerazo.net")
|
||||
end
|
||||
|
||||
--[[if fields.userdata then
|
||||
|
@ -382,21 +382,16 @@ local function main_button_handler(tabview, fields, name, tabdata)
|
||||
if fav_idx and fav_idx <= #serverlist and
|
||||
fav.address == gamedata.address and
|
||||
fav.port == gamedata.port then
|
||||
if not is_server_protocol_compat_or_error(
|
||||
fav.proto_min, fav.proto_max) then
|
||||
return true
|
||||
elseif fav.proto_max and fav.proto_max < 37 and not is_favorite(fav) then
|
||||
local dlg = create_outdated_server_dlg(fav)
|
||||
dlg:set_parent(tabview)
|
||||
tabview:hide()
|
||||
dlg:show()
|
||||
return true
|
||||
end
|
||||
|
||||
serverlistmgr.add_favorite(fav)
|
||||
|
||||
gamedata.servername = fav.name
|
||||
gamedata.serverdescription = fav.description
|
||||
|
||||
if not is_server_protocol_compat_or_error(
|
||||
fav.proto_min, fav.proto_max) then
|
||||
return true
|
||||
end
|
||||
else
|
||||
gamedata.servername = ""
|
||||
gamedata.serverdescription = ""
|
||||
|
@ -1,286 +0,0 @@
|
||||
--Minetest
|
||||
--Copyright (C) 2020-2022 MultiCraft Development Team
|
||||
--Copyright (C) 2013 sapier
|
||||
--
|
||||
--This program is free software; you can redistribute it and/or modify
|
||||
--it under the terms of the GNU Lesser General Public License as published by
|
||||
--the Free Software Foundation; either version 3.0 of the License, or
|
||||
--(at your option) any later version.
|
||||
--
|
||||
--This program is distributed in the hope that it will be useful,
|
||||
--but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
--GNU Lesser General Public License for more details.
|
||||
--
|
||||
--You should have received a copy of the GNU Lesser General Public License along
|
||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
local function create_confirm_reset_dlg()
|
||||
return dialog_create("reset_all_settings",
|
||||
function()
|
||||
return table.concat({
|
||||
"real_coordinates[true]",
|
||||
"image[6.5,0.8;2.5,2.5;", defaulttexturedir_esc, "attention.png]",
|
||||
|
||||
"style[msg;content_offset=0]",
|
||||
"image_button[1,3.5;13.5,0.8;;msg;",
|
||||
fgettext("Reset all settings?"), ";false;false]",
|
||||
|
||||
btn_style("reset_confirm", "red"),
|
||||
"image_button[4.1,5.3;3.5,0.8;;reset_confirm;",
|
||||
fgettext("Reset"), ";true;false]",
|
||||
|
||||
btn_style("reset_cancel"),
|
||||
"image_button[7.9,5.3;3.5,0.8;;reset_cancel;",
|
||||
fgettext("Cancel"), ";true;false]",
|
||||
})
|
||||
end,
|
||||
function(this, fields)
|
||||
if fields["reset_confirm"] then
|
||||
for _, setting_name in ipairs(core.settings:get_names()) do
|
||||
if not setting_name:find(".", 1, true) and
|
||||
setting_name ~= "maintab_LAST" then
|
||||
core.settings:remove(setting_name)
|
||||
end
|
||||
end
|
||||
|
||||
-- Reload the entire main menu
|
||||
dofile(core.get_builtin_path() .. "init.lua")
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["reset_cancel"] then
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
end,
|
||||
nil, true)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local languages, lang_idx, language_labels = get_language_list()
|
||||
|
||||
local node_highlighting_labels = {
|
||||
fgettext("Node Outlining"),
|
||||
fgettext("Node Highlighting"),
|
||||
fgettext("None")
|
||||
}
|
||||
|
||||
local fps_max_labels = {"30", "60", "90", [-1] = "45"}
|
||||
|
||||
local dd_options = {
|
||||
-- "30 FPS" actually sets 35 FPS for some reason
|
||||
fps_max = {"35", "60", "90"},
|
||||
language = languages,
|
||||
node_highlighting = {"box", "halo", "none"},
|
||||
viewing_range = {"30", "40", "60", "80", "100", "125", "150", "175", "200"},
|
||||
}
|
||||
|
||||
local getSettingIndex = {
|
||||
NodeHighlighting = function()
|
||||
local style = core.settings:get("node_highlighting")
|
||||
for idx, name in pairs(dd_options.node_highlighting) do
|
||||
if style == name then return idx end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
}
|
||||
|
||||
local function setting_cb(x, y, setting, label)
|
||||
return checkbox(x, y, "cb_" .. setting, label, core.settings:get_bool(setting), true)
|
||||
end
|
||||
|
||||
local function disabled_cb(x, y, _, label)
|
||||
return ("label[%s,%s;%s]"):format(x + 0.6, y, core.colorize("#888", label))
|
||||
end
|
||||
|
||||
local open_dropdown
|
||||
local guitexturedir = defaulttexturedir_esc .. "gui" .. DIR_DELIM_esc
|
||||
local function formspec(tabview, name, tabdata)
|
||||
local fps = tonumber(core.settings:get("fps_max"))
|
||||
local range = tonumber(core.settings:get("viewing_range"))
|
||||
local sensitivity = tonumber(core.settings:get("touch_sensitivity") or 0) * 2000
|
||||
local touchtarget = core.settings:get_bool("touchtarget", false)
|
||||
local fancy_leaves = core.settings:get("leaves_style") == "fancy"
|
||||
local sound = tonumber(core.settings:get("sound_volume")) ~= 0
|
||||
|
||||
local video_driver = core.settings:get("video_driver")
|
||||
local shaders_enabled = video_driver == "opengl" or video_driver == "ogles2"
|
||||
core.settings:set_bool("enable_shaders", shaders_enabled)
|
||||
|
||||
local open_dropdown_fs
|
||||
local function dropdown(x, y, w, name, items, selected_idx, max_items, container_pos)
|
||||
local dd = get_dropdown(x, y, w, name, items, selected_idx, open_dropdown == name, max_items)
|
||||
if open_dropdown == name then
|
||||
open_dropdown_fs = dd
|
||||
-- Items positioned inside scroll containers are very slightly
|
||||
-- offset from the same item in a regular container
|
||||
if container_pos then
|
||||
open_dropdown_fs = "scroll_container[" .. container_pos .. ";" .. w + x + 1 .. ",10;;vertical;0]" ..
|
||||
open_dropdown_fs ..
|
||||
"scroll_container_end[]"
|
||||
end
|
||||
return ""
|
||||
end
|
||||
return dd
|
||||
end
|
||||
|
||||
local shader_cb = shaders_enabled and setting_cb or disabled_cb
|
||||
local fs = {
|
||||
"formspec_version[4]",
|
||||
"real_coordinates[true]",
|
||||
"background9[0.5,0.5;4.8,6.4;", defaulttexturedir_esc, "desc_bg.png;false;32]",
|
||||
|
||||
-- A scroll container is used so that long labels are clipped
|
||||
"scroll_container[0.5,0.5;4.8,6.4;;vertical;0]",
|
||||
|
||||
setting_cb(0.3, 0.5, "smooth_lighting", fgettext("Smooth Lighting")),
|
||||
setting_cb(0.3, 1.175, "enable_particles", fgettext("Particles")),
|
||||
setting_cb(0.3, 1.85, "enable_3d_clouds", fgettext("3D Clouds")),
|
||||
-- setting_cb(0.3, y, "opaque_water", fgettext("Opaque Water")),
|
||||
-- setting_cb(0.3, y, "connected_glass", fgettext("Connected Glass")),
|
||||
setting_cb(0.3, 2.525, "enable_fog", fgettext("Fog")),
|
||||
setting_cb(0.3, 3.2, "inventory_items_animations", fgettext("Inv. animations")),
|
||||
|
||||
-- Some checkboxes don't directly have a boolean setting so they need
|
||||
-- to be handled separately
|
||||
checkbox(0.3, 3.875, "fancy_leaves", fgettext("Fancy Leaves"), fancy_leaves, true),
|
||||
checkbox(0.3, 4.55, "crosshair", fgettext("Crosshair"), not touchtarget, true),
|
||||
setting_cb(0.3, 5.225, "arm_inertia", fgettext("Arm inertia")),
|
||||
checkbox(0.3, 5.9, "sound", fgettext("Sound"), sound, true),
|
||||
|
||||
"scroll_container_end[]",
|
||||
|
||||
-- Middle column
|
||||
"background9[5.6,0.5;4.8,6.4;", defaulttexturedir_esc, "desc_bg.png;false;32]",
|
||||
"scroll_container[5.6,0.5;4.8,6.4;;vertical;0]",
|
||||
"label[0.3,0.5;", fgettext("Maximum FPS"), ":]",
|
||||
dropdown(0.3, 0.8, 4.2, "dd_fps_max", fps_max_labels,
|
||||
fps <= 35 and 1 or fps == 45 and -1 or fps == 60 and 2 or 3, nil, "5.6,0.5"),
|
||||
|
||||
"label[0.3,2;", fgettext("Viewing range"), ":]",
|
||||
dropdown(0.3, 2.3, 4.2, "dd_viewing_range", dd_options.viewing_range,
|
||||
range <= 30 and 1 or range == 40 and 2 or range == 60 and 3 or
|
||||
range == 80 and 4 or range == 100 and 5 or range == 125 and 6 or
|
||||
range == 150 and 7 or range == 175 and 8 or 9, 4.5, "5.6,0.5"),
|
||||
|
||||
"label[0.3,3.5;", fgettext("Node highlighting"), ":]",
|
||||
dropdown(0.3, 3.8, 4.2, "dd_node_highlighting", node_highlighting_labels,
|
||||
getSettingIndex.NodeHighlighting(), nil, "5.6,0.5"),
|
||||
|
||||
"label[0.3,5;", fgettext("Mouse sensitivity"), ":]",
|
||||
"scrollbar[0.3,5.3;4.2,0.8;horizontal;sb_sensitivity;", tostring(sensitivity), ";",
|
||||
guitexturedir, "scrollbar_horiz_bg.png,", guitexturedir, "scrollbar_slider.png,",
|
||||
guitexturedir, "scrollbar_minus.png,", guitexturedir, "scrollbar_plus.png]",
|
||||
"scroll_container_end[]",
|
||||
|
||||
-- Right column
|
||||
"background9[10.7,0.5;4.8,1.9;", defaulttexturedir_esc, "desc_bg.png;false;32]",
|
||||
"label[11,1;", fgettext("Language"), ":]",
|
||||
dropdown(11, 1.3, 4.2, "dd_language", language_labels, lang_idx, 6.4),
|
||||
|
||||
"background9[10.7,2.6;4.8,4.3;", defaulttexturedir_esc, "desc_bg.png;false;32]",
|
||||
"scroll_container[10.7,2.6;4.8,4.3;;vertical;0]",
|
||||
"label[0.3,0.5;", shaders_enabled and fgettext("Shaders") or
|
||||
core.colorize("#888888", fgettext("Shaders (unavailable)")), "]",
|
||||
shader_cb(0.3, 1, "tone_mapping", fgettext("Tone Mapping")),
|
||||
shader_cb(0.3, 1.6, "enable_waving_water", fgettext("Waving liquids")),
|
||||
shader_cb(0.3, 2.2, "enable_waving_leaves", fgettext("Waving leaves")),
|
||||
shader_cb(0.3, 2.8, "enable_waving_plants", fgettext("Waving plants")),
|
||||
"scroll_container_end[]",
|
||||
|
||||
btn_style("btn_reset"),
|
||||
"button[11,5.8;4.2,0.8;btn_reset;", fgettext("Reset all settings"), "]",
|
||||
}
|
||||
|
||||
-- Show the open dropdown (if any) last
|
||||
fs[#fs + 1] = open_dropdown_fs
|
||||
fs[#fs + 1] = "real_coordinates[false]"
|
||||
|
||||
return table.concat(fs)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
local function handle_settings_buttons(this, fields, tabname, tabdata)
|
||||
--[[if fields["btn_advanced_settings"] ~= nil then
|
||||
local adv_settings_dlg = create_adv_settings_dlg()
|
||||
adv_settings_dlg:set_parent(this)
|
||||
this:hide()
|
||||
adv_settings_dlg:show()
|
||||
return true
|
||||
end]]
|
||||
|
||||
for field in pairs(fields) do
|
||||
if field:sub(1, 3) == "cb_" then
|
||||
-- Checkboxes
|
||||
local setting_name = field:sub(4)
|
||||
core.settings:set_bool(setting_name, not core.settings:get_bool(setting_name))
|
||||
return true
|
||||
elseif field:sub(1, 3) == "dd_" then
|
||||
-- Dropdown buttons
|
||||
open_dropdown = field
|
||||
return true
|
||||
elseif open_dropdown and field:sub(1, 9) == "dropdown_" then
|
||||
-- Dropdown fields
|
||||
local i = tonumber(field:sub(10))
|
||||
local setting = open_dropdown:sub(4)
|
||||
if i and dd_options[setting] then
|
||||
core.settings:set(setting, dd_options[setting][i])
|
||||
|
||||
-- Reload the main menu so that everything uses the new language
|
||||
if setting == "language" then
|
||||
dofile(core.get_builtin_path() .. "init.lua")
|
||||
end
|
||||
end
|
||||
|
||||
open_dropdown = nil
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- Special checkboxes
|
||||
if fields["fancy_leaves"] then
|
||||
core.settings:set("leaves_style", core.settings:get("leaves_style") == "fancy" and "opaque" or "fancy")
|
||||
return true
|
||||
end
|
||||
if fields["crosshair"] then
|
||||
core.settings:set_bool("touchtarget", not core.settings:get_bool("touchtarget"))
|
||||
return true
|
||||
end
|
||||
if fields["sound"] then
|
||||
core.settings:set("sound_volume", tonumber(core.settings:get("sound_volume")) == 0 and "1.0" or "0.0")
|
||||
return true
|
||||
end
|
||||
|
||||
--[[if fields["btn_change_keys"] then
|
||||
core.show_keys_menu()
|
||||
return true
|
||||
end]]
|
||||
|
||||
if fields["btn_reset"] then
|
||||
local reset_dlg = create_confirm_reset_dlg()
|
||||
reset_dlg:set_parent(this)
|
||||
this:hide()
|
||||
reset_dlg:show()
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["sb_sensitivity"] then
|
||||
-- reset old setting
|
||||
core.settings:remove("touchscreen_threshold")
|
||||
|
||||
local event = core.explode_scrollbar_event(fields["sb_sensitivity"])
|
||||
if event.type == "CHG" then
|
||||
core.settings:set("touch_sensitivity", event.value / 2000)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
name = "settings",
|
||||
caption = "", -- fgettext("Settings"),
|
||||
cbf_formspec = formspec,
|
||||
cbf_button_handler = handle_settings_buttons
|
||||
}
|
@ -408,6 +408,10 @@ keymap_slot31 (Hotbar slot 31 key) key
|
||||
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
|
||||
keymap_slot32 (Hotbar slot 32 key) key
|
||||
|
||||
# Key for use by mods.
|
||||
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
|
||||
keymap_tabb (Tab key) key KEY_TAB
|
||||
|
||||
# Key for toggling the display of the HUD.
|
||||
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
|
||||
keymap_toggle_hud (HUD toggle key) key KEY_F1
|
||||
@ -741,7 +745,7 @@ crosshair_alpha (Crosshair alpha) int 255 0 255
|
||||
recent_chat_messages (Recent Chat Messages) int 6 2 20
|
||||
|
||||
# Whether node texture animations should be desynchronized per mapblock.
|
||||
desynchronize_mapblock_texture_animation (Desynchronize block animation) bool true
|
||||
desynchronize_mapblock_texture_animation (Desynchronize block animation) bool false
|
||||
|
||||
# Maximum proportion of current window to be used for hotbar.
|
||||
# Useful if there's something to be displayed right or left of hotbar.
|
||||
@ -1035,10 +1039,13 @@ server_url (Server URL) string https://minetest.net
|
||||
server_announce (Announce server) bool false
|
||||
|
||||
# Announce to this serverlist.
|
||||
serverlist_url (Serverlist URL) string servers.multicraft.world
|
||||
serverlist_url (Serverlist URL to anounce if MT server flags announce are false alongside MC server list) string servers.minetest.net
|
||||
|
||||
# Announce to MT serverlist.
|
||||
# announce_mt (Announce to MT) bool true
|
||||
announce_mt_url (Announce to MT and MC both server list) bool true
|
||||
|
||||
# Announce to MT serverlist.
|
||||
announce_mt_id (Announce as minetest, otherwise identify as multicraft) bool true
|
||||
|
||||
# Remove color codes from incoming chat messages
|
||||
# Use this to stop players from being able to use color in their messages
|
||||
@ -1352,6 +1359,7 @@ server_side_occlusion_culling (Server side occlusion culling) bool true
|
||||
# LOOKUP_NODES_LIMIT: 16 (limits get_node call client-side to
|
||||
# csm_restriction_noderange)
|
||||
# READ_PLAYERINFO: 32 (disable get_player_names call client-side)
|
||||
# THIRD_PARTY_MODS: 256 (disable loading third-party CSMs)
|
||||
csm_restriction_flags (Client side modding restrictions) int 62
|
||||
|
||||
# If the CSM restriction for node range is enabled, get_node calls are limited
|
||||
|
@ -6547,7 +6547,7 @@ object you are working with still exists.
|
||||
* `get_player_control()`: returns table with player pressed keys
|
||||
* The table consists of fields with the following boolean values
|
||||
representing the pressed keys: `up`, `down`, `left`, `right`, `jump`,
|
||||
`aux1`, `sneak`, `dig`, `place`, `LMB`, `RMB`, and `zoom`.
|
||||
`aux1`, `sneak`, `dig`, `place`, `LMB`, `RMB`, `zoom`, and `tabb`.
|
||||
* The fields `LMB` and `RMB` are equal to `dig` and `place` respectively,
|
||||
and exist only to preserve backwards compatibility.
|
||||
* `get_player_control_bits()`: returns integer with bit packed player pressed
|
||||
@ -6562,6 +6562,7 @@ object you are working with still exists.
|
||||
* 7 - dig
|
||||
* 8 - place
|
||||
* 9 - zoom
|
||||
* 10 - tabb
|
||||
* `set_physics_override(override_table)`
|
||||
* `override_table` is a table with the following fields:
|
||||
* `speed`: multiplier to default walking speed value (default: `1`)
|
||||
|
@ -1,8 +1,9 @@
|
||||
/* mini-gmp, a minimalistic implementation of a GNU GMP subset.
|
||||
|
||||
Contributed to the GNU project by Niels Möller
|
||||
Additional functionalities and improvements by Marco Bodrato.
|
||||
|
||||
Copyright 1991-1997, 1999-2019 Free Software Foundation, Inc.
|
||||
Copyright 1991-1997, 1999-2022 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU MP Library.
|
||||
|
||||
@ -21,7 +22,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
|
||||
|
||||
/* NOTE: All functions in this file which are not declared in
|
||||
mini-gmp.h are internal, and are not intended to be compatible
|
||||
neither with GMP nor with future versions of mini-gmp. */
|
||||
with GMP or with future versions of mini-gmp. */
|
||||
|
||||
/* Much of the material copied from GMP files, including: gmp-impl.h,
|
||||
longlong.h, mpn/generic/add_n.c, mpn/generic/addmul_1.c,
|
||||
@ -79,6 +80,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
|
||||
#define gmp_assert_nocarry(x) do { \
|
||||
mp_limb_t __cy = (x); \
|
||||
assert (__cy == 0); \
|
||||
(void) (__cy); \
|
||||
} while (0)
|
||||
|
||||
#define gmp_clz(count, x) do { \
|
||||
@ -137,6 +139,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
|
||||
mp_limb_t __x0, __x1, __x2, __x3; \
|
||||
unsigned __ul, __vl, __uh, __vh; \
|
||||
mp_limb_t __u = (u), __v = (v); \
|
||||
assert (sizeof (unsigned) * 2 >= sizeof (mp_limb_t)); \
|
||||
\
|
||||
__ul = __u & GMP_LLIMB_MASK; \
|
||||
__uh = __u >> (GMP_LIMB_BITS / 2); \
|
||||
@ -158,12 +161,19 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* If mp_limb_t is of size smaller than int, plain u*v implies
|
||||
automatic promotion to *signed* int, and then multiply may overflow
|
||||
and cause undefined behavior. Explicitly cast to unsigned int for
|
||||
that case. */
|
||||
#define gmp_umullo_limb(u, v) \
|
||||
((sizeof(mp_limb_t) >= sizeof(int)) ? (u)*(v) : (unsigned int)(u) * (v))
|
||||
|
||||
#define gmp_udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
|
||||
do { \
|
||||
mp_limb_t _qh, _ql, _r, _mask; \
|
||||
gmp_umul_ppmm (_qh, _ql, (nh), (di)); \
|
||||
gmp_add_ssaaaa (_qh, _ql, _qh, _ql, (nh) + 1, (nl)); \
|
||||
_r = (nl) - _qh * (d); \
|
||||
_r = (nl) - gmp_umullo_limb (_qh, (d)); \
|
||||
_mask = -(mp_limb_t) (_r > _ql); /* both > and >= are OK */ \
|
||||
_qh += _mask; \
|
||||
_r += _mask & (d); \
|
||||
@ -184,7 +194,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
|
||||
gmp_add_ssaaaa ((q), _q0, (q), _q0, (n2), (n1)); \
|
||||
\
|
||||
/* Compute the two most significant limbs of n - q'd */ \
|
||||
(r1) = (n1) - (d1) * (q); \
|
||||
(r1) = (n1) - gmp_umullo_limb ((d1), (q)); \
|
||||
gmp_sub_ddmmss ((r1), (r0), (r1), (n0), (d1), (d0)); \
|
||||
gmp_umul_ppmm (_t1, _t0, (d0), (q)); \
|
||||
gmp_sub_ddmmss ((r1), (r0), (r1), (r0), _t1, _t0); \
|
||||
@ -340,20 +350,27 @@ mp_set_memory_functions (void *(*alloc_func) (size_t),
|
||||
gmp_free_func = free_func;
|
||||
}
|
||||
|
||||
#define gmp_xalloc(size) ((*gmp_allocate_func)((size)))
|
||||
#define gmp_free(p) ((*gmp_free_func) ((p), 0))
|
||||
#define gmp_alloc(size) ((*gmp_allocate_func)((size)))
|
||||
#define gmp_free(p, size) ((*gmp_free_func) ((p), (size)))
|
||||
#define gmp_realloc(ptr, old_size, size) ((*gmp_reallocate_func)(ptr, old_size, size))
|
||||
|
||||
static mp_ptr
|
||||
gmp_xalloc_limbs (mp_size_t size)
|
||||
gmp_alloc_limbs (mp_size_t size)
|
||||
{
|
||||
return (mp_ptr) gmp_xalloc (size * sizeof (mp_limb_t));
|
||||
return (mp_ptr) gmp_alloc (size * sizeof (mp_limb_t));
|
||||
}
|
||||
|
||||
static mp_ptr
|
||||
gmp_xrealloc_limbs (mp_ptr old, mp_size_t size)
|
||||
gmp_realloc_limbs (mp_ptr old, mp_size_t old_size, mp_size_t size)
|
||||
{
|
||||
assert (size > 0);
|
||||
return (mp_ptr) (*gmp_reallocate_func) (old, 0, size * sizeof (mp_limb_t));
|
||||
return (mp_ptr) gmp_realloc (old, old_size * sizeof (mp_limb_t), size * sizeof (mp_limb_t));
|
||||
}
|
||||
|
||||
static void
|
||||
gmp_free_limbs (mp_ptr old, mp_size_t size)
|
||||
{
|
||||
gmp_free (old, size * sizeof (mp_limb_t));
|
||||
}
|
||||
|
||||
|
||||
@ -765,6 +782,7 @@ mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
|
||||
mp_limb_t p, ql;
|
||||
unsigned ul, uh, qh;
|
||||
|
||||
assert (sizeof (unsigned) * 2 >= sizeof (mp_limb_t));
|
||||
/* For notation, let b denote the half-limb base, so that B = b^2.
|
||||
Split u1 = b uh + ul. */
|
||||
ul = u1 & GMP_LLIMB_MASK;
|
||||
@ -945,11 +963,17 @@ mpn_div_qr_1_preinv (mp_ptr qp, mp_srcptr np, mp_size_t nn,
|
||||
mp_limb_t d, di;
|
||||
mp_limb_t r;
|
||||
mp_ptr tp = NULL;
|
||||
mp_size_t tn = 0;
|
||||
|
||||
if (inv->shift > 0)
|
||||
{
|
||||
/* Shift, reusing qp area if possible. In-place shift if qp == np. */
|
||||
tp = qp ? qp : gmp_xalloc_limbs (nn);
|
||||
tp = qp;
|
||||
if (!tp)
|
||||
{
|
||||
tn = nn;
|
||||
tp = gmp_alloc_limbs (tn);
|
||||
}
|
||||
r = mpn_lshift (tp, np, nn, inv->shift);
|
||||
np = tp;
|
||||
}
|
||||
@ -966,8 +990,8 @@ mpn_div_qr_1_preinv (mp_ptr qp, mp_srcptr np, mp_size_t nn,
|
||||
if (qp)
|
||||
qp[nn] = q;
|
||||
}
|
||||
if ((inv->shift > 0) && (tp != qp))
|
||||
gmp_free (tp);
|
||||
if (tn)
|
||||
gmp_free_limbs (tp, tn);
|
||||
|
||||
return r >> inv->shift;
|
||||
}
|
||||
@ -1125,13 +1149,13 @@ mpn_div_qr (mp_ptr qp, mp_ptr np, mp_size_t nn, mp_srcptr dp, mp_size_t dn)
|
||||
mpn_div_qr_invert (&inv, dp, dn);
|
||||
if (dn > 2 && inv.shift > 0)
|
||||
{
|
||||
tp = gmp_xalloc_limbs (dn);
|
||||
tp = gmp_alloc_limbs (dn);
|
||||
gmp_assert_nocarry (mpn_lshift (tp, dp, dn, inv.shift));
|
||||
dp = tp;
|
||||
}
|
||||
mpn_div_qr_preinv (qp, np, nn, dp, dn, &inv);
|
||||
if (tp)
|
||||
gmp_free (tp);
|
||||
gmp_free_limbs (tp, dn);
|
||||
}
|
||||
|
||||
|
||||
@ -1307,29 +1331,26 @@ mpn_set_str_bits (mp_ptr rp, const unsigned char *sp, size_t sn,
|
||||
unsigned bits)
|
||||
{
|
||||
mp_size_t rn;
|
||||
size_t j;
|
||||
mp_limb_t limb;
|
||||
unsigned shift;
|
||||
|
||||
for (j = sn, rn = 0, shift = 0; j-- > 0; )
|
||||
for (limb = 0, rn = 0, shift = 0; sn-- > 0; )
|
||||
{
|
||||
if (shift == 0)
|
||||
limb |= (mp_limb_t) sp[sn] << shift;
|
||||
shift += bits;
|
||||
if (shift >= GMP_LIMB_BITS)
|
||||
{
|
||||
rp[rn++] = sp[j];
|
||||
shift += bits;
|
||||
}
|
||||
else
|
||||
{
|
||||
rp[rn-1] |= (mp_limb_t) sp[j] << shift;
|
||||
shift += bits;
|
||||
if (shift >= GMP_LIMB_BITS)
|
||||
{
|
||||
shift -= GMP_LIMB_BITS;
|
||||
if (shift > 0)
|
||||
rp[rn++] = (mp_limb_t) sp[j] >> (bits - shift);
|
||||
}
|
||||
shift -= GMP_LIMB_BITS;
|
||||
rp[rn++] = limb;
|
||||
/* Next line is correct also if shift == 0,
|
||||
bits == 8, and mp_limb_t == unsigned char. */
|
||||
limb = (unsigned int) sp[sn] >> (bits - shift);
|
||||
}
|
||||
}
|
||||
rn = mpn_normalized_size (rp, rn);
|
||||
if (limb != 0)
|
||||
rp[rn++] = limb;
|
||||
else
|
||||
rn = mpn_normalized_size (rp, rn);
|
||||
return rn;
|
||||
}
|
||||
|
||||
@ -1417,14 +1438,14 @@ mpz_init2 (mpz_t r, mp_bitcnt_t bits)
|
||||
|
||||
r->_mp_alloc = rn;
|
||||
r->_mp_size = 0;
|
||||
r->_mp_d = gmp_xalloc_limbs (rn);
|
||||
r->_mp_d = gmp_alloc_limbs (rn);
|
||||
}
|
||||
|
||||
void
|
||||
mpz_clear (mpz_t r)
|
||||
{
|
||||
if (r->_mp_alloc)
|
||||
gmp_free (r->_mp_d);
|
||||
gmp_free_limbs (r->_mp_d, r->_mp_alloc);
|
||||
}
|
||||
|
||||
static mp_ptr
|
||||
@ -1433,9 +1454,9 @@ mpz_realloc (mpz_t r, mp_size_t size)
|
||||
size = GMP_MAX (size, 1);
|
||||
|
||||
if (r->_mp_alloc)
|
||||
r->_mp_d = gmp_xrealloc_limbs (r->_mp_d, size);
|
||||
r->_mp_d = gmp_realloc_limbs (r->_mp_d, r->_mp_alloc, size);
|
||||
else
|
||||
r->_mp_d = gmp_xalloc_limbs (size);
|
||||
r->_mp_d = gmp_alloc_limbs (size);
|
||||
r->_mp_alloc = size;
|
||||
|
||||
if (GMP_ABS (r->_mp_size) > size)
|
||||
@ -1530,8 +1551,7 @@ mpz_init_set (mpz_t r, const mpz_t x)
|
||||
int
|
||||
mpz_fits_slong_p (const mpz_t u)
|
||||
{
|
||||
return (LONG_MAX + LONG_MIN == 0 || mpz_cmp_ui (u, LONG_MAX) <= 0) &&
|
||||
mpz_cmpabs_ui (u, GMP_NEG_CAST (unsigned long int, LONG_MIN)) <= 0;
|
||||
return mpz_cmp_si (u, LONG_MAX) <= 0 && mpz_cmp_si (u, LONG_MIN) >= 0;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -1554,6 +1574,30 @@ mpz_fits_ulong_p (const mpz_t u)
|
||||
return us >= 0 && mpn_absfits_ulong_p (u->_mp_d, us);
|
||||
}
|
||||
|
||||
int
|
||||
mpz_fits_sint_p (const mpz_t u)
|
||||
{
|
||||
return mpz_cmp_si (u, INT_MAX) <= 0 && mpz_cmp_si (u, INT_MIN) >= 0;
|
||||
}
|
||||
|
||||
int
|
||||
mpz_fits_uint_p (const mpz_t u)
|
||||
{
|
||||
return u->_mp_size >= 0 && mpz_cmpabs_ui (u, UINT_MAX) <= 0;
|
||||
}
|
||||
|
||||
int
|
||||
mpz_fits_sshort_p (const mpz_t u)
|
||||
{
|
||||
return mpz_cmp_si (u, SHRT_MAX) <= 0 && mpz_cmp_si (u, SHRT_MIN) >= 0;
|
||||
}
|
||||
|
||||
int
|
||||
mpz_fits_ushort_p (const mpz_t u)
|
||||
{
|
||||
return u->_mp_size >= 0 && mpz_cmpabs_ui (u, USHRT_MAX) <= 0;
|
||||
}
|
||||
|
||||
long int
|
||||
mpz_get_si (const mpz_t u)
|
||||
{
|
||||
@ -1891,9 +1935,8 @@ mpz_neg (mpz_t r, const mpz_t u)
|
||||
void
|
||||
mpz_swap (mpz_t u, mpz_t v)
|
||||
{
|
||||
MP_SIZE_T_SWAP (u->_mp_size, v->_mp_size);
|
||||
MP_SIZE_T_SWAP (u->_mp_alloc, v->_mp_alloc);
|
||||
MP_PTR_SWAP (u->_mp_d, v->_mp_d);
|
||||
MPN_PTR_SWAP (u->_mp_d, u->_mp_size, v->_mp_d, v->_mp_size);
|
||||
}
|
||||
|
||||
|
||||
@ -2676,7 +2719,7 @@ mpz_make_odd (mpz_t r)
|
||||
|
||||
assert (r->_mp_size > 0);
|
||||
/* Count trailing zeros, equivalent to mpn_scan1, because we know that there is a 1 */
|
||||
shift = mpn_common_scan (r->_mp_d[0], 0, r->_mp_d, 0, 0);
|
||||
shift = mpn_scan1 (r->_mp_d, 0);
|
||||
mpz_tdiv_q_2exp (r, r, shift);
|
||||
|
||||
return shift;
|
||||
@ -2733,9 +2776,13 @@ mpz_gcd (mpz_t g, const mpz_t u, const mpz_t v)
|
||||
|
||||
if (tv->_mp_size == 1)
|
||||
{
|
||||
mp_limb_t vl = tv->_mp_d[0];
|
||||
mp_limb_t ul = mpz_tdiv_ui (tu, vl);
|
||||
mpz_set_ui (g, mpn_gcd_11 (ul, vl));
|
||||
mp_limb_t *gp;
|
||||
|
||||
mpz_tdiv_r (tu, tu, tv);
|
||||
gp = MPZ_REALLOC (g, 1); /* gp = mpz_limbs_modify (g, 1); */
|
||||
*gp = mpn_gcd_11 (tu->_mp_d[0], tv->_mp_d[0]);
|
||||
|
||||
g->_mp_size = *gp != 0; /* mpz_limbs_finish (g, 1); */
|
||||
break;
|
||||
}
|
||||
mpz_sub (tu, tu, tv);
|
||||
@ -2824,7 +2871,6 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v)
|
||||
* s0 = 0, s1 = 2^vz
|
||||
*/
|
||||
|
||||
mpz_setbit (t0, uz);
|
||||
mpz_tdiv_qr (t1, tu, tu, tv);
|
||||
mpz_mul_2exp (t1, t1, uz);
|
||||
|
||||
@ -2835,8 +2881,7 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v)
|
||||
{
|
||||
mp_bitcnt_t shift;
|
||||
shift = mpz_make_odd (tu);
|
||||
mpz_mul_2exp (t0, t0, shift);
|
||||
mpz_mul_2exp (s0, s0, shift);
|
||||
mpz_setbit (t0, uz + shift);
|
||||
power += shift;
|
||||
|
||||
for (;;)
|
||||
@ -2874,6 +2919,8 @@ mpz_gcdext (mpz_t g, mpz_t s, mpz_t t, const mpz_t u, const mpz_t v)
|
||||
power += shift;
|
||||
}
|
||||
}
|
||||
else
|
||||
mpz_setbit (t0, uz);
|
||||
|
||||
/* Now tv = odd part of gcd, and -s0 and t0 are corresponding
|
||||
cofactors. */
|
||||
@ -3048,7 +3095,7 @@ mpz_powm (mpz_t r, const mpz_t b, const mpz_t e, const mpz_t m)
|
||||
|
||||
if (en == 0)
|
||||
{
|
||||
mpz_set_ui (r, 1);
|
||||
mpz_set_ui (r, mpz_cmpabs_ui (m, 1));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3062,7 +3109,7 @@ mpz_powm (mpz_t r, const mpz_t b, const mpz_t e, const mpz_t m)
|
||||
one, using a *normalized* m. */
|
||||
minv.shift = 0;
|
||||
|
||||
tp = gmp_xalloc_limbs (mn);
|
||||
tp = gmp_alloc_limbs (mn);
|
||||
gmp_assert_nocarry (mpn_lshift (tp, mp, mn, shift));
|
||||
mp = tp;
|
||||
}
|
||||
@ -3128,7 +3175,7 @@ mpz_powm (mpz_t r, const mpz_t b, const mpz_t e, const mpz_t m)
|
||||
tr->_mp_size = mpn_normalized_size (tr->_mp_d, mn);
|
||||
}
|
||||
if (tp)
|
||||
gmp_free (tp);
|
||||
gmp_free_limbs (tp, mn);
|
||||
|
||||
mpz_swap (r, tr);
|
||||
mpz_clear (tr);
|
||||
@ -3150,6 +3197,7 @@ void
|
||||
mpz_rootrem (mpz_t x, mpz_t r, const mpz_t y, unsigned long z)
|
||||
{
|
||||
int sgn;
|
||||
mp_bitcnt_t bc;
|
||||
mpz_t t, u;
|
||||
|
||||
sgn = y->_mp_size < 0;
|
||||
@ -3168,7 +3216,8 @@ mpz_rootrem (mpz_t x, mpz_t r, const mpz_t y, unsigned long z)
|
||||
|
||||
mpz_init (u);
|
||||
mpz_init (t);
|
||||
mpz_setbit (t, mpz_sizeinbase (y, 2) / z + 1);
|
||||
bc = (mpz_sizeinbase (y, 2) - 1) / z + 1;
|
||||
mpz_setbit (t, bc);
|
||||
|
||||
if (z == 2) /* simplify sqrt loop: z-1 == 1 */
|
||||
do {
|
||||
@ -3339,13 +3388,15 @@ gmp_jacobi_coprime (mp_limb_t a, mp_limb_t b)
|
||||
gmp_ctz(c, a);
|
||||
a >>= 1;
|
||||
|
||||
do
|
||||
for (;;)
|
||||
{
|
||||
a >>= c;
|
||||
/* (2/b) = -1 if b = 3 or 5 mod 8 */
|
||||
bit ^= c & (b ^ (b >> 1));
|
||||
if (a < b)
|
||||
{
|
||||
if (a == 0)
|
||||
return bit & 1 ? -1 : 1;
|
||||
bit ^= a & b;
|
||||
a = b - a;
|
||||
b -= a;
|
||||
@ -3359,9 +3410,6 @@ gmp_jacobi_coprime (mp_limb_t a, mp_limb_t b)
|
||||
gmp_ctz(c, a);
|
||||
++c;
|
||||
}
|
||||
while (b > 0);
|
||||
|
||||
return bit & 1 ? -1 : 1;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -3407,7 +3455,7 @@ gmp_lucas_mod (mpz_t V, mpz_t Qk, long Q,
|
||||
gmp_lucas_step_k_2k (V, Qk, n);
|
||||
|
||||
/* A step k->k+1 is performed if the bit in $n$ is 1 */
|
||||
/* mpz_tstbit(n,bs) or the the bit is 0 in $n$ but */
|
||||
/* mpz_tstbit(n,bs) or the bit is 0 in $n$ but */
|
||||
/* should be 1 in $n+1$ (bs == b0) */
|
||||
if (b0 == bs || mpz_tstbit (n, bs))
|
||||
{
|
||||
@ -3476,7 +3524,8 @@ gmp_stronglucas (const mpz_t x, mpz_t Qk)
|
||||
mpz_init (V);
|
||||
|
||||
/* n-(D/n) = n+1 = d*2^{b0}, with d = (n>>b0) | 1 */
|
||||
b0 = mpz_scan0 (n, 0);
|
||||
b0 = mpn_common_scan (~ n->_mp_d[0], 0, n->_mp_d, n->_mp_size, GMP_LIMB_MAX);
|
||||
/* b0 = mpz_scan0 (n, 0); */
|
||||
|
||||
/* D= P^2 - 4Q; P = 1; Q = (1-D)/4 */
|
||||
Q = (D & 2) ? (long) (D >> 2) + 1 : -(long) (D >> 2);
|
||||
@ -3508,11 +3557,6 @@ gmp_millerrabin (const mpz_t n, const mpz_t nm1, mpz_t y,
|
||||
mpz_powm_ui (y, y, 2, n);
|
||||
if (mpz_cmp (y, nm1) == 0)
|
||||
return 1;
|
||||
/* y == 1 means that the previous y was a non-trivial square root
|
||||
of 1 (mod n). y == 0 means that n is a power of the base.
|
||||
In either case, n is not prime. */
|
||||
if (mpz_cmp_ui (y, 1) <= 0)
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -3558,7 +3602,8 @@ mpz_probab_prime_p (const mpz_t n, int reps)
|
||||
/* Find q and k, where q is odd and n = 1 + 2**k * q. */
|
||||
mpz_abs (nm1, n);
|
||||
nm1->_mp_d[0] -= 1;
|
||||
k = mpz_scan1 (nm1, 0);
|
||||
/* Count trailing zeros, equivalent to mpn_scan1, because we know that there is a 1 */
|
||||
k = mpn_scan1 (nm1->_mp_d, 0);
|
||||
mpz_tdiv_q_2exp (q, nm1, k);
|
||||
|
||||
/* BPSW test */
|
||||
@ -4133,7 +4178,7 @@ mpz_scan0 (const mpz_t u, mp_bitcnt_t starting_bit)
|
||||
size_t
|
||||
mpz_sizeinbase (const mpz_t u, int base)
|
||||
{
|
||||
mp_size_t un;
|
||||
mp_size_t un, tn;
|
||||
mp_srcptr up;
|
||||
mp_ptr tp;
|
||||
mp_bitcnt_t bits;
|
||||
@ -4166,20 +4211,21 @@ mpz_sizeinbase (const mpz_t u, int base)
|
||||
10. */
|
||||
}
|
||||
|
||||
tp = gmp_xalloc_limbs (un);
|
||||
tp = gmp_alloc_limbs (un);
|
||||
mpn_copyi (tp, up, un);
|
||||
mpn_div_qr_1_invert (&bi, base);
|
||||
|
||||
tn = un;
|
||||
ndigits = 0;
|
||||
do
|
||||
{
|
||||
ndigits++;
|
||||
mpn_div_qr_1_preinv (tp, tp, un, &bi);
|
||||
un -= (tp[un-1] == 0);
|
||||
mpn_div_qr_1_preinv (tp, tp, tn, &bi);
|
||||
tn -= (tp[tn-1] == 0);
|
||||
}
|
||||
while (un > 0);
|
||||
while (tn > 0);
|
||||
|
||||
gmp_free (tp);
|
||||
gmp_free_limbs (tp, un);
|
||||
return ndigits;
|
||||
}
|
||||
|
||||
@ -4189,7 +4235,7 @@ mpz_get_str (char *sp, int base, const mpz_t u)
|
||||
unsigned bits;
|
||||
const char *digits;
|
||||
mp_size_t un;
|
||||
size_t i, sn;
|
||||
size_t i, sn, osn;
|
||||
|
||||
digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
if (base > 1)
|
||||
@ -4210,15 +4256,19 @@ mpz_get_str (char *sp, int base, const mpz_t u)
|
||||
|
||||
sn = 1 + mpz_sizeinbase (u, base);
|
||||
if (!sp)
|
||||
sp = (char *) gmp_xalloc (1 + sn);
|
||||
|
||||
{
|
||||
osn = 1 + sn;
|
||||
sp = (char *) gmp_alloc (osn);
|
||||
}
|
||||
else
|
||||
osn = 0;
|
||||
un = GMP_ABS (u->_mp_size);
|
||||
|
||||
if (un == 0)
|
||||
{
|
||||
sp[0] = '0';
|
||||
sp[1] = '\0';
|
||||
return sp;
|
||||
sn = 1;
|
||||
goto ret;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@ -4237,17 +4287,20 @@ mpz_get_str (char *sp, int base, const mpz_t u)
|
||||
mp_ptr tp;
|
||||
|
||||
mpn_get_base_info (&info, base);
|
||||
tp = gmp_xalloc_limbs (un);
|
||||
tp = gmp_alloc_limbs (un);
|
||||
mpn_copyi (tp, u->_mp_d, un);
|
||||
|
||||
sn = i + mpn_get_str_other ((unsigned char *) sp + i, base, &info, tp, un);
|
||||
gmp_free (tp);
|
||||
gmp_free_limbs (tp, un);
|
||||
}
|
||||
|
||||
for (; i < sn; i++)
|
||||
sp[i] = digits[(unsigned char) sp[i]];
|
||||
|
||||
ret:
|
||||
sp[sn] = '\0';
|
||||
if (osn && osn != sn + 1)
|
||||
sp = (char*) gmp_realloc (sp, osn, sn + 1);
|
||||
return sp;
|
||||
}
|
||||
|
||||
@ -4257,7 +4310,7 @@ mpz_set_str (mpz_t r, const char *sp, int base)
|
||||
unsigned bits, value_of_a;
|
||||
mp_size_t rn, alloc;
|
||||
mp_ptr rp;
|
||||
size_t dn;
|
||||
size_t dn, sn;
|
||||
int sign;
|
||||
unsigned char *dp;
|
||||
|
||||
@ -4295,7 +4348,8 @@ mpz_set_str (mpz_t r, const char *sp, int base)
|
||||
r->_mp_size = 0;
|
||||
return -1;
|
||||
}
|
||||
dp = (unsigned char *) gmp_xalloc (strlen (sp));
|
||||
sn = strlen(sp);
|
||||
dp = (unsigned char *) gmp_alloc (sn);
|
||||
|
||||
value_of_a = (base > 36) ? 36 : 10;
|
||||
for (dn = 0; *sp; sp++)
|
||||
@ -4315,7 +4369,7 @@ mpz_set_str (mpz_t r, const char *sp, int base)
|
||||
|
||||
if (digit >= (unsigned) base)
|
||||
{
|
||||
gmp_free (dp);
|
||||
gmp_free (dp, sn);
|
||||
r->_mp_size = 0;
|
||||
return -1;
|
||||
}
|
||||
@ -4325,7 +4379,7 @@ mpz_set_str (mpz_t r, const char *sp, int base)
|
||||
|
||||
if (!dn)
|
||||
{
|
||||
gmp_free (dp);
|
||||
gmp_free (dp, sn);
|
||||
r->_mp_size = 0;
|
||||
return -1;
|
||||
}
|
||||
@ -4349,7 +4403,7 @@ mpz_set_str (mpz_t r, const char *sp, int base)
|
||||
rn -= rp[rn-1] == 0;
|
||||
}
|
||||
assert (rn <= alloc);
|
||||
gmp_free (dp);
|
||||
gmp_free (dp, sn);
|
||||
|
||||
r->_mp_size = sign ? - rn : rn;
|
||||
|
||||
@ -4367,13 +4421,15 @@ size_t
|
||||
mpz_out_str (FILE *stream, int base, const mpz_t x)
|
||||
{
|
||||
char *str;
|
||||
size_t len;
|
||||
size_t len, n;
|
||||
|
||||
str = mpz_get_str (NULL, base, x);
|
||||
if (!str)
|
||||
return 0;
|
||||
len = strlen (str);
|
||||
len = fwrite (str, 1, len, stream);
|
||||
gmp_free (str);
|
||||
return len;
|
||||
n = fwrite (str, 1, len, stream);
|
||||
gmp_free (str, len + 1);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
@ -4462,7 +4518,7 @@ mpz_export (void *r, size_t *countp, int order, size_t size, int endian,
|
||||
mp_size_t un;
|
||||
|
||||
if (nails != 0)
|
||||
gmp_die ("mpz_import: Nails not supported.");
|
||||
gmp_die ("mpz_export: Nails not supported.");
|
||||
|
||||
assert (order == 1 || order == -1);
|
||||
assert (endian >= -1 && endian <= 1);
|
||||
@ -4477,7 +4533,7 @@ mpz_export (void *r, size_t *countp, int order, size_t size, int endian,
|
||||
ptrdiff_t word_step;
|
||||
/* The current (partial) limb. */
|
||||
mp_limb_t limb;
|
||||
/* The number of bytes left to to in this limb. */
|
||||
/* The number of bytes left to do in this limb. */
|
||||
size_t bytes;
|
||||
/* The index where the limb was read. */
|
||||
mp_size_t i;
|
||||
@ -4501,7 +4557,7 @@ mpz_export (void *r, size_t *countp, int order, size_t size, int endian,
|
||||
count = (k + (un-1) * sizeof (mp_limb_t) + size - 1) / size;
|
||||
|
||||
if (!r)
|
||||
r = gmp_xalloc (count * size);
|
||||
r = gmp_alloc (count * size);
|
||||
|
||||
if (endian == 0)
|
||||
endian = gmp_detect_endian ();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* mini-gmp, a minimalistic implementation of a GNU GMP subset.
|
||||
|
||||
Copyright 2011-2015, 2017, 2019 Free Software Foundation, Inc.
|
||||
Copyright 2011-2015, 2017, 2019-2021 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU MP Library.
|
||||
|
||||
@ -233,6 +233,10 @@ mp_bitcnt_t mpz_scan1 (const mpz_t, mp_bitcnt_t);
|
||||
|
||||
int mpz_fits_slong_p (const mpz_t);
|
||||
int mpz_fits_ulong_p (const mpz_t);
|
||||
int mpz_fits_sint_p (const mpz_t);
|
||||
int mpz_fits_uint_p (const mpz_t);
|
||||
int mpz_fits_sshort_p (const mpz_t);
|
||||
int mpz_fits_ushort_p (const mpz_t);
|
||||
long int mpz_get_si (const mpz_t);
|
||||
unsigned long int mpz_get_ui (const mpz_t);
|
||||
double mpz_get_d (const mpz_t);
|
||||
@ -280,7 +284,9 @@ int mpz_init_set_str (mpz_t, const char *, int);
|
||||
|| defined (_MSL_STDIO_H) /* Metrowerks */ \
|
||||
|| defined (_STDIO_H_INCLUDED) /* QNX4 */ \
|
||||
|| defined (_ISO_STDIO_ISO_H) /* Sun C++ */ \
|
||||
|| defined (__STDIO_LOADED) /* VMS */
|
||||
|| defined (__STDIO_LOADED) /* VMS */ \
|
||||
|| defined (_STDIO) /* HPE NonStop */ \
|
||||
|| defined (__DEFINED_FILE) /* musl */
|
||||
size_t mpz_out_str (FILE *, int, const mpz_t);
|
||||
#endif
|
||||
|
||||
|
@ -449,6 +449,11 @@
|
||||
# type: key
|
||||
# keymap_slot32 =
|
||||
|
||||
# Key for use by mods.
|
||||
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
|
||||
# type: key
|
||||
# keymap_tabb = KEY_TAB
|
||||
|
||||
# Key for toggling the display of the HUD.
|
||||
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
|
||||
# type: key
|
||||
@ -861,7 +866,7 @@
|
||||
|
||||
# Whether node texture animations should be desynchronized per mapblock.
|
||||
# type: bool
|
||||
# desynchronize_mapblock_texture_animation = true
|
||||
# desynchronize_mapblock_texture_animation = false
|
||||
|
||||
# Maximum proportion of current window to be used for hotbar.
|
||||
# Useful if there's something to be displayed right or left of hotbar.
|
||||
@ -1217,13 +1222,19 @@
|
||||
# type: bool
|
||||
# server_announce = false
|
||||
|
||||
# Announce to this serverlist.
|
||||
# Announce to this serverlist. if announce_mt flags are set this is ignored
|
||||
# when mt flags are set will be send to this url and also multicraft server list
|
||||
# type: string
|
||||
# serverlist_url = servers.multicraft.world
|
||||
# serverlist_url = servers.minetest.net
|
||||
|
||||
# Announce to MT serverlist.
|
||||
# Announce to MT serverlist and multicraft serverlist.
|
||||
# type: bool
|
||||
# announce_mt = true
|
||||
# announce_mt_url = true
|
||||
|
||||
# Announce to serverlist that gameid is minetest otehrwise send multicraft,
|
||||
# multicraft server announce alway need "multicraft" as server id, minetest ignore it
|
||||
# type: bool
|
||||
# announce_mt_id = true
|
||||
|
||||
# Remove color codes from incoming chat messages
|
||||
# Use this to stop players from being able to use color in their messages
|
||||
@ -1611,6 +1622,7 @@
|
||||
# LOOKUP_NODES_LIMIT: 16 (limits get_node call client-side to
|
||||
# csm_restriction_noderange)
|
||||
# READ_PLAYERINFO: 32 (disable get_player_names call client-side)
|
||||
# THIRD_PARTY_MODS: 256 (disable loading third-party client-provided mods)
|
||||
# type: int
|
||||
# csm_restriction_flags = 60
|
||||
|
||||
|
@ -84,6 +84,14 @@ if(ENABLE_GETTEXT)
|
||||
endif()
|
||||
set(USE_GETTEXT TRUE)
|
||||
message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}")
|
||||
# On some platforms, such as Linux with GNU libc, the gettext
|
||||
# functions are present in the C standard library and libintl
|
||||
# is not required. For other libc (uClibc-ng or musl) libintl
|
||||
# may be required.
|
||||
find_package(Intl)
|
||||
if(NOT Intl_LIBRARIES STREQUAL "")
|
||||
message(STATUS "GetText Intl : ${Intl_LIBRARIES}")
|
||||
endif()
|
||||
endif(GETTEXTLIB_FOUND)
|
||||
else()
|
||||
mark_as_advanced(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT)
|
||||
@ -179,7 +187,7 @@ if(ENABLE_POSTGRESQL)
|
||||
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
find_package("PostgreSQL")
|
||||
find_package(PostgreSQL)
|
||||
endif()
|
||||
|
||||
if(PostgreSQL_FOUND)
|
||||
@ -576,6 +584,7 @@ if(BUILD_CLIENT)
|
||||
${BZIP2_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${X11_LIBRARIES}
|
||||
${Intl_LIBRARIES}
|
||||
${SOUND_LIBRARIES}
|
||||
${SQLITE3_LIBRARY}
|
||||
${LUA_LIBRARY}
|
||||
@ -685,6 +694,7 @@ if(BUILD_SERVER)
|
||||
${ZLIB_LIBRARIES}
|
||||
${SQLITE3_LIBRARY}
|
||||
${JSON_LIBRARY}
|
||||
${Intl_LIBRARIES}
|
||||
${LUA_LIBRARY}
|
||||
${GMP_LIBRARY}
|
||||
${PLATFORM_LIBS}
|
||||
@ -879,7 +889,7 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${CMAKE_C_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS} $ENV{CFLAGS} -Wall -pipe -funroll-loops")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${RELEASE_WARNING_FLAGS} ${WARNING_FLAGS} ${OTHER_FLAGS} -Wall -pipe -funroll-loops")
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")
|
||||
else()
|
||||
@ -892,12 +902,13 @@ else()
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${MATH_FLAGS}")
|
||||
endif()
|
||||
endif(CMAKE_SYSTEM_NAME MATCHES "(Darwin|BSD|DragonFly)")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${CMAKE_CXX_FLAGS} ${OTHER_FLAGS} $ENV{CPPFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall ${WARNING_FLAGS} ${CMAKE_CXX_FLAGS} ${OTHER_FLAGS} $ENV{CPPFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS} $ENV{CPPFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_SEMIDEBUG "-g -O1 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS} $ENV{CPPFLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall ${WARNING_FLAGS} ${OTHER_FLAGS}")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} $ENV{CFLAGS} ")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS} -g")
|
||||
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_PROFILE} ${CMAKE_C_FLAGS} -O1 -g")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} ${CMAKE_C_FLAGS} $ENV{CFLAGS} -g")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_WITHDEBINFO} ${CMAKE_C_FLAGS} $ENV{CFLAGS} -g")
|
||||
|
||||
if(USE_GPROF)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg")
|
||||
|
@ -164,33 +164,35 @@ void Client::loadMods()
|
||||
scanModIntoMemory(BUILTIN_MOD_NAME, getBuiltinLuaPath());
|
||||
m_script->loadModFromMemory(BUILTIN_MOD_NAME);
|
||||
|
||||
ClientModConfiguration modconf(getClientModsLuaPath());
|
||||
m_mods = modconf.getMods();
|
||||
// complain about mods with unsatisfied dependencies
|
||||
if (!modconf.isConsistent()) {
|
||||
modconf.printUnsatisfiedModsError();
|
||||
return;
|
||||
}
|
||||
|
||||
// Print mods
|
||||
infostream << "Client loading mods: ";
|
||||
for (const ModSpec &mod : m_mods)
|
||||
infostream << mod.name << " ";
|
||||
infostream << std::endl;
|
||||
|
||||
// Load "mod" scripts
|
||||
for (const ModSpec &mod : m_mods) {
|
||||
if (!string_allowed(mod.name, MODNAME_ALLOWED_CHARS)) {
|
||||
throw ModError("Error loading mod \"" + mod.name +
|
||||
"\": Mod name does not follow naming conventions: "
|
||||
"Only characters [a-z0-9_] are allowed.");
|
||||
if (!checkCSMRestrictionFlag(CSMRestrictionFlags::CSM_RF_THIRD_PARTY_MODS)) {
|
||||
ClientModConfiguration modconf(getClientModsLuaPath());
|
||||
m_mods = modconf.getMods();
|
||||
// complain about mods with unsatisfied dependencies
|
||||
if (!modconf.isConsistent()) {
|
||||
modconf.printUnsatisfiedModsError();
|
||||
return;
|
||||
}
|
||||
scanModIntoMemory(mod.name, mod.path);
|
||||
}
|
||||
|
||||
// Run them
|
||||
for (const ModSpec &mod : m_mods)
|
||||
m_script->loadModFromMemory(mod.name);
|
||||
// Print mods
|
||||
infostream << "Client loading mods: ";
|
||||
for (const ModSpec &mod : m_mods)
|
||||
infostream << mod.name << " ";
|
||||
infostream << std::endl;
|
||||
|
||||
// Load "mod" scripts
|
||||
for (const ModSpec &mod : m_mods) {
|
||||
if (!string_allowed(mod.name, MODNAME_ALLOWED_CHARS)) {
|
||||
throw ModError("Error loading mod \"" + mod.name +
|
||||
"\": Mod name does not follow naming conventions: "
|
||||
"Only characters [a-z0-9_] are allowed.");
|
||||
}
|
||||
scanModIntoMemory(mod.name, mod.path);
|
||||
}
|
||||
|
||||
// Run them
|
||||
for (const ModSpec &mod : m_mods)
|
||||
m_script->loadModFromMemory(mod.name);
|
||||
}
|
||||
|
||||
// Mods are done loading. Unlock callbacks
|
||||
m_mods_loaded = true;
|
||||
@ -693,6 +695,40 @@ bool Client::loadMedia(const std::string &data, const std::string &filename,
|
||||
rfile->drop();
|
||||
return false;
|
||||
}
|
||||
#if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR >= 9
|
||||
float memoryMax = porting::getTotalSystemMemory() / 1024;
|
||||
if (memoryMax <= 2) {
|
||||
irr::video::ECOLOR_FORMAT format = img->getColorFormat();
|
||||
irr::video::ECOLOR_FORMAT new_format = irr::video::ECF_UNKNOWN;
|
||||
|
||||
if (format == irr::video::ECF_R8G8B8) {
|
||||
new_format = irr::video::ECF_R5G6B5;
|
||||
} else if (format == irr::video::ECF_A8R8G8B8) {
|
||||
bool can_convert = true;
|
||||
|
||||
u32 data_size = img->getImageDataSizeInBytes();
|
||||
u8 *data = (u8*) img->getData();
|
||||
for (u32 i = 0; i < data_size; i += 4) {
|
||||
u8 alpha = data[i + 3];
|
||||
if (alpha > 0 && alpha < 255) {
|
||||
can_convert = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (can_convert)
|
||||
new_format = irr::video::ECF_A1R5G5B5;
|
||||
}
|
||||
|
||||
if (new_format != irr::video::ECF_UNKNOWN) {
|
||||
core::dimension2du dimensions = img->getDimension();
|
||||
irr::video::IImage* converted_img = vdrv->createImage(new_format, dimensions);
|
||||
img->copyTo(converted_img, core::position2d<s32>(0, 0));
|
||||
img->drop();
|
||||
img = converted_img;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
m_tsrc->insertSourceImage(filename, img);
|
||||
img->drop();
|
||||
|
@ -1420,10 +1420,15 @@ void MapblockMeshGenerator::drawMeshNode()
|
||||
// Convert wallmounted to 6dfacedir.
|
||||
// When cache enabled, it is already converted.
|
||||
facedir = n.getWallMounted(nodedef);
|
||||
if (!enable_mesh_cache)
|
||||
facedir = wallmounted_to_facedir[facedir];
|
||||
if (!enable_mesh_cache) {
|
||||
facedir = wallmountedToFacedir(facedir);
|
||||
}
|
||||
}
|
||||
|
||||
// f->mesh_ptr has 24 elements
|
||||
if (facedir > 23)
|
||||
facedir = 0;
|
||||
|
||||
if (!data->m_smooth_lighting && f->mesh_ptr[facedir]) {
|
||||
// use cached meshes
|
||||
private_mesh = false;
|
||||
|
@ -819,7 +819,7 @@ protected:
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
void handleAndroidChatInput();
|
||||
void handleTouchChatInput();
|
||||
#endif
|
||||
|
||||
private:
|
||||
@ -1530,6 +1530,8 @@ bool Game::connectToServer(const GameStartData &start_data,
|
||||
Wait for server to accept connection
|
||||
*/
|
||||
|
||||
bool result = true;
|
||||
|
||||
try {
|
||||
input->clear();
|
||||
|
||||
@ -1539,7 +1541,7 @@ bool Game::connectToServer(const GameStartData &start_data,
|
||||
|
||||
fps_control.last_time = RenderingEngine::get_timer_time();
|
||||
|
||||
while (RenderingEngine::run()) {
|
||||
while ((result = RenderingEngine::run())) {
|
||||
|
||||
limitFps(&fps_control, &dtime);
|
||||
|
||||
@ -1603,7 +1605,7 @@ bool Game::connectToServer(const GameStartData &start_data,
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Game::getServerContent(bool *aborted)
|
||||
@ -1615,7 +1617,8 @@ bool Game::getServerContent(bool *aborted)
|
||||
|
||||
fps_control.last_time = RenderingEngine::get_timer_time();
|
||||
|
||||
while (RenderingEngine::run()) {
|
||||
bool result = true;
|
||||
while ((result = RenderingEngine::run())) {
|
||||
|
||||
limitFps(&fps_control, &dtime);
|
||||
|
||||
@ -1691,7 +1694,7 @@ bool Game::getServerContent(bool *aborted)
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -1873,6 +1876,14 @@ void Game::processUserInput(f32 dtime)
|
||||
g_touchscreengui->hide();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
if (porting::isInputDialogActive() && porting::getInputDialogOwner() == "chat") {
|
||||
input->clear();
|
||||
g_touchscreengui->hide();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TOUCHSCREENGUI
|
||||
else if (g_touchscreengui) {
|
||||
/* on touchscreengui step may generate own input events which ain't
|
||||
@ -1889,13 +1900,11 @@ void Game::processUserInput(f32 dtime)
|
||||
input->step(dtime);
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
if (!porting::hasRealKeyboard()) {
|
||||
auto formspec = m_game_ui->getFormspecGUI();
|
||||
if (formspec)
|
||||
formspec->getAndroidUIInput();
|
||||
else
|
||||
handleAndroidChatInput();
|
||||
}
|
||||
handleTouchChatInput();
|
||||
|
||||
auto formspec = m_game_ui->getFormspecGUI();
|
||||
if (formspec)
|
||||
formspec->getTouchUIInput();
|
||||
#endif
|
||||
|
||||
bool doubletap_jump = m_cache_doubletap_jump;
|
||||
@ -1923,9 +1932,6 @@ void Game::processKeyInput()
|
||||
} else if (wasKeyDown(KeyType::INVENTORY)) {
|
||||
openInventory();
|
||||
} else if (input->cancelPressed()) {
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
gui_chat_console->setAndroidChatOpen(false);
|
||||
#endif
|
||||
if (!gui_chat_console->isOpenInhibited()) {
|
||||
showPauseMenu();
|
||||
}
|
||||
@ -2137,21 +2143,21 @@ void Game::openConsole(float scale, const wchar_t *line)
|
||||
{
|
||||
assert(scale > 0.0f && scale <= 1.0f);
|
||||
|
||||
if (gui_chat_console->getAndroidChatOpen())
|
||||
if (gui_chat_console->isOpenInhibited())
|
||||
return;
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
if (porting::isInputDialogActive())
|
||||
return;
|
||||
|
||||
if (!porting::hasRealKeyboard()) {
|
||||
porting::showInputDialog("", "", 2);
|
||||
gui_chat_console->setAndroidChatOpen(true);
|
||||
porting::showInputDialog("", "", 2, "chat");
|
||||
}
|
||||
|
||||
if (!RenderingEngine::isTablet())
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (gui_chat_console->isOpenInhibited())
|
||||
return;
|
||||
gui_chat_console->openConsole(scale);
|
||||
if (line) {
|
||||
gui_chat_console->setCloseOnEnter(true);
|
||||
@ -2160,16 +2166,21 @@ void Game::openConsole(float scale, const wchar_t *line)
|
||||
}
|
||||
|
||||
#if defined(__ANDROID__) || defined(__IOS__)
|
||||
void Game::handleAndroidChatInput()
|
||||
void Game::handleTouchChatInput()
|
||||
{
|
||||
if (gui_chat_console->getAndroidChatOpen() &&
|
||||
porting::getInputDialogState() == 0) {
|
||||
if (porting::getInputDialogOwner() == "chat" &&
|
||||
!porting::isInputDialogActive()) {
|
||||
std::string text = porting::getInputDialogValue();
|
||||
client->typeChatMessage(utf8_to_wide(text));
|
||||
gui_chat_console->setAndroidChatOpen(false);
|
||||
if (!text.empty() && gui_chat_console->isOpen()) {
|
||||
gui_chat_console->closeConsole();
|
||||
}
|
||||
#ifdef HAVE_TOUCHSCREENGUI
|
||||
if (!gui_chat_console->isOpen() && !isMenuActive()) {
|
||||
if (g_touchscreengui && g_touchscreengui->isActive())
|
||||
g_touchscreengui->show();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -2519,6 +2530,7 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
|
||||
isKeyDown(KeyType::SPECIAL1),
|
||||
isKeyDown(KeyType::SNEAK),
|
||||
isKeyDown(KeyType::ZOOM),
|
||||
isKeyDown(KeyType::TABB),
|
||||
isKeyDown(KeyType::DIG),
|
||||
isKeyDown(KeyType::PLACE),
|
||||
cam.camera_pitch,
|
||||
@ -2542,7 +2554,8 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
|
||||
( (u32)(isKeyDown(KeyType::SNEAK) & 0x1) << 6) |
|
||||
( (u32)(isKeyDown(KeyType::DIG) & 0x1) << 7) |
|
||||
( (u32)(isKeyDown(KeyType::PLACE) & 0x1) << 8) |
|
||||
( (u32)(isKeyDown(KeyType::ZOOM) & 0x1) << 9)
|
||||
( (u32)(isKeyDown(KeyType::ZOOM) & 0x1) << 9) |
|
||||
( (u32)(isKeyDown(KeyType::TABB) & 0x1) << 10)
|
||||
);
|
||||
|
||||
LocalPlayer *player = client->getEnv().getLocalPlayer();
|
||||
|
@ -74,14 +74,14 @@ void GameUI::init(Client *client)
|
||||
// At the middle of the screen
|
||||
// Object infos are shown in this
|
||||
u32 chat_font_height = m_guitext_chat->getActiveFont()->getDimension(L"Ay").Height;
|
||||
float scale = 1.0f;
|
||||
#if defined(__ANDROID__) || defined(__APPLE__)
|
||||
scale = RenderingEngine::getDisplayDensity() * client->getHudScaling() * 0.5f;
|
||||
#endif
|
||||
v2u32 screensize = RenderingEngine::get_instance()->getWindowSize();
|
||||
s32 text_height = g_fontengine->getTextHeight() * 6;
|
||||
s32 top_y = (screensize.Y - text_height) / 2;
|
||||
s32 horiz_offset = 100 + client->getRoundScreen();
|
||||
|
||||
m_guitext_info = gui::StaticText::add(guienv, L"",
|
||||
core::rect<s32>(0, 0, 400, g_fontengine->getTextHeight() * 6) +
|
||||
v2s32(100 + client->getRoundScreen(),
|
||||
chat_font_height * (g_settings->getU16("recent_chat_messages") + 3) * scale),
|
||||
core::rect<s32>(horiz_offset, top_y,
|
||||
horiz_offset + 400, top_y + text_height),
|
||||
false, true, guiroot);
|
||||
|
||||
// Status text (displays info when showing and hiding GUI stuff, etc.)
|
||||
|
@ -129,7 +129,7 @@ video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver,
|
||||
#endif
|
||||
|
||||
// Convert the scaled image back into a texture.
|
||||
scaled = driver->addTexture(scalename, destimg, NULL);
|
||||
scaled = driver->addTexture(scalename, destimg, NULL); // irr 1.8
|
||||
destimg->drop();
|
||||
g_txrCache[scalename] = scaled;
|
||||
|
||||
|