Compare commits

...

59 Commits

Author SHA1 Message Date
c2d81201d2 updated game 2023-05-03 12:11:19 +02:00
732a993494 small sussy changes 2023-05-02 18:44:30 +02:00
153b0666f8 increased default fov to 90 degrees 2023-04-29 21:48:53 +02:00
b42a5e9673 aaaaaaaaaaa sus idk how to name this commit 2023-04-29 21:46:33 +02:00
2e70abf1e6 changed ip of official sussycraft server to "coming soon!" 2023-04-29 18:16:01 +02:00
605f3306bf darkness light level changed again 2023-04-26 21:28:08 +02:00
03845e630d updated sussycraft 2023-04-26 20:16:28 +02:00
4ef39ff9b6 disabled infinite render distance option on key press 2023-04-26 18:08:09 +02:00
813902662a updated sussycrraft game 2023-04-26 15:23:29 +02:00
19fa51c570 new gui colors, multiplayer menu modified 2023-04-25 23:24:58 +02:00
25ecab3ad8 sussy bigger changes 2023-04-25 00:59:13 +02:00
458dc9dc15 small sussy changes 2023-04-24 01:47:16 +02:00
c1df5d87f3 new remastered logo and small sussy changes 2023-04-24 00:38:23 +02:00
f5428c870a updated sussy craft game 2023-04-17 22:32:07 +02:00
e05058e81e updated sussy craft 2023-04-17 22:28:42 +02:00
163fc1c8a7 many little sussy chanes 2023-04-13 00:13:37 +02:00
322e10342c disabled new minetest version check MUAHAHAHHAHAHA 2023-04-12 23:35:48 +02:00
0e7406d643 enabled multiplayer tab and changed pc font size to 26 2023-04-12 20:20:20 +02:00
e2581753e0 Update 'README.md' 2023-03-19 12:50:06 +00:00
aa85f3ecaf Update 'README.md' 2023-03-19 12:49:42 +00:00
98766a1f2d d 2023-03-19 12:45:39 +00:00
daae0e8e8c Update 'README.md' 2023-03-19 12:43:46 +00:00
342d05e576 Update 'README.md' 2023-03-19 12:38:20 +00:00
043d66e39c FIXED CRITICAL INSTANT CRASH ERROR IN tab_about.lua 2023-03-05 00:05:58 +01:00
60b4175aac version updated to 1.1.1 and little sussy fix to version code increamenting script 2023-03-04 23:27:19 +01:00
a6ea6a1a62 fixed fileprovider conflict with original minetest on android devices 2023-03-04 23:14:47 +01:00
58bada6236 MINETEST GUI SYSTEM SUCKS!!!!!!! AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2023-03-02 23:31:12 +01:00
3978afd8c2 AAAAAAA TOO MANYYY COMMITS 2023-03-02 17:10:20 +01:00
8ddc44ccc5 sussy baka idk sus: 2023-03-02 17:09:38 +01:00
8e86d96da0 AAAAAAAAAAAA 2023-03-02 17:06:58 +01:00
643f5172c8 sus fix 2023-03-02 17:06:33 +01:00
edcf2c71ae even more sus 2023-03-02 17:05:28 +01:00
0001667902 sus 2023-03-02 17:04:36 +01:00
4eba8a044a added overcomplicated script that increments version code in android/build.gradle automaticaly 2023-03-02 16:56:42 +01:00
2b72ec963d reverted back the newest version of sussycraft submodule 2023-03-01 16:05:36 +01:00
86e3962260 mo' bullcrap 2023-02-28 22:41:21 -05:00
37125272d9 Updated Android verSSion code 2023-02-28 16:42:23 -05:00
0fdfae6e23 small sussy changes to about tab 2023-02-28 18:56:53 +01:00
2a29c45ce5 unzipservice code cleanup. does not affect code functionality 2023-02-27 14:58:09 +01:00
11ec9c45ce fixed instant crash on new android versions 2023-02-27 14:54:45 +01:00
2e4198eb2b version numbers in about tab are now correct 2023-02-26 21:15:22 +01:00
MCL Software Official
5b329fc179 Update version to 43 2023-02-26 12:49:29 -05:00
b3c1773b67 fixed ''Zip Path Traversal Vulnerability'' 2023-02-26 11:20:01 +01:00
013f0563a8 some sussy file gradle-wrapper.properties changed after gradle update chages. idk if to commit it sus 2023-02-24 14:10:41 +01:00
ee92d30eda changed capitalized project name from ''Minetest'' to ''SussyCraft'' 2023-02-24 14:09:13 +01:00
MCL Software Official
9f0b3bb8e6 Update SDK version to 31 2023-02-24 07:09:52 -05:00
MCL Software Official
cd54bbabcf "Xtreem" improvements by MCL Software 2023-02-23 17:04:02 -05:00
bdd5308e52 updated SussyCraft submodule 2023-02-23 20:58:59 +01:00
b161a2993f about tab window is now wideeeeeeeeeer 2023-02-23 20:39:10 +01:00
3e653ee166 changed size of privacy policy and discord buttons 2023-02-23 19:27:29 +01:00
d074c487bc changed font size to 21 and ''< Back to Settings page'' button size 2023-02-23 19:18:10 +01:00
861076cd49 modified about tab buttons 2023-02-23 18:06:59 +01:00
Kacper Kostka
21c2c6c2a3 d 2023-02-23 17:30:38 +01:00
Kacper Kostka
a5e59139f0 Merge branch 'master' of http://git.cubesoftware.xyz:20524/Looki2000/sussycraft-engine 2023-02-23 17:11:06 +01:00
Kacper Kostka
99121a0a03 fix 2023-02-23 17:10:51 +01:00
55b750c446 revert 274977b267
revert changed default touchscreen_threshold to 10
2023-02-23 16:08:18 +00:00
Kacper Kostka
68e5f9525e fixed conflicts 2023-02-23 17:00:43 +01:00
Kacper Kostka
2eafb395a0 Discord Button Added and changed the size of the buttons 2023-02-23 16:57:59 +01:00
Kacper Kostka
2a86ec6734 Discord Button Added and changed the size of the buttons 2023-02-23 16:57:33 +01:00
33 changed files with 432 additions and 246 deletions

View File

@@ -9,7 +9,7 @@ endif()
# This can be read from ${PROJECT_NAME} after project() is called # This can be read from ${PROJECT_NAME} after project() is called
project(minetest) project(minetest)
set(PROJECT_NAME_CAPITALIZED "Minetest") set(PROJECT_NAME_CAPITALIZED "SussyCraft")
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
@@ -17,9 +17,9 @@ set(GCC_MINIMUM_VERSION "5.1")
set(CLANG_MINIMUM_VERSION "3.5") set(CLANG_MINIMUM_VERSION "3.5")
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing # Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
set(VERSION_MAJOR 5) set(VERSION_MAJOR 1)
set(VERSION_MINOR 6) set(VERSION_MINOR 2)
set(VERSION_PATCH 1) set(VERSION_PATCH 0)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string") set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases # Change to false for releases

View File

@@ -1,7 +1,30 @@
Minetest fork for SussyCraft ~~Minetest fork for SussyCraft~~ SussyCraft Engine
============================ ============================
This repository is a fork of the Minetest game engine that was modified especially for SussyCraft. Bottom part of this README is the original README from the Minetest repository. JermaSus will eat you if you don't use this fork!\
⠀⠀⠀⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌\
⠀⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌\
⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌\
⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪\
⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡\
⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐\
⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔\
⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘\
⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎\
⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗\
⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷\
⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟\
⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰\
⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊\
⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌\
⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁\
⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌⠀\
⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀⠀\
⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟\
⢀⢂⢑⠀⡂⡃⠅⠊⢄⢑⠠⠑⢕⢕⢝⢮⢺⢕⢟⢮⢊⢢⢱⢄⠃⣇⣞⢞⣞⢾\
⢀⠢⡑⡀⢂⢊⠠⠁⡂⡐⠀⠅⡈⠪⠪⠪⠣⠫⠑⡁⢔⠕⣜⣜⢦⡰⡎⡯⡾⡽
This repository is a fork of the Minetest game engine that was modified especially for SussyCraft. Bottom part of this README is a modified README from the Minetest repository.
Minetest Minetest
======== ========
@@ -17,8 +40,8 @@ and contributors (see source file comments and the version control log)
In case you downloaded the source code In case you downloaded the source code
-------------------------------------- --------------------------------------
If you downloaded the Minetest Engine source code in which this file is If you downloaded the SuusyCraft Engine source code in which this file is
contained, you probably want to download the [Minetest Game](https://github.com/minetest/minetest_game/) contained, you probably want to download the [SussyCraft game](http://git.cubesoftware.xyz:20524/kacperks/SussyCraft) (it's a submodule)
project too. See its README.txt for more information. project too. See its README.txt for more information.
Table of Contents Table of Contents

View File

@@ -1,12 +1,12 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 30 compileSdkVersion 31
buildToolsVersion '30.0.3' buildToolsVersion '30.0.3'
ndkVersion "$ndk_version" ndkVersion "$ndk_version"
defaultConfig { defaultConfig {
applicationId 'xyz.cubesoftware.sussycraft' applicationId 'xyz.cubesoftware.sussycraft'
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 31
versionName "${versionMajor}.${versionMinor}.${versionPatch}" versionName "${versionMajor}.${versionMinor}.${versionPatch}"
versionCode project.versionCode versionCode project.versionCode
} }

View File

@@ -62,7 +62,7 @@
<provider <provider
android:name="androidx.core.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="net.minetest.minetest.fileprovider" android:authorities="xyz.cubesoftware.sussycraft.fileprovider"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:exported="false"> android:exported="false">
<meta-data <meta-data

View File

@@ -45,6 +45,7 @@ import java.util.Objects;
// Native code finds these methods by name (see porting_android.cpp). // Native code finds these methods by name (see porting_android.cpp).
// This annotation prevents the minifier/Proguard from mangling them. // This annotation prevents the minifier/Proguard from mangling them.
@Keep @Keep
@SuppressWarnings("unused")
public class GameActivity extends NativeActivity { public class GameActivity extends NativeActivity {
static { static {
System.loadLibrary("c++_shared"); System.loadLibrary("c++_shared");
@@ -194,7 +195,7 @@ public class GameActivity extends NativeActivity {
return; return;
} }
Uri fileUri = FileProvider.getUriForFile(this, "net.minetest.minetest.fileprovider", file); Uri fileUri = FileProvider.getUriForFile(this, "xyz.cubesoftware.sussycraft.fileprovider", file);
Intent intent = new Intent(Intent.ACTION_SEND, fileUri); Intent intent = new Intent(Intent.ACTION_SEND, fileUri);
intent.setDataAndType(fileUri, getContentResolver().getType(fileUri)); intent.setDataAndType(fileUri, getContentResolver().getType(fileUri));

View File

@@ -127,8 +127,12 @@ public class MainActivity extends AppCompatActivity {
} }
@Override @Override
public void onRequestPermissionsResult(int requestCode, public void onRequestPermissionsResult(
@NonNull String[] permissions, @NonNull int[] grantResults) { int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults
) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == PERMISSIONS) { if (requestCode == PERMISSIONS) {
for (int grantResult : grantResults) { for (int grantResult : grantResults) {
if (grantResult != PackageManager.PERMISSION_GRANTED) { if (grantResult != PackageManager.PERMISSION_GRANTED) {

View File

@@ -29,10 +29,10 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import java.io.File; import java.io.File;
@@ -77,9 +77,6 @@ public class UnzipService extends IntentService {
try { try {
setIsRunning(true); setIsRunning(true);
File userDataDirectory = Utils.getUserDataDirectory(this); File userDataDirectory = Utils.getUserDataDirectory(this);
if (userDataDirectory == null) {
throw new IOException("Unable to find user data directory");
}
try (InputStream in = this.getAssets().open(zipFile.getName())) { try (InputStream in = this.getAssets().open(zipFile.getName())) {
try (OutputStream out = new FileOutputStream(zipFile)) { try (OutputStream out = new FileOutputStream(zipFile)) {
@@ -98,7 +95,9 @@ public class UnzipService extends IntentService {
failureMessage = e.getLocalizedMessage(); failureMessage = e.getLocalizedMessage();
} finally { } finally {
setIsRunning(false); setIsRunning(false);
zipFile.delete(); if (!zipFile.delete()) {
Log.w("UnzipService", "Minetest installation ZIP cannot be deleted");
}
} }
} }
@@ -131,8 +130,12 @@ public class UnzipService extends IntentService {
Intent notificationIntent = new Intent(this, MainActivity.class); Intent notificationIntent = new Intent(this, MainActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP); | Intent.FLAG_ACTIVITY_SINGLE_TOP);
int pendingIntentFlag = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntentFlag = PendingIntent.FLAG_MUTABLE;
}
PendingIntent intent = PendingIntent.getActivity(this, 0, PendingIntent intent = PendingIntent.getActivity(this, 0,
notificationIntent, 0); notificationIntent, pendingIntentFlag);
builder.setContentTitle(getString(R.string.notification_title)) builder.setContentTitle(getString(R.string.notification_title))
.setSmallIcon(R.mipmap.ic_launcher) .setSmallIcon(R.mipmap.ic_launcher)
@@ -165,8 +168,17 @@ public class UnzipService extends IntentService {
continue; continue;
} }
publishProgress(notificationBuilder, R.string.loading, 100 * ++per / size); publishProgress(notificationBuilder, R.string.loading, 100 * ++per / size);
try (OutputStream outputStream = new FileOutputStream(
new File(userDataDirectory, ze.getName()))) { // "Zip Path Traversal Vulnerability" fixed according to this article: https://support.google.com/faqs/answer/9294009
File new_file = new File(userDataDirectory, ze.getName());
String canonicalPath = new_file.getCanonicalPath();
if (!canonicalPath.startsWith(String.valueOf(userDataDirectory))) {
throw new IOException("Unzipping failed due to security issue!");
}
try (OutputStream outputStream = new FileOutputStream(new_file)) {
while ((readLen = zipInputStream.read(readBuffer)) != -1) { while ((readLen = zipInputStream.read(readBuffer)) != -1) {
outputStream.write(readBuffer, 0, readLen); outputStream.write(readBuffer, 0, readLen);
} }
@@ -210,7 +222,9 @@ public class UnzipService extends IntentService {
return; return;
publishProgress(notificationBuilder, R.string.migrating, 0); publishProgress(notificationBuilder, R.string.migrating, 0);
newLocation.mkdir(); if (!newLocation.mkdir()) {
Log.e("UnzipService", "New installation folder cannot be made");
}
String[] dirs = new String[] { "worlds", "games", "mods", "textures", "client" }; String[] dirs = new String[] { "worlds", "games", "mods", "textures", "client" };
for (int i = 0; i < dirs.length; i++) { for (int i = 0; i < dirs.length; i++) {
@@ -228,7 +242,9 @@ public class UnzipService extends IntentService {
} }
} }
recursivelyDeleteDirectory(oldLocation); if (!recursivelyDeleteDirectory(oldLocation)) {
Log.w("UnzipService", "Old installation files cannot be deleted successfully");
}
} }
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) { private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {

View File

@@ -1,36 +1,43 @@
package net.minetest.minetest; package net.minetest.minetest;
import android.content.Context; import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.File; import java.io.File;
import java.util.Objects;
public class Utils { public class Utils {
public static @NonNull File createDirs(File root, String dir) { @NonNull
public static File createDirs(@NonNull File root, @NonNull String dir) {
File f = new File(root, dir); File f = new File(root, dir);
if (!f.isDirectory()) if (!f.isDirectory())
f.mkdirs(); if (!f.mkdirs())
Log.e("Utils", "Directory " + dir + " cannot be created");
return f; return f;
} }
public static @Nullable File getUserDataDirectory(Context context) { @NonNull
File extDir = context.getExternalFilesDir(null); public static File getUserDataDirectory(@NonNull Context context) {
if (extDir == null) { File extDir = Objects.requireNonNull(
return null; context.getExternalFilesDir(null),
} "Cannot get external file directory"
);
return createDirs(extDir, "Minetest"); return createDirs(extDir, "Minetest");
} }
public static @Nullable File getCacheDirectory(Context context) { @NonNull
return context.getCacheDir(); public static File getCacheDirectory(@NonNull Context context) {
return Objects.requireNonNull(
context.getCacheDir(),
"Cannot get cache directory"
);
} }
public static boolean isInstallValid(Context context) { public static boolean isInstallValid(@NonNull Context context) {
File userDataDirectory = getUserDataDirectory(context); File userDataDirectory = getUserDataDirectory(context);
return userDataDirectory != null && userDataDirectory.isDirectory() && return userDataDirectory.isDirectory() &&
new File(userDataDirectory, "games").isDirectory() && new File(userDataDirectory, "games").isDirectory() &&
new File(userDataDirectory, "builtin").isDirectory() && new File(userDataDirectory, "builtin").isDirectory() &&
new File(userDataDirectory, "client").isDirectory() && new File(userDataDirectory, "client").isDirectory() &&

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 262 KiB

View File

@@ -4,10 +4,10 @@
<string name="label">SussyCraft</string> <string name="label">SussyCraft</string>
<string name="loading">Loading&#8230;</string> <string name="loading">Loading&#8230;</string>
<string name="migrating">Migrating save data from old install&#8230; (this may take a while)</string> <string name="migrating">Migrating save data from old install&#8230; (this may take a while)</string>
<string name="not_granted">Required permission wasn\'t granted, Minetest can\'t run without it</string> <string name="not_granted">Required permission wasn\'t granted, SussyCraft can\'t run without it</string>
<string name="notification_title">Loading Minetest</string> <string name="notification_title">Loading SussyCraft</string>
<string name="notification_description">Less than 1 minute&#8230;</string> <string name="notification_description">Less than 1 minute&#8230;</string>
<string name="ime_dialog_done">Done</string> <string name="ime_dialog_done">Done</string>
<string name="no_external_storage">External storage isn\'t available. If you use an SDCard, please reinsert it. Otherwise, try restarting your phone or contacting the Minetest developers</string> <string name="no_external_storage">External storage isn\'t available. If you use an SD Card, please reinsert it. Otherwise, try restarting your phone or contacting the SussyCraft developers</string>
</resources> </resources>

View File

@@ -1,23 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
project.ext.set("versionMajor", 5) // Version Major project.ext.set("versionMajor", 1) // Version Major
project.ext.set("versionMinor", 6) // Version Minor project.ext.set("versionMinor", 2) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch project.ext.set("versionPatch", 0) // Version Patch
project.ext.set("versionExtra", "") // Version Extra project.ext.set("versionExtra", "") // Version Extra
project.ext.set("versionCode", 42) // Android Version Code project.ext.set("versionCode", 47) // Android Version Code
project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release
// NOTE: +2 after each release! // NOTE: +2 after each release!
// +1 for ARM and +1 for ARM64 APK's, because // +1 for ARM and +1 for ARM64 APK's, because
// each APK must have a larger `versionCode` than the previous // each APK must have a larger `versionCode` than the previous
buildscript { buildscript {
ext.ndk_version = '23.2.8568313' ext.ndk_version = '25.1.8937393'
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.3' classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'de.undercouch:gradle-download-task:4.1.1' classpath 'de.undercouch:gradle-download-task:4.1.1'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
@@ -27,7 +27,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
} }

View File

@@ -1,5 +1,6 @@
#Fri Feb 24 12:42:36 CET 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME

View File

@@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'de.undercouch.download' apply plugin: 'de.undercouch.download'
android { android {
compileSdkVersion 30 compileSdkVersion 31
buildToolsVersion '30.0.3' buildToolsVersion '30.0.3'
ndkVersion "$ndk_version" ndkVersion "$ndk_version"
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 31
externalNativeBuild { externalNativeBuild {
ndkBuild { ndkBuild {
arguments '-j' + Runtime.getRuntime().availableProcessors(), arguments '-j' + Runtime.getRuntime().availableProcessors(),

View File

@@ -1,2 +1,2 @@
rootProject.name = "Minetest" rootProject.name = "SussyCraft"
include ':app', ':native' include ':app', ':native'

67
android/versionCode+1.py Normal file
View File

@@ -0,0 +1,67 @@
import os
###############################################################################
# Overcomplicated script that increments the versionCode in build.gradle by 1 #
###############################################################################
script_path = os.path.dirname(os.path.realpath(__file__))
# open build.gradle as read
with open(script_path + "\\build.gradle", "r") as f:
# read lines
lines = f.readlines()
# find versionCode
for line_i in range(len(lines)):
# find char_i of "project.ext.set("versionCode", "
char_i = lines[line_i].find("project.ext.set(\"versionCode\",")
if char_i != -1:
char_i += 30
line_max_i = len(lines[line_i]) - 1
# find start of number
while True:
if char_i > line_max_i:
print("Error: number in versionCode not found")
input("Press Enter to exit...")
exit()
char_unicode = ord(lines[line_i][char_i])
if 48 <= char_unicode <= 57:
break
char_i += 1
# find end of number
num_end_i = char_i + 1
while True:
char_unicode = ord(lines[line_i][num_end_i])
if 48 > char_unicode or char_unicode > 57:
break
num_end_i += 1
# get number
num = int(lines[line_i][char_i:num_end_i])
print(f"OLD versionCode: {num}")
num += 1
print(f"NEW versionCode: {num}")
# replace number
lines[line_i] = lines[line_i][:char_i] + str(num) + lines[line_i][num_end_i:]
# write lines
with open(script_path + "\\build.gradle", "w") as f:
f.writelines(lines)
break
if char_i == -1:
print("Error: versionCode not found")
else:
print("Done!")
input("Press Enter to exit...")

View File

@@ -35,6 +35,9 @@ dofile(commonpath .. "strict.lua")
dofile(commonpath .. "serialize.lua") dofile(commonpath .. "serialize.lua")
dofile(commonpath .. "misc_helpers.lua") dofile(commonpath .. "misc_helpers.lua")
-- disable day/night cycle
minetest.settings:set("time_speed", 0)
if INIT == "game" then if INIT == "game" then
dofile(gamepath .. "init.lua") dofile(gamepath .. "init.lua")
assert(not core.get_http_api) assert(not core.get_http_api)

View File

@@ -1024,7 +1024,7 @@ local function create_settings_formspec(tabview, _, tabdata)
formspec = formspec:sub(1, -2) -- remove trailing comma formspec = formspec:sub(1, -2) -- remove trailing comma
end end
formspec = formspec .. ";" .. selected_setting .. "]" .. formspec = formspec .. ";" .. selected_setting .. "]" ..
"button[0,4.9;4,1;btn_back;".. fgettext("< Back to Settings page") .. "]" .. "button[0,4.9;4.5,1;btn_back;".. fgettext("< Back to Settings page") .. "]" ..
"button[10,4.9;2,1;btn_edit;" .. fgettext("Edit") .. "]" .. "button[10,4.9;2,1;btn_edit;" .. fgettext("Edit") .. "]" ..
"button[7,4.9;3,1;btn_restore;" .. fgettext("Restore Default") .. "]" .. "button[7,4.9;3,1;btn_restore;" .. fgettext("Restore Default") .. "]" ..
"checkbox[0,4.3;cb_tech_settings;" .. fgettext("Show technical names") .. ";" "checkbox[0,4.3;cb_tech_settings;" .. fgettext("Show technical names") .. ";"

View File

@@ -99,7 +99,7 @@ local function init_globals()
tv_main:set_autosave_tab(true) tv_main:set_autosave_tab(true)
tv_main:add(tabs.local_game) tv_main:add(tabs.local_game)
--tv_main:add(tabs.play_online) tv_main:add(tabs.play_online)
--tv_main:add(tabs.content) --tv_main:add(tabs.content)
tv_main:add(tabs.settings) tv_main:add(tabs.settings)
@@ -123,7 +123,8 @@ local function init_globals()
end end
ui.set_default("maintab") ui.set_default("maintab")
check_new_version() -- disable new minetest version check because this is sussycraft MUHAHAHAHAHHAHAHA
-- check_new_version()
tv_main:show() tv_main:show()
ui.update() ui.update()
end end

View File

@@ -17,22 +17,32 @@
-- IMPORTANT! some lines had to be split up to new lines because they didn't fit in the window -- IMPORTANT! some lines had to be split up to new lines because they didn't fit in the window
local sussycraft_authors = { local sussycraft_authors = {
"SussyCraft Game Authors:", "Kacper Kostka (kacperks)",
"<kacperks@cubesoftware.xyz>",
"Kacper Kostka (kacperks) <kacperks@cubesoftware.xyz>",
"(Programming, Textures)", "(Programming, Textures)",
"-----------------------------------------------------------",
"Łukasz Brzostowski (Looki2000)", "Łukasz Brzostowski (Looki2000)",
"<electro.brzostek@gmail.com or looki2000@cubesoftware.xyz>", "<electro.brzostek@gmail.com or looki2000@cubesoftware.xyz>",
"(Programming, Textures, 3D Models, Soundtrack, Sounds)", "(Programming, Textures, 3D Models, Soundtrack, Sounds)",
"Karol Rostek (karoltoja200) discord:karoltoja200#6809", "-----------------------------------------------------------",
"Karol Rostek (karoltoja200)",
"<discord: karoltoja200#6809>",
"(Textures)", "(Textures)",
"Dawid Cholewiusz (D47 0_o) discord:D46 0_o#8952", "-----------------------------------------------------------",
"Dawid Cholewiusz (D47 0_o)",
"<discord: D46 0_o#8952>",
"(Structures builder)", "(Structures builder)",
"Kacper Brzostowski (wooden plank texture)", "-----------------------------------------------------------",
"Kacper Brzostowski",
"(wooden plank texture)",
} }
-- https://github.com/orgs/minetest/teams/engine/members -- https://github.com/orgs/minetest/teams/engine/members
@@ -148,6 +158,7 @@ return {
prepare_credits(credit_list, sussycraft_authors) prepare_credits(credit_list, sussycraft_authors)
table.insert_all(credit_list, { table.insert_all(credit_list, {
"",
core.colorize("#ffdd33", fgettext("Minetest Engine Developers")) core.colorize("#ffdd33", fgettext("Minetest Engine Developers"))
}) })
prepare_credits(credit_list, core_developers) prepare_credits(credit_list, core_developers)
@@ -184,42 +195,41 @@ return {
-- account for the visible portion -- account for the visible portion
scroll_height = math.max(0, scroll_height - 6.9) scroll_height = math.max(0, scroll_height - 6.9)
-- minetest gui system sucks so I had to make these calculations to center the buttons BECAUSE THEY CHANGE ON EVERY ANDROID DEVICE AND I HAVE TO WIDEN THEM MORE BECAUSE MINETEST IS A PIECE OF CRAP AAAAAAAAAAAAAAAA
local privacy_button_size = 3.5
local discord_button_size = 4.5
local fs = "image[1.5,0.6;2.5,2.5;" .. core.formspec_escape(logofile) .. "]" .. local fs = "image[1.5,0.6;2.5,2.5;" .. core.formspec_escape(logofile) .. "]" ..
"style[label_button;border=false]" .. "style[label_button;border=false]" ..
"button[0.1,3.4;5.3,0.5;label_button;" .. "button[0.1,3.4;5.3,0.5;label_button;" ..
core.formspec_escape("SussyCraft 0.8") .. "]" .. core.formspec_escape("SussyCraft " .. core.get_version().string) .. "]" ..
"button[1.5,4.1;2.5,0.8;homepage;Privacy Policy]" ..
"scroll_container[5.5,0.1;9.5,6.9;scroll_credits;vertical;" .. "button[" .. tostring(-privacy_button_size / 2 + 2.75) .. ",4.1;" .. tostring(privacy_button_size) .. ",0.8;privacy;Privacy Policy]" ..
"button[" .. tostring(-discord_button_size / 2 + 2.75) .. ",5.1;" .. tostring(discord_button_size) .. ",0.8;discord;SussyCraft Discord]" ..
"scroll_container[5.5,0.1;13.5,6.9;scroll_credits;vertical;" .. -- originally: 5.5,0.1;9.5,6.9
tostring(scroll_height / 1000) .. "]" .. credit_fs .. tostring(scroll_height / 1000) .. "]" .. credit_fs ..
"scroll_container_end[]".. "scroll_container_end[]"..
"scrollbar[15,0.1;0.4,6.9;vertical;scroll_credits;0]" "scrollbar[19,0.1;0.4,6.9;vertical;scroll_credits;0]" -- originally: 15,0.1;0.4,6.9
-- Render information -- Render information
fs = fs .. "style[label_button2;border=false]" .. fs = fs .. "style[label_button2;border=false]" ..
"button[0.1,6;5.3,1;label_button2;" .. "button[0.1,6;5.3,1;label_button2;" ..
fgettext("Active renderer:") .. "\n" .. fgettext("Active renderer:") .. "\n" ..
core.formspec_escape(core.get_screen_info().render_info) .. "]" core.formspec_escape(core.get_screen_info().render_info) .. "]"
if PLATFORM == "Android" then return fs, "size[19.5,7.1,false]real_coordinates[true]" -- originally: 15.5,7.1
else
end
return fs, "size[15.5,7.1,false]real_coordinates[true]"
end, end,
cbf_button_handler = function(this, fields, name, tabdata) cbf_button_handler = function(this, fields, name, tabdata)
if fields.homepage then if fields.privacy then
core.open_url("https://cubesoftware.xyz/sussycraft/privacy.html") core.open_url("https://cubesoftware.xyz/sussycraft/privacy.html")
end end
if fields.share_debug then if fields.discord then
local path = core.get_user_path() .. DIR_DELIM .. "debug.txt" core.open_url("https://discord.gg/aJmhBN74sh")
core.share_file(path)
end
if fields.userdata then
core.open_dir(core.get_user_path())
end end
end, end,
} }

View File

@@ -165,9 +165,9 @@ local function get_formspec(tabview, name, tabdata)
y = y + yo y = y + yo
end end
if disabled_settings["enable_server"] == nil then if disabled_settings["enable_server"] == nil then
--host = "checkbox[0,"..y..";cb_server;".. fgettext("Host Server") ..";" .. host = "checkbox[0,"..y..";cb_server;".. fgettext("Host Server") ..";" ..
-- dump(core.settings:get_bool("enable_server")) .. "]" dump(core.settings:get_bool("enable_server")) .. "]"
--y = y + yo y = y + yo
end end
retval = retval .. retval = retval ..
@@ -185,7 +185,7 @@ local function get_formspec(tabview, name, tabdata)
if core.settings:get_bool("enable_server") and disabled_settings["enable_server"] == nil then if core.settings:get_bool("enable_server") and disabled_settings["enable_server"] == nil then
retval = retval .. retval = retval ..
"button[7.9,4.75;4.1,1;play;".. fgettext("Host Game") .. "]" .. "button[7.9,4.75;4.1,1;play;".. fgettext("Host Game") .. "]" ..
"checkbox[0,"..y..";cb_server_announce;" .. fgettext("Announce Server") .. ";" .. --"checkbox[0,"..y..";cb_server_announce;" .. fgettext("Announce Server") .. ";" ..
dump(core.settings:get_bool("server_announce")) .. "]" .. dump(core.settings:get_bool("server_announce")) .. "]" ..
"field[0.3,2.85;3.8,0.5;te_playername;" .. fgettext("Name") .. ";" .. "field[0.3,2.85;3.8,0.5;te_playername;" .. fgettext("Name") .. ";" ..
core.formspec_escape(core.settings:get("name")) .. "]" .. core.formspec_escape(core.settings:get("name")) .. "]" ..
@@ -260,13 +260,13 @@ local function main_button_handler(this, fields, name, tabdata)
return true return true
end end
if fields["cb_server_announce"] then --if fields["cb_server_announce"] then
core.settings:set("server_announce", fields["cb_server_announce"]) -- core.settings:set("server_announce", fields["cb_server_announce"])
local selected = core.get_textlist_index("srv_worlds") -- local selected = core.get_textlist_index("srv_worlds")
menu_worldmt(selected, "server_announce", fields["cb_server_announce"]) -- menu_worldmt(selected, "server_announce", fields["cb_server_announce"])
return true -- return true
end --end
if fields["play"] ~= nil or world_doubleclick or fields["key_enter"] then if fields["play"] ~= nil or world_doubleclick or fields["key_enter"] then
local selected = core.get_textlist_index("sp_worlds") local selected = core.get_textlist_index("sp_worlds")

View File

@@ -16,41 +16,54 @@
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. --51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local function get_sorted_servers() local function get_sorted_servers()
--local servers = {
-- fav = {},
-- public = {},
-- incompatible = {}
--}
main_serv = {
address = "in the future!",
port = 30000,
name = "The official SussyCraft server"
}
local servers = { local servers = {
fav = {}, fav = serverlistmgr.get_favorites(),
public = {}, public = {main_serv},
incompatible = {} incompatible = {}
} }
local favs = serverlistmgr.get_favorites() --local favs = serverlistmgr.get_favorites()
local taken_favs = {} --local taken_favs = {}
local result = menudata.search_result or serverlistmgr.servers --local result = menudata.search_result or serverlistmgr.servers
for _, server in ipairs(result) do --for _, server in ipairs(result) do
server.is_favorite = false -- server.is_favorite = false
for index, fav in ipairs(favs) do -- for index, fav in ipairs(favs) do
if server.address == fav.address and server.port == fav.port then -- if server.address == fav.address and server.port == fav.port then
taken_favs[index] = true -- taken_favs[index] = true
server.is_favorite = true -- server.is_favorite = true
break -- break
end -- end
end -- end
server.is_compatible = is_server_protocol_compat(server.proto_min, server.proto_max) -- server.is_compatible = is_server_protocol_compat(server.proto_min, server.proto_max)
if server.is_favorite then -- if server.is_favorite then
table.insert(servers.fav, server) -- table.insert(servers.fav, server)
elseif server.is_compatible then -- elseif server.is_compatible then
table.insert(servers.public, server) -- table.insert(servers.public, server)
else -- else
table.insert(servers.incompatible, server) -- table.insert(servers.incompatible, server)
end -- end
end --end
--
if not menudata.search_result then --if not menudata.search_result then
for index, fav in ipairs(favs) do -- for index, fav in ipairs(favs) do
if not taken_favs[index] then -- if not taken_favs[index] then
table.insert(servers.fav, fav) -- table.insert(servers.fav, fav)
end -- end
end -- end
end --end
return servers return servers
end end
@@ -60,31 +73,31 @@ local function get_formspec(tabview, name, tabdata)
-- it may have changed after a change by the settings menu. -- it may have changed after a change by the settings menu.
common_update_cached_supp_proto() common_update_cached_supp_proto()
if not tabdata.search_for then --if not tabdata.search_for then
tabdata.search_for = "" -- tabdata.search_for = ""
end --end
local retval = local retval =
-- Search -- Search
"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" .. --"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
"container[7.25,0.25]" .. --"container[7.25,0.25]" ..
"image_button[0,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "search.png") .. ";btn_mp_search;]" .. --"image_button[0,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "search.png") .. ";btn_mp_search;]" ..
"image_button[0.75,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "clear.png") .. ";btn_mp_clear;]" .. --"image_button[0.75,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "clear.png") .. ";btn_mp_clear;]" ..
"image_button[1.5,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "refresh.png") .. ";btn_mp_refresh;]" .. --"image_button[1.5,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "refresh.png") .. ";btn_mp_refresh;]" ..
"tooltip[btn_mp_clear;" .. fgettext("Clear") .. "]" .. --"tooltip[btn_mp_clear;" .. fgettext("Clear") .. "]" ..
"tooltip[btn_mp_search;" .. fgettext("Search") .. "]" .. --"tooltip[btn_mp_search;" .. fgettext("Search") .. "]" ..
"tooltip[btn_mp_refresh;" .. fgettext("Refresh") .. "]" .. --"tooltip[btn_mp_refresh;" .. fgettext("Refresh") .. "]" ..
"container_end[]" .. --"container_end[]" ..
"container[9.75,0]" .. "container[9.75,0]" ..
"box[0,0;5.75,7;#666666]" .. "box[0,0;5.75,7;#666666]" ..
-- Address / Port -- Address / Port
"label[0.25,0.35;" .. fgettext("Address") .. "]" .. "label[0.25,0.30;" .. fgettext("Address") .. "]" ..
"label[4.25,0.35;" .. fgettext("Port") .. "]" .. "label[4,0.30;" .. fgettext("Port") .. "]" ..
"field[0.25,0.5;4,0.75;te_address;;" .. "field[0.25,0.5;3.75,0.75;te_address;;" ..
core.formspec_escape(core.settings:get("address")) .. "]" .. core.formspec_escape(core.settings:get("address")) .. "]" ..
"field[4.25,0.5;1.25,0.75;te_port;;" .. "field[4,0.5;1.5,0.75;te_port;;" ..
core.formspec_escape(core.settings:get("remote_port")) .. "]" .. core.formspec_escape(core.settings:get("remote_port")) .. "]" ..
-- Description Background -- Description Background
@@ -108,7 +121,7 @@ local function get_formspec(tabview, name, tabdata)
if tabdata.selected then if tabdata.selected then
if gamedata.fav then if gamedata.fav then
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]" retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove recent") .. "]"
retval = retval .. "style[btn_delete_favorite;padding=6]" retval = retval .. "style[btn_delete_favorite;padding=6]"
retval = retval .. "image_button[5,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir .. retval = retval .. "image_button[5,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir ..
"server_favorite_delete.png") .. ";btn_delete_favorite;]" "server_favorite_delete.png") .. ";btn_delete_favorite;]"
@@ -148,13 +161,14 @@ local function get_formspec(tabview, name, tabdata)
"align=inline,padding=0.25,width=1.5;" .. "align=inline,padding=0.25,width=1.5;" ..
"color,align=inline,span=1;" .. "color,align=inline,span=1;" ..
"text,align=inline,padding=1]" .. "text,align=inline,padding=1]" ..
"table[0.25,1;9.25,5.75;servers;" "table[0.25,0.2;9.25,6.65;servers;"
local servers = get_sorted_servers() local servers = get_sorted_servers()
--minetest.debug("Serverlist: " .. dump(servers))
local dividers = { local dividers = {
fav = "5,#ffff00," .. fgettext("Favorites") .. ",,,0,0,,", fav = "5,#ffff00," .. fgettext("Recent") .. ",,,0,0,,",
public = "6,#4bdd42," .. fgettext("Public Servers") .. ",,,0,0,,", public = "6,#4bdd42," .. fgettext("Main Servers") .. ",,,0,0,,",
incompatible = "7,"..mt_color_grey.."," .. fgettext("Incompatible Servers") .. ",,,0,0,," incompatible = "7,"..mt_color_grey.."," .. fgettext("Incompatible Servers") .. ",,,0,0,,"
} }
local order = {"fav", "public", "incompatible"} local order = {"fav", "public", "incompatible"}
@@ -185,60 +199,60 @@ end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
local function search_server_list(input) --local function search_server_list(input)
menudata.search_result = nil -- menudata.search_result = nil
if #serverlistmgr.servers < 2 then -- if #serverlistmgr.servers < 2 then
return -- return
end -- end
--
-- setup the keyword list -- -- setup the keyword list
local keywords = {} -- local keywords = {}
for word in input:gmatch("%S+") do -- for word in input:gmatch("%S+") do
word = word:gsub("(%W)", "%%%1") -- word = word:gsub("(%W)", "%%%1")
table.insert(keywords, word) -- table.insert(keywords, word)
end -- end
--
if #keywords == 0 then -- if #keywords == 0 then
return -- return
end -- end
--
menudata.search_result = {} -- menudata.search_result = {}
--
-- Search the serverlist -- -- Search the serverlist
local search_result = {} -- local search_result = {}
for i = 1, #serverlistmgr.servers do -- for i = 1, #serverlistmgr.servers do
local server = serverlistmgr.servers[i] -- local server = serverlistmgr.servers[i]
local found = 0 -- local found = 0
for k = 1, #keywords do -- for k = 1, #keywords do
local keyword = keywords[k] -- local keyword = keywords[k]
if server.name then -- if server.name then
local sername = server.name:lower() -- local sername = server.name:lower()
local _, count = sername:gsub(keyword, keyword) -- local _, count = sername:gsub(keyword, keyword)
found = found + count * 4 -- found = found + count * 4
end -- end
--
if server.description then -- if server.description then
local desc = server.description:lower() -- local desc = server.description:lower()
local _, count = desc:gsub(keyword, keyword) -- local _, count = desc:gsub(keyword, keyword)
found = found + count * 2 -- found = found + count * 2
end -- end
end -- end
if found > 0 then -- if found > 0 then
local points = (#serverlistmgr.servers - i) / 5 + found -- local points = (#serverlistmgr.servers - i) / 5 + found
server.points = points -- server.points = points
table.insert(search_result, server) -- table.insert(search_result, server)
end -- end
end -- end
--
if #search_result == 0 then -- if #search_result == 0 then
return -- return
end -- end
--
table.sort(search_result, function(a, b) -- table.sort(search_result, function(a, b)
return a.points > b.points -- return a.points > b.points
end) -- end)
menudata.search_result = search_result -- menudata.search_result = search_result
end --end
local function set_selected_server(tabdata, idx, server) local function set_selected_server(tabdata, idx, server)
-- reset selection -- reset selection
@@ -324,27 +338,27 @@ local function main_button_handler(tabview, fields, name, tabdata)
return true return true
end end
if fields.btn_mp_clear then --if fields.btn_mp_clear then
tabdata.search_for = "" -- tabdata.search_for = ""
menudata.search_result = nil -- menudata.search_result = nil
return true -- return true
end --end
if fields.btn_mp_search or fields.key_enter_field == "te_search" then --if fields.btn_mp_search or fields.key_enter_field == "te_search" then
tabdata.search_for = fields.te_search -- tabdata.search_for = fields.te_search
search_server_list(fields.te_search:lower()) -- search_server_list(fields.te_search:lower())
if menudata.search_result then -- if menudata.search_result then
-- first server in row 2 due to header -- -- first server in row 2 due to header
set_selected_server(tabdata, 2, menudata.search_result[1]) -- set_selected_server(tabdata, 2, menudata.search_result[1])
end -- end
return true -- return true
end --end
if fields.btn_mp_refresh then --if fields.btn_mp_refresh then
serverlistmgr.sync() -- serverlistmgr.sync()
return true -- return true
end --end
if (fields.btn_mp_login or fields.key_enter) if (fields.btn_mp_login or fields.key_enter)
and fields.te_address ~= "" and fields.te_port then and fields.te_address ~= "" and fields.te_port then
@@ -365,7 +379,10 @@ local function main_button_handler(tabview, fields, name, tabdata)
if server and server.address == gamedata.address and if server and server.address == gamedata.address and
server.port == gamedata.port then server.port == gamedata.port then
-- add only if not main_serv
if server.address ~= main_serv.address and server.port ~= main_serv.port then
serverlistmgr.add_favorite(server) serverlistmgr.add_favorite(server)
end
gamedata.servername = server.name gamedata.servername = server.name
gamedata.serverdescription = server.description gamedata.serverdescription = server.description
@@ -413,15 +430,15 @@ local function main_button_handler(tabview, fields, name, tabdata)
return false return false
end end
local function on_change(type, old_tab, new_tab) --local function on_change(type, old_tab, new_tab)
if type == "LEAVE" then return end -- if type == "LEAVE" then return end
serverlistmgr.sync() -- serverlistmgr.sync()
end --end
return { return {
name = "online", name = "online",
caption = fgettext("Join Game"), caption = fgettext("Join Game"),
cbf_formspec = get_formspec, cbf_formspec = get_formspec,
cbf_button_handler = main_button_handler, cbf_button_handler = main_button_handler,
on_change = on_change on_change = nil
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 587 B

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -49,8 +49,8 @@ BEGIN
VALUE "FileDescription", PROJECT_NAME_C " engine" VALUE "FileDescription", PROJECT_NAME_C " engine"
VALUE "FileVersion", VERSION_STRING VALUE "FileVersion", VERSION_STRING
VALUE "InternalName", PROJECT_NAME VALUE "InternalName", PROJECT_NAME
VALUE "LegalCopyright", "(c) 2011-2015 celeron55" VALUE "LegalCopyright", "(c) 2023 SussyCraft Developers ("PROJECT_NAME_C") and (c) 2011-2015 celeron55 (Minetest engine)"
VALUE "LegalTrademarks", """Minetest"" is the property of the Minetest community, don't use it without permission!" VALUE "LegalTrademarks", "SussyCraft is a modified version of ""Minetest"". ""Minetest"" is the property of the Minetest community, don't use it without permission!"
VALUE "OriginalFilename", "minetest.exe" VALUE "OriginalFilename", "minetest.exe"
VALUE "PrivateBuild", VERSION_EXTRA VALUE "PrivateBuild", VERSION_EXTRA
VALUE "ProductName", PROJECT_NAME_C VALUE "ProductName", PROJECT_NAME_C

View File

@@ -142,7 +142,27 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
skin->setColor(gui::EGDC_3D_LIGHT, video::SColor(0, 0, 0, 0)); skin->setColor(gui::EGDC_3D_LIGHT, video::SColor(0, 0, 0, 0));
skin->setColor(gui::EGDC_3D_HIGH_LIGHT, video::SColor(255, 30, 30, 30)); skin->setColor(gui::EGDC_3D_HIGH_LIGHT, video::SColor(255, 30, 30, 30));
skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255, 0, 0, 0)); skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255, 0, 0, 0));
skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 70, 120, 50));
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<> distrib(0, 1);
// random gui color
bool gui_color = static_cast<bool>(distrib(gen));
// sus list highlight color
//skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 70, 120, 50)); // minetest green
//skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 120, 50, 50)); // dark sussy red
//skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 50, 50, 120)); // evening sky blue
if (gui_color)
skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 120, 50, 50)); // dark sussy red
else
skin->setColor(gui::EGDC_HIGH_LIGHT, video::SColor(255, 50, 50, 120)); // evening sky blue
skin->setColor(gui::EGDC_HIGH_LIGHT_TEXT, video::SColor(255, 255, 255, 255)); skin->setColor(gui::EGDC_HIGH_LIGHT_TEXT, video::SColor(255, 255, 255, 255));
#ifdef HAVE_TOUCHSCREENGUI #ifdef HAVE_TOUCHSCREENGUI
float density = RenderingEngine::getDisplayDensity(); float density = RenderingEngine::getDisplayDensity();
@@ -173,7 +193,18 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
// Irrlicht 1.8 input colours // Irrlicht 1.8 input colours
skin->setColor(gui::EGDC_EDITABLE, video::SColor(255, 128, 128, 128)); skin->setColor(gui::EGDC_EDITABLE, video::SColor(255, 128, 128, 128));
skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 96, 134, 49));
// sus field selected color
//skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 96, 134, 49)); // minetest green
//skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 135, 50, 50)); // dark sussy red
//skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 50, 50, 135)); // evening sky blue
if (gui_color)
skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 135, 50, 50)); // dark sussy red
else
skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 50, 50, 135)); // evening sky blue
// Create the menu clouds // Create the menu clouds
if (!g_menucloudsmgr) if (!g_menucloudsmgr)

View File

@@ -1981,8 +1981,8 @@ void Game::processKeyInput()
increaseViewRange(); increaseViewRange();
} else if (wasKeyDown(KeyType::DECREASE_VIEWING_RANGE)) { } else if (wasKeyDown(KeyType::DECREASE_VIEWING_RANGE)) {
decreaseViewRange(); decreaseViewRange();
} else if (wasKeyDown(KeyType::RANGESELECT)) { //} else if (wasKeyDown(KeyType::RANGESELECT)) {
toggleFullViewRange(); // toggleFullViewRange();
} else if (wasKeyDown(KeyType::ZOOM)) { } else if (wasKeyDown(KeyType::ZOOM)) {
checkZoomEnabled(); checkZoomEnabled();
} else if (wasKeyDown(KeyType::QUICKTUNE_NEXT)) { } else if (wasKeyDown(KeyType::QUICKTUNE_NEXT)) {

View File

@@ -14,7 +14,7 @@
#else #else
#if defined (__ANDROID__) #if defined (__ANDROID__)
#define PROJECT_NAME "minetest" #define PROJECT_NAME "minetest"
#define PROJECT_NAME_C "Minetest" #define PROJECT_NAME_C "SussyCraft"
#define STATIC_SHAREDIR "" #define STATIC_SHAREDIR ""
#define ENABLE_UPDATE_CHECKER 0 #define ENABLE_UPDATE_CHECKER 0
#define VERSION_STRING STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR(VERSION_PATCH) STR(VERSION_EXTRA) #define VERSION_STRING STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR(VERSION_PATCH) STR(VERSION_EXTRA)

View File

@@ -110,4 +110,4 @@ with this program; if not, write to the Free Software Foundation, Inc.,
GUI related things GUI related things
*/ */
#define TTF_DEFAULT_FONT_SIZE (16) #define TTF_DEFAULT_FONT_SIZE (32)

View File

@@ -35,7 +35,7 @@ void set_default_settings()
settings->setDefault("language", ""); settings->setDefault("language", "");
settings->setDefault("name", ""); settings->setDefault("name", "");
settings->setDefault("bind_address", ""); settings->setDefault("bind_address", "");
settings->setDefault("serverlist_url", "servers.cubesoftware.xyz"); settings->setDefault("serverlist_url", "servers.minetest.net");
// Client // Client
settings->setDefault("address", ""); settings->setDefault("address", "");
@@ -179,7 +179,7 @@ void set_default_settings()
settings->setDefault("autosave_screensize", "true"); settings->setDefault("autosave_screensize", "true");
settings->setDefault("fullscreen", "false"); settings->setDefault("fullscreen", "false");
settings->setDefault("vsync", "true"); settings->setDefault("vsync", "true");
settings->setDefault("fov", "72"); settings->setDefault("fov", "90");
settings->setDefault("leaves_style", "fancy"); settings->setDefault("leaves_style", "fancy");
settings->setDefault("connected_glass", "false"); settings->setDefault("connected_glass", "false");
settings->setDefault("smooth_lighting", "true"); settings->setDefault("smooth_lighting", "true");
@@ -252,17 +252,22 @@ void set_default_settings()
// Effects // Effects
settings->setDefault("directional_colored_fog", "true"); settings->setDefault("directional_colored_fog", "true");
settings->setDefault("inventory_items_animations", "false"); settings->setDefault("inventory_items_animations", "false");
# if ENABLE_GLES
settings->setDefault("mip_map", "false"); settings->setDefault("mip_map", "false");
settings->setDefault("anisotropic_filter", "false"); settings->setDefault("anisotropic_filter", "false");
# else
settings->setDefault("mip_map", "true");
settings->setDefault("anisotropic_filter", "true");
# endif
settings->setDefault("bilinear_filter", "false"); settings->setDefault("bilinear_filter", "false");
settings->setDefault("trilinear_filter", "false"); settings->setDefault("trilinear_filter", "false");
settings->setDefault("tone_mapping", "false"); settings->setDefault("tone_mapping", "false");
settings->setDefault("enable_waving_water", "false"); settings->setDefault("enable_waving_water", "true");
settings->setDefault("water_wave_height", "1.0"); settings->setDefault("water_wave_height", "1.0");
settings->setDefault("water_wave_length", "20.0"); settings->setDefault("water_wave_length", "20.0");
settings->setDefault("water_wave_speed", "5.0"); settings->setDefault("water_wave_speed", "5.0");
settings->setDefault("enable_waving_leaves", "false"); settings->setDefault("enable_waving_leaves", "true");
settings->setDefault("enable_waving_plants", "false"); settings->setDefault("enable_waving_plants", "true");
// Effects Shadows // Effects Shadows
settings->setDefault("enable_dynamic_shadows", "false"); settings->setDefault("enable_dynamic_shadows", "false");
@@ -279,7 +284,7 @@ void set_default_settings()
// Input // Input
settings->setDefault("invert_mouse", "false"); settings->setDefault("invert_mouse", "false");
settings->setDefault("mouse_sensitivity", "0.05"); settings->setDefault("mouse_sensitivity", "0.08");
settings->setDefault("repeat_place_time", "0.25"); settings->setDefault("repeat_place_time", "0.25");
settings->setDefault("safe_dig_and_place", "false"); settings->setDefault("safe_dig_and_place", "false");
settings->setDefault("random_input", "false"); settings->setDefault("random_input", "false");
@@ -323,7 +328,7 @@ void set_default_settings()
std::string font_size_str = std::to_string(TTF_DEFAULT_FONT_SIZE); std::string font_size_str = std::to_string(TTF_DEFAULT_FONT_SIZE);
settings->setDefault("font_size", font_size_str); settings->setDefault("font_size", font_size_str);
settings->setDefault("mono_font_size", font_size_str); settings->setDefault("mono_font_size", font_size_str);
settings->setDefault("chat_font_size", "0"); // Default "font_size" settings->setDefault("chat_font_size", "16"); // Default "font_size"
// ContentDB // ContentDB
settings->setDefault("contentdb_url", "https://content.minetest.net"); settings->setDefault("contentdb_url", "https://content.minetest.net");
@@ -502,15 +507,15 @@ void set_default_settings()
if (x_inches < 3.7f) { if (x_inches < 3.7f) {
settings->setDefault("hud_scaling", "0.6"); settings->setDefault("hud_scaling", "0.6");
settings->setDefault("font_size", "16"); settings->setDefault("font_size", "21");
settings->setDefault("mono_font_size", "14"); settings->setDefault("mono_font_size", "14");
} else if (x_inches < 4.5f) { } else if (x_inches < 4.5f) {
settings->setDefault("hud_scaling", "0.7"); settings->setDefault("hud_scaling", "0.7");
settings->setDefault("font_size", "16"); settings->setDefault("font_size", "21");
settings->setDefault("mono_font_size", "14"); settings->setDefault("mono_font_size", "14");
} else if (x_inches < 6.0f) { } else if (x_inches < 6.0f) {
settings->setDefault("hud_scaling", "0.85"); settings->setDefault("hud_scaling", "0.85");
settings->setDefault("font_size", "16"); settings->setDefault("font_size", "21");
settings->setDefault("mono_font_size", "14"); settings->setDefault("mono_font_size", "14");
} }
// Tablets >= 6.0 use non-Android defaults for these settings // Tablets >= 6.0 use non-Android defaults for these settings

View File

@@ -74,7 +74,7 @@ void set_light_table(float gamma)
params.gamma = rangelim(gamma, 0.33f, 3.0f); params.gamma = rangelim(gamma, 0.33f, 3.0f);
// Boundary values should be fixed // Boundary values should be fixed
light_LUT[0] = 0; light_LUT[0] = 40;
light_LUT[LIGHT_SUN] = 255; light_LUT[LIGHT_SUN] = 255;
for (size_t i = 1; i < LIGHT_SUN; i++) { for (size_t i = 1; i < LIGHT_SUN; i++) {