From c3b204f77b31f37027799f54b775a04922968e31 Mon Sep 17 00:00:00 2001 From: Revela Date: Fri, 13 Mar 2026 11:11:21 -0500 Subject: [PATCH] Fix Gui.cpp merge and enhance hardcore mode visuals This commit adds new `NamedFrame` entries and `KeyFrame` animations in `skin_Minecraft.xui` for various hardcore game modes, improving the UI representation (likely will get rid of this since it's dead code). A new `isHardcore` variable in `XUI_HUD.cpp` allows for conditional health icon animations based on the game mode. Additionally, commented-out code in `Gui.cpp` has been removed to streamline rendering logic. Several new PNG images for health states in hardcore mode have also been added to enhance the user experience. TL;DR: This commit is basically just prep for adding hardcore heathbar hearts while also fixing some breaking that occurred in Gui.cpp after a merge. --- .claude/settings.local.json | 19 -- .../HUD/Health_Background_Hardcore.png | Bin 0 -> 128 bytes .../HUD/Health_Background_Hardcore_Flash.png | Bin 0 -> 129 bytes .../HUD/Health_Full_Flash_Hardcore.png | Bin 0 -> 149 bytes .../Graphics/HUD/Health_Full_Hardcore.png | Bin 0 -> 135 bytes .../HUD/Health_Full_Poison_Flash_Hardcore.png | Bin 0 -> 153 bytes .../HUD/Health_Full_Poison_Hardcore.png | Bin 0 -> 163 bytes .../HUD/Health_Half_Flash_Hardcore.png | Bin 0 -> 122 bytes .../Graphics/HUD/Health_Half_Hardcore.png | Bin 0 -> 117 bytes .../HUD/Health_Half_Poison_Flash_Hardcore.png | Bin 0 -> 125 bytes .../HUD/Health_Half_Poison_Hardcore.png | Bin 0 -> 135 bytes .../Common/Media/skin_Minecraft.xui | 120 ++++++++++ Minecraft.Client/Common/XUI/XUI_HUD.cpp | 43 +++- Minecraft.Client/Gui.cpp | 214 +----------------- 14 files changed, 157 insertions(+), 239 deletions(-) delete mode 100644 .claude/settings.local.json create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Background_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Background_Hardcore_Flash.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Full_Flash_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Full_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Full_Poison_Flash_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Full_Poison_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Flash_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Poison_Flash_Hardcore.png create mode 100644 Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Poison_Hardcore.png diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 2df5e3e3..00000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(find . -name \"*LevelData*\" -o -name \"*level.dat*\" 2>/dev/null | head -20)", - "Bash(grep -n \"isHardcore\\\\|m_isHardcore\" Minecraft.World/LoginPacket.* Minecraft.Client/PlayerList.cpp)", - "Bash(find \"C:\\\\Users\\\\rexma\\\\Documents\\\\Minecraft\\\\itsRevela\" -name \"*.resx\" -path \"*/Common/Media/*\" ! -path \"*/x64/*\" ! -path \"*/de-DE/*\" ! -path \"*/es-ES/*\" ! -path \"*/fr-FR/*\" ! -path \"*/it-IT/*\" ! -path \"*/ja-JP/*\" ! -path \"*/ko-KR/*\" ! -path \"*/pt-BR/*\" ! -path \"*/pt-PT/*\" ! -path \"*/zh-CHT/*\" -type f 2>/dev/null | head -20)", - "Bash(find /c/Users/rexma/Documents/Minecraft/itsRevela -name \"*.cpp\" -type f | xargs grep -l \"SetSaveUniqueFilename\" | grep -v \"Stubs\\\\|4JLibs\")", - "Bash(find /c/Users/rexma/Documents/Minecraft/itsRevela/Minecraft.Client/Windows64 -name \"*[Ss]torage*\" -type f 2>/dev/null | head -20)", - "Bash(find \"C:\\\\Users\\\\rexma\\\\Documents\\\\Minecraft\\\\itsRevela\" -name \"*.cpp\" -o -name \"*.h\" | xargs grep -l \"GameHDD\" 2>/dev/null)", - "Bash(find \"C:\\\\Users\\\\rexma\\\\Documents\\\\Minecraft\\\\itsRevela\\\\Minecraft.Client\\\\Windows64\" -name \"*.cpp\" -type f 2>/dev/null | head -20)", - "Bash(find \"C:\\\\Users\\\\rexma\\\\Documents\\\\Minecraft\\\\itsRevela\" -name \"*Storage*.cpp\" -o -name \"*Storage*.h\" 2>/dev/null | grep -i windows)", - "Bash(find \"C:\\\\Users\\\\rexma\\\\Documents\\\\Minecraft\\\\itsRevela\\\\Minecraft.Client\\\\Windows64\" -name \"*.cpp\" | xargs grep -l \"SaveSaveData\\\\|SetSaveUniqueFilename\" 2>/dev/null)", - "Bash(find /c/Users/rexma/Documents/Minecraft/itsRevela -type f -name \"*.h\" | xargs grep -l \"StorageManager\\\\|ResetSaveData\\\\|ReturnSavesInfo\\\\|GetSavesInfo\" | head -10)", - "Bash(grep -rn \"SetSaveUniqueFilename\\\\\\(\" Minecraft.Client --include=\"*.cpp\" --include=\"*.h\" 2>/dev/null | grep -v \"^[^:]*Extrax64Stubs.cpp\" | grep -v \"^[^:]*\\\\.h-\")", - "Bash(find /c/Users/rexma/Documents/Minecraft/itsRevela -name \"*.h\" | xargs grep -l \"SetCurrentSaveFolderName\\\\|GetCurrentSaveFolderName\" 2>/dev/null)", - "Bash(find \"C:\\\\Users\\\\rexma\\\\Documents\\\\Minecraft\\\\itsRevela\\\\Minecraft.Client\" -name \"*.h\" -o -name \"*.cpp\" 2>/dev/null | xargs grep -l \"LaunchMoreOptionsMenuParams\" | head -5)" - ] - } -} diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Background_Hardcore.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Background_Hardcore.png new file mode 100644 index 0000000000000000000000000000000000000000..b48e1b5b2b7e6421d5f3128bcbe26fef38280d91 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{V?w&4=Ar*6y6C4`;2lSjvOK9QD z%E)MtG|#(};E>jQ#Xw2>0Gk8X%z{%&jEh7Ko!%bH67`Tv6KZps!IU%0ah}6RJH3X5 a3=E;WW#@g=c)JQ{B!j1`pUXO@geCxl{U>1n literal 0 HcmV?d00001 diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Background_Hardcore_Flash.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Background_Hardcore_Flash.png new file mode 100644 index 0000000000000000000000000000000000000000..a5487c11263ecce81160b8dc67ec070a98c58f3e GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{V9-c0aAr*6y6B?TS2Q-{xV-%aQ zVA(P?W-~Ko4h8Nc=IiU@(-RJ9cC&N@vuqMdQPErN@F`*P2F(`D0~a_ywY0Udb$#E+ bl*7d!R%=}z_GpC$&`btTS3j3^P61|%O$WD@{VF`h1tAr*6y6BJng#P9fE&#`#3 zV*{t!j>mVccO(h$K016O!PS5vm}7CE&#v1|%O$WD@{Vex5FlAr*6y6BJngh>QK>KlCC; zAfbshVPdjoV7TqA^Y_O@^OZo889ZJ6T-G@yGywoF(1|%O$WD@{V37#&FAr*6y6BJl=X32b)Z@G9= z;Q)tl&F8Q-N0%R*F~U9a(|31Fp*iI5;veykIrbysr9e9?&iZPgg&ebxsLQ0D3nr A2LJ#7 literal 0 HcmV?d00001 diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Full_Poison_Hardcore.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Full_Poison_Hardcore.png new file mode 100644 index 0000000000000000000000000000000000000000..b30b434305a778db8b57ba0f8455fb8365353b61 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VS)MMAAr*6y6BJlWwsZewPb@Lx zFgVDvKCU3;!JiXsY0Vh|^2-F)aIl@bvz<+w<)Q*Z(qYlNwx4?sx_s2=`l|46>TUT0 zIc_r&+zgJ_%Z4)UP@2#rnO)!T^x?HemISMbq6w@D!k%1W5)2F-g(j`P)=lFF+REVR L>gTe~DWM4fcH}kU literal 0 HcmV?d00001 diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Flash_Hardcore.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Flash_Hardcore.png new file mode 100644 index 0000000000000000000000000000000000000000..112904c06915fd9e57df6c8ebb4d449bc769f474 GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{Vj-D=#Ar*6y6BJng#P9fE&yhSi zxk>ZJ$9J+ZhGDJ-48a|t7i-zr*!UF{=lC&d2X*zQA6YJtC+nja_&|10S#mDboFyt=akR{08z~&ng9R* literal 0 HcmV?d00001 diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Hardcore.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Hardcore.png new file mode 100644 index 0000000000000000000000000000000000000000..c9ac37aefbbaab811cb2ebe54cf5758f95194fef GIT binary patch literal 117 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VHl8kyAr*6y6BJngh>QK>KXl{C zj07&B{WXo+$5wH$C2(!jx^?)#0fYJN?Hgv7Ip1wL9V@}rX*6-e-UtQ;fk3Ghvk&iF Q1T=@i)78&qol`;+08FkW*#H0l literal 0 HcmV?d00001 diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Poison_Flash_Hardcore.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Poison_Flash_Hardcore.png new file mode 100644 index 0000000000000000000000000000000000000000..b32384020fe8c3e6e860c1552e24765a85d244f7 GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VE}kxqAr*6y6BJl=X32b)Z`pX# z@Sw<^N^R!wo=`!a10qSGUp^j=W)pm`njxgN@xNA4qqn+ literal 0 HcmV?d00001 diff --git a/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Poison_Hardcore.png b/Minecraft.Client/Common/Media/Graphics/HUD/Health_Half_Poison_Hardcore.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ce20743eed0b6f43b91f7842469a6a19c11cbc GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{Vex5FlAr*6y6BJlWwsZewPs}Ou zF<=eXw=gQGOJUx;QLCxZ`1{&}TpP7^RX>w%?tBzD$B$8a*2Zt_kEh<2FVJd19 stop + +NormalHardcore + +stop + + +HalfHardcore + +stop + + +FullHardcore + +stop + + +HalfPoisonHardcore + +stop + + +FullPoisonHardcore + +stop + + +NormalFlashHardcore + +stop + + +HalfFlashHardcore + +stop + + +FullFlashHardcore + +stop + + +HalfPoisonFlashHardcore + +stop + + +FullPoisonFlashHardcore + +stop + Border @@ -38274,6 +38324,16 @@ 0 Graphics\HUD\Health_Background_Flash.png + + +0 +Graphics\HUD\Health_Background_Hardcore.png + + + +0 +Graphics\HUD\Health_Background_Hardcore_Flash.png + Heart @@ -38399,6 +38459,66 @@ true Graphics\HUD\HorseHealth_Half_Flash.png + + +0 +false + + + + +0 +true +Graphics\HUD\Health_Half_Hardcore.png + + + +0 +true +Graphics\HUD\Health_Full_Hardcore.png + + + +0 +true +Graphics\HUD\Health_Half_Poison_Hardcore.png + + + +0 +true +Graphics\HUD\Health_Full_Poison_Hardcore.png + + + +0 +false + + + + +0 +true +Graphics\HUD\Health_Half_Flash_Hardcore.png + + + +0 +true +Graphics\HUD\Health_Full_Flash_Hardcore.png + + + +0 +true +Graphics\HUD\Health_Half_Poison_Flash_Hardcore.png + + + +0 +true +Graphics\HUD\Health_Full_Poison_Flash_Hardcore.png + diff --git a/Minecraft.Client/Common/XUI/XUI_HUD.cpp b/Minecraft.Client/Common/XUI/XUI_HUD.cpp index e188cbf6..dd26e766 100644 --- a/Minecraft.Client/Common/XUI/XUI_HUD.cpp +++ b/Minecraft.Client/Common/XUI/XUI_HUD.cpp @@ -186,7 +186,8 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene() if (pMinecraft->localplayers[m_iPad]->invulnerableTime < 10) blink = false; int iHealth = pMinecraft->localplayers[m_iPad]->getHealth(); int iLastHealth = pMinecraft->localplayers[m_iPad]->lastHealth; - bool bHasPoison = pMinecraft->localplayers[m_iPad]->hasEffect(MobEffect::poison); + bool bHasPoison = pMinecraft->localplayers[m_iPad]->hasEffect(MobEffect::poison); + bool isHardcore = pMinecraft->level != nullptr && pMinecraft->level->getLevelData()->isHardcore(); for (int icon = 0; icon < Player::MAX_HEALTH / 2; icon++) { if(blink) @@ -196,11 +197,15 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene() // Full if(bHasPoison) { - m_healthIcon[icon].PlayVisualRange(L"FullPoisonFlash",nullptr,L"FullPoisonFlash"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"FullPoisonFlashHardcore" : L"FullPoisonFlash", nullptr, + isHardcore ? L"FullPoisonFlashHardcore" : L"FullPoisonFlash"); } else { - m_healthIcon[icon].PlayVisualRange(L"FullFlash",nullptr,L"FullFlash"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"FullFlashHardcore" : L"FullFlash", nullptr, + isHardcore ? L"FullFlashHardcore" : L"FullFlash"); } } else if (icon * 2 + 1 == iLastHealth || icon * 2 + 1 == iHealth) @@ -208,17 +213,23 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene() // Half if(bHasPoison) { - m_healthIcon[icon].PlayVisualRange(L"HalfPoisonFlash",nullptr,L"HalfPoisonFlash"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"HalfPoisonFlashHardcore" : L"HalfPoisonFlash", nullptr, + isHardcore ? L"HalfPoisonFlashHardcore" : L"HalfPoisonFlash"); } else { - m_healthIcon[icon].PlayVisualRange(L"HalfFlash",nullptr,L"HalfFlash"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"HalfFlashHardcore" : L"HalfFlash", nullptr, + isHardcore ? L"HalfFlashHardcore" : L"HalfFlash"); } } else { // Empty - m_healthIcon[icon].PlayVisualRange(L"NormalFlash",nullptr,L"NormalFlash"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"NormalFlashHardcore" : L"NormalFlash", nullptr, + isHardcore ? L"NormalFlashHardcore" : L"NormalFlash"); } } else @@ -228,11 +239,15 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene() // Full if(bHasPoison) { - m_healthIcon[icon].PlayVisualRange(L"FullPoison",nullptr,L"FullPoison"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"FullPoisonHardcore" : L"FullPoison", nullptr, + isHardcore ? L"FullPoisonHardcore" : L"FullPoison"); } else { - m_healthIcon[icon].PlayVisualRange(L"Full",nullptr,L"Full"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"FullHardcore" : L"Full", nullptr, + isHardcore ? L"FullHardcore" : L"Full"); } } else if (icon * 2 + 1 == iHealth) @@ -240,17 +255,23 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene() // Half if(bHasPoison) { - m_healthIcon[icon].PlayVisualRange(L"HalfPoison",nullptr,L"HalfPoison"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"HalfPoisonHardcore" : L"HalfPoison", nullptr, + isHardcore ? L"HalfPoisonHardcore" : L"HalfPoison"); } else { - m_healthIcon[icon].PlayVisualRange(L"Half",nullptr,L"Half"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"HalfHardcore" : L"Half", nullptr, + isHardcore ? L"HalfHardcore" : L"Half"); } } else { // Empty - m_healthIcon[icon].PlayVisualRange(L"Normal",nullptr,L"Normal"); + m_healthIcon[icon].PlayVisualRange( + isHardcore ? L"NormalHardcore" : L"Normal", nullptr, + isHardcore ? L"NormalHardcore" : L"Normal"); } } diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index cb4c7bbc..43c17923 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -499,11 +499,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) int y0 = 0; - // No hardcore on console - /*if (minecraft->level.getLevelData().isHardcore()) - { - y0 = 5; - }*/ + //if (minecraft->level->getLevelData()->isHardcore()) + //{ + // y0 = 5; + //} blit(xo, yo, 16 + bg * 9, 9 * y0, 9, 9); if (blink) @@ -854,209 +853,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // font.draw(str, x + 1, y, 0xffffff); // } -#ifndef _FINAL_BUILD - MemSect(31); - - // temporarily render overlay at all times so version is more obvious in bug reports - // we can turn this off once things stabilize - if (true)// minecraft->options->renderDebug && minecraft->player != nullptr && minecraft->level != nullptr) - { - const int debugLeft = 1; - const int debugTop = 1; - const float maxContentWidth = 1200.f; - const float maxContentHeight = 420.f; - float scale = static_cast(screenWidth - debugLeft - 8) / maxContentWidth; - float scaleV = static_cast(screenHeight - debugTop - 80) / maxContentHeight; - if (scaleV < scale) scale = scaleV; - if (scale > 1.f) scale = 1.f; - if (scale < 0.5f) scale = 0.5f; - glPushMatrix(); - glTranslatef(static_cast(debugLeft), static_cast(debugTop), 0.f); - glScalef(scale, scale, 1.f); - glTranslatef(static_cast(-debugLeft), static_cast(-debugTop), 0.f); - - vector lines; - - // Only add version/branch lines if the watermark toggle is enabled - if (ClientConstants::SHOW_VERSION_WATERMARK) { - lines.push_back(ClientConstants::VERSION_STRING); - lines.push_back(ClientConstants::BRANCH_STRING); - } - if (minecraft->options->renderDebug && minecraft->player != nullptr && minecraft->level != nullptr) - { - lines.push_back(minecraft->fpsString); - lines.push_back(L"E: " + std::to_wstring(minecraft->level->getAllEntities().size())); // Could maybe use entity::shouldRender to work out how many are rendered but thats like expensive - // TODO Add server information with packet counts - once multiplayer is more stable - int renderDistance = app.GetGameSettings(iPad, eGameSetting_RenderDistance); - // Calculate the chunk sections using 16 * (2n + 1)^2 - lines.push_back(L"C: " + std::to_wstring(16 * (2 * renderDistance + 1) * (2 * renderDistance + 1)) + L" D: " + std::to_wstring(renderDistance)); - lines.push_back(minecraft->gatherStats4()); // Chunk Cache - - // Dimension - wstring dimension = L"unknown"; - switch (minecraft->player->dimension) - { - case -1: - dimension = L"minecraft:the_nether"; - break; - case 0: - dimension = L"minecraft:overworld"; - break; - case 1: - dimension = L"minecraft:the_end"; - break; - } - lines.push_back(dimension); - - lines.push_back(L""); // Spacer - - // Players block pos - int xBlockPos = Mth::floor(minecraft->player->x); - int yBlockPos = Mth::floor(minecraft->player->y); - int zBlockPos = Mth::floor(minecraft->player->z); - - // Chunk player is in - int xChunkPos = xBlockPos >> 4; - int yChunkPos = yBlockPos >> 4; - int zChunkPos = zBlockPos >> 4; - - // Players offset within the chunk - int xChunkOffset = xBlockPos & 15; - int yChunkOffset = yBlockPos & 15; - int zChunkOffset = zBlockPos & 15; - - // Format the position like java with limited decumal places - WCHAR posString[44]; // Allows upto 7 digit positions (+-9_999_999) - swprintf(posString, 44, L"%.3f / %.5f / %.3f", minecraft->player->x, minecraft->player->y, minecraft->player->z); - - lines.push_back(L"XYZ: " + std::wstring(posString)); - lines.push_back(L"Block: " + std::to_wstring(static_cast(xBlockPos)) + L" " + std::to_wstring(static_cast(yBlockPos)) + L" " + std::to_wstring(static_cast(zBlockPos))); - lines.push_back(L"Chunk: " + std::to_wstring(xChunkOffset) + L" " + std::to_wstring(yChunkOffset) + L" " + std::to_wstring(zChunkOffset) + L" in " + std::to_wstring(xChunkPos) + L" " + std::to_wstring(yChunkPos) + L" " + std::to_wstring(zChunkPos)); - - // Wrap the yRot to 360 then adjust to (-180 to 180) range to match java - float yRotDisplay = fmod(minecraft->player->yRot, 360.0f); - if (yRotDisplay > 180.0f) - { - yRotDisplay -= 360.0f; - } - if (yRotDisplay < -180.0f) - { - yRotDisplay += 360.0f; - } - // Generate the angle string in the format "yRot / xRot" with one decimal place, similar to java edition - WCHAR angleString[16]; - swprintf(angleString, 16, L"%.1f / %.1f", yRotDisplay, minecraft->player->xRot); - - // Work out the named direction - int direction = Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3; - wstring cardinalDirection; - switch (direction) - { - case 0: - cardinalDirection = L"south"; - break; - case 1: - cardinalDirection = L"west"; - break; - case 2: - cardinalDirection = L"north"; - break; - case 3: - cardinalDirection = L"east"; - break; - } - - lines.push_back(L"Facing: " + cardinalDirection + L" (" + angleString + L")"); - - // We have to limit y to 256 as we don't get any information past that - if (minecraft->level != NULL && minecraft->level->hasChunkAt(xBlockPos, fmod(yBlockPos, 256), zBlockPos)) - { - LevelChunk *chunkAt = minecraft->level->getChunkAt(xBlockPos, zBlockPos); - if (chunkAt != NULL) - { - int skyLight = chunkAt->getBrightness(LightLayer::Sky, xChunkOffset, yChunkOffset, zChunkOffset); - int blockLight = chunkAt->getBrightness(LightLayer::Block, xChunkOffset, yChunkOffset, zChunkOffset); - int maxLight = fmax(skyLight, blockLight); - lines.push_back(L"Light: " + std::to_wstring(maxLight) + L" (" + std::to_wstring(skyLight) + L" sky, " + std::to_wstring(blockLight) + L" block)"); - - lines.push_back(L"CH S: " + std::to_wstring(chunkAt->getHeightmap(xChunkOffset, zChunkOffset))); - - Biome *biome = chunkAt->getBiome(xChunkOffset, zChunkOffset, minecraft->level->getBiomeSource()); - lines.push_back(L"Biome: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")"); - - lines.push_back(L"Difficulty: " + std::to_wstring(minecraft->level->difficulty) + L" (Day " + std::to_wstring(minecraft->level->getGameTime() / Level::TICKS_PER_DAY) + L")"); - } - } - - // This is all LCE only stuff, it was never on java - lines.push_back(L""); // Spacer - lines.push_back(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed())); - lines.push_back(minecraft->gatherStats1()); // Time to autosave - lines.push_back(minecraft->gatherStats2()); // Empty currently - CPlatformNetworkManagerStub::GatherStats() - lines.push_back(minecraft->gatherStats3()); // RTT - } - -#ifdef _DEBUG // Only show terrain features in debug builds not release - // TERRAIN FEATURES - if (minecraft->level->dimension->id == 0) - { - wstring wfeature[eTerrainFeature_Count]; - - wfeature[eTerrainFeature_Stronghold] = L"Stronghold: "; - wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: "; - wfeature[eTerrainFeature_Village] = L"Village: "; - wfeature[eTerrainFeature_Ravine] = L"Ravine: "; - - float maxW = static_cast(screenWidth - debugLeft - 8) / scale; - float maxWForContent = maxW - static_cast(font->width(L"...")); - bool truncated[eTerrainFeature_Count] = {}; - - for (size_t i = 0; i < app.m_vTerrainFeatures.size(); i++) - { - FEATURE_DATA *pFeatureData = app.m_vTerrainFeatures[i]; - int type = pFeatureData->eTerrainFeature; - if (type < eTerrainFeature_Stronghold || type > eTerrainFeature_Ravine) - { - continue; - } - if (truncated[type]) - { - continue; - } - - wstring itemInfo = L"[" + std::to_wstring(pFeatureData->x * 16) + L", " + std::to_wstring(pFeatureData->z * 16) + L"] "; - if (font->width(wfeature[type] + itemInfo) <= maxWForContent) - { - wfeature[type] += itemInfo; - } - else - { - wfeature[type] += L"..."; - truncated[type] = true; - } - } - - lines.push_back(L""); // Add a spacer line - for (int i = eTerrainFeature_Stronghold; i <= static_cast(eTerrainFeature_Ravine); i++) - { - lines.push_back(wfeature[i]); - } - lines.push_back(L""); - } -#endif - - // Loop through the lines and draw them all on screen - int yPos = debugTop; - for (const auto &line : lines) - { - drawString(font, line, debugLeft, yPos, 0xffffff); - yPos += 10; - } - - glPopMatrix(); - } - MemSect(0); -#endif lastTickA = a; // 4J Stu - This is now displayed in a xui scene @@ -1269,7 +1065,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) vector lines; // Only show version/branch for player 0 to avoid cluttering each splitscreen viewport - if (iPad == 0) + if (iPad == 0 && ClientConstants::SHOW_VERSION_WATERMARK) { lines.push_back(ClientConstants::VERSION_STRING); lines.push_back(ClientConstants::BRANCH_STRING);