Add
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
#endif
|
||||
#include "Common/UI/IUIScene_CreativeMenu.h"
|
||||
#include "Common/UI/UIFontData.h"
|
||||
#include "Common/UI/UIComponent_PressStartToPlay.h"
|
||||
#include "DLCTexturePack.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
@@ -1453,6 +1454,7 @@ void Minecraft::run_middle()
|
||||
if(InputManager.ButtonPressed(i, MINECRAFT_ACTION_USE)) localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_USE;
|
||||
|
||||
if(InputManager.ButtonPressed(i, MINECRAFT_ACTION_INVENTORY)) localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_INVENTORY;
|
||||
if(InputManager.ButtonDown(i, MINECRAFT_ACTION_INVENTORY)) localplayers[i]->ullButtonsDown|=1LL<<MINECRAFT_ACTION_INVENTORY;
|
||||
if(InputManager.ButtonPressed(i, MINECRAFT_ACTION_ACTION)) localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_ACTION;
|
||||
if(InputManager.ButtonPressed(i, MINECRAFT_ACTION_CRAFTING)) localplayers[i]->ullButtonsPressed|=1LL<<MINECRAFT_ACTION_CRAFTING;
|
||||
if(InputManager.ButtonPressed(i, MINECRAFT_ACTION_PAUSEMENU))
|
||||
@@ -3632,13 +3634,14 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
#else
|
||||
bool useHeld = InputManager.ButtonDown(iPad, MINECRAFT_ACTION_USE);
|
||||
#endif
|
||||
bool achHeld;
|
||||
if( player->isUsingItem() )
|
||||
{
|
||||
if(!useHeld) gameMode->releaseUsingItem(player);
|
||||
}
|
||||
else if( gameMode->isInputAllowed(MINECRAFT_ACTION_USE) )
|
||||
else if (gameMode->isInputAllowed(MINECRAFT_ACTION_USE))
|
||||
{
|
||||
if( player->abilities.instabuild )
|
||||
if (player->abilities.instabuild)
|
||||
{
|
||||
// 4J - attempt to handle click in special creative mode fashion if possible (used for placing blocks at regular intervals)
|
||||
bool didClick = player->creativeModeHandleMouseClick(1, useHeld );
|
||||
@@ -3689,6 +3692,67 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
player->lastClickTick[1] = 0;
|
||||
}
|
||||
}
|
||||
achHeld = InputManager.ButtonDown(iPad, MINECRAFT_ACTION_INVENTORY) ||
|
||||
(iPad == 0 && g_KBMInput.IsKBMActive() &&
|
||||
g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_INVENTORY));
|
||||
if (ui.toastOn) {
|
||||
if (achHeld) {
|
||||
// Record when the hold started
|
||||
if (player->lastClickTick[2] == 0) {
|
||||
player->lastClickTick[2] = ticks;
|
||||
}
|
||||
// Check if held for 1 second
|
||||
bool heldLongEnough = (ticks - player->lastClickTick[2]) >= (timer->ticksPerSecond);
|
||||
if (heldLongEnough) {
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
ui.NavigateToScene(iPad, eUIScene_AchievementsMenu);
|
||||
ui.getGroups()[static_cast<int>(eUIGroup_Fullscreen)]->getPressStartToPlay()->handleTimerComplete(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If let go during period, open inventory
|
||||
if (player->lastClickTick[2] != 0) {
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->player;
|
||||
if (!player->isRiding())
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
|
||||
if (gameMode->isServerControlledInventory())
|
||||
{
|
||||
player->sendOpenInventory();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.LoadInventoryMenu(iPad, player);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset when button is released
|
||||
player->lastClickTick[2] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//Just open inventory if the toast is not open
|
||||
if ((player->ullButtonsPressed & (1LL << MINECRAFT_ACTION_INVENTORY)) && gameMode->isInputAllowed(MINECRAFT_ACTION_INVENTORY))
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->player;
|
||||
if (!player->isRiding())
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
|
||||
if (gameMode->isServerControlledInventory())
|
||||
{
|
||||
player->sendOpenInventory();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.LoadInventoryMenu(iPad, player);
|
||||
}
|
||||
}
|
||||
player->lastClickTick[2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(app.DebugSettingsOn())
|
||||
@@ -3754,19 +3818,26 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
|
||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_INVENTORY)) && gameMode->isInputAllowed(MINECRAFT_ACTION_INVENTORY))
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->player;
|
||||
if (!player->isRiding())
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
if (achHeld) {
|
||||
|
||||
//ui.PlayUISFX(eSFX_Press);
|
||||
//ui.NavigateToScene(iPad, eUIScene_AchievementsMenu);
|
||||
}
|
||||
else {
|
||||
/*shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->player;
|
||||
if (!player->isRiding())
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
|
||||
if(gameMode->isServerControlledInventory())
|
||||
{
|
||||
player->sendOpenInventory();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.LoadInventoryMenu(iPad,player);
|
||||
if (gameMode->isServerControlledInventory())
|
||||
{
|
||||
player->sendOpenInventory();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.LoadInventoryMenu(iPad, player);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3794,7 +3865,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
||||
else
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
app.LoadCrafting2x2Menu(iPad,player);
|
||||
app.LoadCrafting2x2Menu(iPad, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user