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
project(minetest)
set(PROJECT_NAME_CAPITALIZED "SussyCraft")
set(PROJECT_NAME_CAPITALIZED "Minetest")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
@ -17,9 +17,9 @@ set(GCC_MINIMUM_VERSION "5.1")
set(CLANG_MINIMUM_VERSION "3.5")
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
set(VERSION_MAJOR 1)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
set(VERSION_MAJOR 5)
set(VERSION_MINOR 6)
set(VERSION_PATCH 1)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# 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 a modified 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 the original README from the Minetest repository.
Minetest
========
@ -40,8 +17,8 @@ and contributors (see source file comments and the version control log)
In case you downloaded the source code
--------------------------------------
If you downloaded the SuusyCraft 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)
If you downloaded the Minetest Engine source code in which this file is
contained, you probably want to download the [Minetest Game](https://github.com/minetest/minetest_game/)
project too. See its README.txt for more information.
Table of Contents

View File

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

View File

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

View File

@ -45,7 +45,6 @@ import java.util.Objects;
// Native code finds these methods by name (see porting_android.cpp).
// This annotation prevents the minifier/Proguard from mangling them.
@Keep
@SuppressWarnings("unused")
public class GameActivity extends NativeActivity {
static {
System.loadLibrary("c++_shared");
@ -195,7 +194,7 @@ public class GameActivity extends NativeActivity {
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.setDataAndType(fileUri, getContentResolver().getType(fileUri));
@ -205,4 +204,4 @@ public class GameActivity extends NativeActivity {
Intent shareIntent = Intent.createChooser(intent, null);
startActivity(shareIntent);
}
}
}

View File

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

View File

@ -29,10 +29,10 @@ import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Environment;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import java.io.File;
@ -77,6 +77,9 @@ public class UnzipService extends IntentService {
try {
setIsRunning(true);
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 (OutputStream out = new FileOutputStream(zipFile)) {
@ -95,9 +98,7 @@ public class UnzipService extends IntentService {
failureMessage = e.getLocalizedMessage();
} finally {
setIsRunning(false);
if (!zipFile.delete()) {
Log.w("UnzipService", "Minetest installation ZIP cannot be deleted");
}
zipFile.delete();
}
}
@ -130,12 +131,8 @@ public class UnzipService extends IntentService {
Intent notificationIntent = new Intent(this, MainActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_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,
notificationIntent, pendingIntentFlag);
notificationIntent, 0);
builder.setContentTitle(getString(R.string.notification_title))
.setSmallIcon(R.mipmap.ic_launcher)
@ -159,7 +156,7 @@ public class UnzipService extends IntentService {
int readLen;
byte[] readBuffer = new byte[16384];
try (FileInputStream fileInputStream = new FileInputStream(zipFile);
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream)) {
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream)) {
ZipEntry ze;
while ((ze = zipInputStream.getNextEntry()) != null) {
if (ze.isDirectory()) {
@ -168,17 +165,8 @@ public class UnzipService extends IntentService {
continue;
}
publishProgress(notificationBuilder, R.string.loading, 100 * ++per / size);
// "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)) {
try (OutputStream outputStream = new FileOutputStream(
new File(userDataDirectory, ze.getName()))) {
while ((readLen = zipInputStream.read(readBuffer)) != -1) {
outputStream.write(readBuffer, 0, readLen);
}
@ -222,9 +210,7 @@ public class UnzipService extends IntentService {
return;
publishProgress(notificationBuilder, R.string.migrating, 0);
if (!newLocation.mkdir()) {
Log.e("UnzipService", "New installation folder cannot be made");
}
newLocation.mkdir();
String[] dirs = new String[] { "worlds", "games", "mods", "textures", "client" };
for (int i = 0; i < dirs.length; i++) {
@ -242,9 +228,7 @@ public class UnzipService extends IntentService {
}
}
if (!recursivelyDeleteDirectory(oldLocation)) {
Log.w("UnzipService", "Old installation files cannot be deleted successfully");
}
recursivelyDeleteDirectory(oldLocation);
}
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {

View File

@ -1,46 +1,39 @@
package net.minetest.minetest;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.File;
import java.util.Objects;
public class Utils {
@NonNull
public static File createDirs(@NonNull File root, @NonNull String dir) {
public static @NonNull File createDirs(File root, String dir) {
File f = new File(root, dir);
if (!f.isDirectory())
if (!f.mkdirs())
Log.e("Utils", "Directory " + dir + " cannot be created");
f.mkdirs();
return f;
}
@NonNull
public static File getUserDataDirectory(@NonNull Context context) {
File extDir = Objects.requireNonNull(
context.getExternalFilesDir(null),
"Cannot get external file directory"
);
public static @Nullable File getUserDataDirectory(Context context) {
File extDir = context.getExternalFilesDir(null);
if (extDir == null) {
return null;
}
return createDirs(extDir, "Minetest");
}
@NonNull
public static File getCacheDirectory(@NonNull Context context) {
return Objects.requireNonNull(
context.getCacheDir(),
"Cannot get cache directory"
);
public static @Nullable File getCacheDirectory(Context context) {
return context.getCacheDir();
}
public static boolean isInstallValid(@NonNull Context context) {
public static boolean isInstallValid(Context context) {
File userDataDirectory = getUserDataDirectory(context);
return userDataDirectory.isDirectory() &&
return userDataDirectory != null && userDataDirectory.isDirectory() &&
new File(userDataDirectory, "games").isDirectory() &&
new File(userDataDirectory, "builtin").isDirectory() &&
new File(userDataDirectory, "client").isDirectory() &&
new File(userDataDirectory, "textures").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="loading">Loading&#8230;</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="notification_title">Loading SussyCraft</string>
<string name="not_granted">Required permission wasn\'t granted, Minetest can\'t run without it</string>
<string name="notification_title">Loading Minetest</string>
<string name="notification_description">Less than 1 minute&#8230;</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>

View File

@ -1,23 +1,23 @@
// 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("versionMinor", 2) // Version Minor
project.ext.set("versionMajor", 5) // Version Major
project.ext.set("versionMinor", 6) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
project.ext.set("versionExtra", "") // Version Extra
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("versionExtra", "") // Version Extra
project.ext.set("versionCode", 42) // Android Version Code
project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release
// NOTE: +2 after each release!
// +1 for ARM and +1 for ARM64 APK's, because
// each APK must have a larger `versionCode` than the previous
buildscript {
ext.ndk_version = '25.1.8937393'
ext.ndk_version = '23.2.8568313'
repositories {
google()
mavenCentral()
jcenter()
}
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'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -27,7 +27,7 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}

View File

@ -1,6 +1,5 @@
#Fri Feb 24 12:42:36 CET 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
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'
android {
compileSdkVersion 31
compileSdkVersion 30
buildToolsVersion '30.0.3'
ndkVersion "$ndk_version"
defaultConfig {
minSdkVersion 16
targetSdkVersion 31
targetSdkVersion 30
externalNativeBuild {
ndkBuild {
arguments '-j' + Runtime.getRuntime().availableProcessors(),

View File

@ -1,2 +1,2 @@
rootProject.name = "SussyCraft"
rootProject.name = "Minetest"
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 .. "misc_helpers.lua")
-- disable day/night cycle
minetest.settings:set("time_speed", 0)
if INIT == "game" then
dofile(gamepath .. "init.lua")
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
end
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[7,4.9;3,1;btn_restore;" .. fgettext("Restore Default") .. "]" ..
"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: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.settings)
@ -123,8 +123,7 @@ local function init_globals()
end
ui.set_default("maintab")
-- disable new minetest version check because this is sussycraft MUHAHAHAHAHHAHAHA
-- check_new_version()
check_new_version()
tv_main:show()
ui.update()
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
local sussycraft_authors = {
"Kacper Kostka (kacperks)",
"<kacperks@cubesoftware.xyz>",
"(Programming, Textures)",
"SussyCraft Game Authors:",
"-----------------------------------------------------------",
"Kacper Kostka (kacperks) <kacperks@cubesoftware.xyz>",
"(Programming, Textures)",
"Łukasz Brzostowski (Looki2000)",
"<electro.brzostek@gmail.com or looki2000@cubesoftware.xyz>",
"(Programming, Textures, 3D Models, Soundtrack, Sounds)",
"-----------------------------------------------------------",
"Karol Rostek (karoltoja200)",
"<discord: karoltoja200#6809>",
"Karol Rostek (karoltoja200) discord:karoltoja200#6809",
"(Textures)",
"-----------------------------------------------------------",
"Dawid Cholewiusz (D47 0_o)",
"<discord: D46 0_o#8952>",
"Dawid Cholewiusz (D47 0_o) discord:D46 0_o#8952",
"(Structures builder)",
"-----------------------------------------------------------",
"Kacper Brzostowski",
"(wooden plank texture)",
"Kacper Brzostowski (wooden plank texture)",
}
-- https://github.com/orgs/minetest/teams/engine/members
@ -158,7 +148,6 @@ return {
prepare_credits(credit_list, sussycraft_authors)
table.insert_all(credit_list, {
"",
core.colorize("#ffdd33", fgettext("Minetest Engine Developers"))
})
prepare_credits(credit_list, core_developers)
@ -195,41 +184,42 @@ return {
-- account for the visible portion
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) .. "]" ..
"style[label_button;border=false]" ..
"button[0.1,3.4;5.3,0.5;label_button;" ..
core.formspec_escape("SussyCraft " .. core.get_version().string) .. "]" ..
"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
core.formspec_escape("SussyCraft 0.8") .. "]" ..
"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;" ..
tostring(scroll_height / 1000) .. "]" .. credit_fs ..
"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
fs = fs .. "style[label_button2;border=false]" ..
"button[0.1,6;5.3,1;label_button2;" ..
fgettext("Active renderer:") .. "\n" ..
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,
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")
end
if fields.discord then
core.open_url("https://discord.gg/aJmhBN74sh")
if fields.share_debug then
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,
}

View File

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

View File

@ -16,54 +16,41 @@
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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 = {
fav = serverlistmgr.get_favorites(),
public = {main_serv},
fav = {},
public = {},
incompatible = {}
}
--local favs = serverlistmgr.get_favorites()
--local taken_favs = {}
--local result = menudata.search_result or serverlistmgr.servers
--for _, server in ipairs(result) do
-- server.is_favorite = false
-- for index, fav in ipairs(favs) do
-- if server.address == fav.address and server.port == fav.port then
-- taken_favs[index] = true
-- server.is_favorite = true
-- break
-- end
-- end
-- server.is_compatible = is_server_protocol_compat(server.proto_min, server.proto_max)
-- if server.is_favorite then
-- table.insert(servers.fav, server)
-- elseif server.is_compatible then
-- table.insert(servers.public, server)
-- else
-- table.insert(servers.incompatible, server)
-- end
--end
--
--if not menudata.search_result then
-- for index, fav in ipairs(favs) do
-- if not taken_favs[index] then
-- table.insert(servers.fav, fav)
-- end
-- end
--end
local favs = serverlistmgr.get_favorites()
local taken_favs = {}
local result = menudata.search_result or serverlistmgr.servers
for _, server in ipairs(result) do
server.is_favorite = false
for index, fav in ipairs(favs) do
if server.address == fav.address and server.port == fav.port then
taken_favs[index] = true
server.is_favorite = true
break
end
end
server.is_compatible = is_server_protocol_compat(server.proto_min, server.proto_max)
if server.is_favorite then
table.insert(servers.fav, server)
elseif server.is_compatible then
table.insert(servers.public, server)
else
table.insert(servers.incompatible, server)
end
end
if not menudata.search_result then
for index, fav in ipairs(favs) do
if not taken_favs[index] then
table.insert(servers.fav, fav)
end
end
end
return servers
end
@ -73,31 +60,31 @@ local function get_formspec(tabview, name, tabdata)
-- it may have changed after a change by the settings menu.
common_update_cached_supp_proto()
--if not tabdata.search_for then
-- tabdata.search_for = ""
--end
if not tabdata.search_for then
tabdata.search_for = ""
end
local retval =
-- Search
--"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
--"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.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;]" ..
--"tooltip[btn_mp_clear;" .. fgettext("Clear") .. "]" ..
--"tooltip[btn_mp_search;" .. fgettext("Search") .. "]" ..
--"tooltip[btn_mp_refresh;" .. fgettext("Refresh") .. "]" ..
--"container_end[]" ..
"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
"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.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;]" ..
"tooltip[btn_mp_clear;" .. fgettext("Clear") .. "]" ..
"tooltip[btn_mp_search;" .. fgettext("Search") .. "]" ..
"tooltip[btn_mp_refresh;" .. fgettext("Refresh") .. "]" ..
"container_end[]" ..
"container[9.75,0]" ..
"box[0,0;5.75,7;#666666]" ..
-- Address / Port
"label[0.25,0.30;" .. fgettext("Address") .. "]" ..
"label[4,0.30;" .. fgettext("Port") .. "]" ..
"field[0.25,0.5;3.75,0.75;te_address;;" ..
"label[0.25,0.35;" .. fgettext("Address") .. "]" ..
"label[4.25,0.35;" .. fgettext("Port") .. "]" ..
"field[0.25,0.5;4,0.75;te_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")) .. "]" ..
-- Description Background
@ -121,7 +108,7 @@ local function get_formspec(tabview, name, tabdata)
if tabdata.selected 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 .. "image_button[5,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir ..
"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;" ..
"color,align=inline,span=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()
--minetest.debug("Serverlist: " .. dump(servers))
local dividers = {
fav = "5,#ffff00," .. fgettext("Recent") .. ",,,0,0,,",
public = "6,#4bdd42," .. fgettext("Main Servers") .. ",,,0,0,,",
fav = "5,#ffff00," .. fgettext("Favorites") .. ",,,0,0,,",
public = "6,#4bdd42," .. fgettext("Public Servers") .. ",,,0,0,,",
incompatible = "7,"..mt_color_grey.."," .. fgettext("Incompatible Servers") .. ",,,0,0,,"
}
local order = {"fav", "public", "incompatible"}
@ -199,60 +185,60 @@ end
--------------------------------------------------------------------------------
--local function search_server_list(input)
-- menudata.search_result = nil
-- if #serverlistmgr.servers < 2 then
-- return
-- end
--
-- -- setup the keyword list
-- local keywords = {}
-- for word in input:gmatch("%S+") do
-- word = word:gsub("(%W)", "%%%1")
-- table.insert(keywords, word)
-- end
--
-- if #keywords == 0 then
-- return
-- end
--
-- menudata.search_result = {}
--
-- -- Search the serverlist
-- local search_result = {}
-- for i = 1, #serverlistmgr.servers do
-- local server = serverlistmgr.servers[i]
-- local found = 0
-- for k = 1, #keywords do
-- local keyword = keywords[k]
-- if server.name then
-- local sername = server.name:lower()
-- local _, count = sername:gsub(keyword, keyword)
-- found = found + count * 4
-- end
--
-- if server.description then
-- local desc = server.description:lower()
-- local _, count = desc:gsub(keyword, keyword)
-- found = found + count * 2
-- end
-- end
-- if found > 0 then
-- local points = (#serverlistmgr.servers - i) / 5 + found
-- server.points = points
-- table.insert(search_result, server)
-- end
-- end
--
-- if #search_result == 0 then
-- return
-- end
--
-- table.sort(search_result, function(a, b)
-- return a.points > b.points
-- end)
-- menudata.search_result = search_result
--end
local function search_server_list(input)
menudata.search_result = nil
if #serverlistmgr.servers < 2 then
return
end
-- setup the keyword list
local keywords = {}
for word in input:gmatch("%S+") do
word = word:gsub("(%W)", "%%%1")
table.insert(keywords, word)
end
if #keywords == 0 then
return
end
menudata.search_result = {}
-- Search the serverlist
local search_result = {}
for i = 1, #serverlistmgr.servers do
local server = serverlistmgr.servers[i]
local found = 0
for k = 1, #keywords do
local keyword = keywords[k]
if server.name then
local sername = server.name:lower()
local _, count = sername:gsub(keyword, keyword)
found = found + count * 4
end
if server.description then
local desc = server.description:lower()
local _, count = desc:gsub(keyword, keyword)
found = found + count * 2
end
end
if found > 0 then
local points = (#serverlistmgr.servers - i) / 5 + found
server.points = points
table.insert(search_result, server)
end
end
if #search_result == 0 then
return
end
table.sort(search_result, function(a, b)
return a.points > b.points
end)
menudata.search_result = search_result
end
local function set_selected_server(tabdata, idx, server)
-- reset selection
@ -338,27 +324,27 @@ local function main_button_handler(tabview, fields, name, tabdata)
return true
end
--if fields.btn_mp_clear then
-- tabdata.search_for = ""
-- menudata.search_result = nil
-- return true
--end
if fields.btn_mp_clear then
tabdata.search_for = ""
menudata.search_result = nil
return true
end
--if fields.btn_mp_search or fields.key_enter_field == "te_search" then
-- tabdata.search_for = fields.te_search
-- search_server_list(fields.te_search:lower())
-- if menudata.search_result then
-- -- first server in row 2 due to header
-- set_selected_server(tabdata, 2, menudata.search_result[1])
-- end
if fields.btn_mp_search or fields.key_enter_field == "te_search" then
tabdata.search_for = fields.te_search
search_server_list(fields.te_search:lower())
if menudata.search_result then
-- first server in row 2 due to header
set_selected_server(tabdata, 2, menudata.search_result[1])
end
-- return true
--end
return true
end
--if fields.btn_mp_refresh then
-- serverlistmgr.sync()
-- return true
--end
if fields.btn_mp_refresh then
serverlistmgr.sync()
return true
end
if (fields.btn_mp_login or fields.key_enter)
and fields.te_address ~= "" and fields.te_port then
@ -378,11 +364,8 @@ local function main_button_handler(tabview, fields, name, tabdata)
if server and server.address == gamedata.address and
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)
end
serverlistmgr.add_favorite(server)
gamedata.servername = server.name
gamedata.serverdescription = server.description
@ -430,15 +413,15 @@ local function main_button_handler(tabview, fields, name, tabdata)
return false
end
--local function on_change(type, old_tab, new_tab)
-- if type == "LEAVE" then return end
-- serverlistmgr.sync()
--end
local function on_change(type, old_tab, new_tab)
if type == "LEAVE" then return end
serverlistmgr.sync()
end
return {
name = "online",
caption = fgettext("Join Game"),
cbf_formspec = get_formspec,
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 "FileVersion", VERSION_STRING
VALUE "InternalName", PROJECT_NAME
VALUE "LegalCopyright", "(c) 2023 SussyCraft Developers ("PROJECT_NAME_C") and (c) 2011-2015 celeron55 (Minetest engine)"
VALUE "LegalTrademarks", "SussyCraft is a modified version of ""Minetest"". ""Minetest"" is the property of the Minetest community, don't use it without permission!"
VALUE "LegalCopyright", "(c) 2011-2015 celeron55"
VALUE "LegalTrademarks", """Minetest"" is the property of the Minetest community, don't use it without permission!"
VALUE "OriginalFilename", "minetest.exe"
VALUE "PrivateBuild", VERSION_EXTRA
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_HIGH_LIGHT, video::SColor(255, 30, 30, 30));
skin->setColor(gui::EGDC_3D_SHADOW, video::SColor(255, 0, 0, 0));
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, video::SColor(255, 70, 120, 50));
skin->setColor(gui::EGDC_HIGH_LIGHT_TEXT, video::SColor(255, 255, 255, 255));
#ifdef HAVE_TOUCHSCREENGUI
float density = RenderingEngine::getDisplayDensity();
@ -193,18 +173,7 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
// Irrlicht 1.8 input colours
skin->setColor(gui::EGDC_EDITABLE, video::SColor(255, 128, 128, 128));
// 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
skin->setColor(gui::EGDC_FOCUSED_EDITABLE, video::SColor(255, 96, 134, 49));
// Create the menu clouds
if (!g_menucloudsmgr)

View File

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

View File

@ -14,7 +14,7 @@
#else
#if defined (__ANDROID__)
#define PROJECT_NAME "minetest"
#define PROJECT_NAME_C "SussyCraft"
#define PROJECT_NAME_C "Minetest"
#define STATIC_SHAREDIR ""
#define ENABLE_UPDATE_CHECKER 0
#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
*/
#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("name", "");
settings->setDefault("bind_address", "");
settings->setDefault("serverlist_url", "servers.minetest.net");
settings->setDefault("serverlist_url", "servers.cubesoftware.xyz");
// Client
settings->setDefault("address", "");
@ -179,7 +179,7 @@ void set_default_settings()
settings->setDefault("autosave_screensize", "true");
settings->setDefault("fullscreen", "false");
settings->setDefault("vsync", "true");
settings->setDefault("fov", "90");
settings->setDefault("fov", "72");
settings->setDefault("leaves_style", "fancy");
settings->setDefault("connected_glass", "false");
settings->setDefault("smooth_lighting", "true");
@ -252,22 +252,17 @@ void set_default_settings()
// Effects
settings->setDefault("directional_colored_fog", "true");
settings->setDefault("inventory_items_animations", "false");
# if ENABLE_GLES
settings->setDefault("mip_map", "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("trilinear_filter", "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_length", "20.0");
settings->setDefault("water_wave_speed", "5.0");
settings->setDefault("enable_waving_leaves", "true");
settings->setDefault("enable_waving_plants", "true");
settings->setDefault("enable_waving_leaves", "false");
settings->setDefault("enable_waving_plants", "false");
// Effects Shadows
settings->setDefault("enable_dynamic_shadows", "false");
@ -284,7 +279,7 @@ void set_default_settings()
// Input
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("safe_dig_and_place", "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);
settings->setDefault("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
settings->setDefault("contentdb_url", "https://content.minetest.net");
@ -507,15 +502,15 @@ void set_default_settings()
if (x_inches < 3.7f) {
settings->setDefault("hud_scaling", "0.6");
settings->setDefault("font_size", "21");
settings->setDefault("font_size", "16");
settings->setDefault("mono_font_size", "14");
} else if (x_inches < 4.5f) {
settings->setDefault("hud_scaling", "0.7");
settings->setDefault("font_size", "21");
settings->setDefault("font_size", "16");
settings->setDefault("mono_font_size", "14");
} else if (x_inches < 6.0f) {
settings->setDefault("hud_scaling", "0.85");
settings->setDefault("font_size", "21");
settings->setDefault("font_size", "16");
settings->setDefault("mono_font_size", "14");
}
// 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);
// Boundary values should be fixed
light_LUT[0] = 40;
light_LUT[0] = 0;
light_LUT[LIGHT_SUN] = 255;
for (size_t i = 1; i < LIGHT_SUN; i++) {