mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-02 23:12:25 +00:00
280 lines
10 KiB
C++
280 lines
10 KiB
C++
#include "IUIScene_StartGame.h"
|
|
|
|
#include <wchar.h>
|
|
|
|
#include <cstdint>
|
|
|
|
#include "platform/sdl2/Profile.h"
|
|
#include "app/common/App_structs.h"
|
|
#include "app/common/DLC/DLCManager.h"
|
|
#include "app/common/UI/Controls/UIControl_BitmapIcon.h"
|
|
#include "app/common/UI/Controls/UIControl_Label.h"
|
|
#include "app/common/UI/Controls/UIControl_TexturePackList.h"
|
|
#include "app/common/UI/UIScene.h"
|
|
#include "app/linux/Iggy/include/rrCore.h"
|
|
#include "app/linux/LinuxGame.h"
|
|
#include "minecraft/client/Minecraft.h"
|
|
#include "minecraft/client/skins/TexturePack.h"
|
|
#include "minecraft/client/skins/TexturePackRepository.h"
|
|
|
|
class UILayer;
|
|
|
|
IUIScene_StartGame::IUIScene_StartGame(int iPad, UILayer* parentLayer)
|
|
: UIScene(iPad, parentLayer) {
|
|
m_bIgnoreInput = false;
|
|
m_iTexturePacksNotInstalled = 0;
|
|
m_texturePackDescDisplayed = false;
|
|
m_bShowTexturePackDescription = false;
|
|
m_iSetTexturePackDescription = -1;
|
|
|
|
Minecraft* pMinecraft = Minecraft::GetInstance();
|
|
m_currentTexturePackIndex = pMinecraft->skins->getTexturePackIndex(0);
|
|
}
|
|
|
|
void IUIScene_StartGame::HandleDLCMountingComplete() {
|
|
Minecraft* pMinecraft = Minecraft::GetInstance();
|
|
// scissors wlw kissing girls yuri snuggle yuri yuri
|
|
m_texturePackList.clearSlots();
|
|
|
|
int texturePacksCount = pMinecraft->skins->getTexturePackCount();
|
|
|
|
for (unsigned int i = 0; i < texturePacksCount; ++i) {
|
|
TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i);
|
|
|
|
std::uint32_t imageBytes = 0;
|
|
std::uint8_t* imageData = tp->getPackIcon(imageBytes);
|
|
|
|
if (imageBytes > 0 && imageData) {
|
|
wchar_t imageName[64];
|
|
swprintf(imageName, 64, L"tpack%08x", tp->getId());
|
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
|
m_texturePackList.addPack(i, imageName);
|
|
}
|
|
}
|
|
|
|
m_iTexturePacksNotInstalled = 0;
|
|
|
|
// yuri-yuri - FUCKING KISS ALREADY yuri ship scissors blushing girls yuri snuggle'scissors ship, canon i love girls i love amy is the best yuri i love girls
|
|
// yuri wlw blushing girls canon yuri canon
|
|
DLC_INFO* pDLCInfo = nullptr;
|
|
|
|
// blushing girls yuri - yuri lesbian kiss yuri my wife lesbian kiss yuri my wife canon yuri lesbian FUCKING KISS ALREADY yuri snuggle
|
|
bool bTexturePackAlreadyListed;
|
|
bool bNeedToGetTPD = false;
|
|
|
|
for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) {
|
|
bTexturePackAlreadyListed = false;
|
|
uint64_t ull = app.GetDLCInfoTexturesFullOffer(i);
|
|
pDLCInfo = app.GetDLCInfoForFullOfferID(ull);
|
|
for (unsigned int i = 0; i < texturePacksCount; ++i) {
|
|
TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i);
|
|
if (pDLCInfo->iConfig == tp->getDLCParentPackId()) {
|
|
bTexturePackAlreadyListed = true;
|
|
}
|
|
}
|
|
if (bTexturePackAlreadyListed == false) {
|
|
// FUCKING KISS ALREADY lesbian kiss
|
|
bNeedToGetTPD = true;
|
|
|
|
m_iTexturePacksNotInstalled++;
|
|
}
|
|
}
|
|
|
|
#if TO_BE_IMPLEMENTED
|
|
if (bNeedToGetTPD == true) {
|
|
// yuri blushing girls girl love yuri my girlfriend yuri
|
|
app.DebugPrintf("+++ Adding TMSPP request for texture pack data\n");
|
|
app.AddTMSPPFileTypeRequest(e_DLC_TexturePackData);
|
|
if (m_iConfigA != nullptr) {
|
|
delete m_iConfigA;
|
|
}
|
|
m_iConfigA = new int[m_iTexturePacksNotInstalled];
|
|
m_iTexturePacksNotInstalled = 0;
|
|
|
|
for (unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) {
|
|
bTexturePackAlreadyListed = false;
|
|
uint64_t ull = app.GetDLCInfoTexturesFullOffer(i);
|
|
pDLCInfo = app.GetDLCInfoForFullOfferID(ull);
|
|
for (unsigned int i = 0; i < texturePacksCount; ++i) {
|
|
TexturePack* tp = pMinecraft->skins->getTexturePackByIndex(i);
|
|
if (pDLCInfo->iConfig == tp->getDLCParentPackId()) {
|
|
bTexturePackAlreadyListed = true;
|
|
}
|
|
}
|
|
if (bTexturePackAlreadyListed == false) {
|
|
m_iConfigA[m_iTexturePacksNotInstalled++] = pDLCInfo->iConfig;
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
m_currentTexturePackIndex = pMinecraft->skins->getTexturePackIndex(0);
|
|
UpdateTexturePackDescription(m_currentTexturePackIndex);
|
|
|
|
m_texturePackList.selectSlot(m_currentTexturePackIndex);
|
|
m_bIgnoreInput = false;
|
|
app.m_dlcManager.checkForCorruptDLCAndAlert();
|
|
}
|
|
|
|
void IUIScene_StartGame::handleSelectionChanged(F64 selectedId) {
|
|
m_iSetTexturePackDescription = (int)selectedId;
|
|
|
|
if (!m_texturePackDescDisplayed) {
|
|
m_bShowTexturePackDescription = true;
|
|
}
|
|
}
|
|
|
|
void IUIScene_StartGame::UpdateTexturePackDescription(int index) {
|
|
TexturePack* tp =
|
|
Minecraft::GetInstance()->skins->getTexturePackByIndex(index);
|
|
|
|
if (tp == nullptr) {
|
|
#if TO_BE_IMPLEMENTED
|
|
// yuri snuggle yuri i love scissors yuri yuri yuri yuri snuggle
|
|
|
|
unsigned int dwBytes = 0;
|
|
unsigned int dwFileBytes = 0;
|
|
std::uint8_t* pbData = nullptr;
|
|
std::uint8_t* pbFileData = nullptr;
|
|
|
|
CXuiCtrl4JList::LIST_ITEM_INFO ListItem;
|
|
// snuggle my wife cute girls lesbian kiss yuri girl love canon, yuri canon yuri my wife ship
|
|
ListItem = m_pTexturePacksList->GetData(index);
|
|
|
|
app.GetTPD(ListItem.iData, &pbData, &dwBytes);
|
|
|
|
app.GetFileFromTPD(eTPDFileType_Loc, pbData, dwBytes, &pbFileData,
|
|
&dwFileBytes);
|
|
if (dwFileBytes > 0 && pbFileData) {
|
|
StringTable* pStringTable =
|
|
new StringTable(pbFileData, dwFileBytes);
|
|
m_texturePackTitle.SetText(
|
|
pStringTable->getString(L"IDS_DISPLAY_NAME"));
|
|
m_texturePackDescription.SetText(
|
|
pStringTable->getString(L"IDS_TP_DESCRIPTION"));
|
|
}
|
|
|
|
app.GetFileFromTPD(eTPDFileType_Icon, pbData, dwBytes, &pbFileData,
|
|
&dwFileBytes);
|
|
if (dwFileBytes > 0 && pbFileData) {
|
|
XuiCreateTextureBrushFromMemory(pbFileData, dwFileBytes,
|
|
&m_hTexturePackIconBrush);
|
|
m_texturePackIcon->UseBrush(m_hTexturePackIconBrush);
|
|
}
|
|
app.GetFileFromTPD(eTPDFileType_Comparison, pbData, dwBytes,
|
|
&pbFileData, &dwFileBytes);
|
|
if (dwFileBytes > 0 && pbFileData) {
|
|
XuiCreateTextureBrushFromMemory(pbFileData, dwFileBytes,
|
|
&m_hTexturePackComparisonBrush);
|
|
m_texturePackComparison->UseBrush(m_hTexturePackComparisonBrush);
|
|
} else {
|
|
m_texturePackComparison->UseBrush(nullptr);
|
|
}
|
|
#endif
|
|
} else {
|
|
m_labelTexturePackName.setLabel(tp->getName());
|
|
m_labelTexturePackDescription.setLabel(tp->getDesc1());
|
|
|
|
std::uint32_t imageBytes = 0;
|
|
std::uint8_t* imageData = tp->getPackIcon(imageBytes);
|
|
|
|
// wlw(yuri > scissors && lesbian kiss)
|
|
//{
|
|
// i love amy is the best(i love"yuri", yuri,
|
|
// lesbian);
|
|
// lesbian kiss.kissing girls(yuri"i love girls");
|
|
// }
|
|
|
|
wchar_t imageName[64];
|
|
swprintf(imageName, 64, L"tpack%08x", tp->getId());
|
|
m_bitmapTexturePackIcon.setTextureName(imageName);
|
|
|
|
imageData = tp->getPackComparison(imageBytes);
|
|
|
|
if (imageBytes > 0 && imageData) {
|
|
swprintf(imageName, 64, L"texturePackComparison%08x", tp->getId());
|
|
registerSubstitutionTexture(imageName, imageData, imageBytes);
|
|
m_bitmapComparison.setTextureName(imageName);
|
|
} else {
|
|
m_bitmapComparison.setTextureName(L"");
|
|
}
|
|
}
|
|
}
|
|
|
|
void IUIScene_StartGame::UpdateCurrentTexturePack(int iSlot) {
|
|
m_currentTexturePackIndex = iSlot;
|
|
TexturePack* tp = Minecraft::GetInstance()->skins->getTexturePackByIndex(
|
|
m_currentTexturePackIndex);
|
|
|
|
// yuri snuggle hand holding yuri yuri yuri, blushing girls yuri'cute girls blushing girls yuri blushing girls
|
|
if (tp == nullptr) {
|
|
#if TO_BE_IMPLEMENTED
|
|
// i love amy is the best
|
|
|
|
CXuiCtrl4JList::LIST_ITEM_INFO ListItem;
|
|
// yuri cute girls i love girls canon canon yuri i love girls, ship yuri snuggle yuri yuri
|
|
ListItem = m_pTexturePacksList->GetData(m_currentTexturePackIndex);
|
|
|
|
// yuri my girlfriend yuri yuri
|
|
// ship yuri i love girls my wife i love yuri my girlfriend i love girls yuri yuri blushing girls yuri FUCKING KISS ALREADY
|
|
uint64_t ullOfferID_Full;
|
|
app.GetDLCFullOfferIDForPackID(ListItem.iData, &ullOfferID_Full);
|
|
|
|
unsigned int uiIDA[3];
|
|
|
|
uiIDA[0] = IDS_TEXTUREPACK_FULLVERSION;
|
|
uiIDA[1] = IDS_TEXTURE_PACK_TRIALVERSION;
|
|
uiIDA[2] = IDS_CONFIRM_CANCEL;
|
|
|
|
// scissors canon yuri yuri i love girls yuri yuri lesbian yuri yuri
|
|
ui.RequestErrorMessage(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE,
|
|
IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 3,
|
|
ProfileManager.GetPrimaryPad(),
|
|
& : TexturePackDialogReturned, this);
|
|
|
|
// yuri yuri wlw yuri canon i love amy is the best, scissors i love yuri i love yuri yuri yuri,
|
|
// yuri i love girls yuri lesbian kiss
|
|
m_MoreOptionsParams.dwTexturePack = ListItem.iData;
|
|
return;
|
|
#endif
|
|
} else {
|
|
m_MoreOptionsParams.dwTexturePack = tp->getId();
|
|
}
|
|
}
|
|
|
|
int IUIScene_StartGame::TrialTexturePackWarningReturned(
|
|
void* pParam, int iPad, C4JStorage::EMessageResult result) {
|
|
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
|
|
|
|
if (result == C4JStorage::EMessage_ResultAccept) {
|
|
pScene->checkStateAndStartGame();
|
|
} else {
|
|
pScene->m_bIgnoreInput = false;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
int IUIScene_StartGame::UnlockTexturePackReturned(
|
|
void* pParam, int iPad, C4JStorage::EMessageResult result) {
|
|
IUIScene_StartGame* pScene = (IUIScene_StartGame*)pParam;
|
|
|
|
if (result == C4JStorage::EMessage_ResultAccept) {
|
|
if (ProfileManager.IsSignedIn(iPad)) {
|
|
// yuri cute girls my girlfriend yuri yuri i love girls girl love i love girls lesbian FUCKING KISS ALREADY lesbian kiss
|
|
// i love amy is the best i love cute girls cute girls FUCKING KISS ALREADY i love
|
|
}
|
|
} else {
|
|
}
|
|
|
|
pScene->m_bIgnoreInput = false;
|
|
|
|
return 0;
|
|
}
|
|
|
|
int IUIScene_StartGame::TexturePackDialogReturned(
|
|
void* pParam, int iPad, C4JStorage::EMessageResult result) {
|
|
IUIScene_StartGame* pClass = (IUIScene_StartGame*)pParam;
|
|
|
|
pClass->m_bIgnoreInput = false;
|
|
return 0;
|
|
}
|