Compare commits

..

2 Commits

Author SHA1 Message Date
4f32cfab45 Send Button In Chat
All checks were successful
Build / Build (AMD64, Server) (push) Successful in 9m38s
Build / Build (AMD64, Client) (push) Successful in 10m0s
Build / Build (ARM64, Server) (push) Successful in 7m58s
Build / Build (ARM64, Client) (push) Successful in 10m35s
Build / Build (ARMHF, Client) (push) Successful in 8m50s
Build / Build (ARMHF, Server) (push) Successful in 6m45s
Build / Test (Server) (push) Successful in 10m54s
Build / Release (push) Has been skipped
Build / Test (Client) (push) Successful in 16m7s
2024-02-01 14:56:16 -05:00
69211eb31d Improve Markdown Formatting 2024-02-01 03:18:47 -05:00
53 changed files with 249 additions and 194 deletions

@ -1 +1 @@
Subproject commit 059e572256667f696f2f1ac9f5253859d54f50c4
Subproject commit 95e24d13fa223ff524f8920314c4984686c73928

View File

@ -14,7 +14,7 @@
2. If a setting is cached, then the dialog's default value will be the cached value instead of the normal default.
3. When configuration has been completed, the settings specified will be cached.
2. The launcher replaces itself with MCPI.
1. MCPI-Reborn components are loaded using ``LD_PRELOAD`` and ``LD_LIBRARY_PATH``.
1. MCPI-Reborn components are loaded using `LD_PRELOAD` and `LD_LIBRARY_PATH`.
2. If the Media Layer Proxy is enabled, then the Media Layer Proxy Client is started as a sub-process.
### Server
@ -27,11 +27,11 @@
This component configures the various environmental variables required for MCPI-Reborn to work. When running in client-mode, this component will also launch several Zenity dialogs for interactive configuration.
The environmental variables configured by this component includes:
* ``LD_PRELOAD``
* ``LD_LIBRARY_PATH``
* ``MCPI_FEATURE_FLAGS``
* ``MCPI_RENDER_DISTANCE``
* ``MCPI_USERNAME``
* `LD_PRELOAD`
* `LD_LIBRARY_PATH`
* `MCPI_FEATURE_FLAGS`
* `MCPI_RENDER_DISTANCE`
* `MCPI_USERNAME`
This is always compiled for the host system's architecture.
@ -78,11 +78,11 @@ This is always compiled for ARM.
This sub-component includes headers for SDL, GLES, and EGL allowing easy (cross-)compilation.
### Mods
This component patches MCPI to modify its behavior. It's loaded using ``LD_PRELOAD``.
This component patches MCPI to modify its behavior. It's loaded using `LD_PRELOAD`.
This is always compiled for ARM.
### ``libreborn``
### `libreborn`
This component contains various utility functions including:
* Code Patching (ARM Only)
@ -91,7 +91,7 @@ This component contains various utility functions including:
The code patching is ARM only because it relies on hard-coded ARM instructions. However, this is irrelevant since code patching is only needed in ARM code (to patch MCPI).
### ``symbols``
### `symbols`
This component contains all MCPI symbols.
## Dependencies

View File

@ -19,4 +19,4 @@
```
### Environment Variables
* ``MCPI_TOOLCHAIN_USE_DEFAULT_SEARCH_PATHS``: Use Default CMake Search Paths Rather Than Guessing
* `MCPI_TOOLCHAIN_USE_DEFAULT_SEARCH_PATHS`: Use Default CMake Search Paths Rather Than Guessing

View File

@ -1,41 +1,41 @@
# Changelog
**2.5.3**
* Add ``Replace Block Highlight With Outline`` Feature Flag (Enabled By Default)
* Add `Replace Block Highlight With Outline` Feature Flag (Enabled By Default)
* By Default, The Outline Width Is Set Using The GUI Scale
* This Can Be Overridden Using The ``MCPI_BLOCK_OUTLINE_WIDTH`` Environmental Variable
* Added ``overwrite_calls_within`` Function
* This Can Be Overridden Using The `MCPI_BLOCK_OUTLINE_WIDTH` Environmental Variable
* Added `overwrite_calls_within` Function
**2.5.2**
* Add ``3D Chest Model`` Feature Flag (Enabled By Default)
* Add `3D Chest Model` Feature Flag (Enabled By Default)
* Stop Using Jenkins
* Replace ``iconv``
* Replace `iconv`
* Replace LibPNG
**2.5.1**
* Allow Overriding Custom Skin Server Using ``MCPI_SKIN_SERVER`` Environmental Variable
* Allow Overriding Custom Skin Server Using `MCPI_SKIN_SERVER` Environmental Variable
* Fix Bug With SDK Generation
**2.5.0**
* [Custom skin support](CUSTOM_SKINS.md)!
* Add ``Load Custom Skins`` Feature Flag (Enabled By Default)
* Add `Load Custom Skins` Feature Flag (Enabled By Default)
**2.4.9**
* Allow Overriding GUI Scale With ``MCPI_GUI_SCALE`` Environmental Variable
* Add ``Disable Block Tinting`` Feature Flag (Disabled By Default)
* Add ``Disable Hostile AI In Creative Mode`` Feature Flag (Enabled By Default)
* Allow Overriding GUI Scale With `MCPI_GUI_SCALE` Environmental Variable
* Add `Disable Block Tinting` Feature Flag (Disabled By Default)
* Add `Disable Hostile AI In Creative Mode` Feature Flag (Enabled By Default)
* Allow Accessing Configuration At Runtime (Useful For Mods That Need To Support Multiple Versions)
**2.4.8**
* Fix Bug In ``extract_from_bl_instruction``
* Fix Bug In `extract_from_bl_instruction`
* Update LIEF And GLFW
* Allow Mods To Access The Original GLFW Keycode For Key Events (But Better)
* More Accurate Sound
**2.4.7**
* Improve Server Performance
* Add ``Add Biome Colors To Grass`` Feature Flag (Disabled By Default)
* Add ``Generate Caves`` Feature Flag (Enabled By Default)
* Add `Add Biome Colors To Grass` Feature Flag (Disabled By Default)
* Add `Generate Caves` Feature Flag (Enabled By Default)
* Allow Mods To Access The Original GLFW Keycode For Key Events
**2.4.6**
@ -49,16 +49,16 @@
**2.4.4**
* Cache Previous Launcher Configuration
* Add ``MCPI_API_PORT`` Environmental Variable
* Add `MCPI_API_PORT` Environmental Variable
* Fix Particles In Front-Facing View
* Fixed Launch Crash On Ubuntu ARM64
* PatchELF Replaced With LIEF
* Moved ``3D Anaglyph`` Feature Flag To Options Screen
* Add ``Improved Classic Title Screen`` Feature Flag (Enabled By Default)
* Moved `3D Anaglyph` Feature Flag To Options Screen
* Add `Improved Classic Title Screen` Feature Flag (Enabled By Default)
* Add Quit button
* Add Options Button (Moved From ``Fix Options Screen`` Feature Flag)
* Add ``Disable Speed Bridging`` Feature Flag (Disabled By Default)
* Add ``Disable Creative Mode Mining Delay`` Feature Flag (Disabled By Default)
* Add Options Button (Moved From `Fix Options Screen` Feature Flag)
* Add `Disable Speed Bridging` Feature Flag (Disabled By Default)
* Add `Disable Creative Mode Mining Delay` Feature Flag (Disabled By Default)
* Improved Feature Flag Names
* Miscellaneous Bug Fixes
* Improved Build System
@ -80,11 +80,11 @@
* More Reliable AppImages
* CMake Refactors
* Disable Broken Touchscreen-Specific Block Outline Behavior
* Add ``Remove Forced GUI Lag (Can Break Joining Servers)`` Feature Flag (Disabled By Default)
* Add ``Add Buckets`` Feature Flag (Enabled By Default)
* Add ``Classic HUD`` Feature Flag (Enabled By Default)
* Add ``Translucent Toolbar`` Feature Flag (Enabled By Default)
* Add ``Force EGL`` Feature Flag (Disabled By Default)
* Add `Remove Forced GUI Lag (Can Break Joining Servers)` Feature Flag (Disabled By Default)
* Add `Add Buckets` Feature Flag (Enabled By Default)
* Add `Classic HUD` Feature Flag (Enabled By Default)
* Add `Translucent Toolbar` Feature Flag (Enabled By Default)
* Add `Force EGL` Feature Flag (Disabled By Default)
* Fix Sound Pitch/Volume/Attenuation
* Fix Holding Left-Click When Attacking
* Don't Force EGL (Should Fix Some NVIDIA Systems)
@ -98,7 +98,7 @@
* Bug Fixes
**2.3.11**
* ``--version`` Command Line Option
* `--version` Command Line Option
* TPS Measured In Benchmark & Server
* Front-Facing Third-Person
* GLESv1 Comparability Layer
@ -124,39 +124,39 @@
* Don't Append Hyphens To New World Name, Only Folder Names
**2.3.6**
* Fix ``Invert Y-axis`` Option Name
* Fix `Invert Y-axis` Option Name
* Improve Touch GUI Inventory In Non-Touch GUI
* New Create World Dialog
* Controlled By ``Implement Create World Dialog`` Feature Flag (Enabled By Default)
* Controlled By `Implement Create World Dialog` Feature Flag (Enabled By Default)
* Custom World Names
* Game-Mode Selection
* Custom Seeds
**2.3.5**
* Renamed Some Feature Flags
* Add ``Improved Title Background`` Feature Flag (Enabled By Default)
* Add `Improved Title Background` Feature Flag (Enabled By Default)
* Non-Touch GUI Rework
* Make ``Full Touch GUI`` Feature Flag Disabled By Default
* Add ``Force Touch GUI Button Behavior`` Feature Flag (Enabled By Default)
* Add ``Improved Button Hover Behavior`` Feature Flag (Enabled By Default)
* Make `Full Touch GUI` Feature Flag Disabled By Default
* Add `Force Touch GUI Button Behavior` Feature Flag (Enabled By Default)
* Add `Improved Button Hover Behavior` Feature Flag (Enabled By Default)
**2.3.4**
* AppImage Fixes
* Make Death Messages Customizable Server-Side
* Fix Q-Key Behavior Behavior When Editing Signs
* Add ``Force Touch Inventory`` Feature Flag (Disabled By Default)
* Add ``Fix Pause Menu`` Feature Flag (Enabled By Default)
* Add `Force Touch Inventory` Feature Flag (Disabled By Default)
* Add `Fix Pause Menu` Feature Flag (Enabled By Default)
* Enables Server Visibility Toggle Button
* Options Changes (Not Supported On Legacy)
* Add ``Fix Options Screen`` Feature Flag (Enabled By Default)
* Add `Fix Options Screen` Feature Flag (Enabled By Default)
* Adds Options Button To Classic UI Start Screen
* Removes Useless Options Toggles
* Fixes Options Toggles' Default Position
* Store Multiple Settings In `options.txt`
* ``Peaceful Mode`` Feature Flag Moved To ``game_difficulty``
* ``Smooth Lighting`` Feature Flag Moved To ``gfx_ao``
* ``Fancy Graphics`` Feature Flag Moved To ``gfx_fancygraphics``
* ``Disable Hosting LAN Worlds`` Feature Flag Moved To ``mp_server_visible_default``
* `Peaceful Mode` Feature Flag Moved To `game_difficulty`
* `Smooth Lighting` Feature Flag Moved To `gfx_ao`
* `Fancy Graphics` Feature Flag Moved To `gfx_fancygraphics`
* `Disable Hosting LAN Worlds` Feature Flag Moved To `mp_server_visible_default`
**2.3.3**
* Add More Blocks To Expanded Creative Inventory
@ -167,30 +167,30 @@
* Add More Blocks To Expanded Creative Inventory
* Fix Nether Reactor With Creative Restrictions Disabled
* Alphabetize Feature Flags
* Add ``Disable V-Sync`` Feature Flag (Disabled By Default)
* Add `Disable V-Sync` Feature Flag (Disabled By Default)
**2.3.1**
* Internal Refactor Of ``libreborn``
* Remove Use Of ``/bin/sh``
* Internal Refactor Of `libreborn`
* Remove Use Of `/bin/sh`
* Load Custom Mods First
* Use Zenity Dark Mode
* Add ``Improved Cursor Rendering`` Feature Flag (Enabled By Default)
* Add `Improved Cursor Rendering` Feature Flag (Enabled By Default)
**2.3.0**
* Switch To AppImage For Packaging
* Prevent OpenAL From Crashing When Out Of Memory
* Vendor GLFW & Zenity
* Seamless Wayland Support
* Add ``MCPI_DEBUG`` Environmental Variable
* Add ``Disable Hosting LAN Worlds`` Feature Flag (Disabled By Default)
* Add ``Fix Furnace Not Checking Item Auxiliary`` Feature Flag (Enabled By Default)
* Add ``Disable Raw Mouse Motion (Not Recommended)`` Feature Flag (Disabled By Default) For Broken X11 Setups
* Add `MCPI_DEBUG` Environmental Variable
* Add `Disable Hosting LAN Worlds` Feature Flag (Disabled By Default)
* Add `Fix Furnace Not Checking Item Auxiliary` Feature Flag (Enabled By Default)
* Add `Disable Raw Mouse Motion (Not Recommended)` Feature Flag (Disabled By Default) For Broken X11 Setups
* Added Back `~/.minecraft-pi/mods`
* Improve Build System
* Improve Documentation
**2.2.11**
* Add ``Close Current Screen On Death`` Feature Flag (Enabled By Default) To Prevent Bugs
* Add `Close Current Screen On Death` Feature Flag (Enabled By Default) To Prevent Bugs
* Fix More Furnace UI Bugs When Using "Disable 'gui_blocks' Atlas"
**2.2.10**
@ -201,8 +201,8 @@
* Store Files In `/usr/lib`
**2.2.8**
* Add ``Hide Chat Messages`` Optional Feature Flag
* Add ``Remove Creative Mode Restrictions`` Optional Feature Flag
* Add `Hide Chat Messages` Optional Feature Flag
* Add `Remove Creative Mode Restrictions` Optional Feature Flag
* Improve GLFW->SDL Mouse Motion Event Conversion
* Performance Optimizations
* Make Majority Of Server-Specific Logging Code Also Apply To The Client
@ -234,15 +234,15 @@
* Make Missing Sound Event Cause Warning Rather Than Crash
**2.2.1**
* Prevent ``random.burp`` Sound From Crashing Game
* Prevent `random.burp` Sound From Crashing Game
* Always Cleanup Media Layer, Even On Crash
* Resolve All Sounds On Startup
**2.2.0**
* Sound Support
* Split Off ``Allow Joining Survival Servers`` From Game-Mode Mod
* Split Off `Allow Joining Survival Servers` From Game-Mode Mod
* Separate Headless Code From Server Code
* Fix Bug Where ``RakNetInstance`` Starts Pinging Potential Servers Before The "Join Game" Screen Is Opened
* Fix Bug Where `RakNetInstance` Starts Pinging Potential Servers Before The "Join Game" Screen Is Opened
* Clean-Up Code
* Remove Support For Debian Buster
@ -259,7 +259,7 @@
* Print Error Message If RakNet Fails To Start
**2.1.4**
* Fix ``RakNet::RakString`` Security Bug
* Fix `RakNet::RakString` Security Bug
**2.1.3**
* Workaround Broken Library Search Path On Some ARM 32-Bit Systems
@ -271,16 +271,16 @@
* Fix Symlink Code
**2.1.0**
* Allow Binding ``Q`` Key To Item Dropping
* Allow Binding `Q` Key To Item Dropping
* Expose More Feature Flags
* Replace ``Mob Spawning`` Feature Flag With ``Force Mob Spawning``
* Fix ``ESC`` Key In Options Menu When ``Miscellaneous Input Fixes`` Is Enabled
* Replace `Mob Spawning` Feature Flag With `Force Mob Spawning`
* Fix `ESC` Key In Options Menu When `Miscellaneous Input Fixes` Is Enabled
**2.0.9**
* Fix Translucent Preview Items In Furnace UI Being Fully Opaque When The ``gui_blocks`` Atlas Is Disabled
* Fix Translucent Preview Items In Furnace UI Being Fully Opaque When The `gui_blocks` Atlas Is Disabled
**2.0.8**
* Use Default Port In ``servers.txt`` If Not Specified
* Use Default Port In `servers.txt` If Not Specified
**2.0.7**
* Fix Sign Text Not Updating In Multiplayer When Exiting Editing UI Using Escape Button
@ -297,7 +297,7 @@
* Optimize Media Layer Proxy
**2.0.3**
* Make ``kill`` Admin Command Print Death Message
* Make `kill` Admin Command Print Death Message
**2.0.2**
* Fix Mouse Cursor Bugs

View File

@ -2,19 +2,19 @@
## Command Line Arguments
### ``--version`` (Or ``-v``)
If you run MCPI-Reborn with ``--version`` it will print its version to ``stdout``.
### `--version` (Or `-v`)
If you run MCPI-Reborn with `--version` it will print its version to `stdout`.
### ``--debug``
This sets ``MCPI_DEBUG``.
### `--debug`
This sets `MCPI_DEBUG`.
### ``--copy-sdk``
### `--copy-sdk`
This extracts the modding SDK and immediately exits. (This allows the SDK to be extracted without starting the game.)
### Client Mode Only
#### ``--print-available-feature-flags``
This print the available feature flags (and their default values) to ``stdout`` and then immediately exit.
#### `--print-available-feature-flags`
This print the available feature flags (and their default values) to `stdout` and then immediately exit.
The feature flags are printed in the following format:
```
@ -22,43 +22,43 @@ TRUE This Flag Is On By Default
FALSE This Flag Is Off By Default
```
#### ``--default``
This will skip the startup configuration dialogs and just use the default values. This will use the cached configuration unless ``--no-cache`` is used.
#### `--default`
This will skip the startup configuration dialogs and just use the default values. This will use the cached configuration unless `--no-cache` is used.
#### ``--benchmark``
#### `--benchmark`
This will make MCPI-Reborn enter a simple benchmark mode. This means automatically loading a newly generated world, then rotating the camera for a period of time. When it has finished, it will then exit and print the average FPS while the world was loaded. In this mode, all user input is blocked. However you can still modify rendering settings by changing feature flags.
The world used will always be re-created on start and uses a hard-coded seed.
#### ``--no-cache``
#### `--no-cache`
This will skip loading and saving the cached launcher configuration.
#### ``--wipe-cache``
#### `--wipe-cache`
This will wipe the cached launcher configuration.
### Server Mode Only
#### ``--only-generate``
#### `--only-generate`
This will make MCPI-Reborn immediately exit once world generation has completed. This is mainly used for automatically testing MCPI-Reborn.
## Environmental Variables
### ``MCPI_DEBUG``
### `MCPI_DEBUG`
This enables debug logging if it is set.
### ``MCPI_API_PORT``
### `MCPI_API_PORT`
This configures the API to use a different port (the default is 4711).
### Client Mode Only
If any of the following variables aren't set, one configuration dialog will open on startup for each unset variable.
#### ``MCPI_FEATURE_FLAGS``
This corresponds to ``--print-available-feature-flags``. This is just a list of all enabled feature flags separated by ``|``.
#### `MCPI_FEATURE_FLAGS`
This corresponds to `--print-available-feature-flags`. This is just a list of all enabled feature flags separated by `|`.
For instance, the string ``Feature A|Feature B`` would enable both ``Feature A`` and ``Feature B`` and *disable every other available feature flag*.
For instance, the string `Feature A|Feature B` would enable both `Feature A` and `Feature B` and *disable every other available feature flag*.
#### ``MCPI_RENDER_DISTANCE``
This is the render distance. The possible values are: ``Far``, ``Normal``, ``Short``, and ``Tiny``.
#### `MCPI_RENDER_DISTANCE`
This is the render distance. The possible values are: `Far`, `Normal`, `Short`, and `Tiny`.
#### ``MCPI_USERNAME``
#### `MCPI_USERNAME`
This is the username.

View File

@ -3,4 +3,4 @@ MCPI-Reborn supports downloading custom skins from [a central skin server](https
This *does not* cache skins and *will not* work without internet access.
Custom skins can be disabled using the ``Load Custom Skins`` feature flag.
Custom skins can be disabled using the `Load Custom Skins` feature flag.

View File

@ -1,10 +1,10 @@
# Dedicated Server
The dedicated server is a version of Minecraft: Pi Edition modified to run in a headless environment. It loads settings from a ``server.properties`` file.
The dedicated server is a version of Minecraft: Pi Edition modified to run in a headless environment. It loads settings from a `server.properties` file.
This server is also compatible with MCPE Alpha v0.6.1[^1].
## Setup
To use, install and run the ``minecraft-pi-reborn-server`` AppImage. It will generate the world and ``server.properties`` in the current directory.
To use, install and run the `minecraft-pi-reborn-server` AppImage. It will generate the world and `server.properties` in the current directory.
## Server Limitations
* Player data is not saved because of limitations with MCPE LAN worlds

View File

@ -6,16 +6,16 @@ Download packages [here](https://gitea.thebrokenrail.com/minecraft-pi-reborn/min
### System Requirements
* Debian Bullseye/Ubuntu 20.04 Or Higher
* FUSE 2
* Debian/Ubuntu: ``sudo apt install libfuse2``
* Arch: ``sudo pacman -S fuse2``
* Debian/Ubuntu: `sudo apt install libfuse2`
* Arch: `sudo pacman -S fuse2`
* Client-Only Dependencies
* Graphics Drivers
* GTK+ 3
* Debian/Ubuntu: ``sudo apt install libgtk-3-0``
* Arch: ``sudo pacman -S gtk3``
* Debian/Ubuntu: `sudo apt install libgtk-3-0`
* Arch: `sudo pacman -S gtk3`
* OpenAL
* Debian/Ubuntu: ``sudo apt install libopenal1``
* Arch: ``sudo pacman -S openal``
* Debian/Ubuntu: `sudo apt install libopenal1`
* Arch: `sudo pacman -S openal`
### Running
Follow [these](https://docs.appimage.org/introduction/quickstart.html#how-to-run-an-appimage) instructions.
@ -24,7 +24,7 @@ Follow [these](https://docs.appimage.org/introduction/quickstart.html#how-to-run
<a href="https://flathub.org/apps/details/com.thebrokenrail.MCPIReborn"><img width="240" alt="Download On Flathub" src="https://flathub.org/assets/badges/flathub-badge-en.svg" /></a>
### Note
Game data is stored in ``~/.var/app/com.thebrokenrail.MCPIReborn/.minecraft-pi`` instead of ``~/.minecraft-pi``.
Game data is stored in `~/.var/app/com.thebrokenrail.MCPIReborn/.minecraft-pi` instead of `~/.minecraft-pi`.
## Arch User Repository (Arch Linux Only)
The [``minecraft-pi-reborn-git``](https://aur.archlinux.org/packages/minecraft-pi-reborn-git) is available in the AUR.
The [`minecraft-pi-reborn-git`](https://aur.archlinux.org/packages/minecraft-pi-reborn-git) is available in the AUR.

View File

@ -5,9 +5,9 @@ MCPI-Reborn supports two ways to play multiplayer.
This is also supported by vanilla MCPI. Just load a world in MCPI and other devices on the network can join.
## External Servers
Unlike vanilla MCPI, MCPI-Reborn allows you to natively join a server outside of the local network. Just modify ``~/.minecraft-pi/servers.txt`` and it should show up in MCPI's server list.
Unlike vanilla MCPI, MCPI-Reborn allows you to natively join a server outside of the local network. Just modify `~/.minecraft-pi/servers.txt` and it should show up in MCPI's server list.
### Example ``~/.minecraft-pi/servers.txt``
### Example `~/.minecraft-pi/servers.txt`
```
# Default Port Is 19132
example.com

View File

@ -1,6 +1,6 @@
# Overriding Assets
To make overriding assets easier, MCPI-Reborn provides an overrides folder. Any file located in Minecraft: Pi Edition's ``data`` folder can be overridden by placing a file with the same name and path in the overrides folder. The overrides folder is located at ``~/.minecraft-pi/overrides``.
To make overriding assets easier, MCPI-Reborn provides an overrides folder. Any file located in Minecraft: Pi Edition's `data` folder can be overridden by placing a file with the same name and path in the overrides folder. The overrides folder is located at `~/.minecraft-pi/overrides`.
## Examples
- ``data/images/terrain.png`` -> ``~/.minecraft-pi/overrides/images/terrain.png``
- ``data/lang/en_US.lang`` -> ``~/.minecraft-pi/overrides/lang/en_US.lang``
- `data/images/terrain.png` -> `~/.minecraft-pi/overrides/images/terrain.png`
- `data/lang/en_US.lang` -> `~/.minecraft-pi/overrides/lang/en_US.lang`

View File

@ -31,5 +31,5 @@ struct TextInputBox {
void onClick(int x, int y);
bool clicked(int x, int y);
static TextInputBox create(int id, const std::string &placeholder = "", const std::string &text = "");
static TextInputBox *create(int id, const std::string &placeholder = "", const std::string &text = "");
};

View File

@ -6,7 +6,7 @@
struct TextInputScreen {
Screen super;
std::vector<TextInputBox *> m_textInputs;
std::vector<TextInputBox *> *m_textInputs;
static void setup(Screen_vtable *vtable);
};

View File

@ -1,2 +1,2 @@
# ``atlas`` Mod
This mod allows disabling the ``gui_blocks`` atlas.
# `atlas` Mod
This mod allows disabling the `gui_blocks` atlas.

View File

@ -1,2 +1,2 @@
# ``benchmark`` Mod
# `benchmark` Mod
This mod contain a simple game benchmark.

View File

@ -1,2 +1,2 @@
# ``bucket`` Mod
# `bucket` Mod
This mod adds buckets.

View File

@ -1,2 +1,2 @@
# ``camera`` Mod
# `camera` Mod
This mod fixes the Camera's renderer so that it is no longer invisible.

View File

@ -1,2 +1,2 @@
# ``chat`` Mod
# `chat` Mod
This mod implements a chat system.

View File

@ -12,23 +12,48 @@
// Structure
struct ChatScreen {
TextInputScreen super;
TextInputBox chat;
TextInputBox *chat;
Button *send;
};
CUSTOM_VTABLE(chat_screen, Screen) {
TextInputScreen::setup(vtable);
// Init
static Screen_init_t original_init = vtable->init;
vtable->init = [](Screen *super) {
Screen_init_non_virtual(super);
original_init(super);
ChatScreen *self = (ChatScreen *) super;
self->super.m_textInputs.push_back(&self->chat);
self->chat.init(super->font);
self->chat.setFocused(true);
// Text Input
self->chat = TextInputBox::create(1);
self->super.m_textInputs->push_back(self->chat);
self->chat->init(super->font);
self->chat->setFocused(true);
// Send Button
if (Minecraft_isTouchscreen(super->minecraft)) {
self->send = (Button *) new Touch_TButton;
} else {
self->send = new Button;
}
ALLOC_CHECK(self->send);
int send_id = 2;
std::string send_text = "Send";
if (Minecraft_isTouchscreen(super->minecraft)) {
Touch_TButton_constructor((Touch_TButton *) self->send, send_id, &send_text);
} else {
Button_constructor(self->send, send_id, &send_text);
}
super->rendered_buttons.push_back(self->send);
super->selectable_buttons.push_back(self->send);
// Hide Chat Messages
is_in_chat = true;
};
// Removal
static Screen_removed_t original_removed = vtable->removed;
vtable->removed = [](Screen *super) {
Screen_removed_non_virtual(super);
original_removed(super);
is_in_chat = false;
ChatScreen *self = (ChatScreen *) super;
delete self->chat;
self->send->vtable->destructor_deleting(self->send);
};
// Rendering
static Screen_render_t original_render = vtable->render;
@ -44,24 +69,41 @@ CUSTOM_VTABLE(chat_screen, Screen) {
vtable->setupPositions = [](Screen *super) {
Screen_setupPositions_non_virtual(super);
ChatScreen *self = (ChatScreen *) super;
int height = 20;
self->send->height = 20;
self->send->width = 40;
int x = 0;
int y = super->height - height;
int width = super->width;
self->chat.setSize(x, y, width, height);
int y = super->height - self->send->height;
int width = super->width - self->send->width;
self->chat->setSize(x, y, width, self->send->height);
self->send->y = super->height - self->send->height;
self->send->x = x + width;
};
// Key Presses
static Screen_keyPressed_t original_keyPressed = vtable->keyPressed;
vtable->keyPressed = [](Screen *super, int key) {
// Handle Enter
ChatScreen *self = (ChatScreen *) super;
if (key == 0x0d) {
_chat_queue_message(self->chat.m_text.c_str());
if (key == 0x0d && self->chat->m_bFocused) {
if (self->chat->m_text.length() > 0) {
_chat_queue_message(self->chat->m_text.c_str());
}
Minecraft_setScreen(super->minecraft, NULL);
}
// Call Original Method
original_keyPressed(super, key);
};
// Button Click
vtable->buttonClicked = [](Screen *super, Button *button) {
ChatScreen *self = (ChatScreen *) super;
if (button == self->send) {
// Send
self->chat->setFocused(true);
super->vtable->keyPressed(super, 0x0d);
} else {
// Call Original Method
Screen_buttonClicked_non_virtual(super, button);
}
};
}
static Screen *create_chat_screen() {
// Construct
@ -72,9 +114,6 @@ static Screen *create_chat_screen() {
// Set VTable
screen->super.super.vtable = get_chat_screen_vtable();
// Setup
screen->chat = TextInputBox::create(0);
// Return
return (Screen *) screen;
}

View File

@ -1,2 +1,2 @@
# ``compat`` Mod
# `compat` Mod
This utility mod sends keyboard input to other mods. It also patches out all EGL and X11 calls.

View File

@ -1,2 +1,2 @@
# ``creative`` Mod
# `creative` Mod
This mod adds an optional feature flag to add more items to the Creative Mode inventory.

View File

@ -1,2 +1,2 @@
# ``death`` Mod
# `death` Mod
This mod implements death messages.

View File

@ -1,2 +1,2 @@
# ``feature`` Mod
# `feature` Mod
This utility mod handles feature flags.

View File

@ -1,2 +1,2 @@
# ``game-mode`` Mod
# `game-mode` Mod
This mod implements Survival Mode and dynamic game-mode switching.

View File

@ -1,4 +1,4 @@
# ``home`` Mod
# `home` Mod
This utility mod handles changing the location where world data is stored. This is so it doesn't conflict with Minecraft: Java Edition.
Normally, it changes it to ``~/.minecraft-pi``, but in server mode it changes it to the launch directory.
Normally, it changes it to `~/.minecraft-pi`, but in server mode it changes it to the launch directory.

View File

@ -1,2 +1,2 @@
# ``init`` Mod
# `init` Mod
This utility mod handles initializing the other mods in the correct order.

View File

@ -1,10 +1,10 @@
# ``input`` Mod
# `input` Mod
This mod fixes various input-related bugs, including:
* Bows being broken.
* The cursor interacting with the toolbar while the it is locked.
* Being unable to attack mobs.
* The ``ESC`` key not behaving as expected.
* The `ESC` key not behaving as expected.
It also adds various features, including:
* Hide GUI and third person toggle keys.
* Dropping items with ``Q``.
* Dropping items with `Q`.

View File

@ -1,4 +1,4 @@
# ``misc`` Mod
# `misc` Mod
This mod has several miscellaneous mods that are too small to be their own mod, including:
* Rendering text above the hotbar when an item is selected.
* Sanitizing player usernames for invalid characters.

View File

@ -490,7 +490,7 @@ static ContainerMenu *ContainerMenu_injection(ContainerMenu *container_menu, Con
// Return
return container_menu;
}
static unsigned char *ContainerMenu_destructor_injection(ContainerMenu *container_menu) {
static ContainerMenu *ContainerMenu_destructor_injection(ContainerMenu *container_menu) {
// Play Animation
Container *container = container_menu->container;
ChestTileEntity *tile_entity = (ChestTileEntity *) (((unsigned char *) container) - offsetof(ChestTileEntity, container));
@ -500,7 +500,7 @@ static unsigned char *ContainerMenu_destructor_injection(ContainerMenu *containe
}
// Call Original Method
return ContainerMenu_destructor_non_virtual(container_menu);
return ContainerMenu_destructor_complete_non_virtual(container_menu);
}
#ifndef MCPI_HEADLESS_MODE
@ -720,8 +720,8 @@ void init_misc() {
// Animation
overwrite_calls((void *) ContainerMenu_constructor, (void *) ContainerMenu_injection);
overwrite_calls((void *) ContainerMenu_destructor_non_virtual, (void *) ContainerMenu_destructor_injection);
patch_address(ContainerMenu_destructor_vtable_addr, (void *) ContainerMenu_destructor_injection);
overwrite_calls((void *) ContainerMenu_destructor_complete_non_virtual, (void *) ContainerMenu_destructor_injection);
patch_address(ContainerMenu_destructor_complete_vtable_addr, (void *) ContainerMenu_destructor_injection);
}
patch_address((void *) 0x115b48, (void *) ChestTileEntity_shouldSave_injection);

View File

@ -1,4 +1,4 @@
# ``multiplayer`` Mod
# `multiplayer` Mod
This mod implements connecting to external (non-LAN) servers. This mod is client mode only.
It is controlled by the ``~/.minecraft-pi/servers.txt`` file.
It is controlled by the `~/.minecraft-pi/servers.txt` file.

View File

@ -1,4 +1,4 @@
# ``options`` Mod
# `options` Mod
This mod allows various options to be configured, including:
* Mob Spawning
* The Render Distance

View File

@ -1,4 +1,4 @@
# ``override`` Mod
# `override` Mod
This mod allows built-in assets to be overriden by placing replacements in an override folder.
``<MCPI Root>/data/images/terrain.png`` would be overriden by ``<MCPI World Data Root>/overrides/images/terrain.png``.
`<MCPI Root>/data/images/terrain.png` would be overriden by `<MCPI World Data Root>/overrides/images/terrain.png`.

View File

@ -1,2 +1,2 @@
# ``readdir`` Mod
# `readdir` Mod
This mod fixes a small bug where the contents of directories cannot be read on a 64-bit filesystem. This notably broke the world selection screen.

View File

@ -1,2 +1,2 @@
# ``screenshot`` Mod
# `screenshot` Mod
This mod implements the core screenshot logic.

View File

@ -1,2 +1,2 @@
# ``server`` Mod
# `server` Mod
This mod contains most of the code involved in converting MCPI into a server.

View File

@ -1,2 +1,2 @@
# ``sign`` Mod
# `sign` Mod
This mod fixes sign placement.

View File

@ -1,2 +1,2 @@
# ``skin`` Mod
# `skin` Mod
This mod adds custom skin loading.

View File

@ -1,2 +1,2 @@
# ``sound`` Mod
# `sound` Mod
This mod implements a sound engine.

View File

@ -1,2 +1,2 @@
# ``test`` Mod
# `test` Mod
This utility mod tests that the system is configured correctly before starting.

View File

@ -1,2 +1,2 @@
# ``text-input-box`` Mod
# `text-input-box` Mod
This mod implements a GUI component for text input. This is ported from [ReMinecraftPE](https://github.com/ReMinecraftPE/mcpe/blob/d7a8b6baecf8b3b050538abdbc976f690312aa2d/source/client/gui/components/TextInputBox.cpp).

View File

@ -2,26 +2,26 @@
#include <mods/text-input-box/TextInputBox.h>
TextInputBox TextInputBox::create(int id, const std::string &placeholder, const std::string &text) {
TextInputBox *TextInputBox::create(int id, const std::string &placeholder, const std::string &text) {
// Construct
TextInputBox self;
GuiComponent_constructor(&self.super);
TextInputBox *self = new TextInputBox;
GuiComponent_constructor(&self->super);
// Setup
self.m_ID = id;
self.m_xPos = 0;
self.m_yPos = 0;
self.m_width = 0;
self.m_height = 0;
self.m_placeholder = placeholder;
self.m_text = text;
self.m_bFocused = false;
self.m_bEnabled = true;
self.m_bCursorOn = true;
self.m_insertHead = 0;
self.m_lastFlashed = 0;
self.m_pFont = nullptr;
self.m_maxLength = -1;
self->m_ID = id;
self->m_xPos = 0;
self->m_yPos = 0;
self->m_width = 0;
self->m_height = 0;
self->m_placeholder = placeholder;
self->m_text = text;
self->m_bFocused = false;
self->m_bEnabled = true;
self->m_bCursorOn = true;
self->m_insertHead = 0;
self->m_lastFlashed = 0;
self->m_pFont = nullptr;
self->m_maxLength = -1;
// Return
return self;

View File

@ -7,34 +7,44 @@ void TextInputScreen::setup(Screen_vtable *vtable) {
vtable->keyPressed = [](Screen *super2, int key) {
Screen_keyPressed_non_virtual(super2, key);
TextInputScreen *self = (TextInputScreen *) super2;
for (int i = 0; i < int(self->m_textInputs.size()); i++) {
TextInputBox *textInput = self->m_textInputs[i];
for (int i = 0; i < int(self->m_textInputs->size()); i++) {
TextInputBox *textInput = (*self->m_textInputs)[i];
textInput->keyPressed(key);
}
};
vtable->keyboardNewChar = [](Screen *super2, char key) {
Screen_keyboardNewChar_non_virtual(super2, key);
TextInputScreen *self = (TextInputScreen *) super2;
for (int i = 0; i < int(self->m_textInputs.size()); i++) {
TextInputBox *textInput = self->m_textInputs[i];
for (int i = 0; i < int(self->m_textInputs->size()); i++) {
TextInputBox *textInput = (*self->m_textInputs)[i];
textInput->charPressed(key);
}
};
vtable->mouseClicked = [](Screen *super2, int x, int y, int param_1) {
Screen_mouseClicked_non_virtual(super2, x, y, param_1);
TextInputScreen *self = (TextInputScreen *) super2;
for (int i = 0; i < int(self->m_textInputs.size()); i++) {
TextInputBox *textInput = self->m_textInputs[i];
for (int i = 0; i < int(self->m_textInputs->size()); i++) {
TextInputBox *textInput = (*self->m_textInputs)[i];
textInput->onClick(x, y);
}
};
vtable->render = [](Screen *super2, int x, int y, float param_1) {
Screen_render_non_virtual(super2, x, y, param_1);
TextInputScreen *self = (TextInputScreen *) super2;
for (int i = 0; i < int(self->m_textInputs.size()); i++) {
TextInputBox *textInput = self->m_textInputs[i];
for (int i = 0; i < int(self->m_textInputs->size()); i++) {
TextInputBox *textInput = (*self->m_textInputs)[i];
textInput->tick();
textInput->render();
}
};
vtable->init = [](Screen *super2) {
Screen_init_non_virtual(super2);
TextInputScreen *self = (TextInputScreen *) super2;
self->m_textInputs = new std::vector<TextInputBox *>;
};
vtable->removed = [](Screen *super2) {
Screen_removed_non_virtual(super2);
TextInputScreen *self = (TextInputScreen *) super2;
delete self->m_textInputs;
};
}

View File

@ -1,2 +1,2 @@
# ``textures`` Mod
# `textures` Mod
This mod enables the animated water texture.

View File

@ -1,2 +1,2 @@
# ``title-screen`` Mod
# `title-screen` Mod
This mod improves the title screen.

View File

@ -1,2 +1,2 @@
# ``touch`` Mod
# `touch` Mod
This mod allows the hidden touch GUI to be activated.

View File

@ -1,2 +1,2 @@
# ``version`` Mod
# `version` Mod
This mod adds the MCPI-Reborn version to the start screen.

View File

@ -110,6 +110,7 @@ set(SRC
src/gui/components/IntRectangle.def
src/gui/components/RectangleArea.def
src/gui/components/ScrollingPane.def
src/gui/components/Touch_TButton.def
src/app-platform/AppPlatform.def
src/app-platform/AppPlatform_linux.def
src/app-platform/AppPlatform_readAssetFile_return_value.def

View File

@ -1,7 +1,7 @@
size 0xa74;
extends GuiComponent;
size 0xa74;
method void tick() = 0x27778;
method void handleClick(int param_2, int param_3, int param_4) = 0x2599c;
method void renderOnSelectItemNameText(int param_1, Font *font, int param_2) = 0x26aec;

View File

@ -1,5 +1,6 @@
extends GuiComponent;
size 0x28;
constructor (int param_1, std::string *text) = 0x1bc54;
method int hovered(Minecraft *minecraft, int click_x, int click_y) = 0x1be2c;

View File

@ -1,7 +1,8 @@
size 0x8;
constructor () = 0x28204;
vtable 0x1039b0;
method void blit(int x_dest, int y_dest, int x_src, int y_src, int width_dest, int height_dest, int width_src, int height_src) = 0x282a4;
method void drawCenteredString(Font *font, std::string *text, int x, int y, int color) = 0x2821c;
method void drawString(Font *font, std::string *text, int x, int y, int color) = 0x28284;

View File

@ -3,3 +3,5 @@ extends ImageButton;
constructor (Options_Option *option) = 0x1c968;
method void updateImage(Options *options) = 0x1ca58;
property Options_Option *option = 0x54;

View File

@ -0,0 +1,4 @@
extends Button;
size 0x28;
constructor (int param_1, std::string *text) = 0x1c168;

View File

@ -1,6 +1,5 @@
vtable 0x10e1b8;
constructor (Container *container, int param_1) = 0x919a8;
virtual-method uchar *destructor() = 0x0;
property Container *container = 0x1c;

View File

@ -10,8 +10,6 @@ method int getFreeSlot() = 0x91ffc;
method int getSlot(int id) = 0x91ce0;
method int linkSlot(int linked_slot, int unlinked_slot, bool push_aside) = 0x92188;
virtual-method ItemInstance *getItem(int pos) = 0x8;
virtual-method void setItem(int pos, ItemInstance *item) = 0xc;
virtual-method bool add(ItemInstance *item_instance) = 0x30;
property int *linked_slots = 0xc;