From fa4a1206b3aead0a946479f28629bd539ed6643c Mon Sep 17 00:00:00 2001 From: red <80164245+gabriel-fondato@users.noreply.github.com> Date: Mon, 2 Mar 2026 02:40:04 -0300 Subject: feat: now can skip the tutorial (#82) * now possible to accept and decline tutorial hints that part when it asks if you want to do the tutorial (should work for when the games asks if you already know something like when opening inventories for the first time) * Update ChoiceTask.cpp --------- Co-authored-by: daoge <3523206925@qq.com> --- Minecraft.Client/Common/Tutorial/ChoiceTask.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Minecraft.Client/Common/Tutorial/ChoiceTask.cpp') diff --git a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp index c03166b5..49fb068b 100644 --- a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp @@ -7,6 +7,7 @@ #include "TutorialConstraints.h" #include "ChoiceTask.h" #include "..\..\..\Minecraft.World\Material.h" +#include "..\..\Windows64\KeyboardMouseInput.h" ChoiceTask::ChoiceTask(Tutorial *tutorial, int descriptionId, int promptId /*= -1*/, bool requiresUserInput /*= false*/, int iConfirmMapping /*= 0*/, int iCancelMapping /*= 0*/, @@ -51,11 +52,11 @@ bool ChoiceTask::isCompleted() // If the player is under water then allow all keypresses so they can jump out if( pMinecraft->localplayers[tutorial->getPad()]->isUnderLiquid(Material::water) ) return false; - if(!m_bConfirmMappingComplete && InputManager.GetValue(pMinecraft->player->GetXboxPad(), m_iConfirmMapping) > 0 ) + if(!m_bConfirmMappingComplete && InputManager.GetValue(pMinecraft->player->GetXboxPad(), m_iConfirmMapping) > 0 || KMInput.IsKeyDown(VK_RETURN)) { m_bConfirmMappingComplete = true; } - if(!m_bCancelMappingComplete && InputManager.GetValue(pMinecraft->player->GetXboxPad(), m_iCancelMapping) > 0 ) + if(!m_bCancelMappingComplete && InputManager.GetValue(pMinecraft->player->GetXboxPad(), m_iCancelMapping) > 0 || KMInput.IsKeyDown('B')) { m_bCancelMappingComplete = true; } @@ -99,11 +100,11 @@ void ChoiceTask::handleUIInput(int iAction) { if(bHasBeenActivated && m_bShownForMinimumTime) { - if( iAction == m_iConfirmMapping ) + if( iAction == m_iConfirmMapping) { m_bConfirmMappingComplete = true; } - else if(iAction == m_iCancelMapping ) + else if(iAction == m_iCancelMapping) { m_bCancelMappingComplete = true; } -- cgit v1.2.3 From 2145ada7ce5c1bfb8e336d7d3fd90b84af626203 Mon Sep 17 00:00:00 2001 From: red <80164245+gabriel-fondato@users.noreply.github.com> Date: Mon, 2 Mar 2026 12:47:45 -0300 Subject: now able to press SPACE to continue on hints that wait for you to press A (#135) * now possible to accept and decline tutorial hints that part when it asks if you want to do the tutorial (should work for when the games asks if you already know something like when opening inventories for the first time) * Update ChoiceTask.cpp * now able to press SPACE to continue on hints that wait for you to press A and the hints what wait for you to move the gamepad stick now just skip instantly * windows specific patch now * added ifdefs to shit i did * i think it is fixed now --------- Co-authored-by: daoge <3523206925@qq.com> --- Minecraft.Client/Common/Tutorial/ChoiceTask.cpp | 40 ++++++++++++++++------ .../Common/Tutorial/ControllerTask.cpp | 8 +++++ Minecraft.Client/Common/Tutorial/InfoTask.cpp | 7 +++- 3 files changed, 43 insertions(+), 12 deletions(-) (limited to 'Minecraft.Client/Common/Tutorial/ChoiceTask.cpp') diff --git a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp index 49fb068b..f42b3ee0 100644 --- a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp @@ -34,7 +34,11 @@ ChoiceTask::ChoiceTask(Tutorial *tutorial, int descriptionId, int promptId /*= - bool ChoiceTask::isCompleted() { - Minecraft *pMinecraft = Minecraft::GetInstance(); + Minecraft* pMinecraft = Minecraft::GetInstance(); + if (!pMinecraft || !pMinecraft->player) + return false; + + int xboxPad = pMinecraft->player->GetXboxPad(); if( m_bConfirmMappingComplete || m_bCancelMappingComplete ) { @@ -50,24 +54,38 @@ bool ChoiceTask::isCompleted() else { // If the player is under water then allow all keypresses so they can jump out - if( pMinecraft->localplayers[tutorial->getPad()]->isUnderLiquid(Material::water) ) return false; - - if(!m_bConfirmMappingComplete && InputManager.GetValue(pMinecraft->player->GetXboxPad(), m_iConfirmMapping) > 0 || KMInput.IsKeyDown(VK_RETURN)) + if (pMinecraft->localplayers[tutorial->getPad()]->isUnderLiquid(Material::water)) return false; +#ifdef _WINDOWS64 + if (!m_bConfirmMappingComplete && + (InputManager.GetValue(xboxPad, m_iConfirmMapping) > 0 + || KMInput.IsKeyDown(VK_RETURN))) +#else + if (!m_bConfirmMappingComplete && + InputManager.GetValue(xboxPad, m_iConfirmMapping) > 0) +#endif { m_bConfirmMappingComplete = true; } - if(!m_bCancelMappingComplete && InputManager.GetValue(pMinecraft->player->GetXboxPad(), m_iCancelMapping) > 0 || KMInput.IsKeyDown('B')) + +#ifdef _WINDOWS64 + if (!m_bCancelMappingComplete && + (InputManager.GetValue(xboxPad, m_iCancelMapping) > 0 + || KMInput.IsKeyDown('B'))) +#else + if (!m_bCancelMappingComplete && + InputManager.GetValue(xboxPad, m_iCancelMapping) > 0) +#endif { m_bCancelMappingComplete = true; } - } - if(m_bConfirmMappingComplete || m_bCancelMappingComplete) - { - sendTelemetry(); - enableConstraints(false, true); + if (m_bConfirmMappingComplete || m_bCancelMappingComplete) + { + sendTelemetry(); + enableConstraints(false, true); + } + return m_bConfirmMappingComplete || m_bCancelMappingComplete; } - return m_bConfirmMappingComplete || m_bCancelMappingComplete; } eTutorial_CompletionAction ChoiceTask::getCompletionAction() diff --git a/Minecraft.Client/Common/Tutorial/ControllerTask.cpp b/Minecraft.Client/Common/Tutorial/ControllerTask.cpp index c5fe071b..c3a42120 100644 --- a/Minecraft.Client/Common/Tutorial/ControllerTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ControllerTask.cpp @@ -66,7 +66,11 @@ bool ControllerTask::isCompleted() } else { +#ifdef _WINDOWS64 + bAllComplete = true; +#else bAllComplete = false; +#endif } } iCurrent++; @@ -87,7 +91,11 @@ bool ControllerTask::isCompleted() } else { +#ifdef _WINDOWS64 + bAllComplete = true; +#else bAllComplete = false; +#endif } } iCurrent++; diff --git a/Minecraft.Client/Common/Tutorial/InfoTask.cpp b/Minecraft.Client/Common/Tutorial/InfoTask.cpp index 5330841f..43a10357 100644 --- a/Minecraft.Client/Common/Tutorial/InfoTask.cpp +++ b/Minecraft.Client/Common/Tutorial/InfoTask.cpp @@ -7,6 +7,7 @@ #include "TutorialConstraints.h" #include "InfoTask.h" #include "..\..\..\Minecraft.World\Material.h" +#include "..\..\KeyboardMouseInput.h" InfoTask::InfoTask(Tutorial *tutorial, int descriptionId, int promptId /*= -1*/, bool requiresUserInput /*= false*/, int iMapping /*= 0*/, ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/) @@ -65,7 +66,11 @@ bool InfoTask::isCompleted() bool current = (*it).second; if(!current) { - if( InputManager.GetValue(pMinecraft->player->GetXboxPad(), (*it).first) > 0 ) +#ifdef _WINDOWS64 + if (InputManager.GetValue(pMinecraft->player->GetXboxPad(), (*it).first) > 0 || KMInput.IsKeyDown(VK_SPACE)) +#else + if( InputManager.GetValue(pMinecraft->player->GetXboxPad(), (*it).first) > 0) +#endif { (*it).second = true; bAllComplete=true; -- cgit v1.2.3