mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-22 17:12:25 -05:00
BlockEdit: Also allow changing whether a block emits and/or stops light
Also set an actual proper file version for the android APK
This commit is contained in:
parent
d04327c5e7
commit
83e331c500
2 changed files with 29 additions and 2 deletions
|
@ -2,8 +2,8 @@
|
||||||
<!-- BEGIN_INCLUDE(manifest) -->
|
<!-- BEGIN_INCLUDE(manifest) -->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.classicube.android.client"
|
package="com.classicube.android.client"
|
||||||
android:versionCode="1"
|
android:versionCode="1360"
|
||||||
android:versionName="1.0">
|
android:versionName="1.3.6">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
|
||||||
|
|
|
@ -550,11 +550,28 @@ static cc_bool BlockEditCommand_GetCoords(const cc_string* str, Vec3* coords) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cc_bool BlockEditCommand_GetBool(const cc_string* str, const char* name, cc_bool* value) {
|
||||||
|
if (String_CaselessEqualsConst(str, "true") || String_CaselessEqualsConst(str, "yes")) {
|
||||||
|
*value = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String_CaselessEqualsConst(str, "false") || String_CaselessEqualsConst(str, "no")) {
|
||||||
|
*value = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Chat_Add1("&eBlockEdit: &e%c must be either &ayes &eor &ano", name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void BlockEditCommand_Execute(const cc_string* args, int argsCount__) {
|
static void BlockEditCommand_Execute(const cc_string* args, int argsCount__) {
|
||||||
cc_string parts[3];
|
cc_string parts[3];
|
||||||
cc_string* prop;
|
cc_string* prop;
|
||||||
cc_string* value;
|
cc_string* value;
|
||||||
int argsCount, block, v;
|
int argsCount, block, v;
|
||||||
|
cc_bool b;
|
||||||
Vec3 coords;
|
Vec3 coords;
|
||||||
|
|
||||||
if (String_CaselessEqualsConst(args, "properties")) {
|
if (String_CaselessEqualsConst(args, "properties")) {
|
||||||
|
@ -573,6 +590,8 @@ static void BlockEditCommand_Execute(const cc_string* args, int argsCount__) {
|
||||||
Chat_AddRaw("&eEditable block properties (page 2):");
|
Chat_AddRaw("&eEditable block properties (page 2):");
|
||||||
Chat_AddRaw("&a walksound &e- Sets walk/step sound of the block");
|
Chat_AddRaw("&a walksound &e- Sets walk/step sound of the block");
|
||||||
Chat_AddRaw("&a breaksound &e- Sets break sound of the block");
|
Chat_AddRaw("&a breaksound &e- Sets break sound of the block");
|
||||||
|
Chat_AddRaw("&a emitslight &e- Sets whether the block emits light");
|
||||||
|
Chat_AddRaw("&a blockslight &e- Sets whether the block stops light");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -651,6 +670,14 @@ static void BlockEditCommand_Execute(const cc_string* args, int argsCount__) {
|
||||||
if (!BlockEditCommand_GetInt(value, "Sound", &v, 0, SOUND_COUNT - 1)) return;
|
if (!BlockEditCommand_GetInt(value, "Sound", &v, 0, SOUND_COUNT - 1)) return;
|
||||||
|
|
||||||
Blocks.DigSounds[block] = v;
|
Blocks.DigSounds[block] = v;
|
||||||
|
} else if (String_CaselessEqualsConst(prop, "emitslight")) {
|
||||||
|
if (!BlockEditCommand_GetBool(value, "Emits light", &b)) return;
|
||||||
|
|
||||||
|
Blocks.FullBright[block] = b;
|
||||||
|
} else if (String_CaselessEqualsConst(prop, "blockslight")) {
|
||||||
|
if (!BlockEditCommand_GetBool(value, "Blocks light", &b)) return;
|
||||||
|
|
||||||
|
Blocks.BlocksLight[block] = b;
|
||||||
} else {
|
} else {
|
||||||
Chat_Add1("&eBlockEdit: &eUnknown property %s &e(See &a/client help blockedit&e)", prop);
|
Chat_Add1("&eBlockEdit: &eUnknown property %s &e(See &a/client help blockedit&e)", prop);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue