Merge branch 'main' into dec-2014

# Conflicts:
#	Minecraft.Client/ClientConnection.cpp
#	Minecraft.Client/Common/UI/UIController.cpp
This commit is contained in:
Loki Rautio
2026-03-01 11:01:24 -06:00
33 changed files with 1614 additions and 67 deletions

View File

@@ -182,7 +182,7 @@ UIController::UIController()
#if defined _WINDOWS64 || defined _DURANGO || defined __ORBIS__
m_fScreenWidth = 1920.0f;
m_fScreenHeight = 1080.0f;
m_bScreenWidthSetup = true;
m_bScreenWidthSetup = false;
#else
m_fScreenWidth = 1280.0f;
m_fScreenHeight = 720.0f;
@@ -500,36 +500,36 @@ void UIController::loadSkins()
#elif defined __PSVITA__
platformSkinPath = L"skinVita.swf";
#elif defined _WINDOWS64
if(m_fScreenHeight==1080.0f)
if(m_fScreenHeight>=1080.0f)
{
platformSkinPath = L"skinHDWin.swf";
}
else
{
platformSkinPath = L"skinWin.swf";
platformSkinPath = L"skinWin.swf";
}
#elif defined _DURANGO
if(m_fScreenHeight==1080.0f)
if(m_fScreenHeight>=1080.0f)
{
platformSkinPath = L"skinHDDurango.swf";
platformSkinPath = L"skinHDDurango.swf";
}
else
{
platformSkinPath = L"skinDurango.swf";
platformSkinPath = L"skinDurango.swf";
}
#elif defined __ORBIS__
if(m_fScreenHeight==1080.0f)
if(m_fScreenHeight>=1080.0f)
{
platformSkinPath = L"skinHDOrbis.swf";
platformSkinPath = L"skinHDOrbis.swf";
}
else
{
platformSkinPath = L"skinOrbis.swf";
platformSkinPath = L"skinOrbis.swf";
}
#endif
// Every platform has one of these, so nothing shared
if(m_fScreenHeight==1080.0f)
if(m_fScreenHeight>=1080.0f)
{
m_iggyLibraries[eLibrary_Platform] = loadSkin(platformSkinPath, L"platformskinHD.swf");
}
@@ -994,8 +994,31 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key)
pressed = InputManager.ButtonPressed(iPad,key); // Toggle
released = InputManager.ButtonReleased(iPad,key); // Toggle
//if(pressed) app.DebugPrintf("Pressed %d\n",key);
//if(released) app.DebugPrintf("Released %d\n",key);
#ifdef _WINDOWS64
// Keyboard menu input for player 0
if (iPad == 0)
{
bool kbDown = false, kbPressed = false, kbReleased = false;
switch(key)
{
case ACTION_MENU_UP: kbDown = KMInput.IsKeyDown(VK_UP); kbPressed = KMInput.IsKeyPressed(VK_UP); kbReleased = KMInput.IsKeyReleased(VK_UP); break;
case ACTION_MENU_DOWN: kbDown = KMInput.IsKeyDown(VK_DOWN); kbPressed = KMInput.IsKeyPressed(VK_DOWN); kbReleased = KMInput.IsKeyReleased(VK_DOWN); break;
case ACTION_MENU_LEFT: kbDown = KMInput.IsKeyDown(VK_LEFT); kbPressed = KMInput.IsKeyPressed(VK_LEFT); kbReleased = KMInput.IsKeyReleased(VK_LEFT); break;
case ACTION_MENU_RIGHT: kbDown = KMInput.IsKeyDown(VK_RIGHT); kbPressed = KMInput.IsKeyPressed(VK_RIGHT); kbReleased = KMInput.IsKeyReleased(VK_RIGHT); break;
case ACTION_MENU_OK: kbDown = KMInput.IsKeyDown(VK_RETURN); kbPressed = KMInput.IsKeyPressed(VK_RETURN); kbReleased = KMInput.IsKeyReleased(VK_RETURN); break;
case ACTION_MENU_A: kbDown = KMInput.IsKeyDown(VK_RETURN); kbPressed = KMInput.IsKeyPressed(VK_RETURN); kbReleased = KMInput.IsKeyReleased(VK_RETURN); break;
case ACTION_MENU_CANCEL: kbDown = KMInput.IsKeyDown(VK_ESCAPE); kbPressed = KMInput.IsKeyPressed(VK_ESCAPE); kbReleased = KMInput.IsKeyReleased(VK_ESCAPE); break;
case ACTION_MENU_B: kbDown = KMInput.IsKeyDown(VK_ESCAPE); kbPressed = KMInput.IsKeyPressed(VK_ESCAPE); kbReleased = KMInput.IsKeyReleased(VK_ESCAPE); break;
case ACTION_MENU_PAUSEMENU: kbDown = KMInput.IsKeyDown(VK_ESCAPE); kbPressed = KMInput.IsKeyPressed(VK_ESCAPE); kbReleased = KMInput.IsKeyReleased(VK_ESCAPE); break;
}
pressed = pressed || kbPressed;
released = released || kbReleased;
down = down || kbDown;
}
#endif
if(pressed) app.DebugPrintf("Pressed %d\n",key);
if(released) app.DebugPrintf("Released %d\n",key);
// Repeat handling
if(pressed)
{

View File

@@ -5,6 +5,9 @@
#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h"
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
#include "..\..\MultiplayerLocalPlayer.h"
#ifdef _WINDOWS64
#include "..\..\Windows64\KeyboardMouseInput.h"
#endif
UIScene_AbstractContainerMenu::UIScene_AbstractContainerMenu(int iPad, UILayer *parentLayer) : UIScene(iPad, parentLayer)
{
@@ -25,6 +28,9 @@ UIScene_AbstractContainerMenu::UIScene_AbstractContainerMenu(int iPad, UILayer *
ui.OverrideSFX(m_iPad,ACTION_MENU_DOWN,true);
m_bIgnoreInput=false;
#ifdef _WINDOWS64
m_bMouseDragSlider=false;
#endif
}
UIScene_AbstractContainerMenu::~UIScene_AbstractContainerMenu()
@@ -109,8 +115,8 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
#ifdef __ORBIS__
// we need to map the touchpad rectangle to the UI rectangle. While it works great for the creative menu, it is much too sensitive for the smaller menus.
//X coordinate of the touch point (0 to 1919)
//Y coordinate of the touch point (0 to 941: DUALSHOCK®4 wireless controllers and the CUH-ZCT1J/CAP-ZCT1J/CAP-ZCT1U controllers for the PlayStation®4 development tool,
//0 to 753: JDX-1000x series controllers for the PlayStation®4 development tool,)
//Y coordinate of the touch point (0 to 941: DUALSHOCK<EFBFBD>4 wireless controllers and the CUH-ZCT1J/CAP-ZCT1J/CAP-ZCT1U controllers for the PlayStation<EFBFBD>4 development tool,
//0 to 753: JDX-1000x series controllers for the PlayStation<EFBFBD>4 development tool,)
m_fTouchPadMulX=fPanelWidth/1919.0f;
m_fTouchPadMulY=fPanelHeight/941.0f;
m_fTouchPadDeadZoneX=15.0f*m_fTouchPadMulX;
@@ -176,13 +182,118 @@ void UIScene_AbstractContainerMenu::tick()
{
UIScene::tick();
#ifdef _WINDOWS64
bool mouseActive = (m_iPad == 0 && !KMInput.IsCaptured());
float rawMouseMovieX = 0, rawMouseMovieY = 0;
// Map Windows mouse position to the virtual pointer in movie coordinates
if (mouseActive)
{
RECT clientRect;
GetClientRect(KMInput.GetHWnd(), &clientRect);
int clientWidth = clientRect.right;
int clientHeight = clientRect.bottom;
if (clientWidth > 0 && clientHeight > 0)
{
int mouseX = KMInput.GetMouseX();
int mouseY = KMInput.GetMouseY();
// Convert mouse position to movie coordinates using the movie/client ratio
float mx = (float)mouseX * ((float)m_movieWidth / (float)clientWidth);
float my = (float)mouseY * ((float)m_movieHeight / (float)clientHeight);
m_pointerPos.x = mx;
m_pointerPos.y = my;
rawMouseMovieX = mx;
rawMouseMovieY = my;
}
}
#endif
onMouseTick();
#ifdef _WINDOWS64
// Dispatch mouse clicks AFTER onMouseTick() has updated m_eCurrSection from the new pointer position
if (mouseActive)
{
if (KMInput.ConsumeMousePress(0))
{
if (m_eCurrSection == eSectionInventoryCreativeSlider)
{
// Scrollbar click: use raw mouse position (onMouseTick may have snapped m_pointerPos)
m_bMouseDragSlider = true;
m_pointerPos.x = rawMouseMovieX;
m_pointerPos.y = rawMouseMovieY;
handleOtherClicked(m_iPad, eSectionInventoryCreativeSlider, 0, false);
}
else
{
handleKeyDown(m_iPad, ACTION_MENU_A, false);
}
}
else if (m_bMouseDragSlider && KMInput.IsMouseDown(0))
{
// Continue scrollbar drag: update scroll position from current mouse Y
m_pointerPos.x = rawMouseMovieX;
m_pointerPos.y = rawMouseMovieY;
handleOtherClicked(m_iPad, eSectionInventoryCreativeSlider, 0, false);
}
if (!KMInput.IsMouseDown(0))
m_bMouseDragSlider = false;
if (KMInput.ConsumeMousePress(1))
{
handleKeyDown(m_iPad, ACTION_MENU_X, false);
}
if (KMInput.ConsumeMousePress(2))
{
handleKeyDown(m_iPad, ACTION_MENU_Y, false);
}
// Mouse scroll wheel for page scrolling
int scrollDelta = KMInput.ConsumeScrollDelta();
if (scrollDelta > 0)
{
handleKeyDown(m_iPad, ACTION_MENU_OTHER_STICK_UP, false);
}
else if (scrollDelta < 0)
{
handleKeyDown(m_iPad, ACTION_MENU_OTHER_STICK_DOWN, false);
}
// ESC to close — must be last since it may destroy this scene
if (KMInput.ConsumeKeyPress(VK_ESCAPE))
{
handleKeyDown(m_iPad, ACTION_MENU_B, false);
return;
}
}
#endif
IggyEvent mouseEvent;
S32 width, height;
m_parentLayer->getRenderDimensions(width, height);
#ifdef _WINDOWS64
S32 x, y;
if (mouseActive)
{
// Send raw mouse position directly as Iggy event to avoid coordinate round-trip errors
// Scale mouse client coords to the Iggy display space (which was set to getRenderDimensions())
RECT clientRect;
GetClientRect(KMInput.GetHWnd(), &clientRect);
x = (S32)((float)KMInput.GetMouseX() * ((float)width / (float)clientRect.right));
y = (S32)((float)KMInput.GetMouseY() * ((float)height / (float)clientRect.bottom));
}
else
{
x = (S32)(m_pointerPos.x * ((float)width / m_movieWidth));
y = (S32)(m_pointerPos.y * ((float)height / m_movieHeight));
}
#else
S32 x = m_pointerPos.x*((float)width/m_movieWidth);
S32 y = m_pointerPos.y*((float)height/m_movieHeight);
#endif
IggyMakeEventMouseMove( &mouseEvent, x, y);
// 4J Stu - This seems to be broken on Durango, so do it ourself

View File

@@ -10,6 +10,9 @@ class UIScene_AbstractContainerMenu : public UIScene, public virtual IUIScene_Ab
private:
ESceneSection m_focusSection;
bool m_bIgnoreInput;
#ifdef _WINDOWS64
bool m_bMouseDragSlider;
#endif
protected:
UIControl m_controlMainPanel;

View File

@@ -957,13 +957,18 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
#endif
else
{
{
#ifdef _WINDOWS64
// On Windows64, Xbox Live is unavailable. Skip QuadrantSignin and start directly.
CreateGame(this, 0);
#else
//ProfileManager.RequestSignInUI(false, false, false, true, false,&CScene_MultiGameCreate::StartGame_SignInReturned, this,ProfileManager.GetPrimaryPad());
SignInInfo info;
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
info.lpParam = this;
info.requireOnline = m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
#endif
}
}
else
@@ -1342,12 +1347,18 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
if(isClientSide && app.IsLocalMultiplayerAvailable())
{
#ifdef _WINDOWS64
// On Windows64, Xbox Live is unavailable. Skip QuadrantSignin and start directly.
CreateGame(pClass, 0);
return 0;
#else
//ProfileManager.RequestSignInUI(false, false, false, true, false,&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass,ProfileManager.GetPrimaryPad());
SignInInfo info;
info.Func = &UIScene_CreateWorldMenu::StartGame_SignInReturned;
info.lpParam = pClass;
info.requireOnline = pClass->m_MoreOptionsParams.bOnlineGame;
ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_QuadrantSignin,&info);
#endif
}
else
{

View File

@@ -1444,7 +1444,14 @@ int UIScene_LoadMenu::LoadDataComplete(void *pParam)
#endif
else
{
#ifdef _WINDOWS64
// On Windows64, IsSignedInLive() returns true as a stub but Xbox Live is
// not available. Skip QuadrantSignin and proceed directly with local play.
DWORD dwLocalUsersMask = CGameNetworkManager::GetLocalPlayerMask(ProfileManager.GetPrimaryPad());
StartGameFromSave(pClass, dwLocalUsersMask);
#else
pClass->m_bRequestQuadrantSignin = true;
#endif
}
}
}