Merge pull request #297 from realffqq/dev
Some checks are pending
Publish Documentation / build (push) Waiting to run
Build (Linux, x86_64) / build-linux (push) Waiting to run
Build (Linux, x86_64) / build-linux-debug (push) Waiting to run
Clang Format / clang-format (push) Waiting to run

(java ui) remap creative inventory to C and ensure serverside unpausing in all scenarios
This commit is contained in:
Tropical 2026-03-20 19:19:47 -05:00 committed by GitHub
commit 4c30ef1e62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 14 deletions

View file

@ -3683,10 +3683,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
Minecraft::GetInstance()->player);
ui.PlayUISFX(eSFX_Press);
#ifdef ENABLE_JAVA_GUIS
if (gameMode->hasInfiniteItems())
setScreen(new CreativeInventoryScreen(player));
else
setScreen(new InventoryScreen(player));
setScreen(new InventoryScreen(player));
#else
app.LoadInventoryMenu(iPad, player);
#endif
@ -3706,6 +3703,10 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
// Creative mode
ui.PlayUISFX(eSFX_Press);
#ifdef ENABLE_JAVA_GUIS
setScreen(new CreativeInventoryScreen(player));
}
#else
app.LoadCreativeMenu(iPad, player);
}
// 4J-PB - Microsoft request that we use the 3x3 crafting if someone
@ -3725,6 +3726,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) {
ui.PlayUISFX(eSFX_Press);
app.LoadCrafting2x2Menu(iPad, player);
}
#endif
}
if ((player->ullButtonsPressed & (1LL << MINECRAFT_ACTION_PAUSEMENU))

View file

@ -29,6 +29,12 @@ void Screen::keyPressed(wchar_t eventCharacter, int eventKey) {
if (eventKey == Keyboard::KEY_ESCAPE) {
minecraft->setScreen(NULL);
// minecraft->grabMouse(); // 4J - removed
// 4jcraft: moved here from PauseScreen to ensure that serverside
// unpausing is done in all scenarios
if (g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1)
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)FALSE);
}
}

View file

@ -54,15 +54,6 @@ void PauseScreen::init() {
*/
}
void PauseScreen::keyPressed(wchar_t eventCharacter, int eventKey) {
if (eventKey == Keyboard::KEY_ESCAPE && g_NetworkManager.IsLocalGame() &&
g_NetworkManager.GetPlayerCount() == 1)
app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),
eXuiServerAction_PauseServer, (void*)FALSE);
Screen::keyPressed(eventCharacter, eventKey);
}
void PauseScreen::exitWorld(Minecraft* minecraft, bool save) {
// 4jcraft: made our own static method for use in the java gui (other
// places such as the deathscreen need this)

View file

@ -9,7 +9,6 @@ private:
public:
PauseScreen(); // 4J added
virtual void init();
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
static void exitWorld(Minecraft* minecraft, bool save);
protected: