Modified CreateBattleMenu functions to allow easier UI change

This commit is contained in:
700 committed 2026-03-14 22:15:30 +00:00
1 parent 99bdeac63b
commit e2264bb1f3
9 files changed
+158 -991

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -1,3 +1,4 @@
#pragma once
#include "IUIScene_StartGame.h"
@@ -5,8 +6,10 @@
class UIScene_CreateBattleMenu : public IUIScene_StartGame
{
private:
enum EControls
{
// --- original controls (keep so cpp compiles) ---
eControl_EditWorldName,
eControl_TexturePackList,
eControl_GameModeToggle,
@@ -14,76 +17,121 @@ private:
eControl_MoreOptions,
eControl_NewWorld,
eControl_OnlineGame,
// --- new battle controls ---
eControl_CentralSpawn,
eControl_PublicGame,
eControl_FriendsOfFriends,
eControl_InviteOnly,
eControl_SelectMaps,
eControl_RoundLength,
eControl_CreateCasual
};
static int m_iDifficultyTitleSettingA[4];
// --- original variables (still required by cpp) ---
wstring m_worldName;
wstring m_seed;
UIControl m_controlMainPanel;
UIControl_Label m_labelWorldName;
UIControl_Button m_buttonGamemode, m_buttonMoreOptions, m_buttonCreateWorld;
UIControl_Button m_buttonGamemode;
UIControl_Button m_buttonMoreOptions;
UIControl_Button m_buttonCreateWorld;
UIControl_TextInput m_editWorldName;
UIControl_Slider m_sliderDifficulty;
UIControl_CheckBox m_checkboxOnline;
UIControl_BitmapIcon m_bitmapIcon, m_bitmapComparison;
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(IUIScene_StartGame)
UI_MAP_ELEMENT( m_controlMainPanel, "MainPanel" )
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlMainPanel )
UI_MAP_ELEMENT( m_labelWorldName, "WorldName")
UI_MAP_ELEMENT( m_editWorldName, "EditWorldName")
UI_MAP_ELEMENT( m_texturePackList, "TexturePackSelector")
UI_MAP_ELEMENT( m_buttonGamemode, "GameModeToggle")
UI_MAP_ELEMENT( m_checkboxOnline, "CheckboxOnline")
UI_MAP_ELEMENT( m_buttonMoreOptions, "MoreOptions")
UI_MAP_ELEMENT( m_buttonCreateWorld, "NewWorld")
UI_MAP_ELEMENT( m_sliderDifficulty, "Difficulty")
UI_END_MAP_CHILD_ELEMENTS()
UI_END_MAP_ELEMENTS_AND_NAMES()
UIControl_BitmapIcon m_bitmapIcon;
UIControl_BitmapIcon m_bitmapComparison;
bool m_bGameModeCreative;
int m_iGameModeId;
bool m_bMultiplayerAllowed;
DLCPack * m_pDLCPack;
DLCPack* m_pDLCPack;
bool m_bRebuildTouchBoxes;
// --- new battle UI controls ---
UIControl_Label m_labelMenuTitle;
UIControl_CheckBox m_checkboxCentralSpawn;
UIControl_CheckBox m_checkboxPublicGame;
UIControl_CheckBox m_checkboxFriendsOfFriends;
UIControl_CheckBox m_checkboxInviteOnly;
UIControl_Button m_buttonSelectMaps;
UIControl_Button m_buttonCreateCasual;
UIControl_Slider m_sliderRoundLength;
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(IUIScene_StartGame)
UI_MAP_ELEMENT(m_controlMainPanel, "MainPanel")
UI_BEGIN_MAP_CHILD_ELEMENTS(m_controlMainPanel)
UI_MAP_ELEMENT(m_labelMenuTitle, "MenuTitle")
// original UI bindings
UI_MAP_ELEMENT(m_labelWorldName, "WorldName")
UI_MAP_ELEMENT(m_editWorldName, "EditWorldName")
UI_MAP_ELEMENT(m_texturePackList, "TexturePackSelector")
UI_MAP_ELEMENT(m_buttonGamemode, "GameModeToggle")
UI_MAP_ELEMENT(m_checkboxOnline, "CheckboxOnline")
UI_MAP_ELEMENT(m_buttonMoreOptions, "MoreOptions")
UI_MAP_ELEMENT(m_buttonCreateWorld, "NewWorld")
UI_MAP_ELEMENT(m_sliderDifficulty, "Difficulty")
// battle menu bindings
UI_MAP_ELEMENT(m_checkboxCentralSpawn, "CheckboxCentralSpawn")
UI_MAP_ELEMENT(m_checkboxPublicGame, "CheckboxPublicGame")
UI_MAP_ELEMENT(m_checkboxFriendsOfFriends, "CheckboxFriendsOfFriends")
UI_MAP_ELEMENT(m_checkboxInviteOnly, "CheckboxInviteOnly")
UI_MAP_ELEMENT(m_buttonSelectMaps, "SelectMaps")
UI_MAP_ELEMENT(m_sliderRoundLength, "RoundLength")
UI_MAP_ELEMENT(m_buttonCreateCasual, "CreateCasual")
UI_END_MAP_CHILD_ELEMENTS()
UI_END_MAP_ELEMENTS_AND_NAMES()
public:
UIScene_CreateBattleMenu(int iPad, void *initData, UILayer *parentLayer);
UIScene_CreateBattleMenu(int iPad, void* initData, UILayer* parentLayer);
virtual ~UIScene_CreateBattleMenu();
virtual void updateTooltips();
virtual void updateComponents();
virtual EUIScene getSceneType() { return eUIScene_CreateWorldMenu;}
virtual EUIScene getSceneType() { return eUIScene_CreateWorldMenu; }
virtual void handleDestroy();
virtual void tick();
virtual UIControl* GetMainPanel();
virtual void handleTouchBoxRebuild();
protected:
// TODO: This should be pure virtual in this class
virtual wstring getMoviePath();
virtual void handleTimerComplete(int id);
virtual void handleGainFocus(bool navBack);
public:
// INPUT
virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool& handled);
#ifdef _WINDOWS64
virtual void getDirectEditInputs(vector<UIControl_TextInput*> &inputs);
virtual void onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result);
virtual void getDirectEditInputs(vector<UIControl_TextInput*>& inputs);
virtual void onDirectEditFinished(UIControl_TextInput* input, UIControl_TextInput::EDirectEditResult result);
#endif
private:
void StartSharedLaunchFlow();
bool IsLocalMultiplayerAvailable();
@@ -92,19 +140,20 @@ private:
#endif
protected:
static int KeyboardCompleteWorldNameCallback(LPVOID lpParam,const bool bRes);
static int KeyboardCompleteWorldNameCallback(LPVOID lpParam, const bool bRes);
void handlePress(F64 controlId, F64 childId);
void handleSliderMove(F64 sliderId, F64 currentValue);
static void CreateGame(UIScene_CreateBattleMenu* pClass, DWORD dwLocalUsersMask);
static int ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int StartGame_SignInReturned(void *pParam,bool bContinue, int iPad);
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ConfirmCreateReturned(void* pParam, int iPad, C4JStorage::EMessageResult result);
static int StartGame_SignInReturned(void* pParam, bool bContinue, int iPad);
static int MustSignInReturnedPSN(void* pParam, int iPad, C4JStorage::EMessageResult result);
#ifdef __ORBIS__
//static int PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ContinueOffline(void *pParam,int iPad,C4JStorage::EMessageResult result);
static int ContinueOffline(void* pParam, int iPad, C4JStorage::EMessageResult result);
#endif
virtual void checkStateAndStartGame();
};
@@ -149,21 +149,21 @@ void UIScene_MiniGamesMenu::AddDefaultButtons()
//m_iDefaultButtonsC++;
PBYTE data = nullptr; DWORD size = 0;
if (LoadPngFile(L"Assets/Battle.png", data, size)) {
if (LoadPngFile(L"D:/Assets/Battle.png", data, size)) {
registerSubstitutionTexture(L"mini_battle", data, size);
m_buttonListSaves.addItem(L"Battle", L"mini_battle");
m_iDefaultButtonsC++;
delete[] data;
}
if (LoadPngFile(L"Tumble.png", data, size)) {
if (LoadPngFile(L"D:/Assets/Tumble.png", data, size)) {
registerSubstitutionTexture(L"mini_tumble", data, size);
m_buttonListSaves.addItem(L"Tumble", L"mini_tumble");
m_iDefaultButtonsC++;
delete[] data;
}
if (LoadPngFile(L"Glide.png", data, size)) {
if (LoadPngFile(L"D:/Assets/Glide.png", data, size)) {
registerSubstitutionTexture(L"mini_glide", data, size);
m_buttonListSaves.addItem(L"Glide", L"mini_glide");
m_iDefaultButtonsC++;
+1 -1
View File
@@ -289,7 +289,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v145</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
+1 -1
View File
@@ -287,7 +287,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v145</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64EC'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>