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.
@@ -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)"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
After Width: | Height: | Size: 128 B |
|
After Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 149 B |
|
After Width: | Height: | Size: 135 B |
|
After Width: | Height: | Size: 153 B |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 122 B |
|
After Width: | Height: | Size: 117 B |
|
After Width: | Height: | Size: 125 B |
|
After Width: | Height: | Size: 135 B |
@@ -38220,6 +38220,56 @@
|
|||||||
<Time>19</Time>
|
<Time>19</Time>
|
||||||
<Command>stop</Command>
|
<Command>stop</Command>
|
||||||
</NamedFrame>
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>NormalHardcore</Name>
|
||||||
|
<Time>20</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>HalfHardcore</Name>
|
||||||
|
<Time>21</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>FullHardcore</Name>
|
||||||
|
<Time>22</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>HalfPoisonHardcore</Name>
|
||||||
|
<Time>23</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>FullPoisonHardcore</Name>
|
||||||
|
<Time>24</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>NormalFlashHardcore</Name>
|
||||||
|
<Time>25</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>HalfFlashHardcore</Name>
|
||||||
|
<Time>26</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>FullFlashHardcore</Name>
|
||||||
|
<Time>27</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>HalfPoisonFlashHardcore</Name>
|
||||||
|
<Time>28</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
|
<NamedFrame>
|
||||||
|
<Name>FullPoisonFlashHardcore</Name>
|
||||||
|
<Time>29</Time>
|
||||||
|
<Command>stop</Command>
|
||||||
|
</NamedFrame>
|
||||||
</NamedFrames>
|
</NamedFrames>
|
||||||
<Timeline>
|
<Timeline>
|
||||||
<Id>Border</Id>
|
<Id>Border</Id>
|
||||||
@@ -38274,6 +38324,16 @@
|
|||||||
<Interpolation>0</Interpolation>
|
<Interpolation>0</Interpolation>
|
||||||
<Prop>Graphics\HUD\Health_Background_Flash.png</Prop>
|
<Prop>Graphics\HUD\Health_Background_Flash.png</Prop>
|
||||||
</KeyFrame>
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>20</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>Graphics\HUD\Health_Background_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>25</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>Graphics\HUD\Health_Background_Hardcore_Flash.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
</Timeline>
|
</Timeline>
|
||||||
<Timeline>
|
<Timeline>
|
||||||
<Id>Heart</Id>
|
<Id>Heart</Id>
|
||||||
@@ -38399,6 +38459,66 @@
|
|||||||
<Prop>true</Prop>
|
<Prop>true</Prop>
|
||||||
<Prop>Graphics\HUD\HorseHealth_Half_Flash.png</Prop>
|
<Prop>Graphics\HUD\HorseHealth_Half_Flash.png</Prop>
|
||||||
</KeyFrame>
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>20</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>false</Prop>
|
||||||
|
<Prop></Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>21</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Half_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>22</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Full_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>23</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Half_Poison_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>24</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Full_Poison_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>25</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>false</Prop>
|
||||||
|
<Prop></Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>26</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Half_Flash_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>27</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Full_Flash_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>28</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Half_Poison_Flash_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
|
<KeyFrame>
|
||||||
|
<Time>29</Time>
|
||||||
|
<Interpolation>0</Interpolation>
|
||||||
|
<Prop>true</Prop>
|
||||||
|
<Prop>Graphics\HUD\Health_Full_Poison_Flash_Hardcore.png</Prop>
|
||||||
|
</KeyFrame>
|
||||||
</Timeline>
|
</Timeline>
|
||||||
</Timelines>
|
</Timelines>
|
||||||
</XuiVisual>
|
</XuiVisual>
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
|||||||
int iHealth = pMinecraft->localplayers[m_iPad]->getHealth();
|
int iHealth = pMinecraft->localplayers[m_iPad]->getHealth();
|
||||||
int iLastHealth = pMinecraft->localplayers[m_iPad]->lastHealth;
|
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++)
|
for (int icon = 0; icon < Player::MAX_HEALTH / 2; icon++)
|
||||||
{
|
{
|
||||||
if(blink)
|
if(blink)
|
||||||
@@ -196,11 +197,15 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
|||||||
// Full
|
// Full
|
||||||
if(bHasPoison)
|
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
|
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)
|
else if (icon * 2 + 1 == iLastHealth || icon * 2 + 1 == iHealth)
|
||||||
@@ -208,17 +213,23 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
|||||||
// Half
|
// Half
|
||||||
if(bHasPoison)
|
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
|
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
|
else
|
||||||
{
|
{
|
||||||
// Empty
|
// 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
|
else
|
||||||
@@ -228,11 +239,15 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
|||||||
// Full
|
// Full
|
||||||
if(bHasPoison)
|
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
|
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)
|
else if (icon * 2 + 1 == iHealth)
|
||||||
@@ -240,17 +255,23 @@ HRESULT CXuiSceneHud::OnCustomMessage_TickScene()
|
|||||||
// Half
|
// Half
|
||||||
if(bHasPoison)
|
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
|
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
|
else
|
||||||
{
|
{
|
||||||
// Empty
|
// 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -499,11 +499,10 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||||||
|
|
||||||
int y0 = 0;
|
int y0 = 0;
|
||||||
|
|
||||||
// No hardcore on console
|
//if (minecraft->level->getLevelData()->isHardcore())
|
||||||
/*if (minecraft->level.getLevelData().isHardcore())
|
//{
|
||||||
{
|
// y0 = 5;
|
||||||
y0 = 5;
|
//}
|
||||||
}*/
|
|
||||||
|
|
||||||
blit(xo, yo, 16 + bg * 9, 9 * y0, 9, 9);
|
blit(xo, yo, 16 + bg * 9, 9 * y0, 9, 9);
|
||||||
if (blink)
|
if (blink)
|
||||||
@@ -854,209 +853,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||||||
// font.draw(str, x + 1, y, 0xffffff);
|
// 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<float>(screenWidth - debugLeft - 8) / maxContentWidth;
|
|
||||||
float scaleV = static_cast<float>(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<float>(debugLeft), static_cast<float>(debugTop), 0.f);
|
|
||||||
glScalef(scale, scale, 1.f);
|
|
||||||
glTranslatef(static_cast<float>(-debugLeft), static_cast<float>(-debugTop), 0.f);
|
|
||||||
|
|
||||||
vector<wstring> 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<int>(xBlockPos)) + L" " + std::to_wstring(static_cast<int>(yBlockPos)) + L" " + std::to_wstring(static_cast<int>(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<float>(screenWidth - debugLeft - 8) / scale;
|
|
||||||
float maxWForContent = maxW - static_cast<float>(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<int>(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;
|
lastTickA = a;
|
||||||
// 4J Stu - This is now displayed in a xui scene
|
// 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<wstring> lines;
|
vector<wstring> lines;
|
||||||
|
|
||||||
// Only show version/branch for player 0 to avoid cluttering each splitscreen viewport
|
// 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::VERSION_STRING);
|
||||||
lines.push_back(ClientConstants::BRANCH_STRING);
|
lines.push_back(ClientConstants::BRANCH_STRING);
|
||||||
|
|||||||