Compare commits

..

No commits in common. "master" and "reversebugs" have entirely different histories.

33 changed files with 246 additions and 432 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 "SussyCraft") set(PROJECT_NAME_CAPITALIZED "Minetest")
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 1) set(VERSION_MAJOR 5)
set(VERSION_MINOR 2) set(VERSION_MINOR 6)
set(VERSION_PATCH 0) set(VERSION_PATCH 1)
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,30 +1,7 @@
~~Minetest fork for SussyCraft~~ SussyCraft Engine Minetest fork for SussyCraft
============================ ============================
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 the original README from the Minetest repository.
⠀⠀⠀⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌\
⠀⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌\
⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌\
⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪\
⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡\
⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐\
⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔\
⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘\
⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎\
⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗\
⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷\
⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟\
⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰\
⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊\
⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌\
⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁\
⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌⠀\
⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀⠀\
⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟\
⢀⢂⢑⠀⡂⡃⠅⠊⢄⢑⠠⠑⢕⢕⢝⢮⢺⢕⢟⢮⢊⢢⢱⢄⠃⣇⣞⢞⣞⢾\
⢀⠢⡑⡀⢂⢊⠠⠁⡂⡐⠀⠅⡈⠪⠪⠪⠣⠫⠑⡁⢔⠕⣜⣜⢦⡰⡎⡯⡾⡽
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
======== ========
@ -40,8 +17,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 SuusyCraft Engine source code in which this file is If you downloaded the Minetest Engine source code in which this file is
contained, you probably want to download the [SussyCraft game](http://git.cubesoftware.xyz:20524/kacperks/SussyCraft) (it's a submodule) contained, you probably want to download the [Minetest Game](https://github.com/minetest/minetest_game/)
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 31 compileSdkVersion 30
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 31 targetSdkVersion 30
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="xyz.cubesoftware.sussycraft.fileprovider" android:authorities="net.minetest.minetest.fileprovider"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:exported="false"> android:exported="false">
<meta-data <meta-data

View File

@ -45,7 +45,6 @@ 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");
@ -195,7 +194,7 @@ public class GameActivity extends NativeActivity {
return; return;
} }
Uri fileUri = FileProvider.getUriForFile(this, "xyz.cubesoftware.sussycraft.fileprovider", file); Uri fileUri = FileProvider.getUriForFile(this, "net.minetest.minetest.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,12 +127,8 @@ public class MainActivity extends AppCompatActivity {
} }
@Override @Override
public void onRequestPermissionsResult( public void onRequestPermissionsResult(int requestCode,
int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
@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,6 +77,9 @@ 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)) {
@ -95,9 +98,7 @@ public class UnzipService extends IntentService {
failureMessage = e.getLocalizedMessage(); failureMessage = e.getLocalizedMessage();
} finally { } finally {
setIsRunning(false); setIsRunning(false);
if (!zipFile.delete()) { zipFile.delete();
Log.w("UnzipService", "Minetest installation ZIP cannot be deleted");
}
} }
} }
@ -130,12 +131,8 @@ 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, pendingIntentFlag); notificationIntent, 0);
builder.setContentTitle(getString(R.string.notification_title)) builder.setContentTitle(getString(R.string.notification_title))
.setSmallIcon(R.mipmap.ic_launcher) .setSmallIcon(R.mipmap.ic_launcher)
@ -168,17 +165,8 @@ 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(
// "Zip Path Traversal Vulnerability" fixed according to this article: https://support.google.com/faqs/answer/9294009 new File(userDataDirectory, ze.getName()))) {
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);
} }
@ -222,9 +210,7 @@ public class UnzipService extends IntentService {
return; return;
publishProgress(notificationBuilder, R.string.migrating, 0); publishProgress(notificationBuilder, R.string.migrating, 0);
if (!newLocation.mkdir()) { 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++) {
@ -242,9 +228,7 @@ public class UnzipService extends IntentService {
} }
} }
if (!recursivelyDeleteDirectory(oldLocation)) { 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,43 +1,36 @@
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 {
@NonNull public static @NonNull File createDirs(File root, String dir) {
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())
if (!f.mkdirs()) f.mkdirs();
Log.e("Utils", "Directory " + dir + " cannot be created");
return f; return f;
} }
@NonNull public static @Nullable File getUserDataDirectory(Context context) {
public static File getUserDataDirectory(@NonNull Context context) { File extDir = context.getExternalFilesDir(null);
File extDir = Objects.requireNonNull( if (extDir == null) {
context.getExternalFilesDir(null), return null;
"Cannot get external file directory" }
);
return createDirs(extDir, "Minetest"); return createDirs(extDir, "Minetest");
} }
@NonNull public static @Nullable File getCacheDirectory(Context context) {
public static File getCacheDirectory(@NonNull Context context) { return context.getCacheDir();
return Objects.requireNonNull(
context.getCacheDir(),
"Cannot get cache directory"
);
} }
public static boolean isInstallValid(@NonNull Context context) { public static boolean isInstallValid(Context context) {
File userDataDirectory = getUserDataDirectory(context); File userDataDirectory = getUserDataDirectory(context);
return userDataDirectory.isDirectory() && return userDataDirectory != null && 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: 262 KiB

After

Width:  |  Height:  |  Size: 146 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, SussyCraft can\'t run without it</string> <string name="not_granted">Required permission wasn\'t granted, Minetest can\'t run without it</string>
<string name="notification_title">Loading SussyCraft</string> <string name="notification_title">Loading Minetest</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 SD Card, please reinsert it. Otherwise, try restarting your phone or contacting the SussyCraft developers</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>
</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", 1) // Version Major project.ext.set("versionMajor", 5) // Version Major
project.ext.set("versionMinor", 2) // Version Minor project.ext.set("versionMinor", 6) // 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", 47) // Android Version Code project.ext.set("versionCode", 42) // 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 = '25.1.8937393' ext.ndk_version = '23.2.8568313'
repositories { repositories {
google() google()
mavenCentral() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.2' classpath 'com.android.tools.build:gradle:7.0.3'
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()
mavenCentral() jcenter()
} }
} }

View File

@ -1,6 +1,5 @@
#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
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

View File

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

View File

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

View File

@ -1,67 +0,0 @@
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,9 +35,6 @@ 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.5,1;btn_back;".. fgettext("< Back to Settings page") .. "]" .. "button[0,4.9;4,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,8 +123,7 @@ local function init_globals()
end end
ui.set_default("maintab") ui.set_default("maintab")
-- disable new minetest version check because this is sussycraft MUHAHAHAHAHHAHAHA check_new_version()
-- check_new_version()
tv_main:show() tv_main:show()
ui.update() ui.update()
end end

View File

@ -17,32 +17,22 @@
-- 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 = {
"Kacper Kostka (kacperks)", "SussyCraft Game Authors:",
"<kacperks@cubesoftware.xyz>",
"(Programming, Textures)",
"-----------------------------------------------------------", "Kacper Kostka (kacperks) <kacperks@cubesoftware.xyz>",
"(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
@ -158,7 +148,6 @@ 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)
@ -195,41 +184,42 @@ 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 " .. core.get_version().string) .. "]" .. core.formspec_escape("SussyCraft 0.8") .. "]" ..
"button[1.5,4.1;2.5,0.8;homepage;Privacy Policy]" ..
"button[" .. tostring(-privacy_button_size / 2 + 2.75) .. ",4.1;" .. tostring(privacy_button_size) .. ",0.8;privacy;Privacy Policy]" .. "scroll_container[5.5,0.1;9.5,6.9;scroll_credits;vertical;" ..
"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[19,0.1;0.4,6.9;vertical;scroll_credits;0]" -- originally: 15,0.1;0.4,6.9 "scrollbar[15,0.1;0.4,6.9;vertical;scroll_credits;0]"
-- 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) .. "]"
return fs, "size[19.5,7.1,false]real_coordinates[true]" -- originally: 15.5,7.1 if PLATFORM == "Android" then
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.privacy then if fields.homepage then
core.open_url("https://cubesoftware.xyz/sussycraft/privacy.html") core.open_url("https://cubesoftware.xyz/sussycraft/privacy.html")
end end
if fields.discord then if fields.share_debug then
core.open_url("https://discord.gg/aJmhBN74sh") local path = core.get_user_path() .. DIR_DELIM .. "debug.txt"
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,54 +16,41 @@
--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 = serverlistmgr.get_favorites(), fav = {},
public = {main_serv}, public = {},
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
@ -73,31 +60,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.30;" .. fgettext("Address") .. "]" .. "label[0.25,0.35;" .. fgettext("Address") .. "]" ..
"label[4,0.30;" .. fgettext("Port") .. "]" .. "label[4.25,0.35;" .. fgettext("Port") .. "]" ..
"field[0.25,0.5;3.75,0.75;te_address;;" .. "field[0.25,0.5;4,0.75;te_address;;" ..
core.formspec_escape(core.settings:get("address")) .. "]" .. core.formspec_escape(core.settings:get("address")) .. "]" ..
"field[4,0.5;1.5,0.75;te_port;;" .. "field[4.25,0.5;1.25,0.75;te_port;;" ..
core.formspec_escape(core.settings:get("remote_port")) .. "]" .. core.formspec_escape(core.settings:get("remote_port")) .. "]" ..
-- Description Background -- Description Background
@ -121,7 +108,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 recent") .. "]" retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]"
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;]"
@ -161,14 +148,13 @@ 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,0.2;9.25,6.65;servers;" "table[0.25,1;9.25,5.75;servers;"
local servers = get_sorted_servers() local servers = get_sorted_servers()
--minetest.debug("Serverlist: " .. dump(servers))
local dividers = { local dividers = {
fav = "5,#ffff00," .. fgettext("Recent") .. ",,,0,0,,", fav = "5,#ffff00," .. fgettext("Favorites") .. ",,,0,0,,",
public = "6,#4bdd42," .. fgettext("Main Servers") .. ",,,0,0,,", public = "6,#4bdd42," .. fgettext("Public 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"}
@ -199,60 +185,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
@ -338,27 +324,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
@ -379,10 +365,7 @@ 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
@ -430,15 +413,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 = nil on_change = on_change
} }

@ -1 +1 @@
Subproject commit a3846876ece257adce772a7df767598a949b0c23 Subproject commit adefaaf592d9479cc3870c270ef9d415c305ee5a

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 11 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) 2023 SussyCraft Developers ("PROJECT_NAME_C") and (c) 2011-2015 celeron55 (Minetest engine)" VALUE "LegalCopyright", "(c) 2011-2015 celeron55"
VALUE "LegalTrademarks", "SussyCraft is a modified version of ""Minetest"". ""Minetest"" is the property of the Minetest community, don't use it without permission!" VALUE "LegalTrademarks", """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,27 +142,7 @@ 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();
@ -193,18 +173,7 @@ 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 "SussyCraft" #define PROJECT_NAME_C "Minetest"
#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 (32) #define TTF_DEFAULT_FONT_SIZE (16)

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.minetest.net"); settings->setDefault("serverlist_url", "servers.cubesoftware.xyz");
// 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", "90"); settings->setDefault("fov", "72");
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,22 +252,17 @@ 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", "true"); settings->setDefault("enable_waving_water", "false");
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", "true"); settings->setDefault("enable_waving_leaves", "false");
settings->setDefault("enable_waving_plants", "true"); settings->setDefault("enable_waving_plants", "false");
// Effects Shadows // Effects Shadows
settings->setDefault("enable_dynamic_shadows", "false"); settings->setDefault("enable_dynamic_shadows", "false");
@ -284,7 +279,7 @@ void set_default_settings()
// Input // Input
settings->setDefault("invert_mouse", "false"); settings->setDefault("invert_mouse", "false");
settings->setDefault("mouse_sensitivity", "0.08"); settings->setDefault("mouse_sensitivity", "0.05");
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");
@ -328,7 +323,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", "16"); // Default "font_size" settings->setDefault("chat_font_size", "0"); // Default "font_size"
// ContentDB // ContentDB
settings->setDefault("contentdb_url", "https://content.minetest.net"); settings->setDefault("contentdb_url", "https://content.minetest.net");
@ -507,15 +502,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", "21"); settings->setDefault("font_size", "16");
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", "21"); settings->setDefault("font_size", "16");
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", "21"); settings->setDefault("font_size", "16");
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] = 40; light_LUT[0] = 0;
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++) {