Add --print-features

This commit is contained in:
TheBrokenRail 2020-12-08 16:32:12 -05:00
parent 3533830669
commit f81bf3c67f
3 changed files with 15 additions and 7 deletions

View File

@ -2,8 +2,8 @@
set -e set -e
# Ensure Features Are Selected # All Feature Flags
MCPI_FEATURES="$(zenity --class 'Minecraft - Pi edition' --list --checklist --column 'Enabled' --column 'Feature' \ export AVAILABLE_FEATURES=" \
TRUE 'Touch GUI' \ TRUE 'Touch GUI' \
TRUE 'Fix Bow & Arrow' \ TRUE 'Fix Bow & Arrow' \
TRUE 'Fix Attacking' \ TRUE 'Fix Attacking' \
@ -18,7 +18,16 @@ MCPI_FEATURES="$(zenity --class 'Minecraft - Pi edition' --list --checklist --co
TRUE 'Remove Invalid Item Background' \ TRUE 'Remove Invalid Item Background' \
TRUE 'Disable gui_blocks Atlas' \ TRUE 'Disable gui_blocks Atlas' \
TRUE 'Smooth Lighting' \ TRUE 'Smooth Lighting' \
FALSE '3D Anaglyph')" FALSE '3D Anaglyph'"
# Print Feature Flags Option
if [ "$1" = "--print-features" ]; then
echo "${AVAILABLE_FEATURES}"
exit 0
fi
# Ensure Features Are Selected
MCPI_FEATURES="$(sh -c "zenity --class 'Minecraft - Pi edition' --list --checklist --column 'Enabled' --column 'Feature' ${AVAILABLE_FEATURES}")"
MCPI_USERNAME="$(zenity --class 'Minecraft - Pi edition' --entry --text 'Minecraft Username:' --entry-text 'StevePi')" MCPI_USERNAME="$(zenity --class 'Minecraft - Pi edition' --entry --text 'Minecraft Username:' --entry-text 'StevePi')"
export MCPI_FEATURES export MCPI_FEATURES
export MCPI_USERNAME export MCPI_USERNAME

View File

@ -20,8 +20,8 @@ static void set_is_survival(int new_is_survival) {
unsigned char size_patch[4] = {new_is_survival ? 0x24 : 0x18, 0x00, 0xa0, 0xe3}; unsigned char size_patch[4] = {new_is_survival ? 0x24 : 0x18, 0x00, 0xa0, 0xe3};
patch((void *) 0x16ee4, size_patch); patch((void *) 0x16ee4, size_patch);
// Replace Creator Constructor With CreativeMode Or SurvivalMode Constructor // Replace Default CreatorMode Constructor With CreatorMode Or SurvivalMode Constructor
overwrite(Creator, new_is_survival ? SurvivalMode : CreativeMode); overwrite_call((void *) 0x16ef4, new_is_survival ? SurvivalMode : CreatorMode);
is_survival = new_is_survival; is_survival = new_is_survival;
} }

View File

@ -135,9 +135,8 @@ static Gui_renderOnSelectItemNameText_t Gui_renderOnSelectItemNameText = (Gui_re
// GameMode Constructors // GameMode Constructors
static void *Creator = (void *) 0x1a044; static void *CreatorMode = (void *) 0x1a044;
static void *SurvivalMode = (void *) 0x1b7d8; static void *SurvivalMode = (void *) 0x1b7d8;
static void *CreativeMode = (void *) 0x1b258;
// LevelData // LevelData