initial minigame loading + ui stuff

thank you rockefeler
This commit is contained in:
Fireblade 2026-05-19 19:31:21 -04:00
parent 6fba0c7d72
commit 0ccc633551
11 changed files with 4245 additions and 4116 deletions

View file

@ -614,10 +614,18 @@ void UIController::loadSkins()
//Load skins specifcally edited for use on achievements, if we //Load skins specifcally edited for use on achievements, if we
//used these as skin.swf and skinInGame.swf it breaks some other things //used these as skin.swf and skinInGame.swf it breaks some other things
//hello again i added more library's for minigames swf
//i also send you all a big hello :v
m_iggyLibraries[eLibrary_LCDefault] = loadSkin(L"skinLC.swf", L"skinLC.swf"); m_iggyLibraries[eLibrary_LCDefault] = loadSkin(L"skinLC.swf", L"skinLC.swf");
m_iggyLibraries[eLibrary_LCInGame] = loadSkin(L"skinInGameLC.swf", L"skinInGameLC.swf"); m_iggyLibraries[eLibrary_LCInGame] = loadSkin(L"skinInGameLC.swf", L"skinInGameLC.swf");
m_iggyLibraries[eLibrary_LCGraphics] = loadSkin(L"skinGraphicsLC.swf", L"skinGraphicsLC.swf"); m_iggyLibraries[eLibrary_LCGraphics] = loadSkin(L"skinGraphicsLC.swf", L"skinGraphicsLC.swf");
m_iggyLibraries[eLibrary_LCLabels] = loadSkin(L"skinLabelsLC.swf", L"skinLabelsLC.swf"); m_iggyLibraries[eLibrary_LCLabels] = loadSkin(L"skinLabelsLC.swf", L"skinLabelsLC.swf");
m_iggyLibraries[eLibrary_LCGraphicsLabels] = loadSkin(L"skinGraphicsLabelsLC.swf", L"skinGraphicsLabelsLC.swf");
m_iggyLibraries[eLibrary_LCGraphicsHud] = loadSkin(L"skinGraphicsHudLC.swf", L"skinGraphicsHudLC.swf");
m_iggyLibraries[eLibrary_LCGraphicsInGame] = loadSkin(L"skinGraphicsInGameLC.swf", L"skinGraphicsInGameLC.swf");
m_iggyLibraries[eLibrary_LCGraphicsTooltips] = loadSkin(L"skinGraphicsTooltipsLC.swf", L"skinGraphicsTooltipsLC.swf");
m_iggyLibraries[eLibrary_LCHud] = loadSkin(L"skinHudLC.swf", L"skinHudLC.swf");
m_iggyLibraries[eLibrary_LCTooltips] = loadSkin(L"skinTooltipsLC.swf", L"skinTooltipsLC.swf");
// Some 1080p menu ports (such as LoadCreateJoin) may import DR-specific HD // Some 1080p menu ports (such as LoadCreateJoin) may import DR-specific HD
// libraries by distinct names. Load them opportunistically when present so // libraries by distinct names. Load them opportunistically when present so

View file

@ -107,6 +107,12 @@ private:
eLibrary_LCInGame, eLibrary_LCInGame,
eLibrary_LCGraphics, eLibrary_LCGraphics,
eLibrary_LCLabels, eLibrary_LCLabels,
eLibrary_LCGraphicsLabels,
eLibrary_LCGraphicsHud,
eLibrary_LCGraphicsInGame,
eLibrary_LCGraphicsTooltips,
eLibrary_LCHud,
eLibrary_LCTooltips,
#if defined(_WINDOWS64) #if defined(_WINDOWS64)
// Non-HD skin libraries needed by 720p/480p scene SWFs. // Non-HD skin libraries needed by 720p/480p scene SWFs.

View file

@ -6,12 +6,68 @@
UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
{ {
LoadingInputParams *params = static_cast<LoadingInputParams *>(initData);
m_CompletionData = params->completionData;
m_iPad = params->completionData->iPad;
m_cancelFunc = params->cancelFunc;
m_cancelFuncParam = params->m_cancelFuncParam;
m_completeFunc = params->completeFunc;
m_completeFuncParam = params->m_completeFuncParam;
m_cancelText = params->cancelText;
m_bWasCancelled = false;
m_bWaitForThreadToDelete = params->waitForThreadToDelete;
// Setup all the Iggy references we need for this scene // Setup all the Iggy references we need for this scene
initialiseMovie(); initialiseMovie();
if (m_CompletionData && m_CompletionData->bIsMinigame)
{
byteArray iconBytes = app.getArchiveFile(L"Graphics\\BattleModeIcon.png");
if (iconBytes.data && iconBytes.length > 0)
{
registerSubstitutionTexture(L"mini_game_battle", iconBytes.data, iconBytes.length, true);
}
IggyName funcSetType = registerFastName( L"SetLoadingScreenType" );
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = 1.0;
IggyResult out = IggyPlayerCallMethodRS( getMovie(), &result, IggyPlayerRootPath( getMovie() ), funcSetType, 1, value );
// set the texture for the minigame logo inside the SWF dynamically
IggyValuePath gmIconPath;
if (IggyValuePathMakeNameRef(&gmIconPath, IggyPlayerRootPath(getMovie()), "GMIcon"))
{
// this is to make the logo smaller
// by default it looks huge
// 5.0 is the original scale
IggyName nameScaleX = registerFastName(L"scaleX");
IggyName nameScaleY = registerFastName(L"scaleY");
IggyValueSetF64RS(&gmIconPath, nameScaleX, nullptr, 3.45);
IggyValueSetF64RS(&gmIconPath, nameScaleY, nullptr, 3.5);
IggyValuePath mgLogoPath;
if (IggyValuePathMakeNameRef(&mgLogoPath, &gmIconPath, "MG_Logo"))
{
IggyName funcSetTextureName = registerFastName(L"SetTextureName");
IggyDataValue resultLogo;
IggyDataValue valueLogo[1];
IggyStringUTF16 stringVal;
stringVal.string = (IggyUTF16*)L"mini_game_battle";
stringVal.length = wcslen(L"mini_game_battle");
valueLogo[0].type = IGGY_DATATYPE_string_UTF16;
valueLogo[0].string16 = stringVal;
IggyPlayerCallMethodRS(getMovie(), &resultLogo, &mgLogoPath, funcSetTextureName, 1, valueLogo);
}
}
}
parentLayer->addComponent(iPad,eUIComponent_Panorama); parentLayer->addComponent(iPad,eUIComponent_Panorama);
parentLayer->addComponent(iPad,eUIComponent_Logo); parentLayer->addComponent(iPad,eUIComponent_Logo);
parentLayer->showComponent(iPad,eUIComponent_Logo,true); parentLayer->showComponent(iPad,eUIComponent_Logo, true);
parentLayer->showComponent(iPad,eUIComponent_MenuBackground,false); parentLayer->showComponent(iPad,eUIComponent_MenuBackground,false);
m_controlTimer.setVisible( false ); m_controlTimer.setVisible( false );
@ -26,19 +82,6 @@ UIScene_FullscreenProgress::UIScene_FullscreenProgress(int iPad, void *initData,
m_buttonConfirm.init( app.GetString( IDS_CONFIRM_OK ), eControl_Confirm ); m_buttonConfirm.init( app.GetString( IDS_CONFIRM_OK ), eControl_Confirm );
m_buttonConfirm.setVisible(false); m_buttonConfirm.setVisible(false);
LoadingInputParams *params = static_cast<LoadingInputParams *>(initData);
m_CompletionData = params->completionData;
m_iPad=params->completionData->iPad;
m_cancelFunc = params->cancelFunc;
m_cancelFuncParam = params->m_cancelFuncParam;
m_completeFunc = params->completeFunc;
m_completeFuncParam = params->m_completeFuncParam;
m_cancelText = params->cancelText;
m_bWasCancelled=false;
m_bWaitForThreadToDelete = params->waitForThreadToDelete;
// Clear the progress text // Clear the progress text
Minecraft *pMinecraft=Minecraft::GetInstance(); Minecraft *pMinecraft=Minecraft::GetInstance();
pMinecraft->progressRenderer->progressStart(-1); pMinecraft->progressRenderer->progressStart(-1);

View file

@ -1,11 +1,34 @@
#include "stdafx.h" #include "stdafx.h"
#include "UI.h" #include "UI.h"
#include "UIScene_MinigamesCreateMenu.h" #include "UIScene_MinigamesCreateMenu.h"
#include "UIScene_FullscreenProgress.h"
#include "../../Minecraft.h" #include "../../Minecraft.h"
#include "../../MinecraftServer.h"
#include "../../../Minecraft.World/File.h"
#include "../../../Minecraft.World/InputOutputStream.h"
#include "../../TexturePackRepository.h"
// mini gaimes menus By aRockefeler o aRockefort // mini gaimes menus By aRockefeler o aRockefort
// string localization by Fireblade // string localization by Fireblade
namespace namespace
{ {
LoadSaveDataThreadParam* LoadLobbySaveData()
{
File lobbySave(L"Windows64Media\\Lobby\\Lobby.mcs");
if (!lobbySave.exists())
lobbySave = File(L"Windows64\\Lobby\\Lobby.mcs");
if (!lobbySave.exists())
return nullptr;
int64_t fileSize = lobbySave.length();
FileInputStream fis(lobbySave);
byteArray ba(static_cast<unsigned int>(fileSize));
fis.read(ba);
fis.close();
return new LoadSaveDataThreadParam(ba.data, ba.length, lobbySave.getName());
}
const wchar_t* GetBattleModeLabel(int mode) const wchar_t* GetBattleModeLabel(int mode)
{ {
switch (mode) switch (mode)
@ -385,13 +408,61 @@ void UIScene_MinigamesCreateMenu::checkStateAndStartGame()
void UIScene_MinigamesCreateMenu::LaunchGame() void UIScene_MinigamesCreateMenu::LaunchGame()
{ {
// this is for debugging SyncBattleCheckboxStates();
// if the menu is already complete you can remove this m_bIgnoreInput = true;
app.DebugPrintf("[MGDBG] MiniGamesCreateMenu Create pressed for type=%d mode=%d online=%d public=%d friends=%d invite=%d\n",
m_iMiniGameType, LoadSaveDataThreadParam* saveData = LoadLobbySaveData();
m_iBattleModeSelection, if (!saveData)
m_MoreOptionsParams.bOnlineGame ? 1 : 0, {
m_bPublicGame ? 1 : 0, app.DebugPrintf("[MGDBG] Failed to load Lobby.mcs (Windows64Media/Lobby).\n");
m_MoreOptionsParams.bAllowFriendsOfFriends ? 1 : 0, m_bIgnoreInput = false;
m_MoreOptionsParams.bInviteOnly ? 1 : 0); return;
}
app.SetTutorialMode(false);
StorageManager.ResetSaveData();
StorageManager.SetSaveTitle(L"Lobby");
app.SetAutosaveTimerTime();
app.SetGameHostOption(eGameHostOption_FriendsOfFriends, m_MoreOptionsParams.bAllowFriendsOfFriends);
app.SetGameHostOption(eGameHostOption_Gamertags, app.GetGameSettings(m_iPad, eGameSetting_GamertagsVisible) ? 1 : 0);
app.SetGameHostOption(eGameHostOption_PvP, m_MoreOptionsParams.bPVP);
app.SetGameHostOption(eGameHostOption_TrustPlayers, m_MoreOptionsParams.bTrust);
app.SetGameHostOption(eGameHostOption_FireSpreads, m_MoreOptionsParams.bFireSpreads);
app.SetGameHostOption(eGameHostOption_TNT, m_MoreOptionsParams.bTNT);
app.SetGameHostOption(eGameHostOption_HostCanFly, m_MoreOptionsParams.bHostPrivileges);
app.SetGameHostOption(eGameHostOption_HostCanChangeHunger, m_MoreOptionsParams.bHostPrivileges);
app.SetGameHostOption(eGameHostOption_HostCanBeInvisible, m_MoreOptionsParams.bHostPrivileges);
app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false);
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad())
&& m_MoreOptionsParams.bOnlineGame;
bool isPrivate = m_MoreOptionsParams.bInviteOnly ? true : false;
g_NetworkManager.HostGame(0, isClientSide, isPrivate, MINECRAFT_NET_MAX_PLAYERS, 0);
#ifndef _XBOX
g_NetworkManager.FakeLocalPlayerJoined();
#endif
NetworkGameInitData* param = new NetworkGameInitData();
param->seed = 0;
param->saveData = saveData;
param->settings = app.GetGameHostOption(eGameHostOption_All);
param->savePlatform = SAVE_FILE_PLATFORM_LOCAL;
LoadingInputParams* loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
UIFullscreenProgressCompletionData* completionData = new UIFullscreenProgressCompletionData();
completionData->bShowBackground = TRUE;
completionData->bShowLogo = TRUE;
completionData->bShowTips = TRUE;
completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes;
completionData->iPad = DEFAULT_XUI_MENU_USER;
completionData->bIsMinigame = TRUE;
loadingParams->completionData = completionData;
ui.NavigateToScene(m_iPad, eUIScene_FullscreenProgress, loadingParams);
} }

View file

@ -28,8 +28,8 @@ UIScene_MinigamesMenu::UIScene_MinigamesMenu(int iPad, void *initData, UILayer *
// here the code ask for the swf // here the code ask for the swf
std::wstring UIScene_MinigamesMenu::getMoviePath() std::wstring UIScene_MinigamesMenu::getMoviePath()
{ {
app.DebugPrintf("[MGDBG] UIScene_MinigamesMenu getMoviePath -> MiniGamesMenu\n");// and this is for debugging too app.DebugPrintf("[MGDBG] UIScene_MinigamesMenu getMoviePath -> LoadCreateJoinMenu\n");// and this is for debugging too
return L"MiniGamesMenu"; return L"LoadCreateJoinMenu";
} }
void UIScene_MinigamesMenu::ApplyMiniGamesLabels() void UIScene_MinigamesMenu::ApplyMiniGamesLabels()

View file

@ -218,6 +218,7 @@ typedef struct _UIFullscreenProgressCompletionData
BOOL bShowBackground; BOOL bShowBackground;
BOOL bShowLogo; BOOL bShowLogo;
BOOL bShowTips; BOOL bShowTips;
BOOL bIsMinigame;
ProgressionCompletionType type; ProgressionCompletionType type;
int iPad; int iPad;
EUIScene scene; EUIScene scene;