4jcraft/Minecraft.Client/Platform/Common/UI/UIScene_DLCMainMenu.cpp
MatthewBeshay 28d68befd4 Replace remaining WinAPI types with standard C++ equivalents
DWORD→uint32_t, BYTE→uint8_t, HRESULT→int32_t, HANDLE→void*, UINT→uint32_t, INT→int32_t, WORD→uint16_t, LONG→int32_t, SHORT→int16_t, LONGLONG→int64_t, ULONG_PTR→uintptr_t, PBYTE→uint8_t*, LPWSTR/PWSTR→wchar_t*, FLOAT→float, CHAR→char, boolean→bool, CONST→const, TRUE→true, FALSE→false across 176 files (excluding vendor libs and Linux stubs).
2026-03-30 17:36:15 +11:00

118 lines
3.3 KiB
C++

#include "../../Minecraft.World/Platform/stdafx.h"
#include "UI.h"
#include "UIScene_DLCMainMenu.h"
#define PLAYER_ONLINE_TIMER_ID 0
#define PLAYER_ONLINE_TIMER_TIME 100
UIScene_DLCMainMenu::UIScene_DLCMainMenu(int iPad, void* initData,
UILayer* parentLayer)
: UIScene(iPad, parentLayer) {
// Setup all the Iggy references we need for this scene
initialiseMovie();
// Alert the app the we want to be informed of ethernet connections
app.SetLiveLinkRequired(true);
m_labelOffers.init(IDS_DOWNLOADABLE_CONTENT_OFFERS);
m_buttonListOffers.init(eControl_OffersList);
if (m_loadedResolution == eSceneResolution_1080) {
m_labelXboxStore.init(L"");
}
TelemetryManager->RecordMenuShown(iPad, eUIScene_DLCMainMenu, 0);
}
UIScene_DLCMainMenu::~UIScene_DLCMainMenu() {
// Alert the app the we no longer want to be informed of ethernet
// connections
app.SetLiveLinkRequired(false);
}
std::wstring UIScene_DLCMainMenu::getMoviePath() { return L"DLCMainMenu"; }
void UIScene_DLCMainMenu::updateTooltips() {
ui.SetTooltips(m_iPad, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK);
}
void UIScene_DLCMainMenu::handleInput(int iPad, int key, bool repeat,
bool pressed, bool released,
bool& handled) {
// app.DebugPrintf("UIScene_DebugOverlay handling input for pad %d, key %d,
// down- %s, pressed- %s, released- %s\n", iPad, key, down?"true":"false",
// pressed?"true":"false", released?"true":"false");
ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released);
switch (key) {
case ACTION_MENU_CANCEL:
if (pressed) {
navigateBack();
}
break;
case ACTION_MENU_OK:
sendInputToMovie(key, repeat, pressed, released);
break;
case ACTION_MENU_UP:
case ACTION_MENU_DOWN:
case ACTION_MENU_LEFT:
case ACTION_MENU_RIGHT:
case ACTION_MENU_PAGEUP:
case ACTION_MENU_PAGEDOWN:
sendInputToMovie(key, repeat, pressed, released);
break;
}
}
void UIScene_DLCMainMenu::handlePress(F64 controlId, F64 childId) {
switch ((int)controlId) {
case eControl_OffersList: {
int iIndex = (int)childId;
DLCOffersParam* param = new DLCOffersParam();
param->iPad = m_iPad;
param->iType = iIndex;
// promote the DLC content request type
// Xbox One will have requested the marketplace content - there is
// only that type
app.AddDLCRequest((eDLCMarketplaceType)iIndex, true);
killTimer(PLAYER_ONLINE_TIMER_ID);
ui.NavigateToScene(m_iPad, eUIScene_DLCOffersMenu, param);
break;
}
};
}
void UIScene_DLCMainMenu::handleTimerComplete(int id) {
}
int UIScene_DLCMainMenu::ExitDLCMainMenu(void* pParam, int iPad,
C4JStorage::EMessageResult result) {
UIScene_DLCMainMenu* pClass = (UIScene_DLCMainMenu*)pParam;
pClass->navigateBack();
return 0;
}
void UIScene_DLCMainMenu::handleGainFocus(bool navBack) {
UIScene::handleGainFocus(navBack);
updateTooltips();
if (navBack) {
// add the timer back in
}
}
void UIScene_DLCMainMenu::tick() {
UIScene::tick();
}