add the shitty lcen code

This commit is contained in:
Byte
2026-06-22 07:25:49 +02:00
parent 8a6d21779d
commit 658849b427
356 changed files with 185252 additions and 40953 deletions
@@ -1,79 +1,33 @@
#include "stdafx.h"
#include "UI.h"
#if defined(__PS3__) || defined(__ORBIS__)
#include "Common/Network/Sony/SonyCommerce.h"
#endif
#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)
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 );
app.SetLiveLinkRequired(true);
m_labelOffers.init(IDS_DOWNLOADABLE_CONTENT_OFFERS);
m_buttonListOffers.init(eControl_OffersList);
#if defined _XBOX_ONE || defined __ORBIS__
// load any local DLC images
app.LoadLocalDLCImages();
#endif
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
// show a timer on this menu
m_Timer.setVisible(true);
m_bCategoriesShown=false;
#endif
if(m_loadedResolution == eSceneResolution_1080)
{
#ifdef _DURANGO
m_labelXboxStore.init(IDS_XBOX_STORE);
#else
m_labelXboxStore.init( L"" );
#endif
}
m_labelXboxStore.init(L"");
m_buttonListOffers.addItem(L"All Packs", 0);
m_buttonListOffers.addItem(L"Skin Packs", 1);
m_buttonListOffers.addItem(L"Texture Packs", 2);
m_buttonListOffers.addItem(L"Mash-up Packs", 3);
m_buttonListOffers.setFocus(true);
#if defined(_DURANGO)
m_Timer.setVisible(false);
m_buttonListOffers.addItem(IDS_DLC_MENU_SKINPACKS,e_DLC_SkinPack);
m_buttonListOffers.addItem(IDS_DLC_MENU_TEXTUREPACKS,e_DLC_TexturePacks);
m_buttonListOffers.addItem(IDS_DLC_MENU_MASHUPPACKS,e_DLC_MashupPacks);
app.AddDLCRequest(e_Marketplace_Content); // content is skin packs, texture packs and mash-up packs
// we also need to mount the local DLC so we can tell what's been purchased
app.StartInstallDLCProcess(iPad);
#endif
TelemetryManager->RecordMenuShown(iPad, eUIScene_DLCMainMenu, 0);
#if defined __ORBIS__ || defined __PSVITA__
app.GetCommerce()->ShowPsStoreIcon();
#endif
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ )
addTimer( PLAYER_ONLINE_TIMER_ID, PLAYER_ONLINE_TIMER_TIME );
#endif
}
UIScene_DLCMainMenu::~UIScene_DLCMainMenu()
{
// Alert the app the we no longer want to be informed of ethernet connections
app.SetLiveLinkRequired( false );
#if defined _XBOX_ONE || defined __ORBIS__
app.FreeLocalDLCImages();
#endif
#ifdef _XBOX_ONE
// 4J-JEV: Have to switch back to user preferred languge now.
setLanguageOverride(true);
#endif
app.SetLiveLinkRequired(false);
}
wstring UIScene_DLCMainMenu::getMoviePath()
@@ -83,29 +37,19 @@ wstring UIScene_DLCMainMenu::getMoviePath()
void UIScene_DLCMainMenu::updateTooltips()
{
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK );
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)
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)
{
#if defined __ORBIS__ || defined __PSVITA__
app.GetCommerce()->HidePsStoreIcon();
#endif
navigateBack();
}
if(pressed) navigateBack();
break;
case ACTION_MENU_OK:
#ifdef __ORBIS__
case ACTION_MENU_TOUCHPAD_PRESS:
#endif
sendInputToMovie(key, repeat, pressed, released);
break;
case ACTION_MENU_UP:
@@ -121,122 +65,32 @@ void UIScene_DLCMainMenu::handleInput(int iPad, int key, bool repeat, bool press
void UIScene_DLCMainMenu::handlePress(F64 controlId, F64 childId)
{
switch(static_cast<int>(controlId))
{
case eControl_OffersList:
{
int iIndex = static_cast<int>(childId);
DLCOffersParam *param = new DLCOffersParam();
param->iPad = m_iPad;
if(static_cast<int>(controlId) != eControl_OffersList) return;
param->iType = iIndex;
// promote the DLC content request type
// Xbox One will have requested the marketplace content - there is only that type
#ifndef _XBOX_ONE
app.AddDLCRequest(static_cast<eDLCMarketplaceType>(iIndex), true);
#endif
killTimer(PLAYER_ONLINE_TIMER_ID);
ui.NavigateToScene(m_iPad, eUIScene_DLCOffersMenu, param);
break;
}
};
}
void UIScene_DLCMainMenu::handleTimerComplete(int id)
{
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__)
switch(id)
{
case PLAYER_ONLINE_TIMER_ID:
#ifndef _WINDOWS64
if(ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad())==false)
{
// check the player hasn't gone offline
// If they have, bring up the PSN warning and exit from the leaderboards
unsigned int uiIDA[1];
uiIDA[0]=IDS_OK;
C4JStorage::EMessageResult result = ui.RequestErrorMessage( IDS_CONNECTION_LOST, g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT), uiIDA,1,ProfileManager.GetPrimaryPad(),UIScene_DLCMainMenu::ExitDLCMainMenu,this);
}
#endif
break;
}
#endif
}
int UIScene_DLCMainMenu::ExitDLCMainMenu(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_DLCMainMenu* pClass = static_cast<UIScene_DLCMainMenu *>(pParam);
#if defined __ORBIS__ || defined __PSVITA__
app.GetCommerce()->HidePsStoreIcon();
#endif
pClass->navigateBack();
return 0;
DLCOffersParam* param = new DLCOffersParam();
param->iPad = m_iPad;
param->iType = static_cast<int>(childId);
ui.NavigateToScene(m_iPad, eUIScene_DLCOffersMenu, param);
}
void UIScene_DLCMainMenu::handleGainFocus(bool navBack)
{
UIScene::handleGainFocus(navBack);
updateTooltips();
if(navBack)
{
// add the timer back in
#if ( defined __PS3__ || defined __ORBIS__ || defined __PSVITA__ )
addTimer( PLAYER_ONLINE_TIMER_ID, PLAYER_ONLINE_TIMER_TIME );
#endif
}
}
void UIScene_DLCMainMenu::tick()
{
UIScene::tick();
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
if((m_bCategoriesShown==false) && (app.GetCommerceCategoriesRetrieved()))
{
// disable the timer display on this menu
m_Timer.setVisible(false);
m_bCategoriesShown=true;
// add the categories to the list box
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
std::list<SonyCommerce::CategoryInfoSub>::iterator iter = pCategories->subCategories.begin();
SonyCommerce::CategoryInfoSub category;
for(int i=0;i<pCategories->countOfSubCategories;i++)
{
// add a button in with the subcategory
category = (SonyCommerce::CategoryInfoSub)(*iter);
string teststring=category.categoryName;
m_buttonListOffers.addItem(teststring,i);
iter++;
}
// set the focus to the first thing in the categories if there are any
if(pCategories->countOfSubCategories>0)
{
m_buttonListOffers.setFocus(true);
}
else
{
#if defined __ORBIS__ || defined __PSVITA__ || defined __PS3__
app.CheckForEmptyStore(ProfileManager.GetPrimaryPad());
#endif
// need to display text to say no downloadable content available yet
m_labelOffers.setLabel(app.GetString(IDS_NO_DLCCATEGORIES));
#ifdef __ORBIS__
// 4J-JEV: TRC Requirement (R4055), need to display this system message.
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_EMPTY_STORE, ProfileManager.GetPrimaryPad() );
#endif
}
}
#endif
}
void UIScene_DLCMainMenu::handleTimerComplete(int id)
{
}
int UIScene_DLCMainMenu::ExitDLCMainMenu(void* pParam, int iPad, C4JStorage::EMessageResult result)
{
UIScene_DLCMainMenu* pClass = static_cast<UIScene_DLCMainMenu*>(pParam);
pClass->navigateBack();
return 0;
}
File diff suppressed because it is too large Load Diff
@@ -1,96 +1,75 @@
#pragma once
#include "UIScene.h"
struct WorkshopZip
{
std::string filename;
std::string destToken;
};
struct WorkshopPack
{
std::string id;
std::wstring name;
std::wstring author;
std::wstring description;
std::vector<std::string> categories;
std::string thumbnailUrl;
std::vector<WorkshopZip> zips;
std::string version;
std::vector<BYTE> thumbnailData;
bool thumbnailLoaded;
WorkshopPack() : thumbnailLoaded(false) {}
};
class UIScene_DLCOffersMenu : public UIScene
{
private:
enum EControls
{
eControl_OffersList,
};
bool m_bIsSD;
bool m_bHasPurchased;
bool m_bIsSelected;
UIControl_DLCList m_buttonListOffers;
UIControl_Label m_labelOffers, m_labelPriceTag, m_labelXboxStore;
UIControl_HTMLLabel m_labelHTMLSellText;
UIControl_BitmapIcon m_bitmapIconOfferImage;
UIControl m_Timer;
enum EControls { eControl_OffersList };
enum EFetchState { eFetch_Idle, eFetch_Ready, eFetch_Error };
bool m_bIsSD;
bool m_bHasPurchased;
bool m_bIsSelected;
UIControl_DLCList m_buttonListOffers;
UIControl_Label m_labelOffers, m_labelPriceTag, m_labelXboxStore;
UIControl_HTMLLabel m_labelHTMLSellText;
UIControl_BitmapIcon m_bitmapIconOfferImage;
UIControl m_Timer;
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
UI_MAP_ELEMENT( m_buttonListOffers, "OffersList")
UI_MAP_ELEMENT( m_labelOffers, "OffersList_Title")
UI_MAP_ELEMENT( m_labelPriceTag, "PriceTag")
UI_MAP_ELEMENT( m_labelHTMLSellText, "HTMLSellText")
UI_MAP_ELEMENT( m_bitmapIconOfferImage, "DLCIcon" )
UI_MAP_ELEMENT( m_Timer, "Timer")
UI_MAP_ELEMENT(m_buttonListOffers, "OffersList")
UI_MAP_ELEMENT(m_labelOffers, "OffersList_Title")
UI_MAP_ELEMENT(m_labelPriceTag, "PriceTag")
UI_MAP_ELEMENT(m_labelHTMLSellText, "HTMLSellText")
UI_MAP_ELEMENT(m_bitmapIconOfferImage, "DLCIcon")
UI_MAP_ELEMENT(m_Timer, "Timer")
if(m_loadedResolution == eSceneResolution_1080)
{
UI_MAP_ELEMENT( m_labelXboxStore, "XboxLabel" )
UI_MAP_ELEMENT(m_labelXboxStore, "XboxLabel")
}
UI_END_MAP_ELEMENTS_AND_NAMES()
EFetchState m_eFetchState;
std::vector<WorkshopPack> m_packs;
std::vector<WorkshopPack*> m_filteredPacks;
int m_iCurrentPack;
int m_iProductInfoIndex;
static const char* CategoryForIndex(int index);
static bool FetchURL(const std::string& url, std::vector<BYTE>& outData);
static bool FetchURLString(const std::string& url, std::string& outStr);
bool ParseRegistry(const std::string& json);
void PopulateList();
void UpdateDetailPanel();
static bool InstallPack(const std::vector<BYTE>& zipData, const std::string& packName);
static bool IsPackInstalled(const std::string& packName);
public:
UIScene_DLCOffersMenu(int iPad, void *initData, UILayer *parentLayer);
UIScene_DLCOffersMenu(int iPad, void* initData, UILayer* parentLayer);
~UIScene_DLCOffersMenu();
static int ExitDLCOffersMenu(void *pParam,int iPad,C4JStorage::EMessageResult result);
virtual EUIScene getSceneType() { return eUIScene_DLCOffersMenu;}
virtual void tick();
virtual void updateTooltips();
static int ExitDLCOffersMenu(void* pParam, int iPad, C4JStorage::EMessageResult result);
virtual EUIScene getSceneType() { return eUIScene_DLCOffersMenu; }
virtual void tick();
virtual void updateTooltips();
protected:
// TODO: This should be pure virtual in this class
virtual wstring getMoviePath();
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);
virtual void handlePress(F64 controlId, F64 childId);
virtual void handleSelectionChanged(F64 selectedId);
virtual void handleFocusChange(F64 controlId, F64 childId);
virtual void handleTimerComplete(int id);
#ifdef __PS3__
virtual void HandleDLCInstalled();
#endif
#ifdef _XBOX_ONE
virtual void HandleDLCLicenseChange();
#endif
private:
#ifdef _DURANGO
void GetDLCInfo( int iOfferC, bool bUpdateOnly=false );
void UpdateTooltips(MARKETPLACE_CONTENTOFFER_INFO& xOffer);
bool UpdateDisplay(MARKETPLACE_CONTENTOFFER_INFO& xOffer);
static int OrderSortFunction(const void* a, const void* b);
bool m_bIgnorePress;
bool m_bDLCRequiredIsRetrieved;
DLC_INFO *m_pNoImageFor_DLC;
typedef struct
{
unsigned int uiContentIndex;
unsigned int uiSortIndex;
}
SORTINDEXSTRUCT;
vector <wstring>m_vIconRetrieval;
bool m_bSelectionChanged;
#endif
bool m_bProductInfoShown;
int m_iProductInfoIndex;
int m_iCurrentDLC;
int m_iTotalDLC;
bool m_bAddAllDLCButtons;
#if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__)
std::vector<SonyCommerce::ProductInfo>*m_pvProductInfo;
#endif
};
};
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "UI.h"
#include "UIScene_LanguageSelector.h"
// pasted from lcen client aswell
// strings for buttons in the list
const unsigned int UIScene_LanguageSelector::m_uiHTPButtonNameA[]=
{
@@ -125,5 +125,8 @@ void UIScene_LanguageSelector::handlePress(F64 controlId, F64 childId)
app.SetMinecraftLocale(m_iPad, newLocale);
app.CheckGameSettingsChanged(true, m_iPad);
app.loadStringTable();
app.SetAction(m_iPad, eAppAction_ReloadFont);
}
}
@@ -1,10 +1,8 @@
#include "stdafx.h"
#include "UI.h"
#include "UIScene_SettingsOptionsMenu.h"
#if defined(_XBOX_ONE)
// pasted legit out of lcen client lol
#define _ENABLE_LANGUAGE_SELECT
#endif
int UIScene_SettingsOptionsMenu::m_iDifficultySettingA[4]=
{
@@ -137,26 +135,21 @@ UIScene_SettingsOptionsMenu::UIScene_SettingsOptionsMenu(int iPad, void *initDat
// MGH - disabled the language select for the patch build, we'll re-enable afterwards
// 4J Stu - Removed it with a preprocessor def as we turn this off in various places
#ifdef _ENABLE_LANGUAGE_SELECT
if (app.GetGameStarted())
{
removeControl( &m_buttonLanguageSelect, false );
}
else
{
m_buttonLanguageSelect.init(IDS_LANGUAGE_SELECTOR, eControl_Languages);
}
if (app.GetGameStarted())
{
removeControl(&m_buttonLanguageSelect, false);
}
else
{
m_buttonLanguageSelect.init(IDS_LANGUAGE_SELECTOR, eControl_Languages);
}
#else
removeControl( &m_buttonLanguageSelect, false );
#endif
doHorizontalResizeCheck();
removeControl(&m_buttonLanguageSelect, false);
if(app.GetLocalPlayerCount()>1)
{
#if TO_BE_IMPLEMENTED
app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
#endif
}
m_labelDifficultyText.disableReinitialisation();
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff