diff --git a/Minecraft.Client/Common/Audio/SoundEngine.cpp b/Minecraft.Client/Common/Audio/SoundEngine.cpp index 102fd37e..846c6d8a 100644 --- a/Minecraft.Client/Common/Audio/SoundEngine.cpp +++ b/Minecraft.Client/Common/Audio/SoundEngine.cpp @@ -59,7 +59,7 @@ void SoundEngine::playMusicTick() {}; #ifdef _WINDOWS64 char SoundEngine::m_szSoundPath[]={"Windows64Media\\Sound\\"}; char SoundEngine::m_szMusicPath[]={"music\\"}; -char SoundEngine::m_szRedistName[]={"Windows64\\redist64"}; //str1k3r - moved this to a the Windows64 dir so its out of plain view +char SoundEngine::m_szRedistName[]={"redist64"}; //str1k3r - moved this to a the Windows64 dir so its out of plain view #elif defined _DURANGO char SoundEngine::m_szSoundPath[]={"Sound\\"}; char SoundEngine::m_szMusicPath[]={"music\\"}; diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/iggy_w64.dll b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/iggy_w64.dll new file mode 100644 index 00000000..43430508 Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/iggy_w64.dll differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/binkawin64.asi b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/binkawin64.asi new file mode 100644 index 00000000..d363b31d Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/binkawin64.asi differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dolby.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dolby.flt new file mode 100644 index 00000000..7e9eb605 Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dolby.flt differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64ds3d.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64ds3d.flt new file mode 100644 index 00000000..c6a6a125 Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64ds3d.flt differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dsp.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dsp.flt new file mode 100644 index 00000000..28caa28e Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64dsp.flt differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64eax.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64eax.flt new file mode 100644 index 00000000..c91b6e16 Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64eax.flt differ diff --git a/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64srs.flt b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64srs.flt new file mode 100644 index 00000000..01baef15 Binary files /dev/null and b/Minecraft.Client/Common/Buildsteps/Contents/Windows64/redist64/mss64srs.flt differ diff --git a/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 index 2cc5d756..001cfb11 100644 --- a/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Durango-postbuild.ps1 @@ -26,7 +26,7 @@ foreach ($dir in $directories) { $folderCopies = @( @{ Source = "Common\Media"; Dest = "Common\Media" }, @{ Source = "Common\res"; Dest = "Common\res" }, - @{ Source = "DurangoMedia\Sound"; Dest = "Sound" }, + @{ Source = "Durango\Sound"; Dest = "Sound" }, @{ Source = "DurangoMedia\DLC"; Dest = "DLC" }, @{ Source = "DurangoMedia\Tutorial"; Dest = "Tutorial" }, @{ Source = "music"; Dest = "music" }, @@ -40,8 +40,6 @@ foreach ($copy in $folderCopies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } else { - Write-Host "Durango Postbuild: Folder not found, skipping: $src" } } @@ -55,9 +53,7 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } else { - Write-Host "Durango Postbuild: File not found, skipping: $src" - } + } } $deleteDirs = @( diff --git a/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 index 01bb431a..45f78399 100644 --- a/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Orbis-postbuild.ps1 @@ -22,15 +22,15 @@ foreach ($dir in $directories) { } $folderCopies = @( - @{ Source = "music"; Dest = "PS4_GAME\music" }, - @{ Source = "Common\Media"; Dest = "PS4_GAME\Common\Media" }, - @{ Source = "Common\res"; Dest = "PS4_GAME\Common\res" }, - @{ Source = "OrbisMedia\Sound"; Dest = "PS4_GAME\Orbis\Sound" }, - @{ Source = "OrbisMedia\DLC"; Dest = "PS4_GAME\Orbis\DLC" }, - @{ Source = "Orbis\DLCImages"; Dest = "PS4_GAME\Orbis\DLCImages" }, + @{ Source = "music"; Dest = "PS4_GAME\music" }, + @{ Source = "Common\Media"; Dest = "PS4_GAME\Common\Media" }, + @{ Source = "Common\res"; Dest = "PS4_GAME\Common\res" }, + @{ Source = "Orbis\Sound"; Dest = "PS4_GAME\Orbis\Sound" }, + @{ Source = "OrbisMedia\DLC"; Dest = "PS4_GAME\Orbis\DLC" }, + @{ Source = "Orbis\DLCImages"; Dest = "PS4_GAME\Orbis\DLCImages" }, @{ Source = "OrbisMedia\Tutorial"; Dest = "PS4_GAME\Orbis\Tutorial" }, - @{ Source = "$env:SCE_ORBIS_SDK_DIR\target\sce_module"; Dest = "PS4_GAME\sce_module" }, - @{ Source = Join-Path $PSScriptRoot "Contents\Orbis\sce_gls"; Dest = "PS4_GAME\sce_gls" }, + @{ Source = "$env:SCE_ORBIS_SDK_DIR\target\sce_module"; Dest = "PS4_GAME\sce_module" }, + @{ Source = Join-Path $PSScriptRoot "Contents\Orbis\sce_gls"; Dest = "PS4_GAME\sce_gls" }, @{ Source = Join-Path $PSScriptRoot "Contents\Orbis\sce_sys"; Dest = "PS4_GAME\sce_sys" } ) @@ -44,9 +44,7 @@ foreach ($copy in $folderCopies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } else { - Write-Host "Orbis Postbuild: Folder not found, skipping: $src" - } + } } $fileCopies = @( @@ -59,9 +57,7 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } else { - Write-Host "Orbis Postbuild: File not found, skipping: $src" - } + } } $builtFile = Join-Path $OutDir "Minecraft.Client.elf" diff --git a/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 index b7e8fa5a..c5158822 100644 --- a/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/PS3-postbuild.ps1 @@ -24,24 +24,18 @@ $folderCopies = @( @{ Source = "Common\Media"; Dest = "PS3_GAME\USRDIR\Common\Media" }, @{ Source = "Common\res"; Dest = "PS3_GAME\USRDIR\Common\res" }, @{ Source = "PS3Media\DLC"; Dest = "PS3_GAME\USRDIR\DLC" }, - @{ Source = "PS3Media\Sound"; Dest = "PS3_GAME\USRDIR\PS3\Sound" }, + @{ Source = "PS3\Sound"; Dest = "PS3_GAME\USRDIR\PS3\Sound" }, #@{ Source = "PSVita\Tutorial"; Dest = "PS3_GAME\USRDIR\PS3\Tutorial" }, # str1k3r - softlocks game @{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\LICDIR"; Dest = "PS3_GAME\LICDIR" }, @{ Source = Join-Path $PSScriptRoot "Contents\PS3\PS3_GAME\TROPDIR"; Dest = "PS3_GAME\TROPDIR" } ) foreach ($copy in $folderCopies) { - if ([System.IO.Path]::IsPathRooted($copy.Source)) { - $src = $copy.Source - } else { - $src = Join-Path $ProjectDir $copy.Source - } + $src = Join-Path $ProjectDir $copy.Source $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } else { - Write-Host "PS3 Postbuild: Folder not found, skipping: $src" } } @@ -63,9 +57,7 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } else { - Write-Host "PS3 Postbuild: File not found, skipping: $src" - } + } } if ($Configuration -match "ContentPackage") { diff --git a/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 index 7db32d2e..39bc2a37 100644 --- a/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/PSVita-postbuild.ps1 @@ -20,14 +20,14 @@ foreach ($dir in $directories) { } $folderCopies = @( - @{ Source = "music"; Dest = "PSVITA_GAME\music" }, - @{ Source = "Common\Media"; Dest = "PSVITA_GAME\Common\Media" }, - @{ Source = "Common\res"; Dest = "PSVITA_GAME\Common\res" }, - @{ Source = "PSVitaMedia\Sound"; Dest = "PSVITA_GAME\PSVita\Sound" }, - @{ Source = "PSVitaMedia\DLC"; Dest = "PSVITA_GAME\PSVita\DLC" }, - @{ Source = "PSVita\Tutorial"; Dest = "PSVITA_GAME\PSVita\Tutorial" }, - @{ Source = "$env:SCE_PSP2_SDK_DIR\target\sce_module"; Dest = "PSVITA_GAME\sce_module" }, - @{ Source = Join-Path $PSScriptRoot "Contents\PSVita\sce_sys"; Dest = "PSVITA_GAME\sce_sys" } + @{ Source = "music"; Dest = "PSVITA_GAME\music" }, + @{ Source = "Common\Media"; Dest = "PSVITA_GAME\Common\Media" }, + @{ Source = "Common\res"; Dest = "PSVITA_GAME\Common\res" }, + @{ Source = "PSVita\Sound"; Dest = "PSVITA_GAME\PSVita\Sound" }, + @{ Source = "PSVitaMedia\DLC"; Dest = "PSVITA_GAME\PSVita\DLC" }, + @{ Source = "PSVita\Tutorial"; Dest = "PSVITA_GAME\PSVita\Tutorial" }, + @{ Source = "$env:SCE_PSP2_SDK_DIR\target\sce_module"; Dest = "PSVITA_GAME\sce_module" }, + @{ Source = Join-Path $PSScriptRoot "Contents\PSVita\sce_sys"; Dest = "PSVITA_GAME\sce_sys" } ) foreach ($copy in $folderCopies) { @@ -40,9 +40,7 @@ foreach ($copy in $folderCopies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } else { - Write-Host "PSVita Postbuild: Folder not found, skipping: $src" - } + } } $fileCopies = @( @@ -56,9 +54,7 @@ foreach ($copy in $fileCopies) { if (Test-Path $src) { New-Item -ItemType Directory -Path (Split-Path $dst -Parent) -Force | Out-Null Copy-Item -Path $src -Destination $dst -Force - } else { - Write-Host "PSVita Postbuild: File not found, skipping: $src" - } + } } $builtFile = Join-Path $OutDir "Minecraft.Client.self" diff --git a/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 index d512ad32..77a84ad2 100644 --- a/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Windows64-postbuild.ps1 @@ -20,34 +20,28 @@ foreach ($dir in $directories) { $folderCopies = @( @{ Source = "music"; Dest = "music" }, - @{ Source = "Common\res"; Dest = "Common\res" }, @{ Source = "Common\Media"; Dest = "Common\Media" }, + @{ Source = "Common\res"; Dest = "Common\res" }, @{ Source = "DurangoMedia"; Dest = "Windows64Media" }, @{ Source = "Windows64Media"; Dest = "Windows64Media" }, - @{ Source = "Windows64Media\Sound"; Dest = "Windows64Media\Sound" }, - #@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru - @{ Source = "Windows64\Miles\lib\redist64"; Dest = "Windows64\redist64" } + #@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }, # str1k3r - doesnt even work bru + @{ Source = "Windows64\Sound"; Dest = "Windows64Media\Sound" }, + @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\redist64"; Dest = "redist64" } ) foreach ($copy in $folderCopies) { - if ([System.IO.Path]::IsPathRooted($copy.Source)) { - $src = $copy.Source - } else { - $src = Join-Path $ProjectDir $copy.Source - } + $src = Join-Path $ProjectDir $copy.Source $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } else { - Write-Host "Windows64 Postbuild: Folder not found, skipping: $src" } } $fileCopies = @( @{ Source = Join-Path $ProjectDir "Windows64\4JLibs\4J_Input\Windows64\vendor\SDL\lib\x64\SDL3.dll"; Dest = "SDL3.dll" }, - @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" }, - @{ Source = "Windows64\redist64\iggy_w64.dll"; Dest = "iggy_w64.dll" } + @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" }, + @{ Source = Join-Path $PSScriptRoot "Contents\Windows64\mss64.dll"; Dest = "mss64.dll" } ) foreach ($copy in $fileCopies) { @@ -56,7 +50,7 @@ foreach ($copy in $fileCopies) { if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force } else { - Write-Host "Windows64 Postbuild: File not found, skipping: $src" + Write-Host "Windows64 Postbuild: source not found, skipping: $src" } } diff --git a/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 b/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 index 8da63f72..12279db5 100644 --- a/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 +++ b/Minecraft.Client/Common/Buildsteps/Xbox-postbuild.ps1 @@ -24,8 +24,6 @@ foreach ($copy in $copies) { if (Test-Path $src) { xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null - } else { - Write-Host "Xbox Postbuild: Folder not found, skipping: $src" } } @@ -50,7 +48,5 @@ foreach ($copy in $fileCopies) { $dst = Join-Path $OutDir $copy.Dest if (Test-Path $src) { Copy-Item -Path $src -Destination $dst -Force - } else { - Write-Host "Xbox Postbuild: File not found, skipping: $src" - } + } } \ No newline at end of file diff --git a/Minecraft.Client/Common/Media/AnvilMenu1080.swf b/Minecraft.Client/Common/Media/AnvilMenu1080.swf index 1776eda9..6cf600e7 100644 Binary files a/Minecraft.Client/Common/Media/AnvilMenu1080.swf and b/Minecraft.Client/Common/Media/AnvilMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/AnvilMenuSplit1080.swf b/Minecraft.Client/Common/Media/AnvilMenuSplit1080.swf index 3830d0c1..e9fe5c72 100644 Binary files a/Minecraft.Client/Common/Media/AnvilMenuSplit1080.swf and b/Minecraft.Client/Common/Media/AnvilMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/BeaconMenu1080.swf b/Minecraft.Client/Common/Media/BeaconMenu1080.swf index f84c9101..699953ad 100644 Binary files a/Minecraft.Client/Common/Media/BeaconMenu1080.swf and b/Minecraft.Client/Common/Media/BeaconMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/BeaconMenuSplit1080.swf b/Minecraft.Client/Common/Media/BeaconMenuSplit1080.swf index 02647e98..e1faa4ed 100644 Binary files a/Minecraft.Client/Common/Media/BeaconMenuSplit1080.swf and b/Minecraft.Client/Common/Media/BeaconMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/BrewingStandMenu1080.swf b/Minecraft.Client/Common/Media/BrewingStandMenu1080.swf index 0aa8d2d3..d498091c 100644 Binary files a/Minecraft.Client/Common/Media/BrewingStandMenu1080.swf and b/Minecraft.Client/Common/Media/BrewingStandMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/BrewingStandMenuSplit1080.swf b/Minecraft.Client/Common/Media/BrewingStandMenuSplit1080.swf index 71e95d90..e877ca17 100644 Binary files a/Minecraft.Client/Common/Media/BrewingStandMenuSplit1080.swf and b/Minecraft.Client/Common/Media/BrewingStandMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/ChestLargeMenu1080.swf b/Minecraft.Client/Common/Media/ChestLargeMenu1080.swf index 951a5633..8f768ff4 100644 Binary files a/Minecraft.Client/Common/Media/ChestLargeMenu1080.swf and b/Minecraft.Client/Common/Media/ChestLargeMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/ChestLargeMenuSplit1080.swf b/Minecraft.Client/Common/Media/ChestLargeMenuSplit1080.swf index ab687d9b..b6f05fe3 100644 Binary files a/Minecraft.Client/Common/Media/ChestLargeMenuSplit1080.swf and b/Minecraft.Client/Common/Media/ChestLargeMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/ChestMenu1080.swf b/Minecraft.Client/Common/Media/ChestMenu1080.swf index 6f1672e0..b170cb7a 100644 Binary files a/Minecraft.Client/Common/Media/ChestMenu1080.swf and b/Minecraft.Client/Common/Media/ChestMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/ChestMenuSplit1080.swf b/Minecraft.Client/Common/Media/ChestMenuSplit1080.swf index 3b2d3d84..50089ab7 100644 Binary files a/Minecraft.Client/Common/Media/ChestMenuSplit1080.swf and b/Minecraft.Client/Common/Media/ChestMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/Controls1080.swf b/Minecraft.Client/Common/Media/Controls1080.swf index 9ec38f92..f38aca5c 100644 Binary files a/Minecraft.Client/Common/Media/Controls1080.swf and b/Minecraft.Client/Common/Media/Controls1080.swf differ diff --git a/Minecraft.Client/Common/Media/ControlsRemotePlay1080.swf b/Minecraft.Client/Common/Media/ControlsRemotePlay1080.swf index a1d21f0f..f75d6909 100644 Binary files a/Minecraft.Client/Common/Media/ControlsRemotePlay1080.swf and b/Minecraft.Client/Common/Media/ControlsRemotePlay1080.swf differ diff --git a/Minecraft.Client/Common/Media/ControlsSplit1080.swf b/Minecraft.Client/Common/Media/ControlsSplit1080.swf index e7c1c971..2f569b65 100644 Binary files a/Minecraft.Client/Common/Media/ControlsSplit1080.swf and b/Minecraft.Client/Common/Media/ControlsSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/Crafting2x2Menu1080.swf b/Minecraft.Client/Common/Media/Crafting2x2Menu1080.swf index e462de70..93ebc4bb 100644 Binary files a/Minecraft.Client/Common/Media/Crafting2x2Menu1080.swf and b/Minecraft.Client/Common/Media/Crafting2x2Menu1080.swf differ diff --git a/Minecraft.Client/Common/Media/Crafting2x2MenuSplit1080.swf b/Minecraft.Client/Common/Media/Crafting2x2MenuSplit1080.swf index 5e427387..c2f7d2cd 100644 Binary files a/Minecraft.Client/Common/Media/Crafting2x2MenuSplit1080.swf and b/Minecraft.Client/Common/Media/Crafting2x2MenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/Crafting3x3Menu1080.swf b/Minecraft.Client/Common/Media/Crafting3x3Menu1080.swf index 4d4d4255..dd0c89d0 100644 Binary files a/Minecraft.Client/Common/Media/Crafting3x3Menu1080.swf and b/Minecraft.Client/Common/Media/Crafting3x3Menu1080.swf differ diff --git a/Minecraft.Client/Common/Media/Crafting3x3MenuSplit1080.swf b/Minecraft.Client/Common/Media/Crafting3x3MenuSplit1080.swf index 155db47e..ed372eab 100644 Binary files a/Minecraft.Client/Common/Media/Crafting3x3MenuSplit1080.swf and b/Minecraft.Client/Common/Media/Crafting3x3MenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/CreateWorldMenu1080.swf b/Minecraft.Client/Common/Media/CreateWorldMenu1080.swf index 282c51f8..5b185e0d 100644 Binary files a/Minecraft.Client/Common/Media/CreateWorldMenu1080.swf and b/Minecraft.Client/Common/Media/CreateWorldMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/CreativeMenu1080.swf b/Minecraft.Client/Common/Media/CreativeMenu1080.swf index cdd0b9de..f8ba4ebd 100644 Binary files a/Minecraft.Client/Common/Media/CreativeMenu1080.swf and b/Minecraft.Client/Common/Media/CreativeMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/CreativeMenuSplit1080.swf b/Minecraft.Client/Common/Media/CreativeMenuSplit1080.swf index 51bab154..5deadfad 100644 Binary files a/Minecraft.Client/Common/Media/CreativeMenuSplit1080.swf and b/Minecraft.Client/Common/Media/CreativeMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/Credits1080.swf b/Minecraft.Client/Common/Media/Credits1080.swf index 20b2027e..f7aefdb9 100644 Binary files a/Minecraft.Client/Common/Media/Credits1080.swf and b/Minecraft.Client/Common/Media/Credits1080.swf differ diff --git a/Minecraft.Client/Common/Media/DLCMainMenu1080.swf b/Minecraft.Client/Common/Media/DLCMainMenu1080.swf index 5d7e40fa..ca730283 100644 Binary files a/Minecraft.Client/Common/Media/DLCMainMenu1080.swf and b/Minecraft.Client/Common/Media/DLCMainMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/DLCOffersMenu1080.swf b/Minecraft.Client/Common/Media/DLCOffersMenu1080.swf index 07094b53..8b78d223 100644 Binary files a/Minecraft.Client/Common/Media/DLCOffersMenu1080.swf and b/Minecraft.Client/Common/Media/DLCOffersMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/DeathMenu1080.swf b/Minecraft.Client/Common/Media/DeathMenu1080.swf index 10c097dd..c4364b17 100644 Binary files a/Minecraft.Client/Common/Media/DeathMenu1080.swf and b/Minecraft.Client/Common/Media/DeathMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/DeathMenuSplit1080.swf b/Minecraft.Client/Common/Media/DeathMenuSplit1080.swf index b9aba4c0..47098fee 100644 Binary files a/Minecraft.Client/Common/Media/DeathMenuSplit1080.swf and b/Minecraft.Client/Common/Media/DeathMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/DebugCreateSchematic1080.swf b/Minecraft.Client/Common/Media/DebugCreateSchematic1080.swf index 191bbddd..a1d1bd35 100644 Binary files a/Minecraft.Client/Common/Media/DebugCreateSchematic1080.swf and b/Minecraft.Client/Common/Media/DebugCreateSchematic1080.swf differ diff --git a/Minecraft.Client/Common/Media/DebugMenu1080.swf b/Minecraft.Client/Common/Media/DebugMenu1080.swf index f9de2197..1bd1851f 100644 Binary files a/Minecraft.Client/Common/Media/DebugMenu1080.swf and b/Minecraft.Client/Common/Media/DebugMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/DebugOptionsMenu1080.swf b/Minecraft.Client/Common/Media/DebugOptionsMenu1080.swf index 62c663a6..2cbb4e99 100644 Binary files a/Minecraft.Client/Common/Media/DebugOptionsMenu1080.swf and b/Minecraft.Client/Common/Media/DebugOptionsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/DebugSetCamera1080.swf b/Minecraft.Client/Common/Media/DebugSetCamera1080.swf index 093b1b8e..952b44ed 100644 Binary files a/Minecraft.Client/Common/Media/DebugSetCamera1080.swf and b/Minecraft.Client/Common/Media/DebugSetCamera1080.swf differ diff --git a/Minecraft.Client/Common/Media/DebugUIMarketingGuide1080.swf b/Minecraft.Client/Common/Media/DebugUIMarketingGuide1080.swf index 7406ae55..b6b6aaf7 100644 Binary files a/Minecraft.Client/Common/Media/DebugUIMarketingGuide1080.swf and b/Minecraft.Client/Common/Media/DebugUIMarketingGuide1080.swf differ diff --git a/Minecraft.Client/Common/Media/DispenserMenu1080.swf b/Minecraft.Client/Common/Media/DispenserMenu1080.swf index 1833b868..733aea7d 100644 Binary files a/Minecraft.Client/Common/Media/DispenserMenu1080.swf and b/Minecraft.Client/Common/Media/DispenserMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/DispenserMenuSplit1080.swf b/Minecraft.Client/Common/Media/DispenserMenuSplit1080.swf index 4619e30a..f4fd1748 100644 Binary files a/Minecraft.Client/Common/Media/DispenserMenuSplit1080.swf and b/Minecraft.Client/Common/Media/DispenserMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/EULA1080.swf b/Minecraft.Client/Common/Media/EULA1080.swf index f05c71ed..6c84b87b 100644 Binary files a/Minecraft.Client/Common/Media/EULA1080.swf and b/Minecraft.Client/Common/Media/EULA1080.swf differ diff --git a/Minecraft.Client/Common/Media/EnchantingMenu1080.swf b/Minecraft.Client/Common/Media/EnchantingMenu1080.swf index c86b678b..b6d1de7a 100644 Binary files a/Minecraft.Client/Common/Media/EnchantingMenu1080.swf and b/Minecraft.Client/Common/Media/EnchantingMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/EnchantingMenuSplit1080.swf b/Minecraft.Client/Common/Media/EnchantingMenuSplit1080.swf index 31078758..bbc67b71 100644 Binary files a/Minecraft.Client/Common/Media/EnchantingMenuSplit1080.swf and b/Minecraft.Client/Common/Media/EnchantingMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/EndPoem1080.swf b/Minecraft.Client/Common/Media/EndPoem1080.swf index 64ca91eb..0212adb3 100644 Binary files a/Minecraft.Client/Common/Media/EndPoem1080.swf and b/Minecraft.Client/Common/Media/EndPoem1080.swf differ diff --git a/Minecraft.Client/Common/Media/FireworksMenu1080.swf b/Minecraft.Client/Common/Media/FireworksMenu1080.swf index 20250d06..b1660654 100644 Binary files a/Minecraft.Client/Common/Media/FireworksMenu1080.swf and b/Minecraft.Client/Common/Media/FireworksMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/FireworksMenuSplit1080.swf b/Minecraft.Client/Common/Media/FireworksMenuSplit1080.swf index f8537492..6a37905d 100644 Binary files a/Minecraft.Client/Common/Media/FireworksMenuSplit1080.swf and b/Minecraft.Client/Common/Media/FireworksMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/FullscreenProgress1080.swf b/Minecraft.Client/Common/Media/FullscreenProgress1080.swf index 2f2f85be..e179c014 100644 Binary files a/Minecraft.Client/Common/Media/FullscreenProgress1080.swf and b/Minecraft.Client/Common/Media/FullscreenProgress1080.swf differ diff --git a/Minecraft.Client/Common/Media/FullscreenProgressSplit1080.swf b/Minecraft.Client/Common/Media/FullscreenProgressSplit1080.swf index 811c2dea..e41a5dce 100644 Binary files a/Minecraft.Client/Common/Media/FullscreenProgressSplit1080.swf and b/Minecraft.Client/Common/Media/FullscreenProgressSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/FurnaceMenu1080.swf b/Minecraft.Client/Common/Media/FurnaceMenu1080.swf index e21c3dea..78ca7710 100644 Binary files a/Minecraft.Client/Common/Media/FurnaceMenu1080.swf and b/Minecraft.Client/Common/Media/FurnaceMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/FurnaceMenuSplit1080.swf b/Minecraft.Client/Common/Media/FurnaceMenuSplit1080.swf index 0b78826e..8a0f4f39 100644 Binary files a/Minecraft.Client/Common/Media/FurnaceMenuSplit1080.swf and b/Minecraft.Client/Common/Media/FurnaceMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/HelpAndOptionsMenu1080.swf b/Minecraft.Client/Common/Media/HelpAndOptionsMenu1080.swf index 956277c5..0a907e5c 100644 Binary files a/Minecraft.Client/Common/Media/HelpAndOptionsMenu1080.swf and b/Minecraft.Client/Common/Media/HelpAndOptionsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/HelpAndOptionsMenuSplit1080.swf b/Minecraft.Client/Common/Media/HelpAndOptionsMenuSplit1080.swf index 6073ec66..dccc710b 100644 Binary files a/Minecraft.Client/Common/Media/HelpAndOptionsMenuSplit1080.swf and b/Minecraft.Client/Common/Media/HelpAndOptionsMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/HopperMenu1080.swf b/Minecraft.Client/Common/Media/HopperMenu1080.swf index 84394e94..a980c924 100644 Binary files a/Minecraft.Client/Common/Media/HopperMenu1080.swf and b/Minecraft.Client/Common/Media/HopperMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/HopperMenuSplit1080.swf b/Minecraft.Client/Common/Media/HopperMenuSplit1080.swf index 98dd6cde..f5b08f92 100644 Binary files a/Minecraft.Client/Common/Media/HopperMenuSplit1080.swf and b/Minecraft.Client/Common/Media/HopperMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/HorseInventoryMenu1080.swf b/Minecraft.Client/Common/Media/HorseInventoryMenu1080.swf index db0f4d36..a53870d1 100644 Binary files a/Minecraft.Client/Common/Media/HorseInventoryMenu1080.swf and b/Minecraft.Client/Common/Media/HorseInventoryMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/HorseInventoryMenuSplit1080.swf b/Minecraft.Client/Common/Media/HorseInventoryMenuSplit1080.swf index edfa8430..5cf51dbb 100644 Binary files a/Minecraft.Client/Common/Media/HorseInventoryMenuSplit1080.swf and b/Minecraft.Client/Common/Media/HorseInventoryMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/HowToPlayMenu1080.swf b/Minecraft.Client/Common/Media/HowToPlayMenu1080.swf index 6e128ffa..5c7f2718 100644 Binary files a/Minecraft.Client/Common/Media/HowToPlayMenu1080.swf and b/Minecraft.Client/Common/Media/HowToPlayMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/HowToPlayMenuSplit1080.swf b/Minecraft.Client/Common/Media/HowToPlayMenuSplit1080.swf index f44140b6..bf61e3cf 100644 Binary files a/Minecraft.Client/Common/Media/HowToPlayMenuSplit1080.swf and b/Minecraft.Client/Common/Media/HowToPlayMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGameHostOptions1080.swf b/Minecraft.Client/Common/Media/InGameHostOptions1080.swf index 207c86a7..9a8f6d37 100644 Binary files a/Minecraft.Client/Common/Media/InGameHostOptions1080.swf and b/Minecraft.Client/Common/Media/InGameHostOptions1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGameHostOptionsSplit1080.swf b/Minecraft.Client/Common/Media/InGameHostOptionsSplit1080.swf index a45e8a37..719b0acd 100644 Binary files a/Minecraft.Client/Common/Media/InGameHostOptionsSplit1080.swf and b/Minecraft.Client/Common/Media/InGameHostOptionsSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGameInfoMenu1080.swf b/Minecraft.Client/Common/Media/InGameInfoMenu1080.swf index 5f74a102..1bae07c0 100644 Binary files a/Minecraft.Client/Common/Media/InGameInfoMenu1080.swf and b/Minecraft.Client/Common/Media/InGameInfoMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGameInfoMenu720.swf b/Minecraft.Client/Common/Media/InGameInfoMenu720.swf index e6f1dc54..c3cbfd26 100644 Binary files a/Minecraft.Client/Common/Media/InGameInfoMenu720.swf and b/Minecraft.Client/Common/Media/InGameInfoMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/InGameInfoMenuSplit1080.swf b/Minecraft.Client/Common/Media/InGameInfoMenuSplit1080.swf index dc435457..6c7c7caf 100644 Binary files a/Minecraft.Client/Common/Media/InGameInfoMenuSplit1080.swf and b/Minecraft.Client/Common/Media/InGameInfoMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGamePlayerOptions1080.swf b/Minecraft.Client/Common/Media/InGamePlayerOptions1080.swf index 601cc467..4a7bcedf 100644 Binary files a/Minecraft.Client/Common/Media/InGamePlayerOptions1080.swf and b/Minecraft.Client/Common/Media/InGamePlayerOptions1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGamePlayerOptionsSplit1080.swf b/Minecraft.Client/Common/Media/InGamePlayerOptionsSplit1080.swf index c4187a09..0da8f934 100644 Binary files a/Minecraft.Client/Common/Media/InGamePlayerOptionsSplit1080.swf and b/Minecraft.Client/Common/Media/InGamePlayerOptionsSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGameTeleportMenu1080.swf b/Minecraft.Client/Common/Media/InGameTeleportMenu1080.swf index 8a65f8aa..ffbdcbed 100644 Binary files a/Minecraft.Client/Common/Media/InGameTeleportMenu1080.swf and b/Minecraft.Client/Common/Media/InGameTeleportMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/InGameTeleportMenuSplit1080.swf b/Minecraft.Client/Common/Media/InGameTeleportMenuSplit1080.swf index 0516dcb4..98d65ed7 100644 Binary files a/Minecraft.Client/Common/Media/InGameTeleportMenuSplit1080.swf and b/Minecraft.Client/Common/Media/InGameTeleportMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/Intro1080.swf b/Minecraft.Client/Common/Media/Intro1080.swf index c9f2d3ba..38e250a1 100644 Binary files a/Minecraft.Client/Common/Media/Intro1080.swf and b/Minecraft.Client/Common/Media/Intro1080.swf differ diff --git a/Minecraft.Client/Common/Media/Intro720.swf b/Minecraft.Client/Common/Media/Intro720.swf index 0c2bb3eb..e5e3f8fa 100644 Binary files a/Minecraft.Client/Common/Media/Intro720.swf and b/Minecraft.Client/Common/Media/Intro720.swf differ diff --git a/Minecraft.Client/Common/Media/InventoryMenu1080.swf b/Minecraft.Client/Common/Media/InventoryMenu1080.swf index 47434cc3..13af4181 100644 Binary files a/Minecraft.Client/Common/Media/InventoryMenu1080.swf and b/Minecraft.Client/Common/Media/InventoryMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/InventoryMenuSplit1080.swf b/Minecraft.Client/Common/Media/InventoryMenuSplit1080.swf index efe2d484..8da59862 100644 Binary files a/Minecraft.Client/Common/Media/InventoryMenuSplit1080.swf and b/Minecraft.Client/Common/Media/InventoryMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/JoinMenu1080.swf b/Minecraft.Client/Common/Media/JoinMenu1080.swf index 817c3633..1cc53500 100644 Binary files a/Minecraft.Client/Common/Media/JoinMenu1080.swf and b/Minecraft.Client/Common/Media/JoinMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/Keyboard1080.swf b/Minecraft.Client/Common/Media/Keyboard1080.swf index e9b6107e..159067cd 100644 Binary files a/Minecraft.Client/Common/Media/Keyboard1080.swf and b/Minecraft.Client/Common/Media/Keyboard1080.swf differ diff --git a/Minecraft.Client/Common/Media/KeyboardSplit1080.swf b/Minecraft.Client/Common/Media/KeyboardSplit1080.swf index fdeea502..926c4ce8 100644 Binary files a/Minecraft.Client/Common/Media/KeyboardSplit1080.swf and b/Minecraft.Client/Common/Media/KeyboardSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/LanguagesMenu1080.swf b/Minecraft.Client/Common/Media/LanguagesMenu1080.swf index 9c0bef5a..babe53b5 100644 Binary files a/Minecraft.Client/Common/Media/LanguagesMenu1080.swf and b/Minecraft.Client/Common/Media/LanguagesMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/LanguagesMenuSplit1080.swf b/Minecraft.Client/Common/Media/LanguagesMenuSplit1080.swf index 24d7a0b6..4c46b614 100644 Binary files a/Minecraft.Client/Common/Media/LanguagesMenuSplit1080.swf and b/Minecraft.Client/Common/Media/LanguagesMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/LaunchMoreOptionsMenu1080.swf b/Minecraft.Client/Common/Media/LaunchMoreOptionsMenu1080.swf index 07d81207..3fec537a 100644 Binary files a/Minecraft.Client/Common/Media/LaunchMoreOptionsMenu1080.swf and b/Minecraft.Client/Common/Media/LaunchMoreOptionsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/LeaderboardMenu1080.swf b/Minecraft.Client/Common/Media/LeaderboardMenu1080.swf index ca956284..d6d49225 100644 Binary files a/Minecraft.Client/Common/Media/LeaderboardMenu1080.swf and b/Minecraft.Client/Common/Media/LeaderboardMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/LoadMenu1080.swf b/Minecraft.Client/Common/Media/LoadMenu1080.swf index d0d61ec7..9273c0e4 100644 Binary files a/Minecraft.Client/Common/Media/LoadMenu1080.swf and b/Minecraft.Client/Common/Media/LoadMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/LoadOrJoinMenu1080.swf b/Minecraft.Client/Common/Media/LoadOrJoinMenu1080.swf index 5ad47f8a..b1516009 100644 Binary files a/Minecraft.Client/Common/Media/LoadOrJoinMenu1080.swf and b/Minecraft.Client/Common/Media/LoadOrJoinMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/MainMenu1080.swf b/Minecraft.Client/Common/Media/MainMenu1080.swf index a3c55273..f489d123 100644 Binary files a/Minecraft.Client/Common/Media/MainMenu1080.swf and b/Minecraft.Client/Common/Media/MainMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/MainMenu720.swf b/Minecraft.Client/Common/Media/MainMenu720.swf index 3823791e..4e48faab 100644 Binary files a/Minecraft.Client/Common/Media/MainMenu720.swf and b/Minecraft.Client/Common/Media/MainMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64.arc b/Minecraft.Client/Common/Media/MediaWindows64.arc index 6e6ba9a9..6449378c 100644 Binary files a/Minecraft.Client/Common/Media/MediaWindows64.arc and b/Minecraft.Client/Common/Media/MediaWindows64.arc differ diff --git a/Minecraft.Client/Common/Media/MessageBox1080.swf b/Minecraft.Client/Common/Media/MessageBox1080.swf index eba77b2f..bba2d8e2 100644 Binary files a/Minecraft.Client/Common/Media/MessageBox1080.swf and b/Minecraft.Client/Common/Media/MessageBox1080.swf differ diff --git a/Minecraft.Client/Common/Media/MessageBoxSplit1080.swf b/Minecraft.Client/Common/Media/MessageBoxSplit1080.swf index 7a968050..c381cd37 100644 Binary files a/Minecraft.Client/Common/Media/MessageBoxSplit1080.swf and b/Minecraft.Client/Common/Media/MessageBoxSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/Panorama1080.swf b/Minecraft.Client/Common/Media/Panorama1080.swf index a73b2b85..d0ec0207 100644 Binary files a/Minecraft.Client/Common/Media/Panorama1080.swf and b/Minecraft.Client/Common/Media/Panorama1080.swf differ diff --git a/Minecraft.Client/Common/Media/PanoramaSplit1080.swf b/Minecraft.Client/Common/Media/PanoramaSplit1080.swf index f0178099..682f8fbc 100644 Binary files a/Minecraft.Client/Common/Media/PanoramaSplit1080.swf and b/Minecraft.Client/Common/Media/PanoramaSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/PauseMenu1080.swf b/Minecraft.Client/Common/Media/PauseMenu1080.swf index 9259be16..a40c4b71 100644 Binary files a/Minecraft.Client/Common/Media/PauseMenu1080.swf and b/Minecraft.Client/Common/Media/PauseMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/PauseMenu720.swf b/Minecraft.Client/Common/Media/PauseMenu720.swf index aa60f80c..53861394 100644 Binary files a/Minecraft.Client/Common/Media/PauseMenu720.swf and b/Minecraft.Client/Common/Media/PauseMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/PauseMenuSplit1080.swf b/Minecraft.Client/Common/Media/PauseMenuSplit1080.swf index 31c8a99d..bc368c73 100644 Binary files a/Minecraft.Client/Common/Media/PauseMenuSplit1080.swf and b/Minecraft.Client/Common/Media/PauseMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/PressStartToPlay1080.swf b/Minecraft.Client/Common/Media/PressStartToPlay1080.swf index 87de331d..dd5ede9b 100644 Binary files a/Minecraft.Client/Common/Media/PressStartToPlay1080.swf and b/Minecraft.Client/Common/Media/PressStartToPlay1080.swf differ diff --git a/Minecraft.Client/Common/Media/QuadrantSignin1080.swf b/Minecraft.Client/Common/Media/QuadrantSignin1080.swf index 92e2f348..78fdd155 100644 Binary files a/Minecraft.Client/Common/Media/QuadrantSignin1080.swf and b/Minecraft.Client/Common/Media/QuadrantSignin1080.swf differ diff --git a/Minecraft.Client/Common/Media/ReinstallMenu1080.swf b/Minecraft.Client/Common/Media/ReinstallMenu1080.swf index cff53681..456bd62d 100644 Binary files a/Minecraft.Client/Common/Media/ReinstallMenu1080.swf and b/Minecraft.Client/Common/Media/ReinstallMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/ReinstallMenuSplit1080.swf b/Minecraft.Client/Common/Media/ReinstallMenuSplit1080.swf index fc77e2a2..f144e60f 100644 Binary files a/Minecraft.Client/Common/Media/ReinstallMenuSplit1080.swf and b/Minecraft.Client/Common/Media/ReinstallMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SaveMenu1080.swf b/Minecraft.Client/Common/Media/SaveMenu1080.swf index ff546d74..a6596702 100644 Binary files a/Minecraft.Client/Common/Media/SaveMenu1080.swf and b/Minecraft.Client/Common/Media/SaveMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SaveMessage1080.swf b/Minecraft.Client/Common/Media/SaveMessage1080.swf index 1108359d..1861d05e 100644 Binary files a/Minecraft.Client/Common/Media/SaveMessage1080.swf and b/Minecraft.Client/Common/Media/SaveMessage1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsAudioMenu1080.swf b/Minecraft.Client/Common/Media/SettingsAudioMenu1080.swf index cc3330ab..1b309d81 100644 Binary files a/Minecraft.Client/Common/Media/SettingsAudioMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsAudioMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsAudioMenuSplit1080.swf b/Minecraft.Client/Common/Media/SettingsAudioMenuSplit1080.swf index 6115bf4f..36ce836a 100644 Binary files a/Minecraft.Client/Common/Media/SettingsAudioMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SettingsAudioMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsControlMenu1080.swf b/Minecraft.Client/Common/Media/SettingsControlMenu1080.swf index 19f88ec2..84d24dde 100644 Binary files a/Minecraft.Client/Common/Media/SettingsControlMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsControlMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsControlMenuSplit1080.swf b/Minecraft.Client/Common/Media/SettingsControlMenuSplit1080.swf index 58770d0a..e9f7fab3 100644 Binary files a/Minecraft.Client/Common/Media/SettingsControlMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SettingsControlMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf b/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf index 3a48abc9..90bdc2a5 100644 Binary files a/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsGraphicsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsGraphicsMenuSplit1080.swf b/Minecraft.Client/Common/Media/SettingsGraphicsMenuSplit1080.swf index 6037882d..e1010902 100644 Binary files a/Minecraft.Client/Common/Media/SettingsGraphicsMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SettingsGraphicsMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsMenu1080.swf b/Minecraft.Client/Common/Media/SettingsMenu1080.swf index 9e922acd..35bd03e4 100644 Binary files a/Minecraft.Client/Common/Media/SettingsMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsMenuSplit1080.swf b/Minecraft.Client/Common/Media/SettingsMenuSplit1080.swf index 467b2e1f..ed89191e 100644 Binary files a/Minecraft.Client/Common/Media/SettingsMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SettingsMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsOptionsMenu1080.swf b/Minecraft.Client/Common/Media/SettingsOptionsMenu1080.swf index ede96935..a75cfe55 100644 Binary files a/Minecraft.Client/Common/Media/SettingsOptionsMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsOptionsMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsOptionsMenuSplit1080.swf b/Minecraft.Client/Common/Media/SettingsOptionsMenuSplit1080.swf index b435a238..5479267f 100644 Binary files a/Minecraft.Client/Common/Media/SettingsOptionsMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SettingsOptionsMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsUIMenu1080.swf b/Minecraft.Client/Common/Media/SettingsUIMenu1080.swf index a72537df..d9c996ef 100644 Binary files a/Minecraft.Client/Common/Media/SettingsUIMenu1080.swf and b/Minecraft.Client/Common/Media/SettingsUIMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SettingsUIMenuSplit1080.swf b/Minecraft.Client/Common/Media/SettingsUIMenuSplit1080.swf index 18128a0e..19c0d59c 100644 Binary files a/Minecraft.Client/Common/Media/SettingsUIMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SettingsUIMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SignEntryMenu1080.swf b/Minecraft.Client/Common/Media/SignEntryMenu1080.swf index 710de35e..6b07edde 100644 Binary files a/Minecraft.Client/Common/Media/SignEntryMenu1080.swf and b/Minecraft.Client/Common/Media/SignEntryMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SignEntryMenuSplit1080.swf b/Minecraft.Client/Common/Media/SignEntryMenuSplit1080.swf index 4bea3fcd..64f2070a 100644 Binary files a/Minecraft.Client/Common/Media/SignEntryMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SignEntryMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/SkinSelectMenu1080.swf b/Minecraft.Client/Common/Media/SkinSelectMenu1080.swf index 5eaf67fb..3c299cd6 100644 Binary files a/Minecraft.Client/Common/Media/SkinSelectMenu1080.swf and b/Minecraft.Client/Common/Media/SkinSelectMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/SkinSelectMenu720.swf b/Minecraft.Client/Common/Media/SkinSelectMenu720.swf index 059ae199..c8c85b72 100644 Binary files a/Minecraft.Client/Common/Media/SkinSelectMenu720.swf and b/Minecraft.Client/Common/Media/SkinSelectMenu720.swf differ diff --git a/Minecraft.Client/Common/Media/SkinSelectMenuSplit1080.swf b/Minecraft.Client/Common/Media/SkinSelectMenuSplit1080.swf index 03c532fe..a4cc9431 100644 Binary files a/Minecraft.Client/Common/Media/SkinSelectMenuSplit1080.swf and b/Minecraft.Client/Common/Media/SkinSelectMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/ToolTips1080.swf b/Minecraft.Client/Common/Media/ToolTips1080.swf index 2251f80e..34f3402e 100644 Binary files a/Minecraft.Client/Common/Media/ToolTips1080.swf and b/Minecraft.Client/Common/Media/ToolTips1080.swf differ diff --git a/Minecraft.Client/Common/Media/ToolTips720.swf b/Minecraft.Client/Common/Media/ToolTips720.swf index 7c5a5ba4..3784c0b5 100644 Binary files a/Minecraft.Client/Common/Media/ToolTips720.swf and b/Minecraft.Client/Common/Media/ToolTips720.swf differ diff --git a/Minecraft.Client/Common/Media/ToolTipsSplit1080.swf b/Minecraft.Client/Common/Media/ToolTipsSplit1080.swf index 820fdda1..34c05919 100644 Binary files a/Minecraft.Client/Common/Media/ToolTipsSplit1080.swf and b/Minecraft.Client/Common/Media/ToolTipsSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/TradingMenu1080.swf b/Minecraft.Client/Common/Media/TradingMenu1080.swf index 75b6292e..32171bcd 100644 Binary files a/Minecraft.Client/Common/Media/TradingMenu1080.swf and b/Minecraft.Client/Common/Media/TradingMenu1080.swf differ diff --git a/Minecraft.Client/Common/Media/TradingMenuSplit1080.swf b/Minecraft.Client/Common/Media/TradingMenuSplit1080.swf index 2545ebb0..ed6006bc 100644 Binary files a/Minecraft.Client/Common/Media/TradingMenuSplit1080.swf and b/Minecraft.Client/Common/Media/TradingMenuSplit1080.swf differ diff --git a/Minecraft.Client/Common/Media/skin.swf b/Minecraft.Client/Common/Media/skin.swf index 6206ca47..84a33f6f 100644 Binary files a/Minecraft.Client/Common/Media/skin.swf and b/Minecraft.Client/Common/Media/skin.swf differ diff --git a/Minecraft.Client/Common/Media/skinHD.swf b/Minecraft.Client/Common/Media/skinHD.swf index 12d35caf..78a8ff12 100644 Binary files a/Minecraft.Client/Common/Media/skinHD.swf and b/Minecraft.Client/Common/Media/skinHD.swf differ diff --git a/Minecraft.Client/Common/UI/DirectTextEdit.h b/Minecraft.Client/Common/UI/DirectTextEdit.h new file mode 100644 index 00000000..d7f67441 --- /dev/null +++ b/Minecraft.Client/Common/UI/DirectTextEdit.h @@ -0,0 +1,28 @@ +#pragma once + +#include + +class UIControl_TextInput; +class UIControl; + +namespace DirectTextEdit +{ + typedef int (*CommitCallback)(LPVOID param, bool accepted); + + typedef void (*LineNavCallback)(LPVOID param, int dir); + + void Begin(UIControl_TextInput *ctrl, UIControl *parent, + const wchar_t *initialText, + unsigned int maxChars, int keyboardMode, + CommitCallback callback, LPVOID param); + + bool IsActive(); + + void Tick(); + + void Finish(bool accepted); + + bool TakeText(uint16_t *outText, unsigned int outCapacity); + + void SetLineNav(LineNavCallback callback, LPVOID param); +}; diff --git a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp index 1cedc737..d9cf97e7 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.cpp @@ -1,6 +1,9 @@ #include "stdafx.h" #include "IUIScene_AbstractContainerMenu.h" +#include "UIScene.h" +#include "UIControl.h" +#include "UIControl_SlotList.h" #include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h" #include "..\..\..\Minecraft.World\net.minecraft.world.item.h" @@ -89,6 +92,21 @@ void IUIScene_AbstractContainerMenu::Initialize(int iPad, AbstractContainerMenu* PlatformInitialize(iPad,startIndex); } +void IUIScene_AbstractContainerMenu::FixSlotGridSize(ESceneSection eSection, UIControl_SlotList &list, UIVec2D §ionSize) +{ + if (sectionSize.x <= 0.0f || sectionSize.y <= 0.0f) + { + S32 iSlot = list.GetSlotSize(); + int iCols = 0, iRows = 0; + GetSectionDimensions(eSection, &iCols, &iRows); + if (iSlot > 0 && iCols > 0 && iRows > 0) + { + sectionSize.x = (float)(iSlot * iCols); + sectionSize.y = (float)(iSlot * iRows); + } + } +} + int IUIScene_AbstractContainerMenu::GetSectionDimensions( ESceneSection eSection, int* piNumColumns, int* piNumRows ) { if(IsSectionSlotList(eSection)) @@ -257,7 +275,7 @@ void IUIScene_AbstractContainerMenu::UpdateTooltips() } } -void IUIScene_AbstractContainerMenu::onMouseTick() +void IUIScene_AbstractContainerMenu::onMouseTick(UIScene *pScene) { Minecraft *pMinecraft = Minecraft::GetInstance(); if( pMinecraft->localgameModes[getPad()] != NULL) @@ -289,9 +307,22 @@ void IUIScene_AbstractContainerMenu::onMouseTick() int iPad = getPad(); bool bStickInput = false; + bool bUsingMouse = false; float fInputX = InputManager.GetJoypadStick_LX( iPad, false )*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f); // apply the sensitivity float fInputY = InputManager.GetJoypadStick_LY( iPad, false )*((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InMenu)/100.0f); // apply the sensitivity +#ifdef _WINDOWS64 + if (!InputManager.IsMouseCaptured() && !ui.IsControllerMode()) + { + ui.GetMovieMousePos(pScene, vPointerPos.x, vPointerPos.y); + fInputX = 0.0f; + fInputY = 0.0f; + bUsingMouse = true; + m_eCurrTapState = eTapStateNoInput; + m_iConsectiveInputTicks = 0; + } +#endif + #ifdef __ORBIS__ // should have sensitivity for the touchpad //(float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_TouchPadInMenu)/100.0f @@ -482,6 +513,22 @@ void IUIScene_AbstractContainerMenu::onMouseTick() // Centre position of item under pointer, use this to snap pointer to item. D3DXVECTOR3 vSnapPos; + UIVec2D vMainPanelOffset; + vMainPanelOffset.x = 0.0f; + vMainPanelOffset.y = 0.0f; + if (pScene) + { + UIControl *pMainPanel = pScene->GetMainPanel(); + if (pMainPanel) + { + pMainPanel->UpdateControl(); + vMainPanelOffset.x = (float)pMainPanel->getXPos(); + vMainPanelOffset.y = (float)pMainPanel->getYPos(); + } + } + + RefreshSlotControls(); + for ( int iSection = m_eFirstSection; iSection < m_eMaxSection; ++iSection ) { // Do not check any further if we have already found the item under the pointer. @@ -496,6 +543,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick() // Get position of this section. UIVec2D sectionPos; GetPositionOfSection( eSection, &( sectionPos ) ); + sectionPos.x += vMainPanelOffset.x; + sectionPos.y += vMainPanelOffset.y; if(!IsSectionSlotList(eSection)) { @@ -671,6 +720,8 @@ void IUIScene_AbstractContainerMenu::onMouseTick() // Desired slot after tap input is valid, so make the jump to this slot. UIVec2D sectionPos; GetPositionOfSection( eSectionUnderPointer, &( sectionPos ) ); + sectionPos.x += vMainPanelOffset.x; + sectionPos.y += vMainPanelOffset.y; iNewSlotIndex = ( iDesiredSlotY * iNumColumns ) + iDesiredSlotX; @@ -692,7 +743,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick() // If there is no stick input, and we are over a slot, then snap pointer to slot centre. // 4J - TomK - only if this particular component allows so! - if(CanHaveFocus(eSectionUnderPointer)) + if(CanHaveFocus(eSectionUnderPointer) && !bUsingMouse) { vPointerPos.x = vSnapPos.x; vPointerPos.y = vSnapPos.y; @@ -1320,8 +1371,15 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b buttonNum = 0; quickKeyHeld = FALSE; ui.PlayUISFX(eSFX_Press); +#ifdef _WINDOWS64 + { FILE *cf = fopen("inv_debug.log", "a"); if (cf) { fprintf(cf, "CLICK ptr=(%.1f,%.1f) sec=%d sx=%d sy=%d\n", m_pointerPos.x, m_pointerPos.y, (int)m_eCurrSection, m_iCurrSlotX, m_iCurrSlotY); + if (m_eCurrSection != eSectionNone) { UIVec2D dsp, dip, disz; int dc=0, dr=0; GetPositionOfSection(m_eCurrSection, &dsp); GetItemScreenData(m_eCurrSection, 0, &dip, &disz); GetSectionDimensions(m_eCurrSection, &dc, &dr); + extern int g_iWindowClientW, g_iWindowClientH; int rawx = InputManager.GetMouseX(), rawy = InputManager.GetMouseY(); + fprintf(cf, " secrect=(%.1f,%.1f) item0=(%.1f,%.1f %.1fx%.1f) cols=%d rows=%d raw=(%d,%d) client=(%d,%d) screen=(%.1f,%.1f)\n", dsp.x, dsp.y, dip.x, dip.y, disz.x, disz.y, dc, dr, rawx, rawy, g_iWindowClientW, g_iWindowClientH, ui.getScreenWidth(), ui.getScreenHeight()); } + fclose(cf); } } +#endif } - break; + break; case ACTION_MENU_X: if(!bRepeat) { @@ -1452,12 +1510,12 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b } else { - if( IsSectionSlotList( m_eCurrSection ) ) - { - handleSlotListClicked(m_eCurrSection,buttonNum,quickKeyHeld); - } - else - { + if( IsSectionSlotList( m_eCurrSection ) ) + { + handleSlotListClicked(m_eCurrSection,buttonNum,quickKeyHeld); + } + else + { // TODO Clicked something else, like for example the craft result. Do something here // 4J WESTY : For pointer system we can legally drop items outside of the window panel here, or may press button while diff --git a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h index b7227ee0..3529bd37 100644 --- a/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h +++ b/Minecraft.Client/Common/UI/IUIScene_AbstractContainerMenu.h @@ -19,6 +19,8 @@ class AbstractContainerMenu; class Slot; +class UIScene; +class UIControl_SlotList; class IUIScene_AbstractContainerMenu { @@ -215,7 +217,9 @@ protected: virtual void PlatformInitialize(int iPad, int startIndex) = 0; virtual void InitDataAssociations(int iPad, AbstractContainerMenu *menu, int startIndex = 0) = 0; - void onMouseTick(); + void onMouseTick(UIScene *pScene); + void FixSlotGridSize(ESceneSection eSection, UIControl_SlotList &list, UIVec2D §ionSize); + virtual void RefreshSlotControls() {} bool handleKeyDown(int iPad, int iAction, bool bRepeat); virtual bool handleValidKeyPress(int iUserIndex, int buttonNum, BOOL quickKeyHeld); virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld); diff --git a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp index ce35be8f..9dc53d03 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CraftingMenu.cpp @@ -411,7 +411,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat) { bNoScrollSlots = true; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) bNoScrollSlots = true; #endif @@ -983,7 +983,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots() { bNoScrollSlots = true; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) bNoScrollSlots = true; #endif diff --git a/Minecraft.Client/Common/UI/UI.h b/Minecraft.Client/Common/UI/UI.h index ca834b10..ccf7f5a4 100644 --- a/Minecraft.Client/Common/UI/UI.h +++ b/Minecraft.Client/Common/UI/UI.h @@ -38,7 +38,7 @@ #include "UIControl_SpaceIndicatorBar.h" #include "UIControl_BeaconEffectButton.h" -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) #include "UIControl_Touch.h" #endif diff --git a/Minecraft.Client/Common/UI/UIBitmapFont.cpp b/Minecraft.Client/Common/UI/UIBitmapFont.cpp index f9c70678..80fda11e 100644 --- a/Minecraft.Client/Common/UI/UIBitmapFont.cpp +++ b/Minecraft.Client/Common/UI/UIBitmapFont.cpp @@ -324,7 +324,17 @@ rrbool UIBitmapFont::GetGlyphBitmap(S32 glyph,F32 pixel_scale,IggyBitmapCharacte bitmap->top_left_y = -((S32) m_cFontData->getFontData()->m_uiGlyphHeight) * m_cFontData->getFontData()->m_fAscent; bitmap->oversample = 0; +#ifdef _WINDOWS64 + { + float frac = targetPixelScale - floorf(targetPixelScale); + if (frac < 0.0f) frac = 0.0f; + if (frac > 1.0f) frac = 1.0f; + float distToInt = (frac < 0.5f) ? frac : (1.0f - frac); + bitmap->point_sample = (distToInt < 0.03f); + } +#else bitmap->point_sample = true; +#endif // 4J-JEV: // pixel_scale == font size chosen in flash. diff --git a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp index f933fbb8..99e1c855 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp @@ -14,7 +14,7 @@ UIComponent_Tooltips::UIComponent_Tooltips(int iPad, void *initData, UILayer *pa // Setup all the Iggy references we need for this scene initialiseMovie(); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // initialise vita touch controls with ids for(unsigned int i = 0; i < ETouchInput_Count; ++i) { @@ -353,13 +353,13 @@ void UIComponent_Tooltips::_Relayout() IggyDataValue result; IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcUpdateLayout, 0 , NULL ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // rebuild touchboxes ui.TouchBoxRebuild(this); #endif } -#ifdef __PSVITA__ +#if defined(__PSVITA__) void UIComponent_Tooltips::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) { //app.DebugPrintf("ToolTip Touch ID = %i\n", iId); @@ -427,6 +427,66 @@ void UIComponent_Tooltips::handleTouchInput(unsigned int iPad, S32 x, S32 y, int } } } +#elif defined(_WINDOWS64) +void UIComponent_Tooltips::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) +{ + app.DebugPrintf("MY NAME IS CLEVELEND BROWN\n"); + bool handled = false; + + if((!ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad())) && (app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_Tooltips) == 0)) + return; + + if(bReleased) + { + switch(iId) + { + case ETouchInput_Touch_A: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_A\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_A); + break; + case ETouchInput_Touch_B: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_B\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_B); + break; + case ETouchInput_Touch_X: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_X\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_X); + break; + case ETouchInput_Touch_Y: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_Y\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_Y); + break; + case ETouchInput_Touch_LT: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_LT\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_LT); + break; + case ETouchInput_Touch_RightTrigger: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_RT\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_RT); + break; + case ETouchInput_Touch_LeftBumper: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_LB\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_LB); + break; + case ETouchInput_Touch_RightBumper: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_RB\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_RB); + break; + case ETouchInput_Touch_LeftStick: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_LTHUMB\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_LTHUMB); + break; + case ETouchInput_Touch_RightStick: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_RTHUMB\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_RTHUMB); + break; + case ETouchInput_Touch_Select: + app.DebugPrintf("ToolTip Map Touch to _360_JOY_BUTTON_BACK\n", iId); + InputManager.MapTouchInput(iPad, _360_JOY_BUTTON_BACK); + break; + } + } +} #endif void UIComponent_Tooltips::handleReload() diff --git a/Minecraft.Client/Common/UI/UIComponent_Tooltips.h b/Minecraft.Client/Common/UI/UIComponent_Tooltips.h index c595c265..78d9caed 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Tooltips.h +++ b/Minecraft.Client/Common/UI/UIComponent_Tooltips.h @@ -26,7 +26,7 @@ protected: IggyName m_funcSetTooltip, m_funcSetOpacity, m_funcSetABSwap, m_funcUpdateLayout; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) enum ETouchInput { ETouchInput_Touch_A, @@ -47,7 +47,7 @@ protected: #endif UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_A], "Touch_A") UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_B], "Touch_B") UI_MAP_ELEMENT( m_TouchController[ETouchInput_Touch_X], "Touch_X") @@ -110,7 +110,7 @@ private: bool m_overrideSFX[XUSER_MAX_COUNT][ACTION_MAX_MENU]; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); #endif }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIControl.cpp b/Minecraft.Client/Common/UI/UIControl.cpp index 50454881..4550627e 100644 --- a/Minecraft.Client/Common/UI/UIControl.cpp +++ b/Minecraft.Client/Common/UI/UIControl.cpp @@ -42,7 +42,7 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string return res; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIControl::UpdateControl() { F64 fx, fy, fwidth, fheight; diff --git a/Minecraft.Client/Common/UI/UIControl.h b/Minecraft.Client/Common/UI/UIControl.h index 65aa9bc2..92769e9e 100644 --- a/Minecraft.Client/Common/UI/UIControl.h +++ b/Minecraft.Client/Common/UI/UIControl.h @@ -61,7 +61,7 @@ public: UIControl(); virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UpdateControl(); void setHidden(bool bHidden) {m_bHidden=bHidden;} bool getHidden(void) {return m_bHidden;} diff --git a/Minecraft.Client/Common/UI/UIControl_Button.cpp b/Minecraft.Client/Common/UI/UIControl_Button.cpp index 82f6c839..80e306e1 100644 --- a/Minecraft.Client/Common/UI/UIControl_Button.cpp +++ b/Minecraft.Client/Common/UI/UIControl_Button.cpp @@ -35,7 +35,7 @@ void UIControl_Button::init(UIString label, int id) value[1].number = id; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-PB - add this button to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) diff --git a/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp b/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp index 866928a5..69d9d70b 100644 --- a/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_ButtonList.cpp @@ -35,7 +35,7 @@ void UIControl_ButtonList::init(int id) value[0].number = id; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 1 , value ); - #ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-PB - add this buttonlist to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) @@ -159,7 +159,7 @@ void UIControl_ButtonList::setButtonLabel(int iButtonId, const wstring &label) IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcSetButtonLabel, 2 , value ); } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIControl_ButtonList::SetTouchFocus(S32 iX, S32 iY, bool bRepeat) { IggyDataValue result; diff --git a/Minecraft.Client/Common/UI/UIControl_ButtonList.h b/Minecraft.Client/Common/UI/UIControl_ButtonList.h index 7c3988bd..6e26ac4c 100644 --- a/Minecraft.Client/Common/UI/UIControl_ButtonList.h +++ b/Minecraft.Client/Common/UI/UIControl_ButtonList.h @@ -37,7 +37,7 @@ public: void setButtonLabel(int iButtonId, const wstring &label); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void SetTouchFocus(S32 iX, S32 iY, bool bRepeat); bool CanTouchTrigger(S32 iX, S32 iY); #endif diff --git a/Minecraft.Client/Common/UI/UIControl_CheckBox.cpp b/Minecraft.Client/Common/UI/UIControl_CheckBox.cpp index d803df7c..ee6ba10c 100644 --- a/Minecraft.Client/Common/UI/UIControl_CheckBox.cpp +++ b/Minecraft.Client/Common/UI/UIControl_CheckBox.cpp @@ -43,7 +43,7 @@ void UIControl_CheckBox::init(UIString label, int id, bool checked) value[2].boolval = checked; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 3 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-TomK - add checkbox to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) diff --git a/Minecraft.Client/Common/UI/UIControl_DynamicLabel.cpp b/Minecraft.Client/Common/UI/UIControl_DynamicLabel.cpp index 729482b7..a92cfe9e 100644 --- a/Minecraft.Client/Common/UI/UIControl_DynamicLabel.cpp +++ b/Minecraft.Client/Common/UI/UIControl_DynamicLabel.cpp @@ -44,7 +44,7 @@ void UIControl_DynamicLabel::ReInit() void UIControl_DynamicLabel::SetupTouch() { - #ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-TomK - add this dynamic label to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) diff --git a/Minecraft.Client/Common/UI/UIControl_HTMLLabel.cpp b/Minecraft.Client/Common/UI/UIControl_HTMLLabel.cpp index fdb8c859..f23742fd 100644 --- a/Minecraft.Client/Common/UI/UIControl_HTMLLabel.cpp +++ b/Minecraft.Client/Common/UI/UIControl_HTMLLabel.cpp @@ -49,7 +49,7 @@ void UIControl_HTMLLabel::setLabel(const string &label) void UIControl_HTMLLabel::SetupTouch() { - #ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-TomK - add this dynamic label to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) diff --git a/Minecraft.Client/Common/UI/UIControl_LeaderboardList.cpp b/Minecraft.Client/Common/UI/UIControl_LeaderboardList.cpp index da7e485c..320de9af 100644 --- a/Minecraft.Client/Common/UI/UIControl_LeaderboardList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_LeaderboardList.cpp @@ -17,7 +17,7 @@ bool UIControl_LeaderboardList::setupControl(UIScene *scene, IggyValuePath *pare m_funcResetLeaderboard = registerFastName(L"ResetLeaderboard"); m_funcSetupTitles = registerFastName(L"SetupTitles"); m_funcSetColumnIcon = registerFastName(L"SetColumnIcon"); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) m_funcSetTouchFocus = registerFastName(L"SetTouchFocus"); m_bTouchInitialised = false; #endif @@ -82,7 +82,7 @@ void UIControl_LeaderboardList::initLeaderboard(int iFirstFocus, int iTotalEntri value[2].number = iNumColumns; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_funcInitLeaderboard , 3 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-PB - add this button to the vita touch box list if(!m_bTouchInitialised) { @@ -220,7 +220,7 @@ void UIControl_LeaderboardList::addDataSet(bool bLast, int iId, int iRank, const IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath(), m_funcAddDataSet , 12 , value ); } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIControl_LeaderboardList::SetTouchFocus(S32 iX, S32 iY, bool bRepeat) { IggyDataValue result; diff --git a/Minecraft.Client/Common/UI/UIControl_LeaderboardList.h b/Minecraft.Client/Common/UI/UIControl_LeaderboardList.h index ba448cc7..d271967d 100644 --- a/Minecraft.Client/Common/UI/UIControl_LeaderboardList.h +++ b/Minecraft.Client/Common/UI/UIControl_LeaderboardList.h @@ -8,7 +8,7 @@ private: IggyName m_funcInitLeaderboard, m_funcAddDataSet; IggyName m_funcResetLeaderboard; IggyName m_funcSetupTitles, m_funcSetColumnIcon; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) IggyName m_funcSetTouchFocus; bool m_bTouchInitialised; #endif @@ -44,7 +44,7 @@ public: void setColumnIcon(int iColumn, int iType); void addDataSet(bool bLast, int iId, int iRank, const wstring &gamertag, bool bDisplayMessage, const wstring &col0, const wstring &col1, const wstring &col2, const wstring &col3, const wstring &col4, const wstring &col5, const wstring &col6); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void SetTouchFocus(S32 iX, S32 iY, bool bRepeat); #endif }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIControl_Slider.cpp b/Minecraft.Client/Common/UI/UIControl_Slider.cpp index 682fdf1b..9d9790ed 100644 --- a/Minecraft.Client/Common/UI/UIControl_Slider.cpp +++ b/Minecraft.Client/Common/UI/UIControl_Slider.cpp @@ -52,7 +52,7 @@ void UIControl_Slider::init(UIString label, int id, int min, int max, int curren value[4].number = (int)current; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 5 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-TomK - add slider to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) diff --git a/Minecraft.Client/Common/UI/UIControl_SlotList.cpp b/Minecraft.Client/Common/UI/UIControl_SlotList.cpp index 37595ec1..8c32271e 100644 --- a/Minecraft.Client/Common/UI/UIControl_SlotList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_SlotList.cpp @@ -5,6 +5,7 @@ UIControl_SlotList::UIControl_SlotList() { m_lastHighlighted = -1; + m_iSlotSize = 0; } bool UIControl_SlotList::setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName) @@ -16,8 +17,10 @@ bool UIControl_SlotList::setupControl(UIScene *scene, IggyValuePath *parent, con m_addSlotFunc = registerFastName(L"addSlot"); m_setRedBoxFunc = registerFastName(L"SetSlotRedBox"); m_setHighlightFunc = registerFastName(L"SetSlotHighlight"); + m_slotSizeFunc = registerFastName(L"m_iSlotSize"); m_lastHighlighted = 0; + m_iSlotSize = 0; return success; } @@ -27,6 +30,32 @@ void UIControl_SlotList::ReInit() UIControl_Base::ReInit(); m_lastHighlighted = -1; + m_iSlotSize = 0; +} + +S32 UIControl_SlotList::GetSlotSize() +{ + if (m_iSlotSize <= 0) + { + S32 iSlotSize = 0; + IggyValueGetS32RS(getIggyValuePath(), m_slotSizeFunc, NULL, &iSlotSize); + m_iSlotSize = iSlotSize; + if (m_iSlotSize <= 0) + { + m_iSlotSize = 50; + } + } + return m_iSlotSize; +} + + + +S32 UIControl_SlotList::GetFlashSlotCount() +{ + S32 iCount = -1; + IggyName slotsName = registerFastName(L"m_aSlots"); + IggyValueGetArrayLengthRS(getIggyValuePath(), slotsName, NULL, &iCount); + return iCount; } void UIControl_SlotList::addSlot(int id) @@ -65,6 +94,15 @@ void UIControl_SlotList::setHighlightSlot(int index) } } +void UIControl_SlotList::clearHighlight() +{ + if(m_lastHighlighted != -1) + { + setSlotHighlighted(m_lastHighlighted, false); + m_lastHighlighted = -1; + } +} + void UIControl_SlotList::setSlotHighlighted(int index, bool highlight) { IggyDataValue result; diff --git a/Minecraft.Client/Common/UI/UIControl_SlotList.h b/Minecraft.Client/Common/UI/UIControl_SlotList.h index 3c3893e2..814616dd 100644 --- a/Minecraft.Client/Common/UI/UIControl_SlotList.h +++ b/Minecraft.Client/Common/UI/UIControl_SlotList.h @@ -7,8 +7,10 @@ class UIControl_SlotList : public UIControl_Base private: //IggyName m_addSlotFunc, m_getSlotFunc, m_setRedBoxFunc, m_setHighlightFunc; IggyName m_addSlotFunc, m_setRedBoxFunc, m_setHighlightFunc; + IggyName m_slotSizeFunc; int m_lastHighlighted; + int m_iSlotSize; public: UIControl_SlotList(); @@ -19,8 +21,11 @@ public: void addSlot(int id); void addSlots(int iStartValue, int iCount); + S32 GetSlotSize(); + S32 GetFlashSlotCount(); void setHighlightSlot(int index); + void clearHighlight(); void showSlotRedBox(int index, bool show); virtual void setFocus(bool focus); diff --git a/Minecraft.Client/Common/UI/UIControl_TextInput.cpp b/Minecraft.Client/Common/UI/UIControl_TextInput.cpp index 3ffb2ba3..cf8344da 100644 --- a/Minecraft.Client/Common/UI/UIControl_TextInput.cpp +++ b/Minecraft.Client/Common/UI/UIControl_TextInput.cpp @@ -16,6 +16,8 @@ bool UIControl_TextInput::setupControl(UIScene *scene, IggyValuePath *parent, co m_textName = registerFastName(L"text"); m_funcChangeState = registerFastName(L"ChangeState"); m_funcSetCharLimit = registerFastName(L"SetCharLimit"); + m_funcMoveCaretLeft = registerFastName(L"MoveCaretLeft"); + m_funcMoveCaretRight = registerFastName(L"MoveCaretRight"); return success; } @@ -38,7 +40,7 @@ void UIControl_TextInput::init(UIString label, int id) value[1].number = id; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value ); - #ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-TomK - add this buttonlist to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) @@ -73,6 +75,30 @@ void UIControl_TextInput::setFocus(bool focus) } } +void UIControl_TextInput::SyncCaret(int caretIndex, int textLength) +{ + if (caretIndex < 0) caretIndex = 0; + if (caretIndex > textLength) caretIndex = textLength; + IggyDataValue result; // placeholder to keep diff small + IggyDataValue result2; + int i; + for (i = 0; i < textLength; ++i) + IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcMoveCaretLeft, 0, NULL); + for (i = 0; i < caretIndex; ++i) + IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcMoveCaretRight, 0, NULL); +} + +void UIControl_TextInput::RefreshFocus() +{ + m_bHasFocus = true; + + IggyDataValue result; + IggyDataValue value[1]; + value[0].type = IGGY_DATATYPE_number; + value[0].number = 0; + IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcChangeState, 1, value); +} + void UIControl_TextInput::SetCharLimit(int iLimit) { IggyDataValue result; diff --git a/Minecraft.Client/Common/UI/UIControl_TextInput.h b/Minecraft.Client/Common/UI/UIControl_TextInput.h index c26ad77b..41690a15 100644 --- a/Minecraft.Client/Common/UI/UIControl_TextInput.h +++ b/Minecraft.Client/Common/UI/UIControl_TextInput.h @@ -6,6 +6,7 @@ class UIControl_TextInput : public UIControl_Base { private: IggyName m_textName, m_funcChangeState, m_funcSetCharLimit; + IggyName m_funcMoveCaretLeft, m_funcMoveCaretRight; bool m_bHasFocus; public: @@ -19,4 +20,8 @@ public: virtual void setFocus(bool focus); void SetCharLimit(int iLimit); + + void SyncCaret(int caretIndex, int textLength); + + void RefreshFocus(); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIControl_TexturePackList.cpp b/Minecraft.Client/Common/UI/UIControl_TexturePackList.cpp index db5b5c67..1cd922e7 100644 --- a/Minecraft.Client/Common/UI/UIControl_TexturePackList.cpp +++ b/Minecraft.Client/Common/UI/UIControl_TexturePackList.cpp @@ -41,7 +41,7 @@ void UIControl_TexturePackList::init(const wstring &label, int id) value[1].number = id; IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_initFunc , 2 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J-TomK - add this texturepack list to the vita touch box list switch(m_parentScene->GetParentLayer()->m_iLayer) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 8671a530..7dff847e 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -2,6 +2,7 @@ #include "UIController.h" #include "UI.h" #include "UIScene.h" +#include "DirectTextEdit.h" #include "..\..\..\Minecraft.World\StringHelpers.h" #include "..\..\LocalPlayer.h" #include "..\..\DLCTexturePack.h" @@ -17,6 +18,11 @@ #include "Windows64\Windows64_Minecraft.h" #endif +#ifdef _WINDOWS64 +static float MovieSpaceX(UIScene *pScene,int v); +static float MovieSpaceY(UIScene *pScene,int v); +#endif + // 4J Stu - Enable this to override the Iggy Allocator //#define ENABLE_IGGY_ALLOCATOR //#define EXCLUDE_IGGY_ALLOCATIONS_FROM_HEAP_INSPECTOR @@ -49,9 +55,19 @@ #endif +#ifdef _WINDOWS64 +wstring controlTooltipsPath = L""; +wstring skinName = L""; +#endif + CRITICAL_SECTION UIController::ms_reloadSkinCS; bool UIController::ms_bReloadSkinCSInitialised = false; +#ifdef _WINDOWS64 +CRITICAL_SECTION UIController::ms_controllerPollCS; +bool UIController::ms_bControllerPollCSInitialised = false; +#endif + DWORD UIController::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; static void RADLINK WarningCallback(void *user_callback_data, Iggy *player, IggyResult code, const char *message) @@ -169,6 +185,20 @@ UIController::UIController() m_navigateToHomeOnReload = false; m_bCleanupOnReload = false; + + wasFocused = true; + m_pLastHoverScene = NULL; + m_iLastHoverId = -2; + m_bHoverFresh = false; + m_iFreshMouseX = 0; + m_iFreshMouseY = 0; + m_hoverFreshUntilMs = 0; + m_pLastListFocusControl = NULL; + m_iLastListFocusX = 0; + m_iLastListFocusY = 0; + m_bControllerMode = false; + m_iLastDeviceMouseX = 0; + m_iLastDeviceMouseY = 0; m_mcTTFFont = NULL; m_moj7 = NULL; m_moj11 = NULL; @@ -232,7 +262,7 @@ UIController::UIController() InitializeCriticalSection(&m_registeredCallbackScenesCS); //m_bSysUIShowing=false; m_bSystemUIShowing=false; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) m_bTouchscreenPressed=false; #endif @@ -242,6 +272,14 @@ UIController::UIController() InitializeCriticalSection(&ms_reloadSkinCS); ms_bReloadSkinCSInitialised = true; } + +#ifdef _WINDOWS64 + if(!ms_bControllerPollCSInitialised) + { + InitializeCriticalSection(&ms_controllerPollCS); + ms_bControllerPollCSInitialised = true; + } +#endif } void UIController::SetSysUIShowing(bool bVal) @@ -291,6 +329,14 @@ void UIController::postInit() // loadSkins(); +#ifdef _WINDOWS64 + m_LastControllerType = UNKNOWN; + m_bControllerTypeChanged = false; + + m_controllerPollThread = new C4JThread(controllerPollThreadProc, (void*)this, "Controller poll thread"); + m_controllerPollThread->Run(); +#endif + for(unsigned int i = 0; i < eUIGroup_COUNT; ++i) { m_groups[i] = new UIGroup((EUIGroup)i,i-1); @@ -497,8 +543,112 @@ void UIController::tick() ++it; } } + +#ifdef _WINDOWS64 + fetchControlTooltipSWF(); +#endif } +#ifdef _WINDOWS64 +int UIController::controllerPollThreadProc(void* lpParam) +{ + UIController *controller = (UIController *)lpParam; + + while(true) + { + EControllerType polled = controller->GetControllerType(InputManager.PollControllerType(0)); + EnterCriticalSection(&ms_controllerPollCS); + + if(polled != EControllerType::UNKNOWN && polled != controller->m_LastControllerType) + { + controller->m_bControllerTypeChanged = true; + + wstring path = controller->GetControlTooltipsPath(polled); + controller->getMovieData(path); + } + + LeaveCriticalSection(&ms_controllerPollCS); + Sleep(250); + } + + return 0; +} + +wstring UIController::GetControlTooltipsPath(EControllerType ControllerType) +{ + if(ControllerType == EControllerType::UNSET) + { + EControllerType ControllerType = GetControllerType(InputManager.PollControllerType(0)); + } + + switch(ControllerType) + { + case EControllerType::PS3: + return m_fScreenHeight >= 1080.0f + ? L"ControlTooltips\\HD\\PS3HDControls.swf" + : L"ControlTooltips\\PS3Controls.swf"; + case EControllerType::PS4: + return m_fScreenHeight >= 1080.0f + ? L"ControlTooltips\\HD\\OrbisHDControls.swf" + : L"ControlTooltips\\OrbisControls.swf"; + case EControllerType::XBOXONE: + return m_fScreenHeight >= 1080.0f + ? L"ControlTooltips\\HD\\DurangoHDControls.swf" + : L"ControlTooltips\\DurangoControls.swf"; + case EControllerType::XBOX360: + return m_fScreenHeight >= 1080.0f + ? L"ControlTooltips\\HD\\XboxHDControls.swf" + : L"ControlTooltips\\XboxControls.swf"; + default: + return m_fScreenHeight >= 1080.0f + ? L"ControlTooltips\\HD\\Windows64HDControls.swf" + : L"ControlTooltips\\Windows64Controls.swf"; + } +} + +UIController::EControllerType UIController::GetControllerType(const char* controllerType) +{ + if (strcmp(controllerType, "PS3") == 0) return EControllerType::PS3; + if (strcmp(controllerType, "PS4") == 0) return EControllerType::PS4; + if (strcmp(controllerType, "PS5") == 0) return EControllerType::PS5; + if (strcmp(controllerType, "XBOXONE") == 0) return EControllerType::XBOXONE; + if (strcmp(controllerType, "XBOX360") == 0) return EControllerType::XBOX360; + if (strcmp(controllerType, "SWITCH") == 0) return EControllerType::SWITCH; + if (strcmp(controllerType, "GAMECUBE") == 0) return EControllerType::GAMECUBE; + if (strcmp(controllerType, "STANDARD") == 0) return EControllerType::STANDARD; + + return EControllerType::UNKNOWN; +} + +void UIController::fetchControlTooltipSWF() +{ + if (!m_bControllerTypeChanged) + return; + + if (IsReloadingSkin()) + return; + + EControllerType ControllerType = GetControllerType(InputManager.PollControllerType(0)); + + if (ControllerType == EControllerType::UNKNOWN) + return; // str1k3r - ignore UNKNOWN, keep last tooltip + + if (ControllerType == m_LastControllerType) + { + m_bControllerTypeChanged = false; + return; // str1k3r - nothing changed, skip reload + } + + m_LastControllerType = ControllerType; + m_bControllerTypeChanged = false; + + controlTooltipsPath = GetControlTooltipsPath(ControllerType); + skinName = (m_fScreenHeight >= 1080.0f) ? L"skinControlTooltipsHD.swf" : L"skinControlTooltips.swf"; + + reloadSingleSkin(eLibrary_ControlTooltips, controlTooltipsPath, skinName); +} +#endif + void UIController::loadSkins() { wstring platformSkinPath = L""; @@ -511,10 +661,12 @@ void UIController::loadSkins() if(m_fScreenWidth >= 1920.0f) { platformSkinPath = L"skinHDWin.swf"; + controlTooltipsPath = GetControlTooltipsPath(); } else { - platformSkinPath = L"skinWin.swf"; + platformSkinPath = L"skinWin.swf"; + controlTooltipsPath = GetControlTooltipsPath(); } #elif defined _DURANGO if(m_fScreenHeight==1080.0f) @@ -547,6 +699,9 @@ void UIController::loadSkins() m_iggyLibraries[eLibrary_GraphicsInGame] = loadSkin(L"skinHDGraphicsInGame.swf", L"skinHDGraphicsInGame.swf"); m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf"); m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf"); +#ifdef _WINDOWS64 + m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(controlTooltipsPath, L"skinControlTooltipsHD.swf"); +#endif m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf"); m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf"); m_iggyLibraries[eLibrary_HUD] = loadSkin(L"skinHDHud.swf", L"skinHDHud.swf"); @@ -561,12 +716,66 @@ void UIController::loadSkins() m_iggyLibraries[eLibrary_GraphicsInGame] = loadSkin(L"skinGraphicsInGame.swf", L"skinGraphicsInGame.swf"); m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinGraphicsTooltips.swf", L"skinGraphicsTooltips.swf"); m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinGraphicsLabels.swf", L"skinGraphicsLabels.swf"); +#ifdef _WINDOWS64 + m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(controlTooltipsPath, L"skinControlTooltips.swf"); +#endif m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinLabels.swf", L"skinLabels.swf"); m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinInGame.swf", L"skinInGame.swf"); m_iggyLibraries[eLibrary_HUD] = loadSkin(L"skinHud.swf", L"skinHud.swf"); m_iggyLibraries[eLibrary_Tooltips] = loadSkin(L"skinTooltips.swf", L"skinTooltips.swf"); m_iggyLibraries[eLibrary_Default] = loadSkin(L"skin.swf", L"skin.swf"); } + +#ifdef _WINDOWS64 + { + const bool hdPrimary = (m_fScreenWidth >= 1920.0f); + wstring altControlTooltipsPath = controlTooltipsPath; + size_t hdDir = altControlTooltipsPath.find(L"HD\\"); + if (hdDir != wstring::npos) + { + altControlTooltipsPath.erase(hdDir, 3); + size_t hdFile = altControlTooltipsPath.find(L"HDControls.swf"); + if (hdFile != wstring::npos) altControlTooltipsPath.erase(hdFile, 2); + } + else + { + size_t ttDir = altControlTooltipsPath.find(L"ControlTooltips\\"); + if (ttDir != wstring::npos) altControlTooltipsPath.insert(ttDir + 17, L"HD\\"); + size_t ctlFile = altControlTooltipsPath.find(L"Controls.swf"); + if (ctlFile != wstring::npos) altControlTooltipsPath.insert(ctlFile, L"HD"); + } + if (hdPrimary) + { + m_iggyLibraries[eLibrary_Alt_Platform] = loadSkin(L"skinWin.swf", L"platformskin.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsDefault] = loadSkin(L"skinGraphics.swf", L"skinGraphics.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsHUD] = loadSkin(L"skinGraphicsHud.swf", L"skinGraphicsHud.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsInGame] = loadSkin(L"skinGraphicsInGame.swf", L"skinGraphicsInGame.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsTooltips] = loadSkin(L"skinGraphicsTooltips.swf", L"skinGraphicsTooltips.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsLabels] = loadSkin(L"skinGraphicsLabels.swf", L"skinGraphicsLabels.swf"); + m_iggyLibraries[eLibrary_Alt_ControlTooltips] = loadSkin(altControlTooltipsPath, L"skinControlTooltips.swf"); + m_iggyLibraries[eLibrary_Alt_Labels] = loadSkin(L"skinLabels.swf", L"skinLabels.swf"); + m_iggyLibraries[eLibrary_Alt_InGame] = loadSkin(L"skinInGame.swf", L"skinInGame.swf"); + m_iggyLibraries[eLibrary_Alt_HUD] = loadSkin(L"skinHud.swf", L"skinHud.swf"); + m_iggyLibraries[eLibrary_Alt_Tooltips] = loadSkin(L"skinTooltips.swf", L"skinTooltips.swf"); + m_iggyLibraries[eLibrary_Alt_Default] = loadSkin(L"skin.swf", L"skin.swf"); + } + else + { + m_iggyLibraries[eLibrary_Alt_Platform] = loadSkin(L"skinHDWin.swf", L"platformskinHD.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsDefault] = loadSkin(L"skinHDGraphics.swf", L"skinHDGraphics.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsHUD] = loadSkin(L"skinHDGraphicsHud.swf", L"skinHDGraphicsHud.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsInGame] = loadSkin(L"skinHDGraphicsInGame.swf", L"skinHDGraphicsInGame.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf"); + m_iggyLibraries[eLibrary_Alt_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf"); + m_iggyLibraries[eLibrary_Alt_ControlTooltips] = loadSkin(altControlTooltipsPath, L"skinControlTooltipsHD.swf"); + m_iggyLibraries[eLibrary_Alt_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf"); + m_iggyLibraries[eLibrary_Alt_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf"); + m_iggyLibraries[eLibrary_Alt_HUD] = loadSkin(L"skinHDHud.swf", L"skinHDHud.swf"); + m_iggyLibraries[eLibrary_Alt_Tooltips] = loadSkin(L"skinHDTooltips.swf", L"skinHDTooltips.swf"); + m_iggyLibraries[eLibrary_Alt_Default] = loadSkin(L"skinHD.swf", L"skinHD.swf"); + } + } +#endif } IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinName) @@ -575,10 +784,9 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN // 4J Stu - We need to load the platformskin before the normal skin, as the normal skin requires some elements from the platform skin if(!skinPath.empty() && app.hasArchiveFile(skinPath)) { - byteArray baFile = app.getArchiveFile(skinPath); + byteArray baFile = getMovieData(skinPath); // str1k3r - replaced app.getArchiveFile(skinPath); with this to try and prevent any stutters lib = IggyLibraryCreateFromMemoryUTF16( (IggyUTF16 *)skinName.c_str() , (void *)baFile.data, baFile.length, NULL ); - delete[] baFile.data; #ifdef _DEBUG IggyMemoryUseInfo memoryInfo; rrbool res; @@ -602,6 +810,36 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN return lib; } +void UIController::reloadSingleSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName) +{ + if(m_iggyLibraries[lib] != IGGY_INVALID_LIBRARY) + { + IggyLibraryDestroy(m_iggyLibraries[lib]); + m_iggyLibraries[lib] = IGGY_INVALID_LIBRARY; + } + + m_iggyLibraries[lib] = loadSkin(skinPath, skinName); + + if(skinName == L"skinControlTooltipsHD.swf" || skinName == L"skinControlTooltips.swf") + { + for(unsigned int i = 0; i < eUIGroup_COUNT; ++i) + { + if(m_groups[i]->getTooltips()) + m_groups[i]->getTooltips()->destroyMovie(); + if(m_groups[i]->getPressStartToPlay()) + m_groups[i]->getPressStartToPlay()->destroyMovie(); + } + + for(unsigned int i = 0; i < eUIGroup_COUNT; ++i) + { + if(m_groups[i]->getTooltips()) + m_groups[i]->getTooltips()->reloadMovie(true); + if(m_groups[i]->getPressStartToPlay()) + m_groups[i]->getPressStartToPlay()->reloadMovie(true); + } + } +} + void UIController::ReloadSkin() { // Destroy all scene swf @@ -755,8 +993,103 @@ void UIController::tickInput() } } +#ifdef _WINDOWS64 +void UIController::UpdateInputDeviceMode() +{ + int mouseX = InputManager.GetMouseX(); + int mouseY = InputManager.GetMouseY(); + int dx = mouseX - m_iLastDeviceMouseX; + if (dx < 0) dx = -dx; + int dy = mouseY - m_iLastDeviceMouseY; + if (dy < 0) dy = -dy; + bool mouseActive = (dx > 2 || dy > 2) + || InputManager.IsMouseLDown() + || InputManager.IsMouseRDown() + || InputManager.GetMouseWheelDelta() != 0; + m_iLastDeviceMouseX = mouseX; + m_iLastDeviceMouseY = mouseY; + + if (mouseActive) + { + m_bControllerMode = false; + return; + } + + bool keyboardExplained = InputManager.IsKeyDown(VK_ESCAPE) + || InputManager.IsKeyDown('Q') + || InputManager.IsKeyDown(VK_SHIFT) + || InputManager.IsKeyDown('E') + || InputManager.IsKeyDown('F') + || InputManager.IsKeyDown('R') + || InputManager.IsKeyDown(VK_TAB); + if (keyboardExplained) + { + return; + } + + for (unsigned int iPad = 0; iPad < XUSER_MAX_COUNT; ++iPad) + { + if (InputManager.ButtonDown(iPad)) + { + if (!m_bControllerMode) + { + m_bControllerMode = true; + m_pLastListFocusControl = NULL; + m_ActiveUIElement = NULL; + m_HighlightedUIElement = NULL; + for (int g = (int)eUIGroup_Fullscreen; g < (int)eUIGroup_COUNT; ++g) + { + if (!m_groups[g]->GetMenuDisplayed()) + { + continue; + } + UIScene *pSnapScene = m_groups[g]->getCurrentScene(); + int iSnapId = GetDefaultFocusId(pSnapScene); + if (iSnapId >= 0) + { + pSnapScene->SetFocusToElement(iSnapId); + } + } + } + return; + } + } + } + +int UIController::GetDefaultFocusId(UIScene *pScene) +{ + if (!pScene || !pScene->GetControls()) + { + return -1; + } + for (AUTO_VAR(it, pScene->GetControls()->begin()); it != pScene->GetControls()->end(); ++it) + { + UIControl *control = (UIControl *)*it; + if (!control) + { + continue; + } + UIControl::eUIControlType t = control->getControlType(); + if (t == UIControl::eButton + || t == UIControl::eCheckBox + || t == UIControl::eSlider + || t == UIControl::eButtonList + || t == UIControl::ePlayerList + || t == UIControl::eSaveList + || t == UIControl::eTexturePackList) + { + return control->getId(); + } + } + return -1; +} +#endif + void UIController::handleInput() { +#ifdef _WINDOWS64 + UpdateInputDeviceMode(); +#endif // For each user, loop over each key type and send messages based on the state for(unsigned int iPad = 0; iPad < XUSER_MAX_COUNT; ++iPad) { @@ -770,7 +1103,7 @@ void UIController::handleInput() handleKeyPress(iPad, key); } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) //CD - Vita requires key press 40 - select [MINECRAFT_ACTION_GAME_INFO] handleKeyPress(iPad, MINECRAFT_ACTION_GAME_INFO); #endif @@ -976,6 +1309,204 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) // ignore any other presses if the touchscreen has been used if(bTouchScreenInput) return; } +#elif defined(_WINDOWS64) + if(key==ACTION_MENU_OK) + { + bool bTouchScreenInput=false; + + int mouseX = InputManager.GetMouseX(); + int mouseY = InputManager.GetMouseY(); + + bool lclick = InputManager.IsMouseLDown(); + + UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene(); + UIScene *pToolTips=m_groups[(int)eUIGroup_Fullscreen]->getTooltips(); + + + bool bTouchHit=false; + + if(pScene && TouchBoxHit(pScene,mouseX,mouseY)) bTouchHit=true; + if(!bTouchHit && pToolTips && TouchBoxHit(pToolTips,mouseX,mouseY)) bTouchHit=true; + + if(!bTouchHit) + { + for (int g = (int)eUIGroup_Player1; g <= (int)eUIGroup_Player4 && !bTouchHit; ++g) + { + UIScene *pCandScene = m_groups[g]->getCurrentScene(); + if(pCandScene && TouchBoxHit(pCandScene,mouseX,mouseY)) + { + bTouchHit=true; + break; + } + } + for (int g = (int)eUIGroup_Player1; g <= (int)eUIGroup_Player4 && !bTouchHit; ++g) + { + UIScene *pCandTips = m_groups[g]->getTooltips(); + if(pCandTips && TouchBoxHit(pCandTips,mouseX,mouseY)) + { + bTouchHit=true; + break; + } + } + } + + UIScene *pHoverSceneNow = NULL; + int iHoverIdNow = -1; + if (bTouchHit && m_HighlightedUIElement && m_HighlightedUIElement->pControl) + { + pHoverSceneNow = m_HighlightedUIElement->pControl->getParentScene(); + iHoverIdNow = m_HighlightedUIElement->pControl->getId(); + } + + bool bHoverIsTooltip = false; + if (pHoverSceneNow) + { + if (pHoverSceneNow == pToolTips) bHoverIsTooltip = true; + if (!bHoverIsTooltip) + { + for (int g = (int)eUIGroup_Player1; g <= (int)eUIGroup_Player4; ++g) + { + if (pHoverSceneNow == m_groups[g]->getTooltips()) { bHoverIsTooltip = true; break; } + } + } + } + + if (!m_bControllerMode && pHoverSceneNow && iHoverIdNow >= 0 && !bHoverIsTooltip) + { + if (pHoverSceneNow != m_pLastHoverScene || iHoverIdNow != m_iLastHoverId) + { + pHoverSceneNow->SetFocusToElement(iHoverIdNow); + } + m_pLastHoverScene = pHoverSceneNow; + m_iLastHoverId = iHoverIdNow; + m_bHoverFresh = false; + } + else if (!m_bControllerMode && m_pLastHoverScene && m_iLastHoverId != -2) + { + m_pLastHoverScene->SetFocusToElement(-2); + m_iLastHoverId = -2; + } + else if (!m_bControllerMode && m_bHoverFresh && (mouseX != m_iFreshMouseX || mouseY != m_iFreshMouseY)) + { + if (System::currentTimeMillis() >= m_hoverFreshUntilMs) + { + m_bHoverFresh = false; + } + else + { + if (pScene) pScene->SetFocusToElement(-2, true); + for (int g = (int)eUIGroup_Player1; g <= (int)eUIGroup_Player4; ++g) + { + UIScene *pCandScene = m_groups[g]->getCurrentScene(); + if (pCandScene) pCandScene->SetFocusToElement(-2, true); + } + } + } + + if(bTouchHit) + { + down=true; + bTouchScreenInput=true; + + if (!m_bControllerMode && m_HighlightedUIElement && m_HighlightedUIElement->pControl && + (m_HighlightedUIElement->pControl->getControlType() == UIControl::eButtonList || + m_HighlightedUIElement->pControl->getControlType() == UIControl::ePlayerList || + m_HighlightedUIElement->pControl->getControlType() == UIControl::eSaveList)) + { + UIScene *pElemScene = m_HighlightedUIElement->pControl->getParentScene(); + S32 sx = (S32)MovieSpaceX(pElemScene, mouseX); + S32 sy = (S32)MovieSpaceY(pElemScene, mouseY); + int dx = (int)(sx - m_iLastListFocusX); + int dy = (int)(sy - m_iLastListFocusY); + if (m_HighlightedUIElement->pControl != m_pLastListFocusControl || + dx < -2 || dx > 2 || dy < -2 || dy > 2) + { + UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_HighlightedUIElement->pControl; + pButtonList->SetTouchFocus(sx, sy, false); + m_pLastListFocusControl = m_HighlightedUIElement->pControl; + m_iLastListFocusX = sx; + m_iLastListFocusY = sy; + } + } + } + + if (!m_bControllerMode && m_HighlightedUIElement && m_HighlightedUIElement->pControl->getControlType() == UIControl::eTouchControl) + { + UIScene *pElemScene = m_HighlightedUIElement->pControl->getParentScene(); + if (pElemScene) + { + float hx = MovieSpaceX(pElemScene, mouseX); + float hy = MovieSpaceY(pElemScene, mouseY); + pElemScene->handleMouseHover(hx, hy, m_HighlightedUIElement->pControl->getId()); + } + } + + if(down && lclick && !m_bTouchscreenPressed) + { + pressed=true; + m_bTouchscreenPressed=true; + bTouchScreenInput=true; + } + else if(m_bTouchscreenPressed && !lclick) + { + released=true; + m_bTouchscreenPressed=false; + bTouchScreenInput=true; + } + + if(pressed) + { + m_actionRepeatTimer[iPad][key] = GetTickCount() + UI_REPEAT_KEY_DELAY_MS; + } + else if (released) + { + m_actionRepeatTimer[iPad][key] = 0; + } + else if (down) + { + DWORD currentTime = GetTickCount(); + if(m_actionRepeatTimer[iPad][key] > 0 && currentTime > m_actionRepeatTimer[iPad][key]) + { + repeat = true; + pressed = true; + m_actionRepeatTimer[iPad][key] = currentTime + UI_REPEAT_KEY_REPEAT_RATE_MS; + } + } + HandleTouchInput(iPad, key, pressed, repeat, released); + + if(bTouchScreenInput && !m_bControllerMode) return; + } + else if (InputManager.IsPadActive(0) && m_HighlightedUIElement == NULL) + { + UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene(); + UIScene *pToolTips=m_groups[(int)eUIGroup_Fullscreen]->getTooltips(); + + if(pScene) + { + if(pScene) + { + pScene->SetFocusToElement(-1); + } + else if (pToolTips) + { + pToolTips->SetFocusToElement(-1); + } + } + else + { + pScene=m_groups[(EUIGroup)(iPad+1)]->getCurrentScene(); + pToolTips=m_groups[(int)iPad+1]->getTooltips(); + + if(pScene) + { + pScene->SetFocusToElement(-1); + } + else if (pToolTips) + { + pToolTips->SetFocusToElement(-1); + } + } + } #endif down = InputManager.ButtonDown(iPad,key); @@ -984,6 +1515,9 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) //if(pressed) app.DebugPrintf("Pressed %d\n",key); //if(released) app.DebugPrintf("Released %d\n",key); +#if defined(_WINDOWS64) + if (pressed && key != ACTION_MENU_OK) m_bHoverFresh = false; +#endif // Repeat handling if(pressed) { @@ -1093,6 +1627,23 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) { bool handled = false; +#ifdef _WINDOWS64 + if (m_bControllerMode && (pressed || repeat) + && m_pLastHoverScene && m_iLastHoverId == -2 + && GetMenuDisplayed(iPad) + && (key == ACTION_MENU_UP || key == ACTION_MENU_DOWN + || key == ACTION_MENU_LEFT || key == ACTION_MENU_RIGHT + || key == ACTION_MENU_OK || key == ACTION_MENU_A)) + { + int iDefaultId = GetDefaultFocusId(m_pLastHoverScene); + if (iDefaultId >= 0) + { + m_pLastHoverScene->SetFocusToElement(iDefaultId); + m_iLastHoverId = iDefaultId; + } + } +#endif + // Send the key to the fullscreen group first m_groups[(int)eUIGroup_Fullscreen]->handleInput(iPad, key, repeat, pressed, released, handled); if(!handled) @@ -1480,6 +2031,9 @@ void UIController::unregisterSubstitutionTexture(const wstring &textureName, boo // NAVIGATION bool UIController::NavigateToScene(int iPad, EUIScene scene, void *initData, EUILayer layer, EUIGroup group) { +#ifdef _WINDOWS64 + DirectTextEdit::Finish(true); +#endif static bool bSeenUpdateTextThisSession = false; // If you're navigating to the multigamejoinload, and the player hasn't seen the updates message yet, display it now // display this message the first 3 times @@ -2771,6 +3325,15 @@ void UIController::TouchBoxRebuild(UIScene *pUIScene) // if we delete an element, it's possible that the scene has re-arranged all the elements, so we need to rebuild the boxes ui.TouchBoxesClear(pUIScene); + m_pLastHoverScene = NULL; + m_iLastHoverId = -2; +#ifdef _WINDOWS64 + m_bHoverFresh = true; + m_iFreshMouseX = InputManager.GetMouseX(); + m_iFreshMouseY = InputManager.GetMouseY(); + m_hoverFreshUntilMs = System::currentTimeMillis() + 750; +#endif + // rebuild boxes AUTO_VAR(itEnd, pUIScene->GetControls()->end()); for (AUTO_VAR(it, pUIScene->GetControls()->begin()); it != itEnd; it++) @@ -2782,6 +3345,8 @@ void UIController::TouchBoxRebuild(UIScene *pUIScene) control->getControlType() == UIControl::eCheckBox || control->getControlType() == UIControl::eTexturePackList || control->getControlType() == UIControl::eButtonList || + control->getControlType() == UIControl::ePlayerList || + control->getControlType() == UIControl::eSaveList || control->getControlType() == UIControl::eTextInput || control->getControlType() == UIControl::eDynamicLabel || control->getControlType() == UIControl::eHTMLLabel || @@ -2801,6 +3366,26 @@ void UIController::TouchBoxRebuild(UIScene *pUIScene) void UIController::TouchBoxesClear(UIScene *pUIScene) { + if (m_HighlightedUIElement && m_HighlightedUIElement->pControl && + m_HighlightedUIElement->pControl->getParentScene() == pUIScene) + { + m_HighlightedUIElement = NULL; + } + if (m_ActiveUIElement && m_ActiveUIElement->pControl && + m_ActiveUIElement->pControl->getParentScene() == pUIScene) + { + m_ActiveUIElement = NULL; + } + if (m_pLastListFocusControl && m_pLastListFocusControl->getParentScene() == pUIScene) + { + m_pLastListFocusControl = NULL; + } + if (m_pLastHoverScene == pUIScene) + { + m_pLastHoverScene = NULL; + m_iLastHoverId = -1; + } + EUIGroup eUIGroup=pUIScene->GetParentLayerGroup(); EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer; EUIScene eUIscene=pUIScene->getSceneType(); @@ -2821,8 +3406,10 @@ bool UIController::TouchBoxHit(UIScene *pUIScene,S32 x, S32 y) EUIScene eUIscene=pUIScene->getSceneType(); // 4J-TomK let's do the transformation from touch resolution to screen resolution here, so our touchbox values always are in screen resolution! +#ifndef _WINDOWS64 x *= (m_fScreenWidth/1920.0f); y *= (m_fScreenHeight/1080.0f); +#endif if(m_TouchBoxes[eUIGroup][eUILayer][eUIscene].size()>0) { @@ -2904,6 +3491,8 @@ void UIController::HandleTouchInput(unsigned int iPad, unsigned int key, bool bP bPressed = false; break; case UIControl::eButtonList: + case UIControl::ePlayerList: + case UIControl::eSaveList: // set focus to list UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl; //pButtonList->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); @@ -2980,6 +3569,8 @@ void UIController::HandleTouchInput(unsigned int iPad, unsigned int key, bool bP bPressed = false; break; case UIControl::eButtonList: + case UIControl::ePlayerList: + case UIControl::eSaveList: // handle button list scrolling UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl; pButtonList->SetTouchFocus((float)x, (float)y, true); @@ -3052,6 +3643,8 @@ void UIController::HandleTouchInput(unsigned int iPad, unsigned int key, bool bP bReleased = false; break; case UIControl::eButtonList: + case UIControl::ePlayerList: + case UIControl::eSaveList: // trigger buttonlist on release (ONLY if the finger is still on it!) if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) { @@ -3123,5 +3716,594 @@ void UIController::SendTouchInput(unsigned int iPad, unsigned int key, bool bPre } } +#elif _WINDOWS64 +static float MovieSpaceX(UIScene *pScene,int v) +{ + extern int g_iWindowClientW, g_iWindowClientH; + float fMovieW = pScene ? (float)pScene->getMovieWidth() : 1280.0f; + int iClient = g_iWindowClientW > 0 ? g_iWindowClientW : 1280; + return (float)v * (fMovieW / (float)iClient); +} +static float MovieSpaceY(UIScene *pScene,int v) +{ + extern int g_iWindowClientH; + float fMovieH = pScene ? (float)pScene->getMovieHeight() : 720.0f; + int iClient = g_iWindowClientH > 0 ? g_iWindowClientH : 720; + return (float)v * (fMovieH / (float)iClient); +} + +void UIController::GetMovieMousePos(UIScene *pScene, float &fx, float &fy) +{ + if (!pScene) + { + pScene = m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene(); + } + fx = MovieSpaceX(pScene, InputManager.GetMouseX()); + fy = MovieSpaceY(pScene, InputManager.GetMouseY()); +} + +bool UIController::IsTouchBoxUnderPointInScene(UIScene *pUIScene, S32 x, S32 y) +{ + extern int g_iWindowClientW, g_iWindowClientH; + if (!pUIScene) return false; + return TouchBoxPointInScene(pUIScene, x, y, g_iWindowClientW, g_iWindowClientH); +} + +bool UIController::IsTouchBoxUnderPoint(S32 x, S32 y) +{ + extern int g_iWindowClientW, g_iWindowClientH; + UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene(); + if(pScene && TouchBoxPointInScene(pScene,x,y,g_iWindowClientW,g_iWindowClientH)) return true; + UIScene *pToolTips=m_groups[(int)eUIGroup_Fullscreen]->getTooltips(); + if(pToolTips && TouchBoxPointInScene(pToolTips,x,y,g_iWindowClientW,g_iWindowClientH)) return true; + + for (int g = (int)eUIGroup_Player1; g <= (int)eUIGroup_Player4; ++g) + { + UIScene *pPlayerScene=m_groups[(EUIGroup)g]->getCurrentScene(); + if(pPlayerScene && TouchBoxPointInScene(pPlayerScene,x,y,g_iWindowClientW,g_iWindowClientH)) return true; + UIScene *pPlayerToolTips=m_groups[(EUIGroup)g]->getTooltips(); + if(pPlayerToolTips && TouchBoxPointInScene(pPlayerToolTips,x,y,g_iWindowClientW,g_iWindowClientH)) return true; + } + + return false; +} + +bool UIController::TouchBoxPointInScene(UIScene *pUIScene, S32 x, S32 y, int iClientW, int iClientH) +{ + EUIGroup eUIGroup=pUIScene->GetParentLayerGroup(); + EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer; + EUIScene eUIscene=pUIScene->getSceneType(); + float fMovieW = (float)pUIScene->getMovieWidth(); + float fMovieH = (float)pUIScene->getMovieHeight(); + if (fMovieW > 0.0f && fMovieH > 0.0f && iClientW > 0 && iClientH > 0) + { + x = (S32)(x * (fMovieW / (float)iClientW)); + y = (S32)(y * (fMovieH / (float)iClientH)); + } + AUTO_VAR(itEnd, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].end()); + for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++) + { + UIELEMENT *element=(UIELEMENT *)*it; + if(element->pControl->getHidden() == false && element->pControl->getVisible()) + { + if((x>=element->x1)&&(x<=element->x2)&&(y>=element->y1)&&(y<=element->y2)) + return true; + } + } + return false; +} + +bool UIController::GetTouchBoxBounds(UIControl *pControl, S32 &x1, S32 &y1, S32 &x2, S32 &y2) +{ + if (pControl == NULL || pControl->getParentScene() == NULL) + { + return false; + } + UIScene *pUIScene = pControl->getParentScene(); + EUIGroup eUIGroup = pUIScene->GetParentLayerGroup(); + EUILayer eUILayer = pUIScene->GetParentLayer()->m_iLayer; + EUIScene eUIscene = pUIScene->getSceneType(); + AUTO_VAR(itEnd, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].end()); + for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; ++it) + { + UIELEMENT *element = (UIELEMENT *)*it; + if (element->pControl == pControl) + { + x1 = element->x1; + y1 = element->y1; + x2 = element->x2; + y2 = element->y2; + return true; + } + } + return false; +} + +bool UIController::IsCraftingMenuDisplayed(int iPad) +{ + UIScene *pScene = GetTopScene(iPad); + if (pScene == NULL) + { + return false; + } + EUIScene eType = pScene->getSceneType(); + return eType == eUIScene_Crafting2x2Menu || eType == eUIScene_Crafting3x3Menu; +} + +bool UIController::IsSkinSelectMenuDisplayed(int iPad) +{ + UIScene *pScene = GetTopScene(iPad); + if (pScene == NULL) + { + return false; + } + return pScene->getSceneType() == eUIScene_SkinSelectMenu; +} + +void UIController::TouchBoxAdd(UIControl *pControl,UIScene *pUIScene) +{ + EUIGroup eUIGroup=pUIScene->GetParentLayerGroup(); + EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer; + EUIScene eUIscene=pUIScene->getSceneType(); + + TouchBoxAdd(pControl,eUIGroup,eUILayer,eUIscene, pUIScene->GetMainPanel()); +} + +void UIController::TouchBoxAdd(UIControl *pControl,EUIGroup eUIGroup,EUILayer eUILayer,EUIScene eUIscene, UIControl *pMainPanelControl) +{ + UIELEMENT *puiElement = new UIELEMENT; + puiElement->pControl = pControl; + + S32 iControlWidth = pControl->getWidth(); + S32 iControlHeight = pControl->getHeight(); + S32 iMainPanelOffsetX = 0; + S32 iMainPanelOffsetY= 0; + + if(pMainPanelControl) + { + iMainPanelOffsetX = pMainPanelControl->getXPos(); + iMainPanelOffsetY = pMainPanelControl->getYPos(); + } + + if(puiElement->pControl->getControlType() == UIControl::eSlider) + { + UIControl_Slider *pSlider = (UIControl_Slider *)puiElement->pControl; + iControlWidth = pSlider->GetRealWidth(); + } + else if(puiElement->pControl->getControlType() == UIControl::eTexturePackList) + { + UIControl_TexturePackList *pTexturePackList = (UIControl_TexturePackList *)puiElement->pControl; + iControlHeight = pTexturePackList->GetRealHeight(); + } + else if(puiElement->pControl->getControlType() == UIControl::eDynamicLabel) + { + UIControl_DynamicLabel *pDynamicLabel = (UIControl_DynamicLabel *)puiElement->pControl; + iControlWidth = pDynamicLabel->GetRealWidth(); + iControlHeight = pDynamicLabel->GetRealHeight(); + } + else if(puiElement->pControl->getControlType() == UIControl::eHTMLLabel) + { + UIControl_HTMLLabel *pHtmlLabel = (UIControl_HTMLLabel *)puiElement->pControl; + iControlWidth = pHtmlLabel->GetRealWidth(); + iControlHeight = pHtmlLabel->GetRealHeight(); + } + + puiElement->x1=(S32)((float)pControl->getXPos() + (float)iMainPanelOffsetX); + puiElement->y1=(S32)((float)pControl->getYPos() + (float)iMainPanelOffsetY); + puiElement->x2=(S32)(((float)pControl->getXPos() + (float)iControlWidth + (float)iMainPanelOffsetX)); + puiElement->y2=(S32)(((float)pControl->getYPos() + (float)iControlHeight + (float)iMainPanelOffsetY)); + + if(puiElement->pControl->getControlType() == UIControl::eNoControl) + { + app.DebugPrintf("NO CONTROL!"); + } + + if(puiElement->x1 == puiElement->x2 || puiElement->y1 == puiElement->y2) + { + app.DebugPrintf("NOT adding touchbox %d,%d,%d,%d\n",puiElement->x1,puiElement->y1,puiElement->x2,puiElement->y2); + } + else + { + app.DebugPrintf("Adding touchbox %d,%d,%d,%d\n",puiElement->x1,puiElement->y1,puiElement->x2,puiElement->y2); + m_TouchBoxes[eUIGroup][eUILayer][eUIscene].push_back(puiElement); + } +} + +void UIController::TouchBoxRebuild(UIScene *pUIScene) +{ + EUIGroup eUIGroup=pUIScene->GetParentLayerGroup(); + EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer; + EUIScene eUIscene=pUIScene->getSceneType(); + + ui.TouchBoxesClear(pUIScene); + + m_pLastHoverScene = pUIScene; + m_iLastHoverId = -2; +#ifdef _WINDOWS64 + m_bHoverFresh = true; + m_iFreshMouseX = InputManager.GetMouseX(); + m_iFreshMouseY = InputManager.GetMouseY(); + m_hoverFreshUntilMs = System::currentTimeMillis() + 750; +#endif + + AUTO_VAR(itEnd, pUIScene->GetControls()->end()); + for (AUTO_VAR(it, pUIScene->GetControls()->begin()); it != itEnd; it++) + { + UIControl *control=(UIControl *)*it; + + if(control->getControlType() == UIControl::eButton || + control->getControlType() == UIControl::eSlider || + control->getControlType() == UIControl::eCheckBox || + control->getControlType() == UIControl::eTexturePackList || + control->getControlType() == UIControl::eButtonList || + control->getControlType() == UIControl::ePlayerList || + control->getControlType() == UIControl::eSaveList || + control->getControlType() == UIControl::eTextInput || + control->getControlType() == UIControl::eDynamicLabel || + control->getControlType() == UIControl::eHTMLLabel || + control->getControlType() == UIControl::eLeaderboardList || + control->getControlType() == UIControl::eTouchControl) + { + if(control->getVisible()) + { + control->UpdateControl(); + + ui.TouchBoxAdd(control,eUIGroup,eUILayer,eUIscene, pUIScene->GetMainPanel()); + } + } + } +} + +void UIController::TouchBoxesClear(UIScene *pUIScene) +{ + if (m_HighlightedUIElement && m_HighlightedUIElement->pControl && + m_HighlightedUIElement->pControl->getParentScene() == pUIScene) + { + m_HighlightedUIElement = NULL; + } + if (m_ActiveUIElement && m_ActiveUIElement->pControl && + m_ActiveUIElement->pControl->getParentScene() == pUIScene) + { + m_ActiveUIElement = NULL; + } + if (m_pLastListFocusControl && m_pLastListFocusControl->getParentScene() == pUIScene) + { + m_pLastListFocusControl = NULL; + } + if (m_pLastHoverScene == pUIScene) + { + m_pLastHoverScene = NULL; + m_iLastHoverId = -1; + } + + EUIGroup eUIGroup=pUIScene->GetParentLayerGroup(); + EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer; + EUIScene eUIscene=pUIScene->getSceneType(); + + AUTO_VAR(itEnd, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].end()); + for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++) + { + UIELEMENT *element=(UIELEMENT *)*it; + delete element; + } + m_TouchBoxes[eUIGroup][eUILayer][eUIscene].clear(); +} + +bool UIController::TouchBoxHit(UIScene *pUIScene,S32 x, S32 y) +{ + EUIGroup eUIGroup=pUIScene->GetParentLayerGroup(); + EUILayer eUILayer=pUIScene->GetParentLayer()->m_iLayer; + EUIScene eUIscene=pUIScene->getSceneType(); + +#ifdef _WINDOWS64 + { + extern int g_iWindowClientW, g_iWindowClientH; + float fMovieW = (float)pUIScene->getMovieWidth(); + float fMovieH = (float)pUIScene->getMovieHeight(); + if (fMovieW > 0.0f && fMovieH > 0.0f && g_iWindowClientW > 0 && g_iWindowClientH > 0) + { + x = (S32)(x * (fMovieW / (float)g_iWindowClientW)); + y = (S32)(y * (fMovieH / (float)g_iWindowClientH)); + } + } +#endif + + if(m_TouchBoxes[eUIGroup][eUILayer][eUIscene].size()>0) + { + AUTO_VAR(itEnd, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].end()); + for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++) + { + UIELEMENT *element=(UIELEMENT *)*it; + if(element->pControl->getHidden() == false && element->pControl->getVisible() && pUIScene->isControlActiveForTouch(element->pControl)) // ignore removed controls + { + if((x>=element->x1) &&(x<=element->x2) && (y>=element->y1) && (y<=element->y2)) + { + if(!m_bTouchscreenPressed) + { + app.DebugPrintf("SET m_ActiveUIElement (Layer: %i) at x = %i y = %i\n", (int)eUILayer, (int)x, (int)y); + m_ActiveUIElement = element; + } + m_HighlightedUIElement = element; + + return true; + } + } + } + } + + m_HighlightedUIElement = NULL; + return false; +} + +void UIController::HandleTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased) +{ + if(!bPressed && !bRepeat && !bReleased) + { + if(m_bTouchscreenPressed && m_ActiveUIElement && ( + m_ActiveUIElement->pControl->getControlType() == UIControl::eSlider || + m_ActiveUIElement->pControl->getControlType() == UIControl::eButtonList || + m_ActiveUIElement->pControl->getControlType() == UIControl::eTexturePackList || + m_ActiveUIElement->pControl->getControlType() == UIControl::eDynamicLabel || + m_ActiveUIElement->pControl->getControlType() == UIControl::eHTMLLabel || + m_ActiveUIElement->pControl->getControlType() == UIControl::eLeaderboardList || + m_ActiveUIElement->pControl->getControlType() == UIControl::eTouchControl)) + bRepeat = true; // the above controls need to be controllable without having the finger over them + else + return; + } + + if (!m_ActiveUIElement) + { + return; + } + + int mouseX = InputManager.GetMouseX(); + int mouseY = InputManager.GetMouseY(); + + UIScene *pActiveScene = m_ActiveUIElement ? m_ActiveUIElement->pControl->getParentScene() : NULL; + float x = MovieSpaceX(pActiveScene, mouseX); + float y = MovieSpaceY(pActiveScene, mouseY); + + if(bPressed && !bRepeat && !bReleased) // PRESSED HANDLING + { + wasFocused = true; + app.DebugPrintf("touch input pressed\n"); + switch(m_ActiveUIElement->pControl->getControlType()) + { + case UIControl::eButton: + { + UIControl_Button *pButton=(UIControl_Button *)m_ActiveUIElement->pControl; + pButton->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); + bPressed = false; + break; + } + case UIControl::eSlider: + { + UIControl_Slider *pSlider=(UIControl_Slider *)m_ActiveUIElement->pControl; + pSlider->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); + break; + } + case UIControl::eCheckBox: + { + UIControl_CheckBox *pCheckbox=(UIControl_CheckBox *)m_ActiveUIElement->pControl; + pCheckbox->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); + bPressed = false; + break; + } + case UIControl::eSaveList: + case UIControl::ePlayerList: + case UIControl::eButtonList: + { + UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl; + pButtonList->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); + pButtonList->SetTouchFocus((float)x, (float)y, false); + bPressed = false; + break; + } + case UIControl::eTexturePackList: + { + UIControl_TexturePackList *pTexturePackList=(UIControl_TexturePackList *)m_ActiveUIElement->pControl; + pTexturePackList->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); + pTexturePackList->SetTouchFocus((float)x - (float)m_ActiveUIElement->x1, (float)y - (float)m_ActiveUIElement->y1, false); + bPressed = false; + break; + } + case UIControl::eTextInput: + { + UIControl_TextInput *pTextInput=(UIControl_TextInput *)m_ActiveUIElement->pControl; + pTextInput->getParentScene()->SetFocusToElement(m_ActiveUIElement->pControl->getId()); + bPressed = false; + break; + } + case UIControl::eDynamicLabel: + { + UIControl_DynamicLabel *pDynamicLabel=(UIControl_DynamicLabel *)m_ActiveUIElement->pControl; + pDynamicLabel->TouchScroll(y, true); + bPressed = false; + break; + } + case UIControl::eHTMLLabel: + { + UIControl_HTMLLabel *pHtmlLabel=(UIControl_HTMLLabel *)m_ActiveUIElement->pControl; + pHtmlLabel->TouchScroll(y, true); + bPressed = false; + break; + } + case UIControl::eLeaderboardList: + { + UIControl_LeaderboardList *pLeaderboardList=(UIControl_LeaderboardList *)m_ActiveUIElement->pControl; + pLeaderboardList->SetTouchFocus((float)x, (float)y, false); + bPressed = false; + break; + } + case UIControl::eTouchControl: + { + m_ActiveUIElement->pControl->getParentScene()->handleTouchInput(iPad, x, y, m_ActiveUIElement->pControl->getId(), bPressed, bRepeat, bReleased); + bPressed = false; + break; + } + default: + app.DebugPrintf("PRESSED - UNHANDLED UI ELEMENT\n"); + break; + } + } + else if(bRepeat) // REPEAT HANDLING + { + wasFocused = true; + switch(m_ActiveUIElement->pControl->getControlType()) + { + case UIControl::eButton: + break; + case UIControl::eSlider: + { + UIControl_Slider *pSlider=(UIControl_Slider *)m_ActiveUIElement->pControl; + float fNewSliderPos = ((float)x - (float)m_ActiveUIElement->x1) / (float)pSlider->GetRealWidth(); + pSlider->SetSliderTouchPos(fNewSliderPos); + break; + } + case UIControl::eCheckBox: + { + bRepeat = false; + bPressed = false; + } + break; + case UIControl::eButtonList: + case UIControl::ePlayerList: + case UIControl::eSaveList: + { + UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl; + pButtonList->SetTouchFocus((float)x, (float)y, true); + } + break; + case UIControl::eTexturePackList: + { + UIControl_TexturePackList *pTexturePackList=(UIControl_TexturePackList *)m_ActiveUIElement->pControl; + pTexturePackList->SetTouchFocus((float)x - (float)m_ActiveUIElement->x1, (float)y - (float)m_ActiveUIElement->y1, true); + break; + } + case UIControl::eTextInput: + bRepeat = false; + bPressed = false; + break; + case UIControl::eDynamicLabel: + { + UIControl_DynamicLabel *pDynamicLabel=(UIControl_DynamicLabel *)m_ActiveUIElement->pControl; + pDynamicLabel->TouchScroll(y, true); + bPressed = false; + bRepeat = false; + break; + } + case UIControl::eHTMLLabel: + { + UIControl_HTMLLabel *pHtmlLabel=(UIControl_HTMLLabel *)m_ActiveUIElement->pControl; + pHtmlLabel->TouchScroll(y, true); + bPressed = false; + bRepeat = false; + break; + } + case UIControl::eLeaderboardList: + { + UIControl_LeaderboardList *pLeaderboardList=(UIControl_LeaderboardList *)m_ActiveUIElement->pControl; + pLeaderboardList->SetTouchFocus((float)x, (float)y, true); + break; + } + case UIControl::eTouchControl: + { + bPressed = false; + m_ActiveUIElement->pControl->getParentScene()->handleTouchInput(iPad, x, y, m_ActiveUIElement->pControl->getId(), bPressed, bRepeat, bReleased); + bRepeat = false; + break; + } + default: + app.DebugPrintf("REPEAT - UNHANDLED UI ELEMENT\n"); + break; + } + } + if(bReleased) // RELEASED HANDLING + { + wasFocused = true; + app.DebugPrintf("touch input released\n"); + switch(m_ActiveUIElement->pControl->getControlType()) + { + case UIControl::eButton: + if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) + bPressed = true; + break; + case UIControl::eSlider: + break; + case UIControl::eCheckBox: + if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) + { + UIControl_CheckBox *pCheckbox=(UIControl_CheckBox *)m_ActiveUIElement->pControl; + if(pCheckbox->IsEnabled()) // only proceed if checkbox is enabled! + pCheckbox->TouchSetCheckbox(!pCheckbox->IsChecked()); + } + bReleased = false; + break; + case UIControl::eButtonList: + case UIControl::ePlayerList: + case UIControl::eSaveList: + if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) + { + UIControl_ButtonList *pButtonList=(UIControl_ButtonList *)m_ActiveUIElement->pControl; + if(pButtonList->CanTouchTrigger(x,y)) + bPressed = true; + } + break; + case UIControl::eTexturePackList: + if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) + { + UIControl_TexturePackList *pTexturePackList=(UIControl_TexturePackList *)m_ActiveUIElement->pControl; + if(pTexturePackList->CanTouchTrigger((float)x - (float)m_ActiveUIElement->x1, (float)y - (float)m_ActiveUIElement->y1)) + bPressed = true; + } + break; + case UIControl::eTextInput: + if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) + bPressed = true; + break; + case UIControl::eDynamicLabel: + { + UIControl_DynamicLabel *pDynamicLabel=(UIControl_DynamicLabel *)m_ActiveUIElement->pControl; + pDynamicLabel->TouchScroll(y, false); + break; + } + case UIControl::eHTMLLabel: + { + UIControl_HTMLLabel *pHtmlLabel=(UIControl_HTMLLabel *)m_ActiveUIElement->pControl; + pHtmlLabel->TouchScroll(y, false); + break; + } + case UIControl::eLeaderboardList: + break; + case UIControl::eTouchControl: + if(m_HighlightedUIElement && m_ActiveUIElement->pControl == m_HighlightedUIElement->pControl) + { + m_ActiveUIElement->pControl->getParentScene()->handleTouchInput(iPad, x, y, m_ActiveUIElement->pControl->getId(), bPressed, bRepeat, bReleased); + } + bReleased = false; + break; + default: + app.DebugPrintf("RELEASED - UNHANDLED UI ELEMENT\n"); + break; + } + } + + if(bPressed || bRepeat || bReleased) + { + SendTouchInput(iPad, key, bPressed, bRepeat, bReleased); + } +} + +void UIController::SendTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased) +{ + bool handled = false; + + m_groups[(int)eUIGroup_Fullscreen]->handleInput(iPad, key, bRepeat, bPressed, bReleased, handled); + if(!handled) + { + m_groups[(iPad+1)]->handleInput(iPad, key, bRepeat, bPressed, bReleased, handled); + } +} #endif \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIController.h b/Minecraft.Client/Common/UI/UIController.h index 2a81694f..45d35073 100644 --- a/Minecraft.Client/Common/UI/UIController.h +++ b/Minecraft.Client/Common/UI/UIController.h @@ -21,6 +21,9 @@ public: static CRITICAL_SECTION ms_reloadSkinCS; static bool ms_bReloadSkinCSInitialised; + static CRITICAL_SECTION UIController::ms_controllerPollCS; + static bool UIController::ms_bControllerPollCSInitialised; + protected: UIComponent_DebugUIConsole *m_uiDebugConsole; UIComponent_DebugUIMarketingGuide *m_uiDebugMarketingGuide; @@ -49,6 +52,31 @@ private: eFont_Korean, }; + +#ifdef _WINDOWS64 + enum EControllerType + { + PS3, + PS4, + PS5, + + XBOXONE, + XBOX360, + + SWITCH, + GAMECUBE, + + STANDARD, + UNKNOWN, + UNSET + }; + + EControllerType m_LastControllerType; + C4JThread *m_controllerPollThread; + volatile bool m_bControllerTypeChanged; + + static int controllerPollThreadProc(void *lpParam); +#endif // 4J-JEV: It's important that currentFont == targetFont, unless updateCurrentLanguage is going to be called. EFont m_eCurrentFont, m_eTargetFont; @@ -70,7 +98,7 @@ public: private: // 4J-PB - ui element type for PSVita touch control -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) typedef struct { @@ -91,11 +119,28 @@ private: eLibrary_GraphicsInGame, eLibrary_GraphicsTooltips, eLibrary_GraphicsLabels, +#ifdef _WINDOWS64 + eLibrary_ControlTooltips, +#endif eLibrary_Labels, eLibrary_InGame, eLibrary_HUD, eLibrary_Tooltips, eLibrary_Default, +#ifdef _WINDOWS64 + eLibrary_Alt_Platform, + eLibrary_Alt_GraphicsDefault, + eLibrary_Alt_GraphicsHUD, + eLibrary_Alt_GraphicsInGame, + eLibrary_Alt_GraphicsTooltips, + eLibrary_Alt_GraphicsLabels, + eLibrary_Alt_ControlTooltips, + eLibrary_Alt_Labels, + eLibrary_Alt_InGame, + eLibrary_Alt_HUD, + eLibrary_Alt_Tooltips, + eLibrary_Alt_Default, +#endif eLibrary_Count, }; @@ -155,19 +200,49 @@ private: public: UIController(); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void TouchBoxAdd(UIControl *pControl,UIScene *pUIScene); bool TouchBoxHit(UIScene *pUIScene,S32 x, S32 y); + bool IsTouchBoxUnderPoint(S32 x, S32 y); + bool IsTouchBoxUnderPointInScene(UIScene *pUIScene, S32 x, S32 y); + bool TouchBoxPointInScene(UIScene *pUIScene,S32 x, S32 y, int iClientW, int iClientH); void TouchBoxesClear(UIScene *pUIScene); void TouchBoxRebuild(UIScene *pUIScene); void HandleTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased); void SendTouchInput(unsigned int iPad, unsigned int key, bool bPressed, bool bRepeat, bool bReleased); + bool GetTouchBoxBounds(UIControl *pControl, S32 &x1, S32 &y1, S32 &x2, S32 &y2); + + void GetMovieMousePos(UIScene *pScene, float &fx, float &fy); + + bool IsCraftingMenuDisplayed(int iPad); + bool IsSkinSelectMenuDisplayed(int iPad); +#ifdef _WINDOWS64 + bool IsControllerMode() { return m_bControllerMode; } + int GetDefaultFocusId(UIScene *pScene); +#endif + private: void TouchBoxAdd(UIControl *pControl,EUIGroup eUIGroup,EUILayer eUILayer,EUIScene eUIscene, UIControl *pMainPanelControl); UIELEMENT *m_ActiveUIElement; UIELEMENT *m_HighlightedUIElement; + + bool wasFocused; + + UIScene *m_pLastHoverScene; + int m_iLastHoverId; + bool m_bHoverFresh; + int m_iFreshMouseX; + int m_iFreshMouseY; + __int64 m_hoverFreshUntilMs; + UIControl *m_pLastListFocusControl; + int m_iLastListFocusX; + int m_iLastListFocusY; + bool m_bControllerMode; + int m_iLastDeviceMouseX; + int m_iLastDeviceMouseY; + void UpdateInputDeviceMode(); #endif protected: @@ -199,12 +274,18 @@ public: public: // TICKING virtual void tick(); +#ifdef _WINDOWS64 + wstring GetControlTooltipsPath(EControllerType ControllerType = EControllerType::UNSET); + EControllerType GetControllerType(const char* controllerType); + void fetchControlTooltipSWF(); +#endif private: void loadSkins(); IggyLibrary loadSkin(const wstring &skinPath, const wstring &skinName); public: + void reloadSingleSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName); void ReloadSkin(); virtual void StartReloadSkinThread(); virtual bool IsReloadingSkin(); diff --git a/Minecraft.Client/Common/UI/UIGroup.cpp b/Minecraft.Client/Common/UI/UIGroup.cpp index 4517c948..ca16c201 100644 --- a/Minecraft.Client/Common/UI/UIGroup.cpp +++ b/Minecraft.Client/Common/UI/UIGroup.cpp @@ -18,7 +18,7 @@ UIGroup::UIGroup(EUIGroup group, int iPad) for(unsigned int i = 0; i < eUILayer_COUNT; ++i) { m_layers[i] = new UILayer(this); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) m_layers[i]->m_iLayer=(EUILayer)i; #endif } @@ -206,7 +206,7 @@ bool UIGroup::HasFocus(int iPad) return hasFocus; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UIScene *UIGroup::getCurrentScene() { UIScene *pScene; diff --git a/Minecraft.Client/Common/UI/UIGroup.h b/Minecraft.Client/Common/UI/UIGroup.h index 9ca6bb5f..60972e3a 100644 --- a/Minecraft.Client/Common/UI/UIGroup.h +++ b/Minecraft.Client/Common/UI/UIGroup.h @@ -37,7 +37,7 @@ private: public: UIGroup(EUIGroup group, int iPad); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) EUIGroup GetGroup() {return m_group;} #endif UIComponent_Tooltips *getTooltips() { return m_tooltips; } @@ -74,7 +74,7 @@ public: // INPUT void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // Current active scene UIScene *getCurrentScene(); #endif diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index abc54e84..6f7edfdf 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -2,6 +2,7 @@ #include "UI.h" #include "UILayer.h" #include "UIScene.h" +#include "DirectTextEdit.h" UILayer::UILayer(UIGroup *parent) { @@ -594,7 +595,7 @@ void UILayer::removeComponent(EUIScene scene) { if( (*compIt)->getSceneType() == scene) { -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // remove any touchboxes ui.TouchBoxesClear((*compIt)); #endif @@ -613,7 +614,10 @@ void UILayer::removeComponent(EUIScene scene) void UILayer::removeScene(UIScene *scene) { -#ifdef __PSVITA__ +#ifdef _WINDOWS64 + DirectTextEdit::Finish(true); +#endif +#if defined(__PSVITA__) || defined(_WINDOWS64) // remove any touchboxes ui.TouchBoxesClear(scene); #endif @@ -643,7 +647,7 @@ void UILayer::closeAllScenes() m_sceneStack.clear(); for(AUTO_VAR(it, temp.begin()); it != temp.end(); ++it) { -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // remove any touchboxes ui.TouchBoxesClear(*it); #endif @@ -775,7 +779,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) return m_hasFocus; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UIScene *UILayer::getCurrentScene() { // Note: reverse iterator, the last element is the top of the stack diff --git a/Minecraft.Client/Common/UI/UILayer.h b/Minecraft.Client/Common/UI/UILayer.h index a67e0d7e..967e23d9 100644 --- a/Minecraft.Client/Common/UI/UILayer.h +++ b/Minecraft.Client/Common/UI/UILayer.h @@ -27,7 +27,7 @@ public: bool m_bIgnoreAutosaveMenuDisplayed; bool m_bIgnorePlayerJoinMenuDisplayed; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) EUILayer m_iLayer; #endif @@ -66,7 +66,7 @@ public: // INPUT void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // Current active scene UIScene *getCurrentScene(); #endif diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 1d34195f..260afc08 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -27,6 +27,11 @@ UIScene::UIScene(int iPad, UILayer *parentLayer) m_bUpdateOpacity = false; m_backScene = NULL; + +#if defined(__PSVITA__) || defined(_WINDOWS64) + m_bTouchBoxRebuildPending = false; + m_touchBoxRebuildUntilMs = 0; +#endif m_cacheSlotRenders = false; m_needsCacheRendered = true; @@ -231,11 +236,15 @@ void UIScene::initialiseMovie() updateSafeZone(); +#if defined(__PSVITA__) || defined(_WINDOWS64) + handleTouchBoxRebuild(); +#endif + m_bUpdateOpacity = true; } -#ifdef __PSVITA__ -void UIScene::SetFocusToElement(int iID) +#if defined(__PSVITA__) || defined(_WINDOWS64) +void UIScene::SetFocusToElement(int iID, bool bQuiet) { IggyDataValue result; IggyDataValue value[1]; @@ -245,6 +254,13 @@ void UIScene::SetFocusToElement(int iID) IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetFocus , 1 , value ); + if (bQuiet) + { + m_iFocusControl = iID; + m_iFocusChild = 0; + return; + } + // also trigger handle focus change (just in case if anything else in relation needs updating!) _handleFocusChange(iID, 0); } @@ -318,6 +334,15 @@ void UIScene::loadMovie() moviePath.append(L"720.swf"); m_loadedResolution = eSceneResolution_720; + if(!app.hasArchiveFile(moviePath)) + { +#if defined _WINDOWS64 + moviePath = getMoviePath(); + moviePath.append(L"1080.swf"); + m_loadedResolution = eSceneResolution_1080; +#endif + } + if(!app.hasArchiveFile(moviePath)) { app.DebugPrintf("ERROR: Could not find any iggy movie for %ls!\n", moviePath.c_str()); @@ -437,6 +462,15 @@ void UIScene::tick() { if(m_bIsReloading) return; if(m_hasTickedOnce) m_bCanHandleInput = true; +#if defined(__PSVITA__) || defined(_WINDOWS64) + if (m_bTouchBoxRebuildPending) + { + UpdateSceneControls(); + ui.TouchBoxRebuild(this); + if (System::currentTimeMillis() >= m_touchBoxRebuildUntilMs) + m_bTouchBoxRebuildPending = false; + } +#endif while(IggyPlayerReadyToTick( swf )) { tickTimers(); @@ -454,6 +488,14 @@ UIControl* UIScene::GetMainPanel() return NULL; } +void UIScene::handleTouchBoxRebuild() +{ +#if defined(__PSVITA__) || defined(_WINDOWS64) + m_bTouchBoxRebuildPending = true; + m_touchBoxRebuildUntilMs = System::currentTimeMillis() + 750; +#endif +} + void UIScene::addTimer(int id, int ms) { @@ -530,7 +572,7 @@ void UIScene::removeControl( UIControl_Base *control, bool centreScene) value[1].boolval = centreScene; IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcRemoveObject , 2 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // update the button positions since they may have changed UpdateSceneControls(); @@ -1237,7 +1279,7 @@ UIScene *UIScene::getBackScene() { return m_backScene; } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIScene::UpdateSceneControls() { AUTO_VAR(itEnd, GetControls()->end()); diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index 62cbc0ce..491e3d5f 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -94,6 +94,11 @@ protected: int m_iPad; bool m_hasTickedOnce; +#if defined(__PSVITA__) || defined(_WINDOWS64) + bool m_bTouchBoxRebuildPending; + __int64 m_touchBoxRebuildUntilMs; +#endif + public: virtual Iggy *getMovie() { return swf; } @@ -106,7 +111,10 @@ public: int getRenderWidth() { return m_renderWidth; } int getRenderHeight() { return m_renderHeight; } -#ifdef __PSVITA__ + int getMovieWidth() { return m_movieWidth; } + int getMovieHeight() { return m_movieHeight; } + +#if defined(__PSVITA__) || defined(_WINDOWS64) UILayer *GetParentLayer() {return m_parentLayer;} EUIGroup GetParentLayerGroup() {return m_parentLayer->m_parentGroup->GetGroup();} vector *GetControls() {return &m_controls;} @@ -139,8 +147,8 @@ public: virtual void tick(); IggyName registerFastName(const wstring &name); -#ifdef __PSVITA__ - void SetFocusToElement(int iID); +#if defined(__PSVITA__) || defined(_WINDOWS64) + void SetFocusToElement(int iID, bool bQuiet = false); void UpdateSceneControls(); #endif protected: @@ -228,7 +236,7 @@ protected: virtual void handleAnimationEnd() {} virtual void handleSelectionChanged(F64 selectedId) {} virtual void handleRequestMoreData(F64 startIndex, bool up) {} - virtual void handleTouchBoxRebuild() {} + virtual void handleTouchBoxRebuild(); private: void _handleFocusChange(F64 controlId, F64 childId); void _handleInitFocus(F64 controlId, F64 childId); @@ -264,6 +272,10 @@ public: virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) {} + virtual void handleMouseHover(float x, float y, int iId) {} + + virtual bool isControlActiveForTouch(UIControl *control) { (void)control; return true; } + protected: diff --git a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp index 9c951200..34b24bec 100644 --- a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.cpp @@ -97,6 +97,13 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) fPanelHeight = m_controlBackgroundPanel.getHeight(); fPanelX = m_controlBackgroundPanel.getXPos(); fPanelY = m_controlBackgroundPanel.getYPos(); + if (fPanelWidth <= 0 || fPanelHeight <= 0) + { + fPanelX = 0.0f; + fPanelY = 0.0f; + fPanelWidth = (float)m_movieWidth; + fPanelHeight = (float)m_movieHeight; + } // Get size of pointer m_fPointerImageOffsetX = 0; //floor(fPointerWidth/2.0f); m_fPointerImageOffsetY = 0; //floor(fPointerHeight/2.0f); @@ -142,11 +149,46 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) UIVec2D sectionPos; GetPositionOfSection( m_eCurrSection, &( sectionPos ) ); + UIControl *pInitPanel = GetMainPanel(); + if (pInitPanel) + { + pInitPanel->UpdateControl(); + sectionPos.x += (float)pInitPanel->getXPos(); + sectionPos.y += (float)pInitPanel->getYPos(); + float fMainX = (float)pInitPanel->getXPos(); + float fMainY = (float)pInitPanel->getYPos(); + float fMainMaxX = fMainX + (float)pInitPanel->getWidth(); + float fMainMaxY = fMainY + (float)pInitPanel->getHeight(); + float fInvMinX = fMainX + (float)m_slotListInventory.getXPos(); + float fInvMaxX = fInvMinX + (float)m_slotListInventory.getWidth(); + float fHotMinX = fMainX + (float)m_slotListHotbar.getXPos(); + float fHotMaxX = fHotMinX + (float)m_slotListHotbar.getWidth(); + if (fMainX < m_fPanelMinX) m_fPanelMinX = fMainX; + if (fMainY < m_fPanelMinY) m_fPanelMinY = fMainY; + if (fMainMaxX > m_fPanelMaxX) m_fPanelMaxX = fMainMaxX; + if (fMainMaxY > m_fPanelMaxY) m_fPanelMaxY = fMainMaxY; + if (fInvMinX < m_fPanelMinX) m_fPanelMinX = fInvMinX; + if (fHotMinX < m_fPanelMinX) m_fPanelMinX = fHotMinX; + if (fInvMaxX > m_fPanelMaxX) m_fPanelMaxX = fInvMaxX; + if (fHotMaxX > m_fPanelMaxX) m_fPanelMaxX = fHotMaxX; + if (m_fPanelMinX - fPointerWidth < m_fPointerMinX) m_fPointerMinX = m_fPanelMinX - fPointerWidth; + if (m_fPanelMaxX + fPointerWidth > m_fPointerMaxX) m_fPointerMaxX = m_fPanelMaxX + fPointerWidth; + if (m_fPanelMaxY + (fPointerHeight/2) > m_fPointerMaxY) m_fPointerMaxY = m_fPanelMaxY + (fPointerHeight/2); + } UIVec2D vPointerPos = sectionPos; vPointerPos += itemPos; vPointerPos.x += ( itemSize.x / 2.0f ); vPointerPos.y += ( itemSize.y / 2.0f ); +#ifdef _WINDOWS64 + { FILE *cf = fopen("inv_debug.log", "a"); if (cf) { int isz = m_slotListInventory.GetSlotSize(); int ihz = m_slotListHotbar.GetSlotSize(); + int icnt = m_slotListInventory.GetFlashSlotCount(); int hcnt = m_slotListHotbar.GetFlashSlotCount(); + fprintf(cf, "INIT mainpanel=(%.1f,%.1f) invlist=(%d,%d %dx%d) slotread_inv=%d slotread_hot=%d flashcount_inv=%d flashcount_hot=%d bg=(%.1f,%.1f %.1fx%.1f) pmin=(%.1f,%.1f) pmax=(%.1f,%.1f)\n", + pInitPanel ? (float)pInitPanel->getXPos() : -999.0f, pInitPanel ? (float)pInitPanel->getYPos() : -999.0f, + m_slotListInventory.getXPos(), m_slotListInventory.getYPos(), m_slotListInventory.getWidth(), m_slotListInventory.getHeight(), isz, ihz, icnt, hcnt, + fPanelX, fPanelY, fPanelWidth, fPanelHeight, m_fPointerMinX, m_fPointerMinY, m_fPointerMaxX, m_fPointerMaxY); + fclose(cf); } } +#endif vPointerPos.x -= m_fPointerImageOffsetX; vPointerPos.y -= m_fPointerImageOffsetY; @@ -172,11 +214,11 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex) #endif } -void UIScene_AbstractContainerMenu::tick() + void UIScene_AbstractContainerMenu::tick() { UIScene::tick(); - onMouseTick(); + onMouseTick(this); IggyEvent mouseEvent; S32 width, height; @@ -193,6 +235,26 @@ void UIScene_AbstractContainerMenu::tick() IggyEventResult result; IggyPlayerDispatchEventRS ( getMovie() , &mouseEvent , &result ); + +#ifdef _WINDOWS64 + { + IggyValuePath pointerPath; + if (IggyValuePathMakeNameRef(&pointerPath, m_rootPath, "pointerIcon")) + { + IggyValueSetBooleanRS(&pointerPath, registerFastName(L"visible"), NULL, true); + } + if (hasMovie()) + { + UIControl *pMainPanel = GetMainPanel(); + if (pMainPanel) + { + pMainPanel->UpdateControl(); + IggyValueSetF64RS(m_cursorPath.getIggyValuePath(), registerFastName(L"x"), NULL, (F64)(m_pointerPos.x - (float)pMainPanel->getXPos())); + IggyValueSetF64RS(m_cursorPath.getIggyValuePath(), registerFastName(L"y"), NULL, (F64)(m_pointerPos.y - (float)pMainPanel->getYPos())); + } + } + } +#endif } void UIScene_AbstractContainerMenu::render(S32 width, S32 height, C4JRender::eViewportType viewpBort) diff --git a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h index bc67ab9e..efd18f47 100644 --- a/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_AbstractContainerMenu.h @@ -33,6 +33,8 @@ public: UIScene_AbstractContainerMenu(int iPad, UILayer *parentLayer); ~UIScene_AbstractContainerMenu(); + virtual UIControl* GetMainPanel() { return &m_controlMainPanel; } + virtual void handleDestroy(); int getPad() { return m_iPad; } diff --git a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp index 6671f672..3926b8de 100644 --- a/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_AnvilMenu.cpp @@ -5,6 +5,7 @@ #include "MultiPlayerLocalPlayer.h" #include "..\..\Minecraft.h" #include "UIScene_AnvilMenu.h" +#include "DirectTextEdit.h" UIScene_AnvilMenu::UIScene_AnvilMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene_AbstractContainerMenu(iPad, parentLayer) { @@ -170,6 +171,7 @@ void UIScene_AnvilMenu::GetPositionOfSection( ESceneSection eSection, UIVec2D* p pPosition->y = m_slotListResult.getYPos(); break; case eSectionAnvilName: + m_textInputAnvil.UpdateControl(); pPosition->x = m_textInputAnvil.getXPos(); pPosition->y = m_textInputAnvil.getYPos(); break; @@ -196,26 +198,32 @@ void UIScene_AnvilMenu::GetItemScreenData( ESceneSection eSection, int iItemInde case eSectionAnvilItem1: sectionSize.x = m_slotListItem1.getWidth(); sectionSize.y = m_slotListItem1.getHeight(); + FixSlotGridSize(eSection, m_slotListItem1, sectionSize); break; case eSectionAnvilItem2: sectionSize.x = m_slotListItem2.getWidth(); sectionSize.y = m_slotListItem2.getHeight(); + FixSlotGridSize(eSection, m_slotListItem2, sectionSize); break; case eSectionAnvilResult: sectionSize.x = m_slotListResult.getWidth(); sectionSize.y = m_slotListResult.getHeight(); + FixSlotGridSize(eSection, m_slotListResult, sectionSize); break; case eSectionAnvilName: + m_textInputAnvil.UpdateControl(); sectionSize.x = m_textInputAnvil.getWidth(); sectionSize.y = m_textInputAnvil.getHeight(); break; case eSectionAnvilInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionAnvilUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); @@ -239,6 +247,16 @@ void UIScene_AnvilMenu::GetItemScreenData( ESceneSection eSection, int iItemInde else { GetPositionOfSection(eSection, pPosition); + if (eSection == eSectionAnvilName) + { + UIControl *pMainPanel = GetMainPanel(); + if (pMainPanel) + { + pMainPanel->UpdateControl(); + pPosition->x += pMainPanel->getXPos(); + pPosition->y += pMainPanel->getYPos(); + } + } pSize->x = sectionSize.x; pSize->y = sectionSize.y; } @@ -316,7 +334,10 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) { uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); - InputManager.GetText(pchText); +#ifdef _WINDOWS64 + if (!DirectTextEdit::TakeText(pchText, 128)) +#endif + InputManager.GetText(pchText); pClass->setEditNameValue((wchar_t *)pchText); pClass->m_itemName = (wchar_t *)pchText; pClass->updateItemName(); @@ -326,6 +347,12 @@ int UIScene_AnvilMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) void UIScene_AnvilMenu::handleEditNamePressed() { +#ifdef _WINDOWS64 + DirectTextEdit::Begin(&m_textInputAnvil, GetMainPanel(), m_textInputAnvil.getLabel(), 30, + C_4JInput::EKeyboardMode_Default, + &UIScene_AnvilMenu::KeyboardCompleteCallback, this); + return; +#endif setIgnoreInput(true); #if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__ int language = XGetLanguage(); diff --git a/Minecraft.Client/Common/UI/UIScene_BeaconMenu.cpp b/Minecraft.Client/Common/UI/UIScene_BeaconMenu.cpp index 13dee02a..9f508779 100644 --- a/Minecraft.Client/Common/UI/UIScene_BeaconMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_BeaconMenu.cpp @@ -179,14 +179,17 @@ void UIScene_BeaconMenu::GetItemScreenData( ESceneSection eSection, int iItemInd case eSectionBeaconItem: sectionSize.x = m_slotListActivator.getWidth(); sectionSize.y = m_slotListActivator.getHeight(); + FixSlotGridSize(eSection, m_slotListActivator, sectionSize); break; case eSectionBeaconInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionBeaconUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; case eSectionBeaconPrimaryTierOneOne: diff --git a/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.cpp b/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.cpp index 26dc7410..62fe8750 100644 --- a/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_BrewingStandMenu.cpp @@ -204,26 +204,32 @@ void UIScene_BrewingStandMenu::GetItemScreenData( ESceneSection eSection, int iI case eSectionBrewingBottle1: sectionSize.x = m_slotListBottles[0].getWidth(); sectionSize.y = m_slotListBottles[0].getHeight(); + FixSlotGridSize(eSection, m_slotListBottles[0], sectionSize); break; case eSectionBrewingBottle2: sectionSize.x = m_slotListBottles[1].getWidth(); sectionSize.y = m_slotListBottles[1].getHeight(); + FixSlotGridSize(eSection, m_slotListBottles[1], sectionSize); break; case eSectionBrewingBottle3: sectionSize.x = m_slotListBottles[2].getWidth(); sectionSize.y = m_slotListBottles[2].getHeight(); + FixSlotGridSize(eSection, m_slotListBottles[2], sectionSize); break; case eSectionBrewingIngredient: sectionSize.x = m_slotListIngredient.getWidth(); sectionSize.y = m_slotListIngredient.getHeight(); + FixSlotGridSize(eSection, m_slotListIngredient, sectionSize); break; case eSectionBrewingInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionBrewingUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_ContainerMenu.cpp b/Minecraft.Client/Common/UI/UIScene_ContainerMenu.cpp index ec3541eb..f74d850e 100644 --- a/Minecraft.Client/Common/UI/UIScene_ContainerMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_ContainerMenu.cpp @@ -148,14 +148,17 @@ void UIScene_ContainerMenu::GetItemScreenData( ESceneSection eSection, int iItem case eSectionContainerChest: sectionSize.x = m_slotListContainer.getWidth(); sectionSize.y = m_slotListContainer.getHeight(); + FixSlotGridSize(eSection, m_slotListContainer, sectionSize); break; case eSectionContainerInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionContainerUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp index fd69be8f..3a560023 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.cpp @@ -5,7 +5,7 @@ #include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h" #include "UIScene_CraftingMenu.h" -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) #define GAME_CRAFTING_TOUCHUPDATE_TIMER_ID 0 #define GAME_CRAFTING_TOUCHUPDATE_TIMER_TIME 100 #endif @@ -13,6 +13,9 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { m_bIgnoreKeyPresses = false; + m_bMouseLDownPrev = false; + m_bCraftArmed = false; + m_iHoverHSlot = -1; CraftingPanelScreenInput* initData = (CraftingPanelScreenInput*)_initData; m_iContainerType=initData->iContainerType; @@ -176,13 +179,13 @@ UIScene_CraftingMenu::UIScene_CraftingMenu(int iPad, void *_initData, UILayer *p // 4J-PB - Must be after the CanBeMade list has been set up with CheckRecipesAvailable UpdateTooltips(); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) + ui.TouchBoxRebuild(this); // initialise vita touch controls with ids for(unsigned int i = 0; i < ETouchInput_Count; ++i) { m_TouchInput[i].init(i); } - ui.TouchBoxRebuild(this); #endif } @@ -225,9 +228,7 @@ EUIScene UIScene_CraftingMenu::getSceneType() { return eUIScene_Crafting2x2Menu; } -} - -wstring UIScene_CraftingMenu::getMoviePath() +} wstring UIScene_CraftingMenu::getMoviePath() { if(app.GetLocalPlayerCount() > 1) { @@ -254,7 +255,238 @@ wstring UIScene_CraftingMenu::getMoviePath() } } -#ifdef __PSVITA__ +void UIScene_CraftingMenu::handleMouseHover(float x, float y, int iId) +{ +#ifdef _WINDOWS64 + if (iId == ETouchInput_CraftingHSlots) + { + UpdateHSlotHover(x, y); + } +#endif +} + +#ifdef _WINDOWS64 +bool UIScene_CraftingMenu::GetTabSegmentForPoint(float fx, float fy, int &iOut) +{ + int iMaxGroup = (m_iContainerType == RECIPE_TYPE_3x3) ? m_iMaxGroup3x3 : m_iMaxGroup2x2; + if (iMaxGroup <= 0) return false; + + m_controlMainPanel.UpdateControl(); + m_tabRow.UpdateControl(); + float fOx = (float)m_controlMainPanel.getXPos() + (float)m_tabRow.getXPos(); + float fOy = (float)m_controlMainPanel.getYPos() + (float)m_tabRow.getYPos(); + float fW = (float)m_tabRow.getWidth(); + float fH = (float)m_tabRow.getHeight(); + if (fW < 4.0f || fH < 4.0f) return false; + + if (fx < fOx || fx >= fOx + fW * (float)iMaxGroup || fy < fOy || fy >= fOy + fH) return false; + + int iSeg = (int)((fx - fOx) / fW); + if (iSeg < 0) iSeg = 0; + if (iSeg >= iMaxGroup) iSeg = iMaxGroup - 1; + iOut = iSeg; + return true; +} + +void UIScene_CraftingMenu::SelectGroupTabUnderPoint(float fx, float fy) +{ + int iSeg; + if (!GetTabSegmentForPoint(fx, fy, iSeg)) return; + + if (iSeg == m_iGroupIndex) + { + ui.PlayUISFX(eSFX_Focus); + return; + } + + showTabHighlight(m_iGroupIndex, false); + m_iGroupIndex = iSeg; + showTabHighlight(m_iGroupIndex, true); + + m_iCurrentSlotHIndex = 0; + m_iCurrentSlotVIndex = 1; + CheckRecipesAvailable(); + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + ui.PlayUISFX(eSFX_Focus); + UpdateVerticalSlots(); + UpdateHighlight(); + setGroupText(GetGroupNameText(m_pGroupA[m_iGroupIndex])); +} + +bool UIScene_CraftingMenu::GetHSlotIndexForPoint(float fx, float fy, int &iOut) +{ + if (m_iCraftablesMaxHSlotC <= 0) return false; + + m_controlMainPanel.UpdateControl(); + m_slotListCraftingHSlots.UpdateControl(); + float fRowX = (float)m_slotListCraftingHSlots.getXPos() + (float)m_controlMainPanel.getXPos(); + float fRowY = (float)m_slotListCraftingHSlots.getYPos() + (float)m_controlMainPanel.getYPos(); + S32 iSlotSize = m_slotListCraftingHSlots.GetSlotSize(); + if (iSlotSize <= 0) iSlotSize = 50; + float fRowW = (float)(m_iCraftablesMaxHSlotC * iSlotSize); + float fRowH = (float)iSlotSize; + if (fRowW < 4.0f || fRowH < 4.0f) return false; + if (fx < fRowX || fx >= fRowX + fRowW || fy < fRowY || fy >= fRowY + fRowH) return false; + + float fSlotW = fRowW / (float)m_iCraftablesMaxHSlotC; + int iSlot = (int)((fx - fRowX) / fSlotW); + if (iSlot < 0) iSlot = 0; + if (iSlot >= m_iCraftablesMaxHSlotC) iSlot = m_iCraftablesMaxHSlotC - 1; + if (CanBeMadeA[iSlot].iCount == 0) return false; + iOut = iSlot; + return true; +} + +void UIScene_CraftingMenu::UpdateHSlotHover(float fx, float fy) +{ + int iSlot; + if (GetHSlotIndexForPoint(fx, fy, iSlot)) + { + if (iSlot != m_iHoverHSlot) + { + m_slotListCraftingHSlots.clearHighlight(); + m_slotListCraftingHSlots.setHighlightSlot(iSlot); + m_iHoverHSlot = iSlot; + } + } + else if (m_iHoverHSlot != -1) + { + m_slotListCraftingHSlots.clearHighlight(); + m_iHoverHSlot = -1; + } +} + +void UIScene_CraftingMenu::SelectHSlotUnderPoint(float fx, float fy) +{ + int iNewSlot; + if (!GetHSlotIndexForPoint(fx, fy, iNewSlot)) return; + if (iNewSlot == m_iCurrentSlotHIndex) return; + + int iOldHSlot = m_iCurrentSlotHIndex; + m_iCurrentSlotHIndex = iNewSlot; + m_iCurrentSlotVIndex = 1; + iVSlotIndexA[0] = CanBeMadeA[m_iCurrentSlotHIndex].iCount - 1; + iVSlotIndexA[1] = 0; + iVSlotIndexA[2] = 1; + UpdateVerticalSlots(); + UpdateHighlight(); + if (CanBeMadeA[iOldHSlot].iCount > 0) + { + setShowCraftHSlot(iOldHSlot, true); + } +} + +void UIScene_CraftingMenu::tick() +{ + UIScene::tick(); + + if (InputManager.IsMouseCaptured()) return; + + extern int g_iWindowClientW, g_iWindowClientH; + float fMovieW = getMovieWidth(); + float fMovieH = getMovieHeight(); + if (fMovieW < 1.0f) fMovieW = 1280.0f; + if (fMovieH < 1.0f) fMovieH = 720.0f; + float fScalex = fMovieW / (float)(g_iWindowClientW > 0 ? g_iWindowClientW : 1280); + float fScaley = fMovieH / (float)(g_iWindowClientH > 0 ? g_iWindowClientH : 720); + float fx = (float)InputManager.GetMouseX() * fScalex; + float fy = (float)InputManager.GetMouseY() * fScaley; + + if (ui.IsControllerMode()) + { + if (m_iHoverHSlot != -1) + { + m_slotListCraftingHSlots.clearHighlight(); + m_iHoverHSlot = -1; + } + } + else + { + UpdateHSlotHover(fx, fy); + } + + bool bLDown = InputManager.IsMouseLDown(); + if (bLDown && !m_bMouseLDownPrev) + { + m_bCraftArmed = false; + int iTab; + if (GetTabSegmentForPoint(fx, fy, iTab)) + { + SelectGroupTabUnderPoint(fx, fy); + } + else + { + int iSlot; + if (GetHSlotIndexForPoint(fx, fy, iSlot)) + { + if (iSlot == m_iCurrentSlotHIndex) + m_bCraftArmed = true; + else + SelectHSlotUnderPoint(fx, fy); + } + } + } + else if (!bLDown && m_bMouseLDownPrev) + { + if (m_bCraftArmed) + { + m_bCraftArmed = false; + int iSlot; + if (GetHSlotIndexForPoint(fx, fy, iSlot) && iSlot == m_iCurrentSlotHIndex) + handleKeyDown(m_iPad, ACTION_MENU_A, false); + } + } + m_bMouseLDownPrev = bLDown; +} +#endif + +void UIScene_CraftingMenu::CycleVerticalVariant(bool bForward) +{ + int iCount = CanBeMadeA[m_iCurrentSlotHIndex].iCount; + if (iCount <= 1) return; + + if (iCount > 2) + { + if (bForward) + { + if (m_iCurrentSlotVIndex != 2) + { + m_iCurrentSlotVIndex++; + } + else + { + iVSlotIndexA[0] = iVSlotIndexA[1]; + iVSlotIndexA[1] = iVSlotIndexA[2]; + iVSlotIndexA[2] = (iVSlotIndexA[2] == iCount - 1) ? 0 : iVSlotIndexA[2] + 1; + } + } + else + { + if (m_iCurrentSlotVIndex != 0) + { + m_iCurrentSlotVIndex--; + } + else + { + iVSlotIndexA[2] = iVSlotIndexA[1]; + iVSlotIndexA[1] = iVSlotIndexA[0]; + iVSlotIndexA[0] = (iVSlotIndexA[0] == 0) ? iCount - 1 : iVSlotIndexA[0] - 1; + } + } + } + else + { + m_iCurrentSlotVIndex = (bForward) ? ((m_iCurrentSlotVIndex != 1) ? 1 : 0) : ((m_iCurrentSlotVIndex != 0) ? 0 : 1); + } + + ui.PlayUISFX(eSFX_Focus); + UpdateVerticalSlots(); + UpdateHighlight(); +} + +#if defined(__PSVITA__) || defined(_WINDOWS64) UIControl* UIScene_CraftingMenu::GetMainPanel() { return &m_controlMainPanel; @@ -369,6 +601,7 @@ void UIScene_CraftingMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int void UIScene_CraftingMenu::handleTouchBoxRebuild() { addTimer(GAME_CRAFTING_TOUCHUPDATE_TIMER_ID,GAME_CRAFTING_TOUCHUPDATE_TIMER_TIME); + UIScene::handleTouchBoxRebuild(); } void UIScene_CraftingMenu::handleTimerComplete(int id) @@ -556,7 +789,10 @@ void UIScene_CraftingMenu::handleInput(int iPad, int key, bool repeat, bool pres { case ACTION_MENU_OTHER_STICK_UP: case ACTION_MENU_OTHER_STICK_DOWN: - sendInputToMovie(key,repeat,pressed,released); + if (pressed) + { + CycleVerticalVariant(key == ACTION_MENU_OTHER_STICK_DOWN); + } break; default: if(pressed) diff --git a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h index 89ba2645..661a9832 100644 --- a/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CraftingMenu.h @@ -64,7 +64,26 @@ public: virtual void customDraw(IggyCustomDrawCallbackRegion *region); -#ifdef __PSVITA__ + virtual void tick(); + + void SelectHSlotUnderPoint(float fx, float fy); + + bool GetHSlotIndexForPoint(float fx, float fy, int &iOut); + + void UpdateHSlotHover(float fx, float fy); + + int m_iHoverHSlot; + + + + void SelectGroupTabUnderPoint(float fx, float fy); + bool GetTabSegmentForPoint(float fx, float fy, int &iOut); + + void CycleVerticalVariant(bool bForward); + + virtual void handleMouseHover(float x, float y, int iId); + +#if defined(__PSVITA__) || defined(_WINDOWS64) virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); virtual UIControl* GetMainPanel(); virtual void handleTouchBoxRebuild(); @@ -74,6 +93,7 @@ public: protected: UIControl m_controlMainPanel; UIControl m_control1Selector, m_control2Selector, m_control3Selector; + UIControl m_tabRow; UIControl_SlotList m_slotListCraftingHSlots; UIControl_SlotList m_slotListCrafting1VSlots, m_slotListCrafting2VSlots[2], m_slotListCrafting3VSlots[3]; UIControl_SlotList m_slotListIngredientsLayout, m_slotListCraftingOutput; @@ -86,7 +106,7 @@ protected: IggyName m_funcMoveSelector, m_funcSelectVerticalItem, m_funcSetActiveTab; IggyName m_funcShowPanelDisplay, m_funcShowIngredientSlot; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) enum ETouchInput { ETouchInput_TouchPanel_0, @@ -104,11 +124,17 @@ protected: S32 m_iCraftingSlotTouchStartY; #endif + bool m_bMouseLDownPrev; + + bool m_bCraftArmed; + UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) UI_MAP_ELEMENT( m_controlMainPanel, "MainPanel" ) UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlMainPanel ) UI_MAP_ELEMENT( m_slotListCraftingHSlots, "CraftingHSlots") + UI_MAP_ELEMENT( m_tabRow, "CraftingTabs") + UI_MAP_ELEMENT( m_control3Selector, "SlotSelector3" ) UI_BEGIN_MAP_CHILD_ELEMENTS( m_control3Selector) UI_MAP_ELEMENT( m_slotListCrafting3VSlots[0], "Crafting3VSlot1") @@ -157,7 +183,7 @@ protected: UI_MAP_NAME( m_funcShowPanelDisplay, L"showPanelDisplay") UI_MAP_NAME( m_funcShowIngredientSlot, L"ShowIngredient") -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_0], "TouchPanel_0" ) UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_1], "TouchPanel_1" ) UI_MAP_ELEMENT( m_TouchInput[ETouchInput_TouchPanel_2], "TouchPanel_2" ) diff --git a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp index 42ef73f5..504ded19 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "UI.h" #include "UIScene_CreateWorldMenu.h" +#include "DirectTextEdit.h" #include "..\..\MinecraftServer.h" #include "..\..\Minecraft.h" #include "..\..\Options.h" @@ -81,6 +82,8 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_MoreOptionsParams.bDoDaylightCycle = true; m_bGameModeCreative = false; + m_lastPackSelId = -1; + m_bPackSelTracked = false; m_iGameModeId = GameType::SURVIVAL->getId(); m_pDLCPack = NULL; m_bRebuildTouchBoxes = false; @@ -298,6 +301,7 @@ void UIScene_CreateWorldMenu::tick() { slideLeft(); m_texturePackDescDisplayed = true; + handleTouchBoxRebuild(); m_bShowTexturePackDescription = false; } @@ -386,8 +390,16 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p case ACTION_MENU_RIGHT: case ACTION_MENU_OTHER_STICK_UP: case ACTION_MENU_OTHER_STICK_DOWN: - sendInputToMovie(key, repeat, pressed, released); - + if (pressed && (key == ACTION_MENU_OTHER_STICK_UP || key == ACTION_MENU_OTHER_STICK_DOWN) + && MouseHoversTexturePackList()) + { + StepTexturePack(key == ACTION_MENU_OTHER_STICK_UP ? -1 : +1); + } + else + { + sendInputToMovie(key, repeat, pressed, released); + } + bool bOnlineGame = m_checkboxOnline.IsChecked(); if (m_MoreOptionsParams.bOnlineGame != bOnlineGame) { @@ -416,8 +428,14 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId) { case eControl_EditWorldName: { +#ifdef _WINDOWS64 + DirectTextEdit::Begin(&m_editWorldName, &m_controlMainPanel, m_editWorldName.getLabel(), 25, + C_4JInput::EKeyboardMode_Default, + &UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback, this); +#else m_bIgnoreInput=true; InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD),m_editWorldName.getLabel(),(DWORD)0,25,&UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback,this,C_4JInput::EKeyboardMode_Default); +#endif } break; case eControl_GameModeToggle: @@ -622,7 +640,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue) void UIScene_CreateWorldMenu::handleTimerComplete(int id) { -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls if(m_bRebuildTouchBoxes) { @@ -729,7 +747,10 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bo { uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); - InputManager.GetText(pchText); +#ifdef _WINDOWS64 + if (!DirectTextEdit::TakeText(pchText, 128)) +#endif + InputManager.GetText(pchText); if(pchText[0]!=0) { @@ -742,6 +763,54 @@ int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bo return 0; } +void UIScene_CreateWorldMenu::handleSelectionChanged(F64 selectedId) +{ + m_lastPackSelId = (int)selectedId; + m_bPackSelTracked = true; + IUIScene_StartGame::handleSelectionChanged(selectedId); +} + +bool UIScene_CreateWorldMenu::MouseHoversTexturePackList() +{ + m_controlMainPanel.UpdateControl(); + m_texturePackList.UpdateControl(); + float x = (float)m_controlMainPanel.getXPos() + (float)m_texturePackList.getXPos(); + float y = (float)m_controlMainPanel.getYPos() + (float)m_texturePackList.getYPos(); + float w = (float)m_texturePackList.getWidth(); + float h = (float)m_texturePackList.getHeight(); + if (w < 4.0f || h < 4.0f) + return false; + float fx = 0.0f, fy = 0.0f; + ui.GetMovieMousePos(this, fx, fy); + return fx >= x && fx < x + w && fy >= y && fy < y + h; +} + +void UIScene_CreateWorldMenu::StepTexturePack(int iDir) +{ + Minecraft *pMinecraft = Minecraft::GetInstance(); + if (!pMinecraft || !pMinecraft->skins) + return; + int count = (int)pMinecraft->skins->getTexturePackCount(); + if (count < 2) + return; + int step = (iDir < 0 ? -1 : +1); + int idx = m_bPackSelTracked ? m_lastPackSelId : (int)m_currentTexturePackIndex; + for (;;) + { + idx += step; + if (idx < 0 || idx >= count) + return; + if (pMinecraft->skins->getTexturePackByIndex(idx) != NULL) + break; + } + m_lastPackSelId = idx; + m_bPackSelTracked = true; + m_texturePackList.selectSlot(idx); + UpdateCurrentTexturePack(idx); + UpdateTexturePackDescription(idx); + ui.PlayUISFX(eSFX_Scroll); +} + void UIScene_CreateWorldMenu::checkStateAndStartGame() { int primaryPad = ProfileManager.GetPrimaryPad(); @@ -1441,4 +1510,5 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor void UIScene_CreateWorldMenu::handleTouchBoxRebuild() { m_bRebuildTouchBoxes = true; + UIScene::handleTouchBoxRebuild(); } diff --git a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h index dd093f32..36144a8f 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.h @@ -81,6 +81,11 @@ public: private: void StartSharedLaunchFlow(); bool IsLocalMultiplayerAvailable(); + virtual void handleSelectionChanged(F64 selectedId); + bool MouseHoversTexturePackList(); + void StepTexturePack(int iDir); + int m_lastPackSelId; + bool m_bPackSelTracked; #ifdef _DURANGO static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad); diff --git a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp index 3b7bc8a2..c6216be6 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.cpp @@ -9,7 +9,7 @@ #include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h" #include "..\..\..\Minecraft.World\net.minecraft.world.item.h" -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) #define GAME_CREATIVE_TOUCHUPDATE_TIMER_ID 0 #define GAME_CREATIVE_TOUCHUPDATE_TIMER_TIME 100 #endif @@ -54,7 +54,7 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p m_curTab = eCreativeInventoryTab_COUNT; switchTab(eCreativeInventoryTab_BuildingBlocks); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // initialise vita touch controls with ids for(unsigned int i = 0; i < ETouchInput_Count; ++i) { @@ -75,7 +75,7 @@ wstring UIScene_CreativeMenu::getMoviePath() } } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UIControl* UIScene_CreativeMenu::GetMainPanel() { return &m_controlMainPanel; @@ -117,6 +117,7 @@ void UIScene_CreativeMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int void UIScene_CreativeMenu::handleTouchBoxRebuild() { addTimer(GAME_CREATIVE_TOUCHUPDATE_TIMER_ID,GAME_CREATIVE_TOUCHUPDATE_TIMER_TIME); + UIScene::handleTouchBoxRebuild(); } void UIScene_CreativeMenu::handleTimerComplete(int id) @@ -326,10 +327,12 @@ void UIScene_CreativeMenu::GetItemScreenData( ESceneSection eSection, int iItemI case eSectionInventoryCreativeSelector: sectionSize.x = m_slotListContainer.getWidth(); sectionSize.y = m_slotListContainer.getHeight(); + FixSlotGridSize(eSection, m_slotListContainer, sectionSize); break; case eSectionInventoryCreativeUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; case eSectionInventoryCreativeTab_0: sectionSize.x = m_TouchInput[ETouchInput_TouchPanel_0].getWidth(); diff --git a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.h b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.h index f4b89777..093d272c 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreativeMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_CreativeMenu.h @@ -29,7 +29,7 @@ protected: ETouchInput_Count, }; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // 4J - TomK - this only needs to be a touch component on vita! UIControl_Touch m_TouchInput[ETouchInput_Count]; #else @@ -74,7 +74,7 @@ public: // INPUT virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); virtual UIControl* GetMainPanel(); virtual void handleTouchBoxRebuild(); diff --git a/Minecraft.Client/Common/UI/UIScene_DLCOffersMenu.cpp b/Minecraft.Client/Common/UI/UIScene_DLCOffersMenu.cpp index cf08371b..69816fe9 100644 --- a/Minecraft.Client/Common/UI/UIScene_DLCOffersMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DLCOffersMenu.cpp @@ -69,7 +69,7 @@ UIScene_DLCOffersMenu::UIScene_DLCOffersMenu(int iPad, void *initData, UILayer * addTimer( PLAYER_ONLINE_TIMER_ID, PLAYER_ONLINE_TIMER_TIME ); #endif -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_DispenserMenu.cpp b/Minecraft.Client/Common/UI/UIScene_DispenserMenu.cpp index e7c9950a..bba24c74 100644 --- a/Minecraft.Client/Common/UI/UIScene_DispenserMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_DispenserMenu.cpp @@ -123,14 +123,17 @@ void UIScene_DispenserMenu::GetItemScreenData( ESceneSection eSection, int iItem case eSectionTrapTrap: sectionSize.x = m_slotListTrap.getWidth(); sectionSize.y = m_slotListTrap.getHeight(); + FixSlotGridSize(eSection, m_slotListTrap, sectionSize); break; case eSectionTrapInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionTrapUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_EULA.cpp b/Minecraft.Client/Common/UI/UIScene_EULA.cpp index 7f5aa9d1..3ba426d3 100644 --- a/Minecraft.Client/Common/UI/UIScene_EULA.cpp +++ b/Minecraft.Client/Common/UI/UIScene_EULA.cpp @@ -81,7 +81,7 @@ UIScene_EULA::UIScene_EULA(int iPad, void *initData, UILayer *parentLayer) : UIS //ui.setFontCachingCalculationBuffer(20000); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp index 598e13d0..803afeaf 100644 --- a/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp @@ -140,14 +140,17 @@ void UIScene_EnchantingMenu::GetItemScreenData( ESceneSection eSection, int iIte case eSectionEnchantSlot: sectionSize.x = m_slotListIngredient.getWidth(); sectionSize.y = m_slotListIngredient.getHeight(); + FixSlotGridSize(eSection, m_slotListIngredient, sectionSize); break; case eSectionEnchantInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionEnchantUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; case eSectionEnchantButton1: sectionSize.x = m_enchantButton[0].getWidth(); diff --git a/Minecraft.Client/Common/UI/UIScene_FireworksMenu.cpp b/Minecraft.Client/Common/UI/UIScene_FireworksMenu.cpp index a3741c93..fa3803fa 100644 --- a/Minecraft.Client/Common/UI/UIScene_FireworksMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_FireworksMenu.cpp @@ -137,18 +137,22 @@ void UIScene_FireworksMenu::GetItemScreenData( ESceneSection eSection, int iItem case eSectionFireworksIngredients: sectionSize.x = m_slotList3x3.getWidth(); sectionSize.y = m_slotList3x3.getHeight(); + FixSlotGridSize(eSection, m_slotList3x3, sectionSize); break; case eSectionFireworksResult: sectionSize.x = m_slotListResult.getWidth(); sectionSize.y = m_slotListResult.getHeight(); + FixSlotGridSize(eSection, m_slotListResult, sectionSize); break; case eSectionFireworksInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionFireworksUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp b/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp index b6d5384d..0c2aace9 100644 --- a/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp +++ b/Minecraft.Client/Common/UI/UIScene_FullscreenProgress.cpp @@ -67,7 +67,7 @@ UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData, thread->Run(); threadStarted = true; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif @@ -200,7 +200,7 @@ void UIScene_FullscreenProgress::tick() m_threadCompleted = true; m_buttonConfirm.setVisible( true ); // 4J-TomK - rebuild touch after confirm button made visible again -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif updateTooltips(); diff --git a/Minecraft.Client/Common/UI/UIScene_FurnaceMenu.cpp b/Minecraft.Client/Common/UI/UIScene_FurnaceMenu.cpp index 9f507a2b..e254c991 100644 --- a/Minecraft.Client/Common/UI/UIScene_FurnaceMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_FurnaceMenu.cpp @@ -161,22 +161,27 @@ void UIScene_FurnaceMenu::GetItemScreenData( ESceneSection eSection, int iItemIn case eSectionFurnaceResult: sectionSize.x = m_slotListResult.getWidth(); sectionSize.y = m_slotListResult.getHeight(); + FixSlotGridSize(eSection, m_slotListResult, sectionSize); break; case eSectionFurnaceFuel: sectionSize.x = m_slotListFuel.getWidth(); sectionSize.y = m_slotListFuel.getHeight(); + FixSlotGridSize(eSection, m_slotListFuel, sectionSize); break; case eSectionFurnaceIngredient: sectionSize.x = m_slotListIngredient.getWidth(); sectionSize.y = m_slotListIngredient.getHeight(); + FixSlotGridSize(eSection, m_slotListIngredient, sectionSize); break; case eSectionFurnaceInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionFurnaceUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_HopperMenu.cpp b/Minecraft.Client/Common/UI/UIScene_HopperMenu.cpp index 377dc2fe..016599cf 100644 --- a/Minecraft.Client/Common/UI/UIScene_HopperMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HopperMenu.cpp @@ -123,14 +123,17 @@ void UIScene_HopperMenu::GetItemScreenData( ESceneSection eSection, int iItemInd case eSectionHopperContents: sectionSize.x = m_slotListTrap.getWidth(); sectionSize.y = m_slotListTrap.getHeight(); + FixSlotGridSize(eSection, m_slotListTrap, sectionSize); break; case eSectionHopperInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionHopperUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_HorseInventoryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_HorseInventoryMenu.cpp index 445116c7..bf3462f4 100644 --- a/Minecraft.Client/Common/UI/UIScene_HorseInventoryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HorseInventoryMenu.cpp @@ -198,14 +198,17 @@ void UIScene_HorseInventoryMenu::GetItemScreenData( ESceneSection eSection, int case eSectionHorseChest: sectionSize.x = m_slotListChest.getWidth(); sectionSize.y = m_slotListChest.getHeight(); + FixSlotGridSize(eSection, m_slotListChest, sectionSize); break; case eSectionHorseInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionHorseUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_HowToPlay.cpp b/Minecraft.Client/Common/UI/UIScene_HowToPlay.cpp index f7f678ab..894925ed 100644 --- a/Minecraft.Client/Common/UI/UIScene_HowToPlay.cpp +++ b/Minecraft.Client/Common/UI/UIScene_HowToPlay.cpp @@ -337,7 +337,7 @@ void UIScene_HowToPlay::StartPage( EHowToPlayPage ePage ) TelemetryManager->RecordMenuShown(m_iPad, eUIScene_HowToPlay, (ETelemetry_HowToPlay_SubMenuId)ePage); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp index 092b7156..3f0da027 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InGameInfoMenu.cpp @@ -57,6 +57,10 @@ UIScene_InGameInfoMenu::UIScene_InGameInfoMenu(int iPad, void *initData, UILayer #if TO_BE_IMPLEMENTED SetTimer(IGNORE_KEYPRESS_TIMERID,IGNORE_KEYPRESS_TIME); #endif + +#if defined(__PSVITA__) || defined(_WINDOWS64) + ui.TouchBoxRebuild(this); +#endif } UIScene_InGameInfoMenu::~UIScene_InGameInfoMenu() @@ -204,6 +208,7 @@ void UIScene_InGameInfoMenu::tick() { UIScene::tick(); + // Update players by index for(DWORD i = 0; i < m_players.size(); ++i) { diff --git a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp index 83e64747..945df4e7 100644 --- a/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InGamePlayerOptionsMenu.cpp @@ -210,7 +210,7 @@ UIScene_InGamePlayerOptionsMenu::UIScene_InGamePlayerOptionsMenu(int iPad, void g_NetworkManager.RegisterPlayerChangedCallback(m_iPad, &UIScene_InGamePlayerOptionsMenu::OnPlayerChanged, this); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_Intro.cpp b/Minecraft.Client/Common/UI/UIScene_Intro.cpp index d677e814..f0f92b5b 100644 --- a/Minecraft.Client/Common/UI/UIScene_Intro.cpp +++ b/Minecraft.Client/Common/UI/UIScene_Intro.cpp @@ -49,7 +49,7 @@ UIScene_Intro::UIScene_Intro(int iPad, void *initData, UILayer *parentLayer) : U IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetIntroPlatform , 3 , value ); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // initialise vita touch controls with ids m_TouchToSkip.init(0); #endif @@ -106,7 +106,7 @@ void UIScene_Intro::handleInput(int iPad, int key, bool repeat, bool pressed, bo } } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIScene_Intro::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) { if(bReleased) diff --git a/Minecraft.Client/Common/UI/UIScene_Intro.h b/Minecraft.Client/Common/UI/UIScene_Intro.h index 5edaf2f5..6c664733 100644 --- a/Minecraft.Client/Common/UI/UIScene_Intro.h +++ b/Minecraft.Client/Common/UI/UIScene_Intro.h @@ -9,11 +9,11 @@ private: bool m_bAnimationEnded; IggyName m_funcSetIntroPlatform; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UIControl_Touch m_TouchToSkip; #endif UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_TouchToSkip, "TouchToSkip" ) #endif UI_MAP_NAME( m_funcSetIntroPlatform, L"SetIntroPlatform") @@ -45,7 +45,7 @@ public: virtual void handleAnimationEnd(); virtual void handleGainFocus(bool navBack); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); #endif diff --git a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp index 7da17876..f7514add 100644 --- a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.cpp @@ -118,6 +118,13 @@ int UIScene_InventoryMenu::getSectionRows(ESceneSection eSection) return rows; } +void UIScene_InventoryMenu::RefreshSlotControls() +{ + m_slotListArmor.UpdateControl(); + m_slotListInventory.UpdateControl(); + m_slotListHotbar.UpdateControl(); +} + void UIScene_InventoryMenu::GetPositionOfSection( ESceneSection eSection, UIVec2D* pPosition ) { switch( eSection ) @@ -149,14 +156,17 @@ void UIScene_InventoryMenu::GetItemScreenData( ESceneSection eSection, int iItem case eSectionInventoryArmor: sectionSize.x = m_slotListArmor.getWidth(); sectionSize.y = m_slotListArmor.getHeight(); + FixSlotGridSize(eSection, m_slotListArmor, sectionSize); break; case eSectionInventoryInventory: sectionSize.x = m_slotListInventory.getWidth(); sectionSize.y = m_slotListInventory.getHeight(); + FixSlotGridSize(eSection, m_slotListInventory, sectionSize); break; case eSectionInventoryUsing: sectionSize.x = m_slotListHotbar.getWidth(); sectionSize.y = m_slotListHotbar.getHeight(); + FixSlotGridSize(eSection, m_slotListHotbar, sectionSize); break; default: assert( false ); diff --git a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.h b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.h index fb0ee77c..4966a127 100644 --- a/Minecraft.Client/Common/UI/UIScene_InventoryMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_InventoryMenu.h @@ -36,6 +36,7 @@ protected: virtual int getSectionColumns(ESceneSection eSection); virtual int getSectionRows(ESceneSection eSection); + virtual void RefreshSlotControls(); virtual void GetPositionOfSection( ESceneSection eSection, UIVec2D* pPosition ); virtual void GetItemScreenData( ESceneSection eSection, int iItemIndex, UIVec2D* pPosition, UIVec2D* pSize ); virtual void handleSectionClick(ESceneSection eSection) {} diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp index 741d446e..6fb39150 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp @@ -1,6 +1,7 @@ -#include "stdafx.h" +#include "stdafx.h" #include "UI.h" #include "UIScene_LaunchMoreOptionsMenu.h" +#include "DirectTextEdit.h" #define GAME_CREATE_ONLINE_TIMER_ID 0 #define GAME_CREATE_ONLINE_TIMER_TIME 100 @@ -131,6 +132,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini // #endif m_tabIndex = m_params->bGenerateOptions ? TAB_WORLD_OPTIONS : TAB_GAME_OPTIONS; + SyncTabVisibility(); // set the default text #ifdef _LARGE_WORLDS @@ -161,7 +163,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini addTimer(GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // initialise vita tab controls with ids m_TouchTabWorld.init(ETouchInput_TabWorld); m_TouchTabGame.init(ETouchInput_TabGame); @@ -170,6 +172,7 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini #endif m_bIgnoreInput = false; + m_iLastPanelSig = 0; } void UIScene_LaunchMoreOptionsMenu::updateTooltips() @@ -211,6 +214,12 @@ void UIScene_LaunchMoreOptionsMenu::tick() { UIScene::tick(); + { + bool bWorld = (m_tabIndex == TAB_WORLD_OPTIONS); + if (m_gameOptions.getVisible() == bWorld) m_gameOptions.setVisible(!bWorld); + if (m_worldOptions.getVisible() != bWorld) m_worldOptions.setVisible(bWorld); + } + bool bMultiplayerAllowed = ProfileManager.IsSignedInLive(m_params->iPad) && ProfileManager.AllowedToPlayMultiplayer(m_params->iPad); if (bMultiplayerAllowed != m_bMultiplayerAllowed) @@ -240,6 +249,143 @@ void UIScene_LaunchMoreOptionsMenu::tick() UpdateOnline(); m_bUpdateOnline = false; } + +#ifdef _WINDOWS64 + { + m_worldOptions.UpdateControl(); + m_gameOptions.UpdateControl(); + int sig = m_worldOptions.getXPos(); + sig = sig * 31 + m_worldOptions.getYPos(); + sig = sig * 31 + m_worldOptions.getWidth(); + sig = sig * 31 + m_worldOptions.getHeight(); + sig = sig * 31 + m_gameOptions.getXPos(); + sig = sig * 31 + m_gameOptions.getYPos(); + sig = sig * 31 + m_gameOptions.getWidth(); + sig = sig * 31 + m_gameOptions.getHeight(); + if (sig != 0 && sig != m_iLastPanelSig) + { + m_iLastPanelSig = sig; + ui.TouchBoxRebuild(this); + } + } + + { + extern int g_iWindowClientW, g_iWindowClientH; + static bool s_bTabLDownPrev = false; + static char s_szTabLog[MAX_PATH]; + static bool s_bTabLogInit = false; + if (!s_bTabLogInit) + { + s_bTabLogInit = true; + s_szTabLog[0] = 0; + char szExe[MAX_PATH]; + DWORD dwExe = GetModuleFileNameA(NULL, szExe, MAX_PATH); + if (dwExe > 0 && dwExe < MAX_PATH) + { + int lastSlash = -1; + for (int i = 0; szExe[i] != 0; ++i) + if (szExe[i] == '\\') lastSlash = i; + if (lastSlash > 0 && lastSlash + 32 < MAX_PATH) + { + int i = 0; + for (; i <= lastSlash; ++i) s_szTabLog[i] = szExe[i]; + const char *tail = "lmo_tabs.log"; + for (int j = 0; tail[j] != 0; ++j, ++i) s_szTabLog[i] = tail[j]; + s_szTabLog[i] = 0; + } + } + if (!s_szTabLog[0]) + { + const char *fb = "lmo_tabs.log"; + int i = 0; + for (; fb[i] != 0; ++i) s_szTabLog[i] = fb[i]; + s_szTabLog[i] = 0; + } + char szCwd[MAX_PATH]; + szCwd[0] = 0; + GetCurrentDirectoryA(MAX_PATH, szCwd); + FILE *phead = fopen(s_szTabLog, "a"); + if (phead) + { + fprintf(phead, "=== MoreOptions tick alive. exe=%s cwd=%s movie=%.0fx%.0f log=%s ===\n", + szExe, szCwd, (float)getMovieWidth(), (float)getMovieHeight(), s_szTabLog); + fclose(phead); + } + } + bool bLDown = InputManager.IsMouseLDown(); + if (bLDown && !s_bTabLDownPrev) + { + float fMovieW = (float)getMovieWidth(); + float fMovieH = (float)getMovieHeight(); + float fx = (float)InputManager.GetMouseX(); + float fy = (float)InputManager.GetMouseY(); + if (fMovieW > 0.0f && fMovieH > 0.0f && g_iWindowClientW > 0 && g_iWindowClientH > 0) + { + fx = fx * (fMovieW / (float)g_iWindowClientW); + fy = fy * (fMovieH / (float)g_iWindowClientH); + } + + m_labelWorldOptions.UpdateControl(); + m_labelGameOptions.UpdateControl(); + + const float pad = 32.0f; + float wx = (float)m_labelWorldOptions.getXPos() - pad; + float wy = (float)m_labelWorldOptions.getYPos() - pad; + float ww = (float)m_labelWorldOptions.getWidth() + pad * 2.0f; + float wh = (float)m_labelWorldOptions.getHeight() + pad * 2.0f; + float gx = (float)m_labelGameOptions.getXPos() - pad; + float gy = (float)m_labelGameOptions.getYPos() - pad; + float gw = (float)m_labelGameOptions.getWidth() + pad * 2.0f; + float gh = (float)m_labelGameOptions.getHeight() + pad * 2.0f; + + bool wHit = (ww > 0.0f && wh > 0.0f && fx >= wx && fx < wx + ww && fy >= wy && fy < wy + wh); + bool gHit = (gw > 0.0f && gh > 0.0f && fx >= gx && fx < gx + gw && fy >= gy && fy < gy + gh); + + int iTab = -1; + if (wHit && !gHit) iTab = TAB_WORLD_OPTIONS; + else if (gHit && !wHit) iTab = TAB_GAME_OPTIONS; + else if (wHit && gHit) + { + float wdx = fx - (wx + ww * 0.5f); + float wdy = fy - (wy + wh * 0.5f); + float gdx = fx - (gx + gw * 0.5f); + float gdy = fy - (gy + gh * 0.5f); + iTab = (wdx * wdx + wdy * wdy <= gdx * gdx + gdy * gdy) ? TAB_WORLD_OPTIONS : TAB_GAME_OPTIONS; + } + + { + char szCwd2[MAX_PATH]; + szCwd2[0] = 0; + GetCurrentDirectoryA(MAX_PATH, szCwd2); + FILE *plog = fopen(s_szTabLog[0] ? s_szTabLog : "lmo_tabs.log", "a"); + if (plog) + { + fprintf(plog, "CLICK raw=%d,%d client=%dx%d movie=%.0fx%.0f pt=%.1f,%.1f curTab=%d\n", + InputManager.GetMouseX(), InputManager.GetMouseY(), + g_iWindowClientW, g_iWindowClientH, fMovieW, fMovieH, fx, fy, m_tabIndex); + fprintf(plog, " LabelWorld x=%d y=%d w=%d h=%d | LabelGame x=%d y=%d w=%d h=%d | wHit=%d gHit=%d iTab=%d cwd=%s\n", + m_labelWorldOptions.getXPos(), m_labelWorldOptions.getYPos(), + m_labelWorldOptions.getWidth(), m_labelWorldOptions.getHeight(), + m_labelGameOptions.getXPos(), m_labelGameOptions.getYPos(), + m_labelGameOptions.getWidth(), m_labelGameOptions.getHeight(), + (int)wHit, (int)gHit, iTab, szCwd2); + fclose(plog); + } + } + + if (iTab != -1 && iTab != m_tabIndex) + { + m_tabIndex = iTab; + updateTooltips(); + IggyDataValue result; + IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcChangeTab, 0, NULL); + SyncTabVisibility(); + ui.TouchBoxRebuild(this); + } + } + s_bTabLDownPrev = bLDown; + } + #endif } void UIScene_LaunchMoreOptionsMenu::handleDestroy() @@ -306,15 +452,16 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat, updateTooltips(); IggyDataValue result; IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , NULL ); + SyncTabVisibility(); } break; } } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) { - if(bPressed) + if(bPressed || bReleased) { switch(iId) { @@ -328,6 +475,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S updateTooltips(); IggyDataValue result; IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , NULL ); + SyncTabVisibility(); } ui.TouchBoxRebuild(this); break; @@ -335,6 +483,7 @@ void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S } } + UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel() { if(m_tabIndex == 0) @@ -342,6 +491,54 @@ UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel() else return &m_gameOptions; } + +#if defined(__PSVITA__) || defined(_WINDOWS64) +bool UIScene_LaunchMoreOptionsMenu::isControlActiveForTouch(UIControl *control) +{ + if (control == &m_TouchTabWorld || control == &m_TouchTabGame) + return true; + + bool bWorld = (m_tabIndex == TAB_WORLD_OPTIONS); + + if (control == &m_labelDescription_GameOptions) + return !bWorld; + { + static const int gameBoxes[] = + { + eLaunchCheckbox_Online, eLaunchCheckbox_InviteOnly, eLaunchCheckbox_AllowFoF, + eLaunchCheckbox_PVP, eLaunchCheckbox_HostPrivileges, eLaunchCheckbox_DayLightCycle, + eLaunchCheckbox_KeepInventory, eLaunchCheckbox_MobSpawning, eLaunchCheckbox_MobGriefing, + eLaunchCheckbox_MobLoot, eLaunchCheckbox_TileDrops, eLaunchCheckbox_NaturalRegeneration + }; + for (int i = 0; i < sizeof(gameBoxes) / sizeof(gameBoxes[0]); ++i) + { + if (control == &m_checkboxes[gameBoxes[i]]) + return !bWorld; + } + } + + if (control == &m_labelDescription_WorldOptions + || control == &m_editSeed + || control == &m_sliderWorldSize + || control == &m_sliderWorldResize) + return bWorld; + { + static const int worldBoxes[] = + { + eLaunchCheckbox_ResetNether, eLaunchCheckbox_Structures, eLaunchCheckbox_FlatWorld, + eLaunchCheckbox_BonusChest, eLaunchCheckbox_DisableSaving, eLaunchCheckbox_WorldResizeType, + eLaunchCheckbox_TrustSystem, eLaunchCheckbox_FireSpreads, eLaunchCheckbox_TNT + }; + for (int i = 0; i < sizeof(worldBoxes) / sizeof(worldBoxes[0]); ++i) + { + if (control == &m_checkboxes[worldBoxes[i]]) + return bWorld; + } + } + + return true; +} +#endif #endif void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool selected) @@ -557,7 +754,10 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); #endif - InputManager.GetText(pchText); +#ifdef _WINDOWS64 + if (!DirectTextEdit::TakeText(pchText, 128)) +#endif + InputManager.GetText(pchText); pClass->m_editSeed.setLabel((wchar_t *)pchText); pClass->m_params->seed = (wchar_t *)pchText; } @@ -572,6 +772,11 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) { case eControl_EditSeed: { +#ifdef _WINDOWS64 + DirectTextEdit::Begin(&m_editSeed, &m_worldOptions, m_editSeed.getLabel(), 60, + C_4JInput::EKeyboardMode_Default, + &UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback, this); +#else m_bIgnoreInput=true; #ifdef __PS3__ int language = XGetLanguage(); @@ -589,6 +794,7 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId) } #else InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default); +#endif #endif } break; @@ -652,4 +858,13 @@ void UIScene_LaunchMoreOptionsMenu::UpdateOnline() m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bOnline); m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(bOnline); -} \ No newline at end of file +} + +void UIScene_LaunchMoreOptionsMenu::SyncTabVisibility() +{ + bool bWorld = (m_tabIndex == TAB_WORLD_OPTIONS); + m_gameOptions.getVisible(); + m_worldOptions.getVisible(); + m_gameOptions.setVisible(!bWorld); + m_worldOptions.setVisible(bWorld); +} diff --git a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h index 23c187b8..6a70190a 100644 --- a/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.h @@ -42,7 +42,7 @@ private: eControl_Count }; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) enum ETouchInput { ETouchInput_TabWorld = eControl_Count, @@ -68,7 +68,7 @@ private: UI_MAP_ELEMENT( m_gameOptions, "GameOptions") UI_BEGIN_MAP_CHILD_ELEMENTS(m_gameOptions) -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_TouchTabGame, "TouchTabGame" ) #endif UI_MAP_ELEMENT( m_labelDescription_GameOptions, "Description_GameOptions") @@ -89,7 +89,7 @@ private: UI_MAP_ELEMENT(m_worldOptions, "WorldOptions") UI_BEGIN_MAP_CHILD_ELEMENTS(m_worldOptions) -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_TouchTabWorld, "TouchTabWorld" ) #endif UI_MAP_ELEMENT( m_labelDescription_WorldOptions, "Description_WorldOptions") @@ -124,6 +124,7 @@ private: bool m_bMultiplayerAllowed; bool m_bIgnoreInput; int m_tabIndex; + int m_iLastPanelSig; // geometry signature for touch-box rebuilds public: UIScene_LaunchMoreOptionsMenu(int iPad, void *initData, UILayer *parentLayer); @@ -157,9 +158,11 @@ private: bool m_bUpdateOnline; // If true, update online settings on next tick void UpdateOnline(); + void SyncTabVisibility(); -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); virtual UIControl* GetMainPanel(); + virtual bool isControlActiveForTouch(UIControl *control); #endif //__PSVITA__ }; diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp index e61f1d1e..25d1dce3 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp @@ -560,6 +560,7 @@ void UIScene_LoadMenu::tick() { slideLeft(); m_texturePackDescDisplayed = true; + handleTouchBoxRebuild(); m_bShowTexturePackDescription = false; } @@ -953,12 +954,13 @@ void UIScene_LoadMenu::handleSliderMove(F64 sliderId, F64 currentValue) void UIScene_LoadMenu::handleTouchBoxRebuild() { m_bRebuildTouchBoxes = true; + UIScene::handleTouchBoxRebuild(); } void UIScene_LoadMenu::handleTimerComplete(int id) { -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // we cannot rebuild touch boxes in an iggy callback because it requires further iggy calls if(m_bRebuildTouchBoxes) { diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 8e863519..fa0389d0 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -1210,6 +1210,15 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr sendInputToMovie(key, repeat, pressed, released); handled = true; break; + case ACTION_MENU_OTHER_STICK_UP: + case ACTION_MENU_OTHER_STICK_DOWN: + if (m_buttonListSaves.hasFocus() || m_buttonListGames.hasFocus()) + { + sendInputToMovie(key == ACTION_MENU_OTHER_STICK_UP ? ACTION_MENU_UP : ACTION_MENU_DOWN, + repeat, pressed, released); + handled = true; + } + break; } } diff --git a/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp b/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp index 22621a23..1b5577b5 100644 --- a/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp +++ b/Minecraft.Client/Common/UI/UIScene_MessageBox.cpp @@ -49,7 +49,7 @@ UIScene_MessageBox::UIScene_MessageBox(int iPad, void *initData, UILayer *parent parentLayer->addComponent(iPad,eUIComponent_MenuBackground); // 4J-TomK - rebuild touch after auto resize -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp b/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp index 0cf7b3d5..f31b2b77 100644 --- a/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp +++ b/Minecraft.Client/Common/UI/UIScene_NewUpdateMessage.cpp @@ -37,7 +37,7 @@ UIScene_NewUpdateMessage::UIScene_NewUpdateMessage(int iPad, void *initData, UIL m_bIgnoreInput=false; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp index ceb92473..6f75b46c 100644 --- a/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_PauseMenu.cpp @@ -109,6 +109,10 @@ UIScene_PauseMenu::UIScene_PauseMenu(int iPad, void *initData, UILayer *parentLa gameMode->getTutorial()->showTutorialPopup(false); } m_bErrorDialogRunning = false; + +#if defined(__PSVITA__) || defined(_WINDOWS64) + ui.TouchBoxRebuild(this); +#endif } UIScene_PauseMenu::~UIScene_PauseMenu() @@ -137,12 +141,11 @@ wstring UIScene_PauseMenu::getMoviePath() { return L"PauseMenu"; } -} - -void UIScene_PauseMenu::tick() +}void UIScene_PauseMenu::tick() { UIScene::tick(); + #ifdef __PSVITA__ // 4J-MGH - Need to check for installed DLC here, as we delay the installation of the key file on Vita if(!app.DLCInstallProcessCompleted()) app.StartInstallDLCProcess(0); diff --git a/Minecraft.Client/Common/UI/UIScene_SaveMessage.cpp b/Minecraft.Client/Common/UI/UIScene_SaveMessage.cpp index fa9cd6c5..aed25458 100644 --- a/Minecraft.Client/Common/UI/UIScene_SaveMessage.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SaveMessage.cpp @@ -37,7 +37,7 @@ UIScene_SaveMessage::UIScene_SaveMessage(int iPad, void *initData, UILayer *pare m_bIgnoreInput=false; // 4J-TomK - rebuild touch after auto resize -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) ui.TouchBoxRebuild(this); #endif } diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsControlMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsControlMenu.cpp index 5739fd36..9dcd6b68 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsControlMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsControlMenu.cpp @@ -62,6 +62,7 @@ void UIScene_SettingsControlMenu::updateComponents() } } + void UIScene_SettingsControlMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled) { ui.AnimateKeyPress(iPad, key, repeat, pressed, released); diff --git a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp index 767921ab..afdf7098 100644 --- a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "UI.h" #include "UIScene_SignEntryMenu.h" +#include "DirectTextEdit.h" #include "..\..\Minecraft.h" #include "..\..\MultiPlayerLocalPlayer.h" #include "..\..\MultiPlayerLevel.h" @@ -149,7 +150,10 @@ int UIScene_SignEntryMenu::KeyboardCompleteCallback(LPVOID lpParam,bool bRes) { uint16_t pchText[128]; ZeroMemory(pchText, 128 * sizeof(uint16_t) ); - InputManager.GetText(pchText); +#ifdef _WINDOWS64 + if (!DirectTextEdit::TakeText(pchText, 128)) +#endif + InputManager.GetText(pchText); pClass->m_textInputLines[pClass->m_iEditingLine].setLabel((wchar_t *)pchText); } return 0; @@ -169,8 +173,14 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) case eControl_Line3: case eControl_Line4: { - m_iEditingLine = (int)controlId; - m_bIgnoreInput = true; + m_iEditingLine = (int)controlId; +#ifdef _WINDOWS64 + DirectTextEdit::Begin(&m_textInputLines[m_iEditingLine], NULL, m_textInputLines[m_iEditingLine].getLabel(), 15, + C_4JInput::EKeyboardMode_Alphabet, + &UIScene_SignEntryMenu::KeyboardCompleteCallback, this); + DirectTextEdit::SetLineNav(&UIScene_SignEntryMenu::DirectTextLineNav, this); +#else + m_bIgnoreInput = true; #ifdef _XBOX_ONE // 4J-PB - Xbox One uses the Windows virtual keyboard, and doesn't have the Xbox 360 Latin keyboard type, so we can't restrict the input set to alphanumeric. The closest we get is the emailSmtpAddress type. int language = XGetLanguage(); @@ -188,9 +198,29 @@ void UIScene_SignEntryMenu::handlePress(F64 controlId, F64 childId) #else InputManager.RequestKeyboard(app.GetString(IDS_SIGN_TITLE),m_textInputLines[m_iEditingLine].getLabel(),(DWORD)m_iPad,15,&UIScene_SignEntryMenu::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Alphabet); #endif - } - break; +#endif } + break; + } +} + +void UIScene_SignEntryMenu::DirectTextLineNav(LPVOID pParam, int iDir) +{ + UIScene_SignEntryMenu *pClass = (UIScene_SignEntryMenu *)pParam; + int line = pClass->m_iEditingLine + iDir; + if (line < 0 || line > 3) + { + if (iDir > 0) + pClass->m_bConfirmed = true; + return; + } + pClass->m_iEditingLine = line; +#ifdef _WINDOWS64 + DirectTextEdit::Begin(&pClass->m_textInputLines[line], NULL, pClass->m_textInputLines[line].getLabel(), 15, + C_4JInput::EKeyboardMode_Alphabet, + &UIScene_SignEntryMenu::KeyboardCompleteCallback, pClass); + DirectTextEdit::SetLineNav(&UIScene_SignEntryMenu::DirectTextLineNav, pClass); +#endif } void UIScene_SignEntryMenu::handleDestroy() diff --git a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h index 490a167f..61c2cec6 100644 --- a/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SignEntryMenu.h @@ -54,5 +54,6 @@ public: protected: void handlePress(F64 controlId, F64 childId); static int KeyboardCompleteCallback(LPVOID lpParam,const bool bRes); + static void DirectTextLineNav(LPVOID pParam, int iDir); virtual void handleDestroy(); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp index fdfbfdf9..d2b43598 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.cpp @@ -54,6 +54,12 @@ UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer m_bAnimatingMove = false; m_bSkinIndexChanged = false; + m_fMouseDragStartX = 0.0f; + m_bMouseDragActive = false; + m_bMouseDragScrolled = false; + m_bMouseLDownPrev = false; + m_iPressedPackTab = 0; + m_currentNavigation = eSkinNavigation_Skin; m_currentPackCount = 0; @@ -77,7 +83,7 @@ UIScene_SkinSelectMenu::UIScene_SkinSelectMenu(int iPad, void *initData, UILayer m_centreLabel = L""; m_rightLabel = L""; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) // initialise vita tab controls with ids m_TouchTabLeft.init(ETouchInput_TabLeft); m_TouchTabRight.init(ETouchInput_TabRight); @@ -165,6 +171,247 @@ void UIScene_SkinSelectMenu::tick() handleSkinIndexChanged(); } +#ifdef _WINDOWS64 + { + m_TouchIggyCharacters.UpdateControl(); + bool bHaveTouch = (m_TouchIggyCharacters.getWidth() >= 4 && m_TouchIggyCharacters.getHeight() >= 4); + + bool bLDown = InputManager.IsMouseLDown(); + static char s_szSkinLog[MAX_PATH]; + static bool s_bSkinLogInit = false; + if (!s_bSkinLogInit) + { + s_bSkinLogInit = true; + s_szSkinLog[0] = 0; + char szExe[MAX_PATH]; + DWORD dwExe = GetModuleFileNameA(NULL, szExe, MAX_PATH); + if (dwExe > 0 && dwExe < MAX_PATH) + { + int lastSlash = -1; + for (int i = 0; szExe[i] != 0; ++i) + if (szExe[i] == '\\') lastSlash = i; + if (lastSlash > 0 && lastSlash + 32 < MAX_PATH) + { + int i = 0; + for (; i <= lastSlash; ++i) s_szSkinLog[i] = szExe[i]; + const char *tail = "skin_drag.log"; + for (int j = 0; tail[j] != 0; ++j, ++i) s_szSkinLog[i] = tail[j]; + s_szSkinLog[i] = 0; + } + } + if (!s_szSkinLog[0]) + { + const char *fb = "skin_drag.log"; + int i = 0; + for (; fb[i] != 0; ++i) s_szSkinLog[i] = fb[i]; + s_szSkinLog[i] = 0; + } + m_probeTabLeft.UpdateControl(); + m_probeTabCenter.UpdateControl(); + m_probeTabRight.UpdateControl(); + FILE *phead = fopen(s_szSkinLog, "a"); + if (phead) + { + fprintf(phead, "=== SkinSelect tick alive. touchClip=%dx%d movie=%.0fx%.0f log=%s ===\n", + m_TouchIggyCharacters.getWidth(), m_TouchIggyCharacters.getHeight(), + (float)getMovieWidth(), (float)getMovieHeight(), s_szSkinLog); + fprintf(phead, " probeLeft x=%d y=%d w=%d h=%d | probeCenter x=%d y=%d w=%d h=%d | probeRight x=%d y=%d w=%d h=%d\n", + m_probeTabLeft.getXPos(), m_probeTabLeft.getYPos(), + m_probeTabLeft.getWidth(), m_probeTabLeft.getHeight(), + m_probeTabCenter.getXPos(), m_probeTabCenter.getYPos(), + m_probeTabCenter.getWidth(), m_probeTabCenter.getHeight(), + m_probeTabRight.getXPos(), m_probeTabRight.getYPos(), + m_probeTabRight.getWidth(), m_probeTabRight.getHeight()); + fclose(phead); + } + } + if (!bHaveTouch) + { + extern int g_iWindowClientW, g_iWindowClientH; + float fMovieW = (float)getMovieWidth(); + float fMovieH = (float)getMovieHeight(); + float fx = (float)InputManager.GetMouseX(); + float fy = (float)InputManager.GetMouseY(); + if (fMovieW > 0.0f && fMovieH > 0.0f && g_iWindowClientW > 0 && g_iWindowClientH > 0) + { + fx = fx * (fMovieW / (float)g_iWindowClientW); + fy = fy * (fMovieH / (float)g_iWindowClientH); + } + + m_controlIggyCharacters.UpdateControl(); + float ox = (float)m_controlIggyCharacters.getXPos(); + float oy = (float)m_controlIggyCharacters.getYPos(); + m_characters[eCharacter_Current].UpdateControl(); + m_characters[eCharacter_Next1].UpdateControl(); + m_characters[eCharacter_Previous1].UpdateControl(); + const float pad = 48.0f; + float x1 = ox + (float)m_characters[eCharacter_Current].getXPos(); + float y1 = oy + (float)m_characters[eCharacter_Current].getYPos(); + float x2 = x1 + (float)m_characters[eCharacter_Current].getWidth(); + float y2 = y1 + (float)m_characters[eCharacter_Current].getHeight(); + const int adj[2] = { eCharacter_Next1, eCharacter_Previous1 }; + for (int i = 0; i < 2; ++i) + { + float ax1 = ox + (float)m_characters[adj[i]].getXPos(); + float ay1 = oy + (float)m_characters[adj[i]].getYPos(); + float ax2 = ax1 + (float)m_characters[adj[i]].getWidth(); + float ay2 = ay1 + (float)m_characters[adj[i]].getHeight(); + if (ax2 <= ax1 || ay2 <= ay1) continue; + if (ax1 < x1) x1 = ax1; + if (ay1 < y1) y1 = ay1; + if (ax2 > x2) x2 = ax2; + if (ay2 > y2) y2 = ay2; + } + bool bValidSurface = (x2 > x1 && y2 > y1); + bool bInside = bValidSurface + && fx >= x1 - pad && fx < x2 + pad + && fy >= y1 - pad && fy < y2 + pad; + + if (bLDown && !m_bMouseLDownPrev) + { + FILE *ppress = fopen(s_szSkinLog[0] ? s_szSkinLog : "skin_drag.log", "a"); + if (ppress) + { + fprintf(ppress, "PRESS pt=%.1f,%.1f surf=%.0f,%.0f-%.0f,%.0f valid=%d inside=%d nav=%d skin=%u touch=%dx%d cont=%d,%d\n", + fx, fy, x1, y1, x2, y2, (int)bValidSurface, (int)bInside, + (int)m_currentNavigation, m_skinIndex, + m_TouchIggyCharacters.getWidth(), m_TouchIggyCharacters.getHeight(), + m_controlIggyCharacters.getXPos(), m_controlIggyCharacters.getYPos()); + fclose(ppress); + } + } + + if (bLDown && !m_bMouseLDownPrev) + { + m_iPressedPackTab = 0; + m_bMouseDragActive = false; + int iTabHit = HitPackTab(fx, fy); + { + FILE *ptab = fopen(s_szSkinLog[0] ? s_szSkinLog : "skin_drag.log", "a"); + if (ptab) + { + fprintf(ptab, "PACKPRESS tab=%d nav=%d pack=%u\n", iTabHit, (int)m_currentNavigation, m_packIndex); + fclose(ptab); + } + } + if (iTabHit != 0) + { + m_iPressedPackTab = iTabHit; + if (m_currentNavigation != eSkinNavigation_Pack) + { + ui.PlayUISFX(eSFX_Scroll); + m_currentNavigation = eSkinNavigation_Pack; + sendInputToMovie(ACTION_MENU_UP, false, true, false); + } + } + else if (bInside) + { + if (m_packIndex == SKIN_SELECT_PACK_FAVORITES + && app.GetPlayerFavoriteSkinsCount(m_iPad) == 0) + { + } + else + { + if (m_currentNavigation != eSkinNavigation_Skin) + { + ui.PlayUISFX(eSFX_Scroll); + m_currentNavigation = eSkinNavigation_Skin; + sendInputToMovie(ACTION_MENU_DOWN, false, true, false); + } + m_fMouseDragStartX = fx; + m_bMouseDragScrolled = false; + m_bMouseDragActive = true; + } + } + } + else if (bLDown && m_bMouseDragActive) + { + if (m_currentNavigation == eSkinNavigation_Skin) + { + if (fx < m_fMouseDragStartX - 50.0f) + { + if (!m_bAnimatingMove && !m_bMouseDragScrolled) + { + ui.PlayUISFX(eSFX_Scroll); + m_skinIndex = getNextSkinIndex(m_skinIndex); + + m_bSlidingSkins = true; + m_bAnimatingMove = true; + + m_characters[eCharacter_Current].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Right, true); + m_characters[eCharacter_Next1].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Forward, true); + + sendInputToMovie(ACTION_MENU_LEFT, false, true, false); + + m_bMouseDragScrolled = true; + } + } + else if (fx > m_fMouseDragStartX + 50.0f) + { + if (!m_bAnimatingMove && !m_bMouseDragScrolled) + { + ui.PlayUISFX(eSFX_Scroll); + + m_skinIndex = getPreviousSkinIndex(m_skinIndex); + + m_bSlidingSkins = true; + m_bAnimatingMove = true; + + m_characters[eCharacter_Current].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Left, true); + m_characters[eCharacter_Previous1].SetFacing(UIControl_PlayerSkinPreview::e_SkinPreviewFacing_Forward, true); + + sendInputToMovie(ACTION_MENU_RIGHT, false, true, false); + + m_bMouseDragScrolled = true; + } + } + } + } + else if (!bLDown && (m_bMouseDragActive || m_iPressedPackTab != 0)) + { + int iTabRel = (m_iPressedPackTab != 0) ? HitPackTab(fx, fy) : 0; + FILE *prel = fopen(s_szSkinLog[0] ? s_szSkinLog : "skin_drag.log", "a"); + if (prel) + { + fprintf(prel, "RELEASE scrolled=%d skin=%u packTab=%d relTab=%d pack=%u\n", + (int)m_bMouseDragScrolled, m_skinIndex, m_iPressedPackTab, iTabRel, m_packIndex); + fclose(prel); + } + if (m_iPressedPackTab != 0 && iTabRel == m_iPressedPackTab) + { + if (m_currentNavigation == eSkinNavigation_Pack + && (m_iPressedPackTab == 1 || m_iPressedPackTab == 3)) + { + ui.PlayUISFX(eSFX_Scroll); + DWORD startingIndex = m_packIndex; + if (m_iPressedPackTab == 1) + m_packIndex = getPreviousPackIndex(m_packIndex); + else + m_packIndex = getNextPackIndex(m_packIndex); + if (startingIndex != m_packIndex) + { + handlePackIndexChanged(); + } + } + } + if (m_bMouseDragActive && !m_bMouseDragScrolled) + { + if (HitSkinPreview(fx, fy) != -1) + InputActionOK(m_iPad); + } + m_bMouseDragActive = false; + m_iPressedPackTab = 0; + } + } + else + { + m_bMouseDragActive = false; + m_iPressedPackTab = 0; + } + m_bMouseLDownPrev = bLDown; + } + #endif + // check for new DLC installed // check for the patch error dialog @@ -184,6 +431,80 @@ void UIScene_SkinSelectMenu::tick() #endif } +int UIScene_SkinSelectMenu::HitPackTab(float fx, float fy) +{ + m_probeTabLeft.UpdateControl(); + m_probeTabCenter.UpdateControl(); + m_probeTabRight.UpdateControl(); + const float tpad = 12.0f; + UIControl *tabs[3] = { &m_probeTabLeft, &m_probeTabCenter, &m_probeTabRight }; + + bool probesValid = false; + float tabsX[3], tabsY[3], tabsW[3], tabsH[3]; + for (int ti = 0; ti < 3; ++ti) + { + float tw = (float)tabs[ti]->getWidth(); + float th = (float)tabs[ti]->getHeight(); + if (tw >= 4.0f && th >= 4.0f) + { + probesValid = true; + tabsX[ti] = (float)tabs[ti]->getXPos() - tpad; + tabsY[ti] = (float)tabs[ti]->getYPos() - tpad; + tabsW[ti] = tw + tpad * 2.0f; + tabsH[ti] = th + tpad * 2.0f; + } + } + + if (probesValid) + { + for (int ti = 0; ti < 3; ++ti) + { + if (fx >= tabsX[ti] && fx < tabsX[ti] + tabsW[ti] && fy >= tabsY[ti] && fy < tabsY[ti] + tabsH[ti]) + return ti + 1; + } + } + else + { + float movieH = (float)getMovieHeight(); + float tabHeight = movieH * 0.15f; + float tabWidth = (float)getMovieWidth() * 0.33f; + float t = 8.0f; + + for (int ti = 0; ti < 3; ++ti) + { + float tx = (float)getMovieWidth() * (ti * 0.33f); + float ty = 0.0f; + if (fx >= tx && fx < tx + tabWidth + t * 2.0f && fy >= ty && fy < ty + tabHeight + t * 2.0f) + return ti + 1; + } + } + + return 0; +} + +int UIScene_SkinSelectMenu::HitSkinPreview(float fx, float fy) +{ + m_controlIggyCharacters.UpdateControl(); + m_characters[eCharacter_Current].UpdateControl(); + m_characters[eCharacter_Next1].UpdateControl(); + m_characters[eCharacter_Previous1].UpdateControl(); + float ox = (float)m_controlIggyCharacters.getXPos(); + float oy = (float)m_controlIggyCharacters.getYPos(); + const int ids[3] = { eCharacter_Previous1, eCharacter_Current, eCharacter_Next1 }; + for (int k = 0; k < 3; ++k) + { + int id = ids[k]; + float w = (float)m_characters[id].getWidth(); + float h = (float)m_characters[id].getHeight(); + if (w < 4.0f || h < 4.0f) continue; + float x = ox + (float)m_characters[id].getXPos(); + float y = oy + (float)m_characters[id].getYPos(); + if (fx >= x && fx < x + w && fy >= y && fy < y + h) + return id; + } + return -1; +} + void UIScene_SkinSelectMenu::handleAnimationEnd() { if(m_bSlidingSkins) @@ -1300,7 +1621,7 @@ void UIScene_SkinSelectMenu::setRightLabel(const wstring &label) } } -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) void UIScene_SkinSelectMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased) { if(bPressed) diff --git a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h index 3d19d2a2..5ecee6cd 100644 --- a/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SkinSelectMenu.h @@ -11,7 +11,7 @@ private: // 4J Stu - How many to show on each side of the main control static const BYTE sidePreviewControls = 4; -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) enum ETouchInput { ETouchInput_TabLeft = 10, @@ -50,18 +50,22 @@ private: UIControl_Label m_labelSkinName, m_labelSkinOrigin; UIControl_Label m_labelSelected; UIControl m_controlSkinNamePlate, m_controlSelectedPanel, m_controlIggyCharacters, m_controlTimer; -#ifdef __PSVITA__ + UIControl m_probeTabLeft, m_probeTabCenter, m_probeTabRight; +#if defined(__PSVITA__) || defined(_WINDOWS64) UIControl_Touch m_TouchTabLeft, m_TouchTabRight, m_TouchTabCenter, m_TouchIggyCharacters; #endif IggyName m_funcSetPlayerCharacterSelected, m_funcSetCharacterLocked; IggyName m_funcSetLeftLabel, m_funcSetRightLabel, m_funcSetCentreLabel; UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) -#ifdef __PSVITA__ +#if defined(__PSVITA__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_TouchTabLeft, "TouchTabLeft" ) UI_MAP_ELEMENT( m_TouchTabRight, "TouchTabRight" ) UI_MAP_ELEMENT( m_TouchTabCenter, "TouchTabCenter" ) UI_MAP_ELEMENT( m_TouchIggyCharacters, "TouchIggyCharacters" ) #endif + UI_MAP_ELEMENT( m_probeTabLeft, "Left" ) + UI_MAP_ELEMENT( m_probeTabCenter, "Center" ) + UI_MAP_ELEMENT( m_probeTabRight, "Right" ) UI_MAP_ELEMENT( m_controlSkinNamePlate, "SkinNamePlate") UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlSkinNamePlate ) UI_MAP_ELEMENT( m_labelSkinName, "SkinTitle1") @@ -116,6 +120,9 @@ private: S32 m_iTouchXStart; bool m_bTouchScrolled; + float m_fMouseDragStartX; + bool m_bMouseDragActive, m_bMouseDragScrolled, m_bMouseLDownPrev; + int m_iPressedPackTab; public: UIScene_SkinSelectMenu(int iPad, void *initData, UILayer *parentLayer); #ifdef __PSVITA__ @@ -174,7 +181,9 @@ private: void AddFavoriteSkin(int iPad,int iSkinID); void InputActionOK(unsigned int iPad); -#ifdef __PSVITA__ + int HitPackTab(float fx, float fy); + int HitSkinPreview(float fx, float fy); +#if defined(__PSVITA__) || defined(_WINDOWS64) virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); #endif //__PSVITA__ virtual void handleReload(); diff --git a/Minecraft.Client/PS3Media/Sound/Minecraft.msscmp b/Minecraft.Client/Durango/Sound/Minecraft.msscmp similarity index 100% rename from Minecraft.Client/PS3Media/Sound/Minecraft.msscmp rename to Minecraft.Client/Durango/Sound/Minecraft.msscmp diff --git a/Minecraft.Client/Input.cpp b/Minecraft.Client/Input.cpp index 1e3e0637..eabba364 100644 --- a/Minecraft.Client/Input.cpp +++ b/Minecraft.Client/Input.cpp @@ -40,6 +40,17 @@ void Input::tick(LocalPlayer *player) else ya = 0.0f; +#ifdef _WINDOWS64 + if (InputManager.IsMouseCaptured()) + { + if (InputManager.IsKeyDown('A')) xa = 1.0f; + else if (InputManager.IsKeyDown('D')) xa = -1.0f; + + if (InputManager.IsKeyDown('W')) ya = 1.0f; + else if (InputManager.IsKeyDown('S')) ya = -1.0f; + } +#endif + #ifndef _CONTENT_PACKAGE if (app.GetFreezePlayers()) { @@ -99,8 +110,25 @@ void Input::tick(LocalPlayer *player) } tx = ty = 0.0f; } - player->interpolateTurn(tx * abs(tx) * turnSpeed, ty * abs(ty) * turnSpeed); - + + float turnX = tx * abs(tx) * turnSpeed; + float turnY = ty * abs(ty) * turnSpeed; + +#ifdef _WINDOWS64 + if (InputManager.IsMouseCaptured()) + { + float mouseSensitivity = ((float)app.GetGameSettings(iPad,eGameSetting_Sensitivity_InGame)) / 100.0f; + float mx = (float)InputManager.GetRawMouseX() * (mouseSensitivity * 5.0f); + float my = -(float)InputManager.GetRawMouseY() * (mouseSensitivity * 5.0f); + if ( app.GetGameSettings(iPad,eGameSetting_ControlInvertLook) ) + my = -my; + + turnX += mx; + turnY += my; + } +#endif + player->interpolateTurn(turnX, turnY); + //jumping = controller.isButtonPressed(0); @@ -110,6 +138,16 @@ void Input::tick(LocalPlayer *player) else jumping = false; +#ifdef _WINDOWS64 + if (InputManager.IsMouseCaptured()) + { + if (InputManager.IsKeyDown(VK_SPACE)) jumping = true; + if (InputManager.IsKeyDown(VK_SHIFT)) sneaking = true; + else sneaking = false; + sprinting = InputManager.IsKeyDown(VK_CONTROL); + } +#endif + #ifndef _CONTENT_PACKAGE if (app.GetFreezePlayers()) jumping = false; #endif diff --git a/Minecraft.Client/Input.h b/Minecraft.Client/Input.h index eb3487e9..3ca56024 100644 --- a/Minecraft.Client/Input.h +++ b/Minecraft.Client/Input.h @@ -10,6 +10,7 @@ public: bool wasJumping; bool jumping; bool sneaking; + bool sprinting; Input(); // 4J - added diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index a7f1356d..39b8d75b 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -282,7 +282,13 @@ void LocalPlayer::aiStep() // 4J - altered this slightly to make sure that the joypad returns to below returnTreshold in between registering two movements up to runThreshold if (onGround && !isSprinting() && enoughFoodToSprint && !isUsingItem() && !hasEffect(MobEffect::blindness)) { - if( !wasRunning && input->ya >= runTreshold ) + if (input->sprinting && input->ya >= runTreshold) + { + setSprinting(true); + sprintTriggerTime = 0; + sprintTriggerRegisteredReturn = false; + } + else if( !wasRunning && input->ya >= runTreshold ) { if (sprintTriggerTime == 0) { diff --git a/Minecraft.Client/Minecraft.Client.vcxproj b/Minecraft.Client/Minecraft.Client.vcxproj index 46a1b866..bb7e6f77 100644 --- a/Minecraft.Client/Minecraft.Client.vcxproj +++ b/Minecraft.Client/Minecraft.Client.vcxproj @@ -482,7 +482,6 @@ $(SCE_PSP2_SDK_DIR)/target\src\npToolkit\include;$(ProjectDir)..\Minecraft.Client\PSVita\Assert;$(ProjectDir);$(ProjectDir)..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\PSVita\PSVitaExtras - $(OutDir) true $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) @@ -502,7 +501,6 @@ - $(OutDir) false $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) @@ -594,25 +592,21 @@ $(ProjectDir)..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\PSVita\PSVitaExtras - $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) - $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) - $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) - $(OutDir) false $(OutDir)default$(TargetExt) $(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\Windows64\Sentient\Include;$(IncludePath) @@ -938,7 +932,7 @@ true $(OutDir)$(ProjectName).pdb - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) NotSet false @@ -1038,7 +1032,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)$(ProjectName).pch MultiThreaded - _LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions) + __DISABLE_MILES__;_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions) Disabled Windows64\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories) true @@ -1050,7 +1044,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU true $(OutDir)$(ProjectName).pdb - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) NotSet false @@ -1747,7 +1741,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)default.pdb true - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) false @@ -1791,7 +1785,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)default.pdb true - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) xapilib.lib false false @@ -1830,7 +1824,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CU true $(OutDir)$(ProjectName).pdb - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) NotSet false @@ -1871,7 +1865,7 @@ xcopy /q /y /i /s /e $(ProjectDir)DurangoMedia\CU $(LayoutDir)Image\Loose\CUfalse $(OutDir)default.pdb true - d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib;%(AdditionalDependencies) + d3d11.lib;..\Minecraft.World\x64_$(Configuration)\Minecraft.World.lib;XInput9_1_0.lib;Windows64\Iggy\lib\iggy_w64.lib;%(AdditionalDependencies) xapilib.lib false false @@ -4491,13 +4485,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true - true - true - true - true + false + false + false + false true - true - true + false + false true true true @@ -21648,13 +21642,13 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true - true - true - true - true + false + false + false + false true - true - true + false + false true true true @@ -34401,6 +34395,12 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true + true + true + true + true + true + true true @@ -34439,6 +34439,12 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true + true + true + true + true + true + true true @@ -34477,6 +34483,12 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true + true + true + true + true + true + true true @@ -34515,6 +34527,12 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true + true + true + true + true + true + true true @@ -34553,6 +34571,12 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true + true + true + true + true + true + true true @@ -34642,6 +34666,12 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CUtrue true true + true + true + true + true + true + true true diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 35261db8..ee4b2270 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -90,6 +90,10 @@ int Minecraft::frameTimePos = 0; __int64 Minecraft::warezTime = 0; File Minecraft::workDir = File(L""); +#ifdef _WINDOWS64 +static bool s_bHotbarKeyPrev[9] = {false,false,false,false,false,false,false,false,false}; +#endif + #ifdef __PSVITA__ TOUCHSCREENRECT QuickSelectRect[3]= @@ -501,6 +505,13 @@ void Minecraft::setScreen(Screen *screen) this->screen->removed(); } +#ifdef _WINDOWS64 + if (screen != nullptr && InputManager.IsMouseCaptured()) + { + InputManager.SetMouseCaptured(false); + } +#endif + //4J Gordon: Do not force a stats save here /*if (dynamic_cast(screen)!=NULL) { @@ -2184,8 +2195,39 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } } +#ifdef _WINDOWS64 + if (iPad == ProfileManager.GetPrimaryPad()) + { + if ((screen != nullptr || ui.GetMenuDisplayed(iPad)) && InputManager.IsMouseCaptured()) + { + InputManager.SetMouseCaptured(false); + } + if (screen == nullptr && ui.GetMenuDisplayed(iPad)) + { + if ((ui.IsContainerMenuDisplayed(iPad) && !ui.IsCraftingMenuDisplayed(iPad)) +#ifdef _WINDOWS64 + || ui.IsControllerMode() +#endif + ) + { + while (ShowCursor(FALSE) >= 0) {} + } + else + { + while (ShowCursor(TRUE) < 0) {} + } + } + } +#endif + if (screen == NULL && !ui.GetMenuDisplayed(iPad) ) { +#ifdef _WINDOWS64 + if (iPad == ProfileManager.GetPrimaryPad() && !InputManager.IsMouseCaptured() /*&& InputManager.IsWindowFocused()*/) + { + InputManager.SetMouseCaptured(true); + } +#endif // 4J-PB - add some tooltips if required int iA=-1, iB=-1, iX, iY=IDS_CONTROLS_INVENTORY, iLT=-1, iRT=-1, iLB=-1, iRB=-1, iLS=-1, iRS=-1; @@ -3338,9 +3380,25 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) { wheel = -1; } + extern int g_iPendingHotbarScroll; + int iNotchCount = 0; + if (g_iPendingHotbarScroll > 0 && gameMode->isInputAllowed(MINECRAFT_ACTION_LEFT_SCROLL)) + { + wheel = 1; + iNotchCount = g_iPendingHotbarScroll; + } + else if (g_iPendingHotbarScroll < 0 && gameMode->isInputAllowed(MINECRAFT_ACTION_RIGHT_SCROLL)) + { + wheel = -1; + iNotchCount = -g_iPendingHotbarScroll; + } + g_iPendingHotbarScroll = 0; if (wheel != 0) { - player->inventory->swapPaint(wheel); + if (iNotchCount < 1) iNotchCount = 1; + else if (iNotchCount > 12) iNotchCount = 12; + for (int iNotch = 0; iNotch < iNotchCount; ++iNotch) + player->inventory->swapPaint(wheel); if( gameMode != NULL && gameMode->getTutorial() != NULL ) { @@ -3356,7 +3414,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if (wheel > 0) wheel = 1; if (wheel < 0) wheel = -1; - options->flySpeed += wheel * .25f; + options->flySpeed += wheel * .25f * (float)iNotchCount; } } @@ -3580,6 +3638,27 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) __uint64 ullButtonsPressed=player->ullButtonsPressed; bool selected = false; +#ifdef _WINDOWS64 + if (iPad == ProfileManager.GetPrimaryPad()) + { + for (int iSlot = 0; iSlot < 9; iSlot++) + { + if (InputManager.IsKeyDown('1' + iSlot) && !s_bHotbarKeyPrev[iSlot]) + { + player->inventory->selected = iSlot; + selected = true; + + if( gameMode != NULL && gameMode->getTutorial() != NULL ) + { + gameMode->getTutorial()->onSelectedItemChanged(player->inventory->getSelected()); + } + + player->updateRichPresence(); + } + s_bHotbarKeyPrev[iSlot] = InputManager.IsKeyDown('1' + iSlot); + } + } +#endif #ifdef __PSVITA__ // 4J-PB - use the touchscreen for quickselect SceTouchData* pTouchData = InputManager.GetTouchPadData(iPad,false); diff --git a/Minecraft.Client/OrbisMedia/Sound/Minecraft.msscmp b/Minecraft.Client/Orbis/Sound/Minecraft.msscmp similarity index 100% rename from Minecraft.Client/OrbisMedia/Sound/Minecraft.msscmp rename to Minecraft.Client/Orbis/Sound/Minecraft.msscmp diff --git a/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp b/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp index 4c5dd09d..c2f74e53 100644 --- a/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp +++ b/Minecraft.Client/PS3/Leaderboards/PS3LeaderboardManager.cpp @@ -53,16 +53,16 @@ HRESULT PS3LeaderboardManager::destroyTransactionContext(int transactionContext) return sceNpScoreDestroyTransactionCtx(transactionContext); } -HRESULT PS3LeaderboardManager::getFriendsList(const SceNpId &myNpId, SceNpId* &npIds, uint32_t &len) -{ - EFilterMode filterMode = m_eFilterMode; - m_eFilterMode = eFM_Friends; - - HRESULT ret = fillByIdsQuery(myNpId, npIds, len); - - m_eFilterMode = filterMode; - - return ret; +HRESULT PS3LeaderboardManager::getFriendsList(const SceNpId &myNpId, SceNpId* &npIds, uint32_t &len) +{ + EFilterMode filterMode = m_eFilterMode; + m_eFilterMode = eFM_Friends; + + HRESULT ret = fillByIdsQuery(myNpId, npIds, len); + + m_eFilterMode = filterMode; + + return ret; } char *PS3LeaderboardManager::getComment(SceNpScoreComment *comment) diff --git a/Minecraft.Client/PS3/Sound/Minecraft.msscmp b/Minecraft.Client/PS3/Sound/Minecraft.msscmp new file mode 100644 index 00000000..860c42cc Binary files /dev/null and b/Minecraft.Client/PS3/Sound/Minecraft.msscmp differ diff --git a/Minecraft.Client/PSVitaMedia/Sound/Minecraft.msscmp b/Minecraft.Client/PSVita/Sound/Minecraft.msscmp similarity index 100% rename from Minecraft.Client/PSVitaMedia/Sound/Minecraft.msscmp rename to Minecraft.Client/PSVita/Sound/Minecraft.msscmp diff --git a/Minecraft.Client/Windows64/4JLibs b/Minecraft.Client/Windows64/4JLibs index f549c757..b6088fd0 160000 --- a/Minecraft.Client/Windows64/4JLibs +++ b/Minecraft.Client/Windows64/4JLibs @@ -1 +1 @@ -Subproject commit f549c757b925bf0ff5bda9be506e643dceea3f13 +Subproject commit b6088fd07987dfda540dc4431f459a8d47b4c199 diff --git a/Minecraft.Client/Windows64Media/Sound/Minecraft.msscmp b/Minecraft.Client/Windows64/Sound/Minecraft.msscmp similarity index 84% rename from Minecraft.Client/Windows64Media/Sound/Minecraft.msscmp rename to Minecraft.Client/Windows64/Sound/Minecraft.msscmp index ba22b635..0d0df508 100644 Binary files a/Minecraft.Client/Windows64Media/Sound/Minecraft.msscmp and b/Minecraft.Client/Windows64/Sound/Minecraft.msscmp differ diff --git a/Minecraft.Client/Windows64/Windows64_App.h b/Minecraft.Client/Windows64/Windows64_App.h index 6302e7f2..745bfb3b 100644 --- a/Minecraft.Client/Windows64/Windows64_App.h +++ b/Minecraft.Client/Windows64/Windows64_App.h @@ -34,3 +34,4 @@ public: }; extern CConsoleMinecraftApp app; +extern HWND g_hWnd; \ No newline at end of file diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index e952391b..7b7fee49 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -39,7 +39,12 @@ #include "Windows64_Minecraft.h" #include "Xbox/resource.h" +#include +#include "..\Common\UI\DirectTextEdit.h" +#include "..\Common\UI\UIControl_TextInput.h" +#include "..\Common\UI\UIScene.h" +BOOL g_bResolutionSetByCMD = FALSE; HINSTANCE hMyInst; LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam); char chGlobalText[256]; @@ -76,10 +81,53 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]= //------------------------------------------------------------------------------------- BOOL g_bWidescreen = TRUE; -BOOL g_bResolutionSetByCMD = FALSE; -int g_iScreenWidth = 1920; -int g_iScreenHeight = 1080; +int g_iScreenWidth = 1280; +int g_iScreenHeight = 720; + +int g_iWindowClientW = 1280; +int g_iWindowClientH = 720; + +static bool s_bEscapeKeyPrev = false; +static bool s_bMenuMouseLPrev = false; +static bool s_bMenuMouseRPrev = false; +static int s_iWheelCarry = 0; + +static void TickMenuNavKeys(int iPad, bool bMenuOpen) +{ + struct NavKey { int vk; int altVk; unsigned int action; bool repeat; bool prev; }; + static NavKey s_keys[] = + { + { 'W', VK_UP, ACTION_MENU_UP, true, false }, + { 'S', VK_DOWN, ACTION_MENU_DOWN, true, false }, + { 'A', VK_LEFT, ACTION_MENU_LEFT, true, false }, + { 'D', VK_RIGHT, ACTION_MENU_RIGHT, true, false }, + { 'F', VK_RETURN, ACTION_MENU_OK, false, false }, + { 'Q', 0, ACTION_MENU_LEFT_SCROLL, false, false }, + { 'E', 0, ACTION_MENU_RIGHT_SCROLL, false, false }, + }; + bool bActive = bMenuOpen && !DirectTextEdit::IsActive(); + for (int i = 0; i < sizeof(s_keys) / sizeof(s_keys[0]); ++i) + { + NavKey &k = s_keys[i]; + bool down = InputManager.IsKeyDown(k.vk) || (k.altVk != 0 && InputManager.IsKeyDown(k.altVk)); + if (bActive) + { + unsigned int button = InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), k.action); + if (k.repeat) + { + if (down) + InputManager.MapTouchInput(iPad, button); + } + else if (down && !k.prev) + { + InputManager.MapTouchInput(iPad, button); + } + } + k.prev = down; + } +} +int g_iPendingHotbarScroll = 0; void DefineActions(void) { @@ -360,6 +408,94 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) pMinecraft->soundEngine->playMusicTick(); } break; + + case WM_KEYDOWN: + case WM_SYSKEYDOWN: + if (!(lParam & 0x40000000)) + { + InputManager.OnKeyDown((int)wParam); + } + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_KEYUP: + case WM_SYSKEYUP: + InputManager.OnKeyUp((int)wParam); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_CHAR: + InputManager.OnChar((wchar_t)wParam); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_INPUT: + { + UINT dwSize = 0; + GetRawInputData((HRAWINPUT)lParam, RID_INPUT, nullptr, &dwSize, sizeof(RAWINPUTHEADER)); + if (dwSize > 0 && dwSize <= 256) + { + BYTE rawBuffer[256]; + if (GetRawInputData((HRAWINPUT)lParam, RID_INPUT, rawBuffer, &dwSize, sizeof(RAWINPUTHEADER)) == dwSize) + { + const RAWINPUT* raw = (RAWINPUT*)rawBuffer; + if (raw->header.dwType == RIM_TYPEMOUSE) + { + InputManager.OnRawMouseDelta(raw->data.mouse.lLastX, raw->data.mouse.lLastY); + } + } + } + } + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_SIZE: + g_iWindowClientW = LOWORD(lParam); + g_iWindowClientH = HIWORD(lParam); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_MOUSEMOVE: + InputManager.OnMouseMove(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_LBUTTONDOWN: + InputManager.OnLButtonDown(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_LBUTTONUP: + InputManager.OnLButtonUp(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_RBUTTONDOWN: + InputManager.OnRButtonDown(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_RBUTTONUP: + InputManager.OnRButtonUp(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_MBUTTONDOWN: + InputManager.OnMButtonDown(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_MBUTTONUP: + InputManager.OnMButtonUp(LOWORD(lParam), HIWORD(lParam)); + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_MOUSEWHEEL: + { + POINT pt = { (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam) }; + ScreenToClient(hWnd, &pt); + InputManager.OnMouseWheel((short)HIWORD(wParam), pt.x, pt.y); + } + return DefWindowProc(hWnd, message, wParam, lParam); + + case WM_KILLFOCUS: + InputManager.SetWindowFocused(false); + if (InputManager.IsMouseCaptured()) + InputManager.SetMouseCaptured(false); + break; + + case WM_SETFOCUS: + InputManager.SetWindowFocused(true); + break; + case WM_DESTROY: PostQuitMessage(0); break; @@ -432,6 +568,13 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) ShowWindow(g_hWnd, (nCmdShow != SW_HIDE) ? SW_SHOWMAXIMIZED : nCmdShow); UpdateWindow(g_hWnd); + RECT rcClient; + if (GetClientRect(g_hWnd, &rcClient)) + { + g_iWindowClientW = rcClient.right - rcClient.left; + g_iWindowClientH = rcClient.bottom - rcClient.top; + } + return TRUE; } @@ -483,6 +626,492 @@ LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam) return FALSE; } +namespace DirectTextEdit +{ + static UIControl_TextInput *s_ctrl = NULL; + static UIControl *s_parent = NULL; + static bool s_mousePrev = false; + static LineNavCallback s_navCb = NULL; + static LPVOID s_navParam = NULL; + static CommitCallback s_callback = NULL; + static LPVOID s_param = NULL; + static wstring s_text; + static wstring s_initial; + static size_t s_caret = 0; + static bool s_selAll = false; + static unsigned int s_maxChars = 0; + static int s_keyMode = 0; + static vector > s_undo; + static wstring s_clipboard; + static bool s_keyPrev[256] = { false }; + static int s_repKey = 0; + static int s_repDelay = 0; + + static bool s_commitReady = false; + static wstring s_commitText; + + enum { UNDO_CAP = 64, REPEAT_DELAY_FRAMES = 24, REPEAT_RATE_FRAMES = 2 }; + + static void PushUndo() + { + if (s_undo.size() >= UNDO_CAP) + s_undo.erase(s_undo.begin()); + s_undo.push_back(make_pair(s_text, s_caret)); + } + + static bool CharAllowed(wchar_t ch) + { + if (ch < 0x20 || ch == 0x7F) + return false; + if (s_keyMode == C_4JInput::EKeyboardMode_Numeric) + return (ch >= L'0' && ch <= L'9') || ch == L'-' || ch == L'+'; + return true; + } + + static void PushToFlash() + { + if (!s_ctrl) + return; + s_ctrl->setLabel(s_text.c_str()); + s_ctrl->SyncCaret((int)s_caret, (int)s_text.length()); + } + + static void InsertText(const wstring &ins) + { + if (ins.empty() || !s_ctrl) + return; + wstring filtered; + for (size_t i = 0; i < ins.length(); ++i) + if (CharAllowed(ins[i])) + filtered += ins[i]; + if (filtered.empty()) + return; + PushUndo(); + if (s_selAll) + { + s_text.clear(); + s_caret = 0; + s_selAll = false; + } + if (s_text.length() + filtered.length() > s_maxChars) + filtered.erase(s_maxChars > s_text.length() ? s_maxChars - s_text.length() : 0); + s_text.insert(s_caret, filtered); + s_caret += filtered.length(); + PushToFlash(); + } + + static void ActBackspace() + { + if (!s_ctrl) + return; + if (s_selAll) + { + s_selAll = false; + if (s_text.empty()) + return; + PushUndo(); + s_text.clear(); + s_caret = 0; + PushToFlash(); + return; + } + if (s_caret == 0) + return; + PushUndo(); + s_text.erase(s_caret - 1, 1); + --s_caret; + PushToFlash(); + } + + static void ActDelete() + { + if (!s_ctrl) + return; + if (s_selAll) + { + s_selAll = false; + if (s_text.empty()) + return; + PushUndo(); + s_text.clear(); + s_caret = 0; + PushToFlash(); + return; + } + if (s_caret >= s_text.length()) + return; + PushUndo(); + s_text.erase(s_caret, 1); + PushToFlash(); + } + + static void ActLeft() + { + if (!s_ctrl || s_caret == 0) + { + s_selAll = false; + return; + } + s_selAll = false; + --s_caret; + PushToFlash(); + } + + static void ActRight() + { + if (!s_ctrl) + return; + s_selAll = false; + if (s_caret < s_text.length()) + { + ++s_caret; + PushToFlash(); + } + } + + static void ActHome() + { + if (!s_ctrl) + return; + s_selAll = false; + if (s_caret != 0) + { + s_caret = 0; + PushToFlash(); + } + } + + static void ActEnd() + { + if (!s_ctrl) + return; + s_selAll = false; + if (s_caret != s_text.length()) + { + s_caret = s_text.length(); + PushToFlash(); + } + } + + static void CopyToClipboard(const wstring &s) + { + s_clipboard = s; + InputManager.SetClipboardText(s.c_str()); + } + + static bool ClipboardText(wstring &out) + { + wchar_t buf[512]; + int n = InputManager.GetClipboardText(buf, 512); + if (n > 0) + { + out.assign(buf, n); + return true; + } + if (!s_clipboard.empty()) + { + out = s_clipboard; + return true; + } + return false; + } + + static bool FreshPress(int vk) + { + return vk >= 0 && vk < 256 && InputManager.IsKeyDown(vk) && !s_keyPrev[vk]; + } + + static void PollRepeatKey(int vk, void (*action)()) + { + bool down = InputManager.IsKeyDown(vk); + if (down && !s_keyPrev[vk]) + { + action(); + s_repKey = vk; + s_repDelay = REPEAT_DELAY_FRAMES; + } + else if (down && s_repKey == vk) + { + if (--s_repDelay <= 0) + { + action(); + s_repDelay = REPEAT_RATE_FRAMES; + } + } + else if (!down && s_repKey == vk) + { + s_repKey = 0; + } + } + + static bool ClickOutsideBox() + { + if (!s_ctrl) + return false; + UIScene *scene = s_ctrl->getParentScene(); + if (!scene) + return false; + float movieW = (float)scene->getMovieWidth(); + float movieH = (float)scene->getMovieHeight(); + float fx = (float)InputManager.GetMouseX(); + float fy = (float)InputManager.GetMouseY(); + if (movieW > 0.0f && movieH > 0.0f && g_iWindowClientW > 0 && g_iWindowClientH > 0) + { + fx = fx * (movieW / (float)g_iWindowClientW); + fy = fy * (movieH / (float)g_iWindowClientH); + } + float ox = 0.0f, oy = 0.0f; + if (s_parent) + { + s_parent->UpdateControl(); + ox = (float)s_parent->getXPos(); + oy = (float)s_parent->getYPos(); + } + s_ctrl->UpdateControl(); + float w = (float)s_ctrl->getWidth(); + float h = (float)s_ctrl->getHeight(); + if (w < 4.0f || h < 4.0f) + return false; + float x = ox + (float)s_ctrl->getXPos(); + float y = oy + (float)s_ctrl->getYPos(); + return fx < x || fx >= x + w || fy < y || fy >= y + h; + } + + void Begin(UIControl_TextInput *ctrl, UIControl *parent, + const wchar_t *initialText, + unsigned int maxChars, int keyboardMode, + CommitCallback callback, LPVOID param) + { + if (!ctrl) + return; + if (s_ctrl == ctrl) + return; + if (s_ctrl) + Finish(true); + s_ctrl = ctrl; + s_parent = parent; + s_mousePrev = InputManager.IsMouseLDown(); + s_callback = callback; + s_param = param; + s_text = initialText ? initialText : L""; + s_initial = s_text; + s_caret = s_text.length(); + s_selAll = false; + s_maxChars = maxChars; + s_keyMode = keyboardMode; + s_undo.clear(); + memset(s_keyPrev, 0, sizeof(s_keyPrev)); + s_repKey = 0; + ctrl->setFocus(true); + PushToFlash(); + } + + bool IsActive() + { + return s_ctrl != NULL; + } + + void SetLineNav(LineNavCallback callback, LPVOID param) + { + if (!s_ctrl) + return; + s_navCb = callback; + s_navParam = param; + } + + static void DoLineNav(int vk, int dir) + { + LineNavCallback cb = s_navCb; + LPVOID p = s_navParam; + Finish(true); + if (cb) + cb(p, dir); + s_keyPrev[vk] = true; + s_repKey = vk; + s_repDelay = REPEAT_DELAY_FRAMES; + } + + static void PollNavKey(int vk, int dir) + { + if (!s_navCb) + return; + bool down = InputManager.IsKeyDown(vk); + if (down && !s_keyPrev[vk]) + { + DoLineNav(vk, dir); + } + else if (down && s_repKey == vk) + { + if (--s_repDelay <= 0) + { + DoLineNav(vk, dir); + s_repDelay = REPEAT_RATE_FRAMES; + } + } + else if (!down && s_repKey == vk) + { + s_repKey = 0; + } + } + + void Tick() + { + if (!s_ctrl) + return; + + s_ctrl->RefreshFocus(); + + { + UIScene *pinScene = s_ctrl->getParentScene(); + if (pinScene && s_ctrl->getId() >= 0) + pinScene->SetFocusToElement(s_ctrl->getId(), true); + } + + bool mouseDown = InputManager.IsMouseLDown(); + if (mouseDown && !s_mousePrev) + { + if (ClickOutsideBox()) + { + Finish(true); + s_mousePrev = mouseDown; + for (int v = 0; v < 256; ++v) + s_keyPrev[v] = InputManager.IsKeyDown(v); + return; + } + } + s_mousePrev = mouseDown; + + bool ctrlDown = InputManager.IsKeyDown(VK_CONTROL) && !InputManager.IsKeyDown(VK_MENU); + if (ctrlDown) + { + if (FreshPress('A')) + { + s_selAll = !s_text.empty(); + } + else if (FreshPress('C')) + { + CopyToClipboard(s_text); + } + else if (FreshPress('X')) + { + CopyToClipboard(s_text); + if (!s_text.empty()) + { + PushUndo(); + s_text.clear(); + s_caret = 0; + s_selAll = false; + PushToFlash(); + } + } + else if (FreshPress('V')) + { + wstring pasted; + if (ClipboardText(pasted)) + InsertText(pasted); + } + else if (FreshPress('Z')) + { + if (!s_undo.empty()) + { + s_text = s_undo.back().first; + s_caret = s_undo.back().second; + if (s_caret > s_text.length()) + s_caret = s_text.length(); + s_undo.pop_back(); + s_selAll = false; + PushToFlash(); + } + } + } + + if (FreshPress(VK_RETURN)) + { + if (s_navCb) + { + LineNavCallback cb = s_navCb; + LPVOID p = s_navParam; + Finish(true); + cb(p, +1); + } + else + { + Finish(true); + } + } + else if (FreshPress(VK_ESCAPE)) + { + Finish(false); + } + else if (s_ctrl) + { + int n = InputManager.GetCharCount(); + if (n > 0) + { + wstring ins; + for (int i = 0; i < n; ++i) + ins += InputManager.GetChar(i); + InsertText(ins); + } + PollRepeatKey(VK_BACK, ActBackspace); + PollRepeatKey(VK_DELETE, ActDelete); + PollRepeatKey(VK_LEFT, ActLeft); + PollRepeatKey(VK_RIGHT, ActRight); + PollRepeatKey(VK_HOME, ActHome); + PollRepeatKey(VK_END, ActEnd); + PollNavKey(VK_UP, -1); + PollNavKey(VK_DOWN, +1); + } + + for (int v = 0; v < 256; ++v) + s_keyPrev[v] = InputManager.IsKeyDown(v); + } + + void Finish(bool accepted) + { + if (!s_ctrl) + return; + UIControl_TextInput *ctrl = s_ctrl; + s_ctrl = NULL; + if (!accepted) + { + s_text = s_initial; + s_caret = 0; + ctrl->setLabel(s_text.c_str()); + } + ctrl->setFocus(false); + if (s_callback) + { + s_commitReady = true; + s_commitText = accepted ? s_text : L""; + CommitCallback cb = s_callback; + LPVOID p = s_param; + s_callback = NULL; + s_param = NULL; + cb(p, accepted); + s_commitReady = false; + } + s_undo.clear(); + s_selAll = false; + s_repKey = 0; + s_navCb = NULL; + s_navParam = NULL; + } + + bool TakeText(uint16_t *outText, unsigned int outCapacity) + { + if (!s_commitReady || !outText || outCapacity == 0) + return false; + unsigned int n = (unsigned int)s_commitText.length(); + if (n >= outCapacity) + n = outCapacity - 1; + for (unsigned int i = 0; i < n; ++i) + outText[i] = (uint16_t)s_commitText[i]; + outText[n] = 0; + return true; + } +}; + //-------------------------------------------------------------------------------------- // Create Direct3D device and swap chain //-------------------------------------------------------------------------------------- @@ -647,6 +1276,17 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); + { + HMODULE hShcore = LoadLibraryW(L"Shcore.dll"); + if (hShcore) + { + typedef HRESULT (STDAPICALLTYPE *SetProcDpiAwareFn)(int); + SetProcDpiAwareFn pFn = (SetProcDpiAwareFn)GetProcAddress(hShcore, "SetProcessDpiAwareness"); + if (pFn) pFn(2); + FreeLibrary(hShcore); + } + } + if(lpCmdLine) { if(lpCmdLine[0] == '1') @@ -975,12 +1615,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, MSG msg = {0}; while( WM_QUIT != msg.message ) { - if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) + while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { + if (msg.message == WM_QUIT) break; TranslateMessage( &msg ); DispatchMessage( &msg ); - continue; } + if (msg.message == WM_QUIT) break; RenderManager.StartFrame(); #if 0 if(pMinecraft->soundEngine->isStreamingWavebankReady() && @@ -1000,6 +1641,117 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, // } app.UpdateTime(); + + if (app.GetGameStarted()) + { + int iPad = ProfileManager.GetPrimaryPad(); + TickMenuNavKeys(iPad, ui.GetMenuDisplayed(iPad) || pMinecraft->screen != NULL); + if (ui.GetMenuDisplayed(iPad) || pMinecraft->screen != NULL) + { + if (InputManager.IsKeyDown(VK_ESCAPE) && !s_bEscapeKeyPrev && !DirectTextEdit::IsActive()) + { + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_CANCEL)); + } + + bool bMouseL = InputManager.IsMouseLDown(); + bool bMouseR = InputManager.IsMouseRDown(); + if (bMouseL && !s_bMenuMouseLPrev) + { + if (InputManager.IsKeyDown(VK_SHIFT)) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_Y)); + else if (!ui.IsCraftingMenuDisplayed(iPad)) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_A)); + } + if (bMouseR && !s_bMenuMouseRPrev) + { + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_X)); + } + s_bMenuMouseLPrev = bMouseL; + s_bMenuMouseRPrev = bMouseR; + + int iWheelMenu = InputManager.GetMouseWheelDelta(); + if (iWheelMenu > 0) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_OTHER_STICK_UP)); + else if (iWheelMenu < 0) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_OTHER_STICK_DOWN)); + s_iWheelCarry = 0; + g_iPendingHotbarScroll = 0; + } + else + { + if (InputManager.IsMouseLDown()) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_ACTION)); + if (InputManager.IsMouseRDown()) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_USE)); + if (!DirectTextEdit::IsActive()) + { + if (InputManager.IsKeyDown('Q')) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_DROP)); + if (InputManager.IsKeyDown(VK_SHIFT)) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_SNEAK_TOGGLE)); + if (InputManager.IsKeyDown('E')) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_INVENTORY)); + if (InputManager.IsKeyDown('F')) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_RENDER_THIRD_PERSON)); + if (InputManager.IsKeyDown(VK_ESCAPE)) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_PAUSEMENU)); + if (InputManager.IsKeyDown('R')) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_CRAFTING)); + if (InputManager.IsKeyDown(VK_TAB)) InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), MINECRAFT_ACTION_GAME_INFO)); + } + s_iWheelCarry += InputManager.GetMouseWheelDelta(); + int iNewNotches = s_iWheelCarry / 120; + if (iNewNotches != 0) + { + s_iWheelCarry -= iNewNotches * 120; + g_iPendingHotbarScroll += iNewNotches; + if (g_iPendingHotbarScroll > 12) g_iPendingHotbarScroll = 12; + else if (g_iPendingHotbarScroll < -12) g_iPendingHotbarScroll = -12; + } + } + s_bEscapeKeyPrev = InputManager.IsKeyDown(VK_ESCAPE); + } + else + { + int iPad = ProfileManager.GetPrimaryPad(); + TickMenuNavKeys(iPad, ui.GetMenuDisplayed(iPad) ? true : false); + if (ui.GetMenuDisplayed(iPad)) + { + if (InputManager.IsKeyDown(VK_ESCAPE) && !s_bEscapeKeyPrev && !DirectTextEdit::IsActive()) + { + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_CANCEL)); + } + + bool bMouseL = InputManager.IsMouseLDown(); + bool bMouseR = InputManager.IsMouseRDown(); + if (bMouseL && !s_bMenuMouseLPrev) + { + if (!ui.IsSkinSelectMenuDisplayed(iPad)) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_OK)); + } + s_bMenuMouseLPrev = bMouseL; + s_bMenuMouseRPrev = bMouseR; + + int iWheelMenu = InputManager.GetMouseWheelDelta(); + if (iWheelMenu > 0) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_OTHER_STICK_UP)); + else if (iWheelMenu < 0) + InputManager.MapTouchInput(iPad, InputManager.GetGameJoypadMaps(InputManager.GetJoypadMapVal(iPad), ACTION_MENU_OTHER_STICK_DOWN)); + } + s_bEscapeKeyPrev = InputManager.IsKeyDown(VK_ESCAPE); + } + + { + int iPad = ProfileManager.GetPrimaryPad(); + bool bPointerMenu = ui.IsContainerMenuDisplayed(iPad) && !ui.IsCraftingMenuDisplayed(iPad); + if (bPointerMenu && !InputManager.IsMouseCaptured()) + { + while (ShowCursor(FALSE) >= 0) {} + } + else if (!InputManager.IsMouseCaptured()) + { + while (ShowCursor(TRUE) < 0) {} + } + } + + DirectTextEdit::Tick(); + + PIXBeginNamedEvent(0,"Input manager tick mouse"); + InputManager.TickKBM(); + PIXEndNamedEvent(); + PIXBeginNamedEvent(0,"Input manager tick"); InputManager.Tick(); PIXEndNamedEvent(); diff --git a/Minecraft.Client/Windows64Media/Media/skinHDWin.swf b/Minecraft.Client/Windows64Media/Media/skinHDWin.swf index a5cc720a..f7cc0de2 100644 Binary files a/Minecraft.Client/Windows64Media/Media/skinHDWin.swf and b/Minecraft.Client/Windows64Media/Media/skinHDWin.swf differ diff --git a/Minecraft.Client/Windows64Media/Media/skinWin.swf b/Minecraft.Client/Windows64Media/Media/skinWin.swf index b3a9edbb..a633af7b 100644 Binary files a/Minecraft.Client/Windows64Media/Media/skinWin.swf and b/Minecraft.Client/Windows64Media/Media/skinWin.swf differ diff --git a/Minecraft.World/Minecraft.World.vcxproj b/Minecraft.World/Minecraft.World.vcxproj index fa4b876e..f4684648 100644 --- a/Minecraft.World/Minecraft.World.vcxproj +++ b/Minecraft.World/Minecraft.World.vcxproj @@ -862,7 +862,7 @@ false $(OutDir)$(ProjectName).pch MultiThreaded - _LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions) + __DISABLE_MILES__;_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions) Disabled true false diff --git a/Minecraft.World/stdafx.h b/Minecraft.World/stdafx.h index 93c5cfa0..e3b57988 100644 --- a/Minecraft.World/stdafx.h +++ b/Minecraft.World/stdafx.h @@ -17,10 +17,13 @@ typedef unsigned __int64 __uint64; #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include +#include #include #include // TODO: reference additional headers your program requires here #include + +extern HWND g_hWnd; #endif #ifdef _DURANGO