Fix overlapping debug menus and screens (#294)
* Fix overlapping debug menus and screens Also resolves a formatting issue with clang-format * Update readme
This commit is contained in:
@@ -39,9 +39,7 @@ RemoveSemicolon: false
|
|||||||
SeparateDefinitionBlocks: Leave
|
SeparateDefinitionBlocks: Leave
|
||||||
ShortNamespaceLines: 1
|
ShortNamespaceLines: 1
|
||||||
SkipMacroDefinitionBody: false
|
SkipMacroDefinitionBody: false
|
||||||
SortIncludes:
|
SortIncludes: CaseSensitive
|
||||||
Enabled: true
|
|
||||||
IgnoreCase: false
|
|
||||||
SpacesInParens: Never
|
SpacesInParens: Never
|
||||||
SpacesInParensOptions:
|
SpacesInParensOptions:
|
||||||
ExceptDoubleParentheses: false
|
ExceptDoubleParentheses: false
|
||||||
|
|||||||
@@ -3618,8 +3618,6 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_RENDER_DEBUG)) )
|
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_RENDER_DEBUG)) )
|
||||||
{
|
{
|
||||||
#ifndef _CONTENT_PACKAGE
|
#ifndef _CONTENT_PACKAGE
|
||||||
|
|
||||||
options->renderDebug = !options->renderDebug;
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
app.EnableDebugOverlay(options->renderDebug,iPad);
|
app.EnableDebugOverlay(options->renderDebug,iPad);
|
||||||
#else
|
#else
|
||||||
@@ -3629,13 +3627,11 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_SPAWN_CREEPER)) && app.GetMobsDontAttackEnabled())
|
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_SPAWN_CREEPER)))
|
||||||
{
|
{
|
||||||
//shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(Creeper::_class->newInstance( level ));
|
#ifndef _CONTENT_PACKAGE
|
||||||
//shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(Wolf::_class->newInstance( level ));
|
options->renderDebug = !options->renderDebug;
|
||||||
shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(shared_ptr<Spider>(new Spider( level )));
|
#endif
|
||||||
mob->moveTo(player->x+1, player->y, player->z+1, level->random->nextFloat() * 360, 0);
|
|
||||||
level->addEntity(mob);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1278,7 +1278,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// F1 toggles the HUD, F3 toggles the debug console overlay, F11 toggles fullscreen
|
// F1 toggles the HUD
|
||||||
if (KMInput.IsKeyPressed(VK_F1))
|
if (KMInput.IsKeyPressed(VK_F1))
|
||||||
{
|
{
|
||||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||||
@@ -1287,20 +1287,42 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
app.SetGameSettings(primaryPad, eGameSetting_DisplayHand, displayHud ? 0 : 1);
|
app.SetGameSettings(primaryPad, eGameSetting_DisplayHand, displayHud ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// F3 toggles onscreen debug info
|
||||||
if (KMInput.IsKeyPressed(VK_F3))
|
if (KMInput.IsKeyPressed(VK_F3))
|
||||||
|
{
|
||||||
|
if (Minecraft* pMinecraft = Minecraft::GetInstance())
|
||||||
|
{
|
||||||
|
if (pMinecraft->options)
|
||||||
|
{
|
||||||
|
pMinecraft->options->renderDebug = !pMinecraft->options->renderDebug;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _DEBUG_MENUS_ENABLED
|
||||||
|
// F4 Open debug overlay
|
||||||
|
if (KMInput.IsKeyPressed(VK_F4))
|
||||||
|
{
|
||||||
|
if (Minecraft *pMinecraft = Minecraft::GetInstance())
|
||||||
|
{
|
||||||
|
if (pMinecraft->options &&
|
||||||
|
app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL)
|
||||||
|
{
|
||||||
|
ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// F6 Open debug console
|
||||||
|
if (KMInput.IsKeyPressed(VK_F6))
|
||||||
{
|
{
|
||||||
static bool s_debugConsole = false;
|
static bool s_debugConsole = false;
|
||||||
s_debugConsole = !s_debugConsole;
|
s_debugConsole = !s_debugConsole;
|
||||||
ui.ShowUIDebugConsole(s_debugConsole);
|
ui.ShowUIDebugConsole(s_debugConsole);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG_MENUS_ENABLED
|
|
||||||
if (KMInput.IsKeyPressed(VK_F4))
|
|
||||||
{
|
|
||||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_DebugOverlay, NULL, eUILayer_Debug);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// F11 Toggle fullscreen
|
||||||
if (KMInput.IsKeyPressed(VK_F11))
|
if (KMInput.IsKeyPressed(VK_F11))
|
||||||
{
|
{
|
||||||
ToggleFullscreen();
|
ToggleFullscreen();
|
||||||
@@ -1318,33 +1340,6 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _DEBUG_MENUS_ENABLED
|
|
||||||
// F3 toggles onscreen debug info
|
|
||||||
if (KMInput.IsKeyPressed(VK_F3))
|
|
||||||
{
|
|
||||||
if (Minecraft* pMinecraft = Minecraft::GetInstance())
|
|
||||||
{
|
|
||||||
if (pMinecraft->options && app.DebugSettingsOn())
|
|
||||||
{
|
|
||||||
pMinecraft->options->renderDebug = !pMinecraft->options->renderDebug;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// F4 opens debug overlay
|
|
||||||
if (KMInput.IsKeyPressed(VK_F4))
|
|
||||||
{
|
|
||||||
if (Minecraft* pMinecraft = Minecraft::GetInstance())
|
|
||||||
{
|
|
||||||
if (pMinecraft->options && app.DebugSettingsOn() &&
|
|
||||||
app.GetGameStarted() && !ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL)
|
|
||||||
{
|
|
||||||
ui.NavigateToScene(0, eUIScene_DebugOverlay, NULL, eUILayer_Debug);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// has the game defined profile data been changed (by a profile load)
|
// has the game defined profile data been changed (by a profile load)
|
||||||
if(app.uiGameDefinedDataChangedBitmask!=0)
|
if(app.uiGameDefinedDataChangedBitmask!=0)
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ This feature is based on [LCEMP](https://github.com/LCEMP/LCEMP/)
|
|||||||
- **Toggle HUD**: `F1`
|
- **Toggle HUD**: `F1`
|
||||||
- **Toggle Debug Info**: `F3`
|
- **Toggle Debug Info**: `F3`
|
||||||
- **Open Debug Overlay**: `F4`
|
- **Open Debug Overlay**: `F4`
|
||||||
|
- **Toggle Debug Console**: `F6`
|
||||||
|
|
||||||
## Build & Run
|
## Build & Run
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user