This commit is contained in:
GabsPuNs
2026-05-14 21:52:21 -04:00
parent 1b2f5c6fe8
commit f8a2d644f5
291 changed files with 7363 additions and 18368 deletions

View File

@@ -58,30 +58,29 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
// 4J-PB - to stop an offline game being able to select the online flag
if(ProfileManager.IsSignedInLive(m_params->iPad) == false)
{
//m_checkboxes[eLaunchCheckbox_Online].SetEnable(false);
m_checkboxes[eLaunchCheckbox_Online].SetEnable(false);
}
if ( m_params->bOnlineSettingChangedBySystem && !m_bMultiplayerAllowed )
{
// 4J-JEV: Disable and uncheck these boxes if they can't play multiplayer.
/*
m_checkboxes[eLaunchCheckbox_Online].SetEnable(false);
m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(false);
m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(false);
*/
bOnlineGame = bInviteOnly = bAllowFriendsOfFriends = false;
}
else if(!m_params->bOnlineGame)
{
//m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(false);
//m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(false);
m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(false);
m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(false);
}
// Init cheats
m_bUpdateCheats = false;
// Update cheat checkboxes
UpdateCheats();
/*
m_checkboxes[eLaunchCheckbox_Online].init(app.GetString(IDS_ONLINE_GAME),eLaunchCheckbox_Online,bOnlineGame);
m_checkboxes[eLaunchCheckbox_InviteOnly].init(app.GetString(IDS_INVITE_ONLY),eLaunchCheckbox_InviteOnly,bInviteOnly);
m_checkboxes[eLaunchCheckbox_AllowFoF].init(app.GetString(IDS_ALLOWFRIENDSOFFRIENDS),eLaunchCheckbox_AllowFoF,bAllowFriendsOfFriends);
@@ -102,28 +101,12 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
m_checkboxes[eLaunchCheckbox_TileDrops].init(app.GetString(IDS_TILE_DROPS), eLaunchCheckbox_TileDrops, m_params->bDoTileDrops);
m_checkboxes[eLaunchCheckbox_NaturalRegeneration].init(app.GetString(IDS_NATURAL_REGEN), eLaunchCheckbox_NaturalRegeneration, m_params->bNaturalRegeneration);
m_checkboxes[eLaunchCheckbox_DayLightCycle].init(app.GetString(IDS_DAYLIGHT_CYCLE), eLaunchCheckbox_DayLightCycle, m_params->bDoDaylightCycle);
*/
m_labelGameOptions.init(app.GetString(IDS_GAME_OPTIONS));
m_worldOptionsList.AddNewLabel(app.GetString(IDS_CREATE_NEW_WORLD_SEED));
m_worldOptionsList.AddNewLabel(app.GetString(IDS_CREATE_NEW_WORLD_RANDOM_SEED));
m_worldOptionsList.AddNewTextInput(app.GetString(IDS_GAMEOPTION_SEED), eControl_EditSeed);
m_labelGameOptions.init( app.GetString(IDS_GAME_OPTIONS) );
m_labelSeed.init(app.GetString(IDS_CREATE_NEW_WORLD_SEED));
m_labelRandomSeed.init(app.GetString(IDS_CREATE_NEW_WORLD_RANDOM_SEED));
m_editSeed.init(m_params->seed, eControl_EditSeed);
m_worldOptionsList.AddNewLabel(app.GetString(IDS_WORLD_SIZE));
m_worldOptionsList.AddNewSlider(app.GetString(m_iWorldSizeTitleA[m_params->worldSize]), eControl_WorldSize, 0, 3, m_params->worldSize);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_GENERATE_STRUCTURES), eLaunchCheckbox_Structures, m_params->bStructures);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_BONUS_CHEST), eLaunchCheckbox_BonusChest, m_params->bBonusChest);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_SUPERFLAT_WORLD), eLaunchCheckbox_FlatWorld, m_params->bFlatWorld);
m_worldOptionsList.AddNewButton(L"Customize Superflat", 22);
//m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_RESET_NETHER), eLaunchCheckbox_ResetNether, m_params->bResetNether);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_DISABLE_SAVING), eLaunchCheckbox_DisableSaving, m_params->bDisableSaving);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_TRUST_PLAYERS), eLaunchCheckbox_TrustSystem, m_params->bTrust);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_FIRE_SPREADS), eLaunchCheckbox_FireSpreads, m_params->bFireSpreads);
m_worldOptionsList.AddNewCheckbox(app.GetString(IDS_TNT_EXPLODES), eLaunchCheckbox_TNT, m_params->bTNT);
/*
#ifdef _LARGE_WORLDS
m_labelWorldSize.init(app.GetString(IDS_WORLD_SIZE));
m_sliderWorldSize.init(app.GetString(m_iWorldSizeTitleA[m_params->worldSize]),eControl_WorldSize,0,3,m_params->worldSize);
@@ -140,7 +123,12 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
m_checkboxes[eLaunchCheckbox_WorldResizeType].init(app.GetString(IDS_INCREASE_WORLD_SIZE_OVERWRITE_EDGES),eLaunchCheckbox_WorldResizeType,m_params->newWorldSizeOverwriteEdges);
}
#endif
*/
// Only the Xbox 360 needs a reset nether
// 4J-PB - PS3 needs it now
// #ifndef _XBOX
// if(!m_params->bGenerateOptions) removeControl( &m_checkboxes[eLaunchCheckbox_ResetNether], false );
// #endif
m_tabIndex = m_params->bGenerateOptions ? TAB_WORLD_OPTIONS : TAB_GAME_OPTIONS;
@@ -173,6 +161,14 @@ UIScene_LaunchMoreOptionsMenu::UIScene_LaunchMoreOptionsMenu(int iPad, void *ini
addTimer(GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME);
#ifdef __PSVITA__
// initialise vita tab controls with ids
m_TouchTabWorld.init(ETouchInput_TabWorld);
m_TouchTabGame.init(ETouchInput_TabGame);
ui.TouchBoxRebuild(this);
#endif
m_bIgnoreInput = false;
}
@@ -199,7 +195,11 @@ void UIScene_LaunchMoreOptionsMenu::updateTooltips()
void UIScene_LaunchMoreOptionsMenu::updateComponents()
{
m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
//#ifdef _LARGE_WORLDS
// m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,true);
//#else
m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,false);
//#endif
}
wstring UIScene_LaunchMoreOptionsMenu::getMoviePath()
@@ -215,14 +215,14 @@ void UIScene_LaunchMoreOptionsMenu::tick()
if (bMultiplayerAllowed != m_bMultiplayerAllowed)
{
//m_checkboxes[ eLaunchCheckbox_Online].SetEnable(bMultiplayerAllowed);
//m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bMultiplayerAllowed);
//m_checkboxes[ eLaunchCheckbox_AllowFoF].SetEnable(bMultiplayerAllowed);
m_checkboxes[ eLaunchCheckbox_Online].SetEnable(bMultiplayerAllowed);
m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bMultiplayerAllowed);
m_checkboxes[ eLaunchCheckbox_AllowFoF].SetEnable(bMultiplayerAllowed);
if (bMultiplayerAllowed)
{
//m_checkboxes[ eLaunchCheckbox_Online].setChecked(true);
//m_checkboxes[eLaunchCheckbox_AllowFoF].setChecked(true);
m_checkboxes[ eLaunchCheckbox_Online].setChecked(true);
m_checkboxes[eLaunchCheckbox_AllowFoF].setChecked(true);
}
m_bMultiplayerAllowed = bMultiplayerAllowed;
@@ -244,6 +244,14 @@ void UIScene_LaunchMoreOptionsMenu::tick()
void UIScene_LaunchMoreOptionsMenu::handleDestroy()
{
#ifdef __PSVITA__
app.DebugPrintf("missing InputManager.DestroyKeyboard on Vita !!!!!!\n");
#endif
// so shut down the keyboard if it is displayed
#if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO)
InputManager.DestroyKeyboard();
#endif
}
void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
@@ -266,6 +274,21 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat,
}
break;
case ACTION_MENU_OK:
#ifdef __ORBIS__
case ACTION_MENU_TOUCHPAD_PRESS:
#endif
// 4J-JEV: Inform user why their game must be offline.
#if defined _XBOX_ONE
{
UIControl_CheckBox *checkboxOnline = &m_checkboxes[eLaunchCheckbox_Online];
if ( pressed && controlHasFocus( checkboxOnline->getId()) && !checkboxOnline->IsEnabled() )
{
UINT uiIDA[1] = { IDS_CONFIRM_OK };
ui.RequestErrorMessage(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad);
}
}
#endif
case ACTION_MENU_UP:
case ACTION_MENU_DOWN:
case ACTION_MENU_LEFT:
@@ -291,7 +314,32 @@ void UIScene_LaunchMoreOptionsMenu::handleInput(int iPad, int key, bool repeat,
}
}
#ifdef _WINDOWS64
#ifdef __PSVITA__
void UIScene_LaunchMoreOptionsMenu::handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased)
{
if(bPressed)
{
switch(iId)
{
case ETouchInput_TabWorld:
case ETouchInput_TabGame:
// Toggle tab index
int iNewTabIndex = (iId == ETouchInput_TabWorld) ? 0 : 1;
if(m_tabIndex != iNewTabIndex)
{
m_tabIndex = iNewTabIndex;
updateTooltips();
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcChangeTab , 0 , nullptr );
}
ui.TouchBoxRebuild(this);
break;
}
}
}
#endif
#if defined(__PSVITA__) || defined(_WINDOWS64)
UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel()
{
if(m_tabIndex == 0)
@@ -301,7 +349,7 @@ UIControl* UIScene_LaunchMoreOptionsMenu::GetMainPanel()
}
#endif
void UIScene_LaunchMoreOptionsMenu::handleCheckboxElementToggled(F64 controlId, F64 idk, bool selected)
void UIScene_LaunchMoreOptionsMenu::handleCheckboxToggled(F64 controlId, bool selected)
{
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
@@ -458,17 +506,46 @@ void UIScene_LaunchMoreOptionsMenu::handleFocusChange(F64 controlId, F64 childId
#endif
};
UpdateDescriptionText(stringId);
wstring wsText=app.GetString(stringId);
EHTMLFontSize size = eHTMLSize_Normal;
if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
{
size = eHTMLSize_Splitscreen;
}
wchar_t startTags[64];
swprintf(startTags,64,L"<font color=\"#%08x\">",app.GetHTMLColour(eHTMLColor_White));
wsText = startTags + wsText;
if (m_tabIndex == TAB_WORLD_OPTIONS)
m_labelDescription_WorldOptions.setLabel(wsText);
else
m_labelDescription_GameOptions.setLabel(wsText);
}
/*
void UIScene_LaunchMoreOptionsMenu::handleGainFocus(F64 controlId, F64 childId)
void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id)
{
UpdateDescriptionText(stringId);
}
*/
/*switch(id) //4J-JEV: Moved this over to the tick.
{
case GAME_CREATE_ONLINE_TIMER_ID:
{
bool bMultiplayerAllowed
= ProfileManager.IsSignedInLive(m_params->iPad)
&& ProfileManager.AllowedToPlayMultiplayer(m_params->iPad);
void UIScene_LaunchMoreOptionsMenu::handleTimerComplete(int id) {}
if (bMultiplayerAllowed != m_bMultiplayerAllowed)
{
m_checkboxes[ eLaunchCheckbox_Online].SetEnable(bMultiplayerAllowed);
m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bMultiplayerAllowed);
m_checkboxes[ eLaunchCheckbox_AllowFoF].SetEnable(bMultiplayerAllowed);
m_checkboxes[eLaunchCheckbox_Online].setChecked(bMultiplayerAllowed);
m_bMultiplayerAllowed = bMultiplayerAllowed;
}
}
break;
};*/
}
int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,bool bRes)
{
@@ -481,6 +558,15 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b
Win64_GetKeyboardText(pchText, 128);
pClass->m_editSeed.setLabel(reinterpret_cast<wchar_t*>(pchText));
pClass->m_params->seed = static_cast<wstring>(reinterpret_cast<wchar_t*>(pchText));
#else
#ifdef __PSVITA__
uint16_t pchText[2048] = {};
#else
uint16_t pchText[128] = {};
#endif
InputManager.GetText(pchText);
pClass->m_editSeed.setLabel((wchar_t *)pchText);
pClass->m_params->seed = (wchar_t *)pchText;
#endif
}
return 0;
@@ -526,6 +612,24 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId)
kbData.lpParam = this;
ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData);
}
#else
m_bIgnoreInput=true;
#ifdef __PS3__
int language = XGetLanguage();
switch(language)
{
case XC_LANGUAGE_JAPANESE:
case XC_LANGUAGE_KOREAN:
case XC_LANGUAGE_TCHINESE:
InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default);
break;
default:
InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Alphabet_Extended);
break;
}
#else
InputManager.RequestKeyboard(app.GetString(IDS_CREATE_NEW_WORLD_SEED),m_editSeed.getLabel(),(DWORD)0,60,&UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback,this,C_4JInput::EKeyboardMode_Default);
#endif
#endif
}
break;
@@ -533,7 +637,7 @@ void UIScene_LaunchMoreOptionsMenu::handlePress(F64 controlId, F64 childId)
}
void UIScene_LaunchMoreOptionsMenu::handleSliderElementMove(F64 sliderId, F64 currentValue, F64 idk)
void UIScene_LaunchMoreOptionsMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
@@ -563,10 +667,10 @@ void UIScene_LaunchMoreOptionsMenu::UpdateCheats()
{
bool cheatsOn = m_params->bHostPrivileges;
//m_checkboxes[eLaunchCheckbox_KeepInventory].SetEnable(cheatsOn);
//m_checkboxes[eLaunchCheckbox_MobSpawning].SetEnable(cheatsOn);
//m_checkboxes[eLaunchCheckbox_MobGriefing].SetEnable(cheatsOn);
//m_checkboxes[eLaunchCheckbox_DayLightCycle].SetEnable(cheatsOn);
m_checkboxes[eLaunchCheckbox_KeepInventory].SetEnable(cheatsOn);
m_checkboxes[eLaunchCheckbox_MobSpawning].SetEnable(cheatsOn);
m_checkboxes[eLaunchCheckbox_MobGriefing].SetEnable(cheatsOn);
m_checkboxes[eLaunchCheckbox_DayLightCycle].SetEnable(cheatsOn);
if (!cheatsOn)
{
@@ -576,10 +680,10 @@ void UIScene_LaunchMoreOptionsMenu::UpdateCheats()
m_params->bDoMobSpawning = true;
m_params->bDoDaylightCycle = true;
//m_checkboxes[eLaunchCheckbox_KeepInventory].setChecked(m_params->bKeepInventory);
//m_checkboxes[eLaunchCheckbox_MobSpawning].setChecked(m_params->bDoMobSpawning);
//m_checkboxes[eLaunchCheckbox_MobGriefing].setChecked(m_params->bMobGriefing);
//m_checkboxes[eLaunchCheckbox_DayLightCycle].setChecked(m_params->bDoDaylightCycle);
m_checkboxes[eLaunchCheckbox_KeepInventory].setChecked(m_params->bKeepInventory);
m_checkboxes[eLaunchCheckbox_MobSpawning].setChecked(m_params->bDoMobSpawning);
m_checkboxes[eLaunchCheckbox_MobGriefing].setChecked(m_params->bMobGriefing);
m_checkboxes[eLaunchCheckbox_DayLightCycle].setChecked(m_params->bDoDaylightCycle);
}
}
@@ -587,24 +691,6 @@ void UIScene_LaunchMoreOptionsMenu::UpdateOnline()
{
bool bOnline = m_params->bOnlineGame;
//m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bOnline);
//m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(bOnline);
}
void UIScene_LaunchMoreOptionsMenu::UpdateDescriptionText(int stringId)
{
wstring wsText=app.GetString(stringId);
EHTMLFontSize size = eHTMLSize_Normal;
if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen())
{
size = eHTMLSize_Splitscreen;
}
wchar_t startTags[64];
swprintf(startTags,64,L"<font color=\"#%08x\">",app.GetHTMLColour(eHTMLColor_White));
wsText = startTags + wsText;
if (m_tabIndex == TAB_WORLD_OPTIONS)
m_labelDescription_WorldOptions.setLabel(wsText);
else
m_labelDescription_GameOptions.setLabel(wsText);
m_checkboxes[eLaunchCheckbox_InviteOnly].SetEnable(bOnline);
m_checkboxes[eLaunchCheckbox_AllowFoF].SetEnable(bOnline);
}