feat: new skinselectmenu

This commit is contained in:
aRockefeller
2026-07-04 15:44:01 -04:00
committed by Fireblade
parent cf909ff9ff
commit 0f5ef3b6c0
16 changed files with 585 additions and 317 deletions
@@ -32,6 +32,7 @@ bool UIControl_MultiList::setupControl(UIScene *scene, IggyValuePath *parent, co
m_funcEnableItem = registerFastName(L"EnableItem"); m_funcEnableItem = registerFastName(L"EnableItem");
m_funcCheckElementExists = registerFastName(L"CheckElementExists"); m_funcCheckElementExists = registerFastName(L"CheckElementExists");
m_funcSetTouchFocus = registerFastName(L"SetTouchFocus"); m_funcSetTouchFocus = registerFastName(L"SetTouchFocus");
m_removeAllItemsFunc = registerFastName(L"removeAllItems");
return success; return success;
} }
@@ -316,6 +317,17 @@ void UIControl_MultiList::EnableItem(int id, bool bEnable, bool bImmediate)
getIggyValuePath(), m_funcEnableItem, 2, value); getIggyValuePath(), m_funcEnableItem, 2, value);
} }
void UIControl_MultiList::clearList()
{
IggyDataValue result;
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result,
getIggyValuePath(), m_removeAllItemsFunc, 0, nullptr);
m_itemIds.clear();
m_itemCount = 0;
m_iCurrentSelection = 0;
}
bool UIControl_MultiList::CheckElementExists(int id) bool UIControl_MultiList::CheckElementExists(int id)
{ {
IggyDataValue result; IggyDataValue result;
@@ -24,6 +24,7 @@ protected:
IggyName m_funcEnableItem; IggyName m_funcEnableItem;
IggyName m_funcCheckElementExists; IggyName m_funcCheckElementExists;
IggyName m_funcSetTouchFocus; IggyName m_funcSetTouchFocus;
IggyName m_removeAllItemsFunc;
// stores caller-defined ids in insertion order (label = -1) // stores caller-defined ids in insertion order (label = -1)
// iggy uses positional index; getListIndex() converts id to index. // iggy uses positional index; getListIndex() converts id to index.
@@ -50,6 +51,7 @@ public:
void SetSliderLabel(int id, const wstring &label, bool bImmediate = true); void SetSliderLabel(int id, const wstring &label, bool bImmediate = true);
void HighlightItem(int id, bool animate = false); void HighlightItem(int id, bool animate = false);
void EnableItem(int id, bool bEnable, bool bImmediate = true); void EnableItem(int id, bool bEnable, bool bImmediate = true);
void clearList();
bool CheckElementExists(int id); bool CheckElementExists(int id);
int getCurrentSelection() const { return m_iCurrentSelection; } int getCurrentSelection() const { return m_iCurrentSelection; }
void updateChildFocus(int iChild) { m_iCurrentSelection = iChild; } void updateChildFocus(int iChild) { m_iCurrentSelection = iChild; }
@@ -120,7 +120,7 @@ void UIControl_PlayerSkinPreview::tick()
++m_framesAnimatingRotation; ++m_framesAnimatingRotation;
m_yRot = m_fOriginalRotation + m_framesAnimatingRotation * ( (m_fTargetRotation - m_fOriginalRotation) / CHANGING_SKIN_FRAMES ); m_yRot = m_fOriginalRotation + m_framesAnimatingRotation * ( (m_fTargetRotation - m_fOriginalRotation) / CHANGING_SKIN_FRAMES );
//if(m_framesAnimatingRotation == CHANGING_SKIN_FRAMES) m_bAnimatingToFacing = false; if(m_framesAnimatingRotation == CHANGING_SKIN_FRAMES) m_bAnimatingToFacing = false;
} }
else else
{ {
@@ -12,7 +12,7 @@ private:
static const int LOOK_LEFT_EXTENT = 45; static const int LOOK_LEFT_EXTENT = 45;
static const int LOOK_RIGHT_EXTENT = -45; static const int LOOK_RIGHT_EXTENT = -45;
static const int CHANGING_SKIN_FRAMES = 15; static const int CHANGING_SKIN_FRAMES = 8;
enum ESkinPreviewAnimations enum ESkinPreviewAnimations
{ {
@@ -76,6 +76,7 @@ public:
void DecrementXRotation() { m_xRot = (m_xRot-2); if(m_xRot < -22) m_xRot = -22; } void DecrementXRotation() { m_xRot = (m_xRot-2); if(m_xRot < -22) m_xRot = -22; }
void SetAutoRotate(bool autoRotate) { m_bAutoRotate = autoRotate; } void SetAutoRotate(bool autoRotate) { m_bAutoRotate = autoRotate; }
void SetFacing(ESkinPreviewFacing facing, bool bAnimate = false); void SetFacing(ESkinPreviewFacing facing, bool bAnimate = false);
bool IsAnimatingToFacing() const { return m_bAnimatingToFacing; }
void CycleNextAnimation(); void CycleNextAnimation();
void CyclePreviousAnimation(); void CyclePreviousAnimation();
@@ -45,6 +45,7 @@ void UIScene_SettingsAudioMenu::tick()
{ {
m_bNeedsMultiListPopulate = false; m_bNeedsMultiListPopulate = false;
m_multiList.setupControl(this, m_rootPath, "MultiList"); m_multiList.setupControl(this, m_rootPath, "MultiList");
m_multiList.clearList();
m_multiList.init(eControl_MultiList); m_multiList.init(eControl_MultiList);
WCHAR TempString[256]; WCHAR TempString[256];
@@ -100,6 +100,7 @@ void UIScene_SettingsGraphicsMenu::tick()
{ {
m_bNeedsMultiListPopulate = false; m_bNeedsMultiListPopulate = false;
m_multiList.setupControl(this, m_rootPath, "MultiList"); m_multiList.setupControl(this, m_rootPath, "MultiList");
m_multiList.clearList();
m_multiList.init(eControl_MultiList); m_multiList.init(eControl_MultiList);
WCHAR TempString[256]; WCHAR TempString[256];
@@ -57,6 +57,7 @@ void UIScene_SettingsOptionsMenu::tick()
{ {
m_bNeedsMultiListPopulate = false; m_bNeedsMultiListPopulate = false;
m_multiList.setupControl(this, m_rootPath, "MultiList"); m_multiList.setupControl(this, m_rootPath, "MultiList");
m_multiList.clearList();
m_multiList.init(eControl_MultiList); m_multiList.init(eControl_MultiList);
m_multiList.AddNewCheckbox(app.GetString(IDS_CHECKBOX_VERTICAL_SPLIT_SCREEN), eControl_VerticalSplitscreen, (app.GetGameSettings(m_iPad,eGameSetting_SplitScreenVertical)!=0)); m_multiList.AddNewCheckbox(app.GetString(IDS_CHECKBOX_VERTICAL_SPLIT_SCREEN), eControl_VerticalSplitscreen, (app.GetGameSettings(m_iPad,eGameSetting_SplitScreenVertical)!=0));
@@ -59,6 +59,7 @@ void UIScene_SettingsUIMenu::tick()
{ {
m_bNeedsMultiListPopulate = false; m_bNeedsMultiListPopulate = false;
m_multiList.setupControl(this, m_rootPath, "MultiList"); m_multiList.setupControl(this, m_rootPath, "MultiList");
m_multiList.clearList();
m_multiList.init(eControl_MultiList); m_multiList.init(eControl_MultiList);
bool bPrimaryPlayer = (ProfileManager.GetPrimaryPad() == m_iPad); bool bPrimaryPlayer = (ProfileManager.GetPrimaryPad() == m_iPad);
File diff suppressed because it is too large Load Diff
@@ -2,6 +2,8 @@
#include "../../../Minecraft.World/Definitions.h" #include "../../../Minecraft.World/Definitions.h"
#include "UIScene.h" #include "UIScene.h"
#include "UIControl_PlayerSkinPreview.h" #include "UIControl_PlayerSkinPreview.h"
#include "UIControl_MultiList.h"
#include "UIControl_BitmapIcon.h"
class UIScene_SkinSelectMenu : public UIScene class UIScene_SkinSelectMenu : public UIScene
{ {
@@ -9,7 +11,7 @@ private:
static const WCHAR *wchDefaultNamesA[eDefaultSkins_Count]; static const WCHAR *wchDefaultNamesA[eDefaultSkins_Count];
// 4J Stu - How many to show on each side of the main control // 4J Stu - How many to show on each side of the main control
static const BYTE sidePreviewControls = 4; static const BYTE sidePreviewControls = 2;
#ifdef __PSVITA__ #ifdef __PSVITA__
enum ETouchInput enum ETouchInput
@@ -33,45 +35,37 @@ private:
enum ECharacters enum ECharacters
{ {
eCharacter_Current, eCharacter_Current = 0,
eCharacter_Next1, eCharacter_Next1 = 1,
eCharacter_Next2, eCharacter_Next2 = 2,
eCharacter_Next3, eCharacter_Previous1 = 5,
eCharacter_Next4, eCharacter_Previous2 = 6,
eCharacter_Previous1,
eCharacter_Previous2,
eCharacter_Previous3,
eCharacter_Previous4,
eCharacter_COUNT, eCharacter_COUNT = 7,
}; };
UIControl_PlayerSkinPreview m_characters[eCharacter_COUNT]; UIControl_PlayerSkinPreview m_characters[eCharacter_COUNT];
UIControl_Label m_labelSkinName, m_labelSkinOrigin; UIControl_Label m_labelSkinName, m_labelSkinOrigin;
UIControl_Label m_labelSelected; UIControl m_controlBlocked, m_controlFavourite, m_controlLocked, m_controlSelected;
UIControl m_controlSkinNamePlate, m_controlSelectedPanel, m_controlIggyCharacters, m_controlTimer; UIControl_Label m_labelPackName, m_labelPackType;
#ifdef __PSVITA__ UIControl_MultiList m_controlSkinButtonList;
UIControl_Touch m_TouchTabLeft, m_TouchTabRight, m_TouchTabCenter, m_TouchIggyCharacters; UIControl_BitmapIcon m_controlTexturePackIcon;
#endif UIControl m_controlIggyCharacters, m_controlTimer;
IggyName m_funcSetPlayerCharacterSelected, m_funcSetCharacterLocked; IggyName m_funcSetPlayerCharacterSelected, m_funcSetCharacterLocked;
IggyName m_funcSetLeftLabel, m_funcSetRightLabel, m_funcSetCentreLabel; IggyName m_funcSetCharacterFavourite, m_funcSetCharacterBlocked;
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
#ifdef __PSVITA__ UI_MAP_ELEMENT( m_controlBlocked, "Blocked" )
UI_MAP_ELEMENT( m_TouchTabLeft, "TouchTabLeft" ) UI_MAP_ELEMENT( m_controlFavourite, "Favourite" )
UI_MAP_ELEMENT( m_TouchTabRight, "TouchTabRight" ) UI_MAP_ELEMENT( m_controlLocked, "Locked" )
UI_MAP_ELEMENT( m_TouchTabCenter, "TouchTabCenter" ) UI_MAP_ELEMENT( m_controlSelected, "Selected" )
UI_MAP_ELEMENT( m_TouchIggyCharacters, "TouchIggyCharacters" )
#endif UI_MAP_ELEMENT( m_labelSkinName, "SkinTitle1" )
UI_MAP_ELEMENT( m_controlSkinNamePlate, "SkinNamePlate") UI_MAP_ELEMENT( m_labelSkinOrigin, "SkinTitle2" )
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlSkinNamePlate ) UI_MAP_ELEMENT( m_labelPackName, "Pack_Name" )
UI_MAP_ELEMENT( m_labelSkinName, "SkinTitle1") UI_MAP_ELEMENT( m_labelPackType, "Pack_Type" )
UI_MAP_ELEMENT( m_labelSkinOrigin, "SkinTitle2")
UI_END_MAP_CHILD_ELEMENTS() UI_MAP_ELEMENT( m_controlTexturePackIcon, "TexturePackIcon" )
UI_MAP_ELEMENT( m_controlSkinButtonList, "SkinButtonList" )
UI_MAP_ELEMENT( m_controlSelectedPanel, "SelectedPanel" )
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlSelectedPanel )
UI_MAP_ELEMENT( m_labelSelected, "SelectedPanelLabel" )
UI_END_MAP_CHILD_ELEMENTS()
UI_MAP_ELEMENT( m_controlTimer, "Timer" ) UI_MAP_ELEMENT( m_controlTimer, "Timer" )
@@ -82,21 +76,17 @@ private:
UI_MAP_ELEMENT( m_characters[eCharacter_Next1], "iggy_Character1" ) UI_MAP_ELEMENT( m_characters[eCharacter_Next1], "iggy_Character1" )
UI_MAP_ELEMENT( m_characters[eCharacter_Next2], "iggy_Character2" ) UI_MAP_ELEMENT( m_characters[eCharacter_Next2], "iggy_Character2" )
UI_MAP_ELEMENT( m_characters[eCharacter_Next3], "iggy_Character3" ) UI_MAP_ELEMENT( m_characters[3], "iggy_Character3" )
UI_MAP_ELEMENT( m_characters[eCharacter_Next4], "iggy_Character4" ) UI_MAP_ELEMENT( m_characters[4], "iggy_Character4" )
UI_MAP_ELEMENT( m_characters[eCharacter_Previous1], "iggy_Character5" ) UI_MAP_ELEMENT( m_characters[eCharacter_Previous1], "iggy_Character5" )
UI_MAP_ELEMENT( m_characters[eCharacter_Previous2], "iggy_Character6" ) UI_MAP_ELEMENT( m_characters[eCharacter_Previous2], "iggy_Character6" )
UI_MAP_ELEMENT( m_characters[eCharacter_Previous3], "iggy_Character7" )
UI_MAP_ELEMENT( m_characters[eCharacter_Previous4], "iggy_Character8" )
UI_END_MAP_CHILD_ELEMENTS() UI_END_MAP_CHILD_ELEMENTS()
UI_MAP_NAME( m_funcSetPlayerCharacterSelected, L"SetPlayerCharacterSelected" ) UI_MAP_NAME( m_funcSetPlayerCharacterSelected, L"SetPlayerCharacterSelected" )
UI_MAP_NAME( m_funcSetCharacterLocked, L"SetCharacterLocked" ) UI_MAP_NAME( m_funcSetCharacterLocked, L"SetCharacterLocked" )
UI_MAP_NAME( m_funcSetCharacterFavourite, L"SetCharacterFavourite" )
UI_MAP_NAME( m_funcSetLeftLabel, L"SetLeftLabel" ) UI_MAP_NAME( m_funcSetCharacterBlocked, L"SetCharacterBlocked" )
UI_MAP_NAME( m_funcSetCentreLabel, L"SetCenterLabel" )
UI_MAP_NAME( m_funcSetRightLabel, L"SetRightLabel" )
UI_END_MAP_ELEMENTS_AND_NAMES() UI_END_MAP_ELEMENTS_AND_NAMES()
DLCPack *m_currentPack; DLCPack *m_currentPack;
@@ -112,7 +102,10 @@ private:
DWORD m_currentPackCount; DWORD m_currentPackCount;
bool m_bIgnoreInput; bool m_bIgnoreInput;
bool m_bSkinIndexChanged; bool m_bSkinIndexChanged;
wstring m_leftLabel, m_centreLabel, m_rightLabel; bool m_bFocusDirty;
bool m_bNeedButtonListRefresh;
bool m_bHasTexturePack;
int m_iTexturePackIndex;
S32 m_iTouchXStart; S32 m_iTouchXStart;
bool m_bTouchScrolled; bool m_bTouchScrolled;
@@ -131,6 +124,7 @@ public:
virtual void handleAnimationEnd(); virtual void handleAnimationEnd();
virtual void handleFocusChange(F64 controlId, F64 childId);
protected: protected:
// TODO: This should be pure virtual in this class // TODO: This should be pure virtual in this class
@@ -156,10 +150,14 @@ private:
void setCharacterSelected(bool selected); void setCharacterSelected(bool selected);
void setCharacterLocked(bool locked); void setCharacterLocked(bool locked);
void setCharacterFavourite(bool favourite);
void setLeftLabel(const wstring &label); void setCharacterBlocked(bool blocked);
void setCentreLabel(const wstring &label); void SetSkinPackButtonList();
void setRightLabel(const wstring &label); void setPackLabel();
int relativePackIndex(DWORD base, int offset);
void handlePress(F64 controlId, F64 childId);
void setActivePackIndex();
bool registerTexture(const wstring &texturePath);
virtual void HandleDLCMountingComplete(); virtual void HandleDLCMountingComplete();
virtual void HandleDLCInstalled(); virtual void HandleDLCInstalled();
@@ -174,6 +172,8 @@ private:
void AddFavoriteSkin(int iPad,int iSkinID); void AddFavoriteSkin(int iPad,int iSkinID);
void InputActionOK(unsigned int iPad); void InputActionOK(unsigned int iPad);
void InputActionFavorite(unsigned int iPad);
void SetFavoriteSkin(unsigned int pad, int skinId);
#ifdef __PSVITA__ #ifdef __PSVITA__
virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased);
#endif //__PSVITA__ #endif //__PSVITA__
@@ -9646,4 +9646,20 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc
<data name="IDS_PROGRESS_COPYING_SAVE"> <data name="IDS_PROGRESS_COPYING_SAVE">
<value>Copying Save</value> <value>Copying Save</value>
</data> </data>
<data name="IDS_TEXTURE_PACK">
<value>Texture Pack</value>
</data>
<data name="IDS_SKIN_PACK">
<value>Skin Pack</value>
</data>
<data name="IDS_TOOLTIPS_ADD_FAVORITE">
<value>Add Favorite</value>
</data>
<data name="IDS_TOOLTIPS_REMOVE_FAVORITE">
<value>Remove Favorite</value>
</data>
</root> </root>