mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Hide the terrain features in debug builds unless we have the full F3 open
This commit is contained in:
parent
a195ac7172
commit
e830d6b8ad
|
|
@ -986,56 +986,56 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
||||||
lines.push_back(minecraft->gatherStats1()); // Time to autosave
|
lines.push_back(minecraft->gatherStats1()); // Time to autosave
|
||||||
lines.push_back(minecraft->gatherStats2()); // Empty currently - CPlatformNetworkManagerStub::GatherStats()
|
lines.push_back(minecraft->gatherStats2()); // Empty currently - CPlatformNetworkManagerStub::GatherStats()
|
||||||
lines.push_back(minecraft->gatherStats3()); // RTT
|
lines.push_back(minecraft->gatherStats3()); // RTT
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _DEBUG // Only show terrain features in debug builds not release
|
#ifdef _DEBUG // Only show terrain features in debug builds not release
|
||||||
// TERRAIN FEATURES
|
// TERRAIN FEATURES
|
||||||
if (minecraft->level->dimension->id == 0)
|
if (minecraft->level->dimension->id == 0)
|
||||||
{
|
{
|
||||||
wstring wfeature[eTerrainFeature_Count];
|
wstring wfeature[eTerrainFeature_Count];
|
||||||
|
|
||||||
wfeature[eTerrainFeature_Stronghold] = L"Stronghold: ";
|
wfeature[eTerrainFeature_Stronghold] = L"Stronghold: ";
|
||||||
wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: ";
|
wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: ";
|
||||||
wfeature[eTerrainFeature_Village] = L"Village: ";
|
wfeature[eTerrainFeature_Village] = L"Village: ";
|
||||||
wfeature[eTerrainFeature_Ravine] = L"Ravine: ";
|
wfeature[eTerrainFeature_Ravine] = L"Ravine: ";
|
||||||
|
|
||||||
float maxW = static_cast<float>(screenWidth - debugLeft - 8) / scale;
|
float maxW = static_cast<float>(screenWidth - debugLeft - 8) / scale;
|
||||||
float maxWForContent = maxW - static_cast<float>(font->width(L"..."));
|
float maxWForContent = maxW - static_cast<float>(font->width(L"..."));
|
||||||
bool truncated[eTerrainFeature_Count] = {};
|
bool truncated[eTerrainFeature_Count] = {};
|
||||||
|
|
||||||
for (size_t i = 0; i < app.m_vTerrainFeatures.size(); i++)
|
for (size_t i = 0; i < app.m_vTerrainFeatures.size(); i++)
|
||||||
{
|
{
|
||||||
FEATURE_DATA *pFeatureData = app.m_vTerrainFeatures[i];
|
FEATURE_DATA *pFeatureData = app.m_vTerrainFeatures[i];
|
||||||
int type = pFeatureData->eTerrainFeature;
|
int type = pFeatureData->eTerrainFeature;
|
||||||
if (type < eTerrainFeature_Stronghold || type > eTerrainFeature_Ravine)
|
if (type < eTerrainFeature_Stronghold || type > eTerrainFeature_Ravine)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (truncated[type])
|
if (truncated[type])
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring itemInfo = L"[" + std::to_wstring(pFeatureData->x * 16) + L", " + std::to_wstring(pFeatureData->z * 16) + L"] ";
|
wstring itemInfo = L"[" + std::to_wstring(pFeatureData->x * 16) + L", " + std::to_wstring(pFeatureData->z * 16) + L"] ";
|
||||||
if (font->width(wfeature[type] + itemInfo) <= maxWForContent)
|
if (font->width(wfeature[type] + itemInfo) <= maxWForContent)
|
||||||
{
|
{
|
||||||
wfeature[type] += itemInfo;
|
wfeature[type] += itemInfo;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wfeature[type] += L"...";
|
wfeature[type] += L"...";
|
||||||
truncated[type] = true;
|
truncated[type] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lines.push_back(L""); // Add a spacer line
|
lines.push_back(L""); // Add a spacer line
|
||||||
for (int i = eTerrainFeature_Stronghold; i <= static_cast<int>(eTerrainFeature_Ravine); i++)
|
for (int i = eTerrainFeature_Stronghold; i <= static_cast<int>(eTerrainFeature_Ravine); i++)
|
||||||
{
|
{
|
||||||
lines.push_back(wfeature[i]);
|
lines.push_back(wfeature[i]);
|
||||||
}
|
}
|
||||||
lines.push_back(L"");
|
lines.push_back(L"");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Loop through the lines and draw them all on screen
|
// Loop through the lines and draw them all on screen
|
||||||
int yPos = debugTop;
|
int yPos = debugTop;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue