* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
73 lines
1.7 KiB
C++
73 lines
1.7 KiB
C++
#include "stdafx.h"
|
|
|
|
#include <assert.h>
|
|
#include "XUI_DebugTips.h"
|
|
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
|
|
|
//----------------------------------------------------------------------------------
|
|
// Performs initialization tasks - retrieves controls.
|
|
//----------------------------------------------------------------------------------
|
|
HRESULT CScene_DebugTips::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
|
{
|
|
m_iPad = *static_cast<int *>(pInitData->pvInitData);
|
|
|
|
m_bIgnoreInput = false;
|
|
|
|
MapChildControls();
|
|
|
|
// Display the tooltips
|
|
//ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT);
|
|
// display the next tip
|
|
wstring wsText=app.FormatHTMLString(m_iPad,app.GetString(app.GetNextTip()));
|
|
wchar_t startTags[64];
|
|
swprintf(startTags,64,L"<font color=\"#%08x\" size=14><DIV ALIGN=CENTER>",app.GetHTMLColour(eHTMLColor_White));
|
|
wsText= startTags + wsText + L"</DIV>";
|
|
XuiControlSetText(m_tip,wsText.c_str());
|
|
|
|
return S_OK;
|
|
}
|
|
|
|
|
|
HRESULT CScene_DebugTips::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled)
|
|
{
|
|
//ui.AnimateKeyPress(pInputData->UserIndex, pInputData->dwKeyCode);
|
|
|
|
|
|
switch(pInputData->dwKeyCode)
|
|
{
|
|
case VK_PAD_A:
|
|
{
|
|
|
|
|
|
// next tip
|
|
// display the next tip
|
|
wstring wsText=app.FormatHTMLString(m_iPad,app.GetString(app.GetNextTip()));
|
|
wchar_t startTags[64];
|
|
swprintf(startTags,64,L"<font color=\"#%08x\" size=14><DIV ALIGN=CENTER>",app.GetHTMLColour(eHTMLColor_White));
|
|
wsText= startTags + wsText + L"</DIV>";
|
|
XuiControlSetText(m_tip,wsText.c_str());
|
|
|
|
rfHandled = TRUE;
|
|
}
|
|
break;
|
|
|
|
case VK_PAD_B:
|
|
case VK_PAD_START:
|
|
case VK_ESCAPE:
|
|
|
|
app.NavigateBack(m_iPad);
|
|
|
|
rfHandled = TRUE;
|
|
|
|
break;
|
|
#ifndef _CONTENT_PACKAGE
|
|
case VK_PAD_LTHUMB_PRESS:
|
|
#ifdef _XBOX
|
|
app.OverrideFontRenderer(true);
|
|
#endif
|
|
break;
|
|
#endif
|
|
}
|
|
|
|
return S_OK;
|
|
} |