mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-20 05:52:56 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f13cbf2e4f
Binary file not shown.
|
After Width: | Height: | Size: 834 B |
Binary file not shown.
|
After Width: | Height: | Size: 1,014 B |
Binary file not shown.
|
After Width: | Height: | Size: 438 B |
Binary file not shown.
BIN
Minecraft.Client/Common/Media/MediaWindows64/skinHDDR.swf
Normal file
BIN
Minecraft.Client/Common/Media/MediaWindows64/skinHDDR.swf
Normal file
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/Common/Media/MediaWindows64/skinHDLabelsDR.swf
Normal file
BIN
Minecraft.Client/Common/Media/MediaWindows64/skinHDLabelsDR.swf
Normal file
Binary file not shown.
|
|
@ -159,6 +159,7 @@ void IUIScene_CreativeMenu::staticCtor()
|
|||
ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::SMOOTHBRICK_SLAB)
|
||||
ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::NETHERBRICK_SLAB)
|
||||
ITEM_AUX(Tile::stoneSlabHalf_Id,StoneSlabTile::QUARTZ_SLAB)
|
||||
ITEM_AUX(Tile::stone_slab2_Id ,StoneSlabTile2::RED_SANDSTONE_SLAB)
|
||||
ITEM(Tile::stairs_wood_Id)
|
||||
ITEM(Tile::stairs_birchwood_Id)
|
||||
ITEM(Tile::stairs_sprucewood_Id)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "../../../Minecraft.World/net.minecraft.world.entity.ai.attributes.h"
|
||||
#include "../../../Minecraft.World/net.minecraft.world.entity.monster.h"
|
||||
#include "../../MultiPlayerLevel.h"
|
||||
#include "../../../Minecraft.World\LevelData.h"
|
||||
#include "../../../Minecraft.World/LevelData.h"
|
||||
#include "IUIScene_HUD.h"
|
||||
|
||||
#include "UI.h"
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@ void IUIScene_StartGame::UpdateTexturePackDescription(int index)
|
|||
//}
|
||||
|
||||
wchar_t imageName[64];
|
||||
swprintf(imageName,64,L"tpack%08x",tp->getId());
|
||||
swprintf(imageName,64,L"texturePackIcon%08x",tp->getId());
|
||||
registerSubstitutionTexture(imageName, pbImageData, dwImageBytes);
|
||||
m_bitmapTexturePackIcon.setTextureName(imageName);
|
||||
|
||||
pbImageData = tp->getPackComparison(dwImageBytes);
|
||||
|
|
@ -376,4 +377,4 @@ int IUIScene_StartGame::TexturePackDialogReturned(void *pParam,int iPad,C4JStora
|
|||
#endif
|
||||
pClass->m_bIgnoreInput=false;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <vector>
|
||||
#include "IUIScene_WritingBookMenu.h"
|
||||
#include "MultiPlayerLocalPlayer.h"
|
||||
#include "Common\UI\UI.h"
|
||||
#include "Common/UI/UI.h"
|
||||
#include "ClientConnection.h"
|
||||
#include "../Minecraft.World/CustomPayloadPacket.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
#include "UIScene_LoadMenu.h"
|
||||
#include "UIScene_JoinMenu.h"
|
||||
#include "UIScene_LoadOrJoinMenu.h"
|
||||
#include "UIScene_LoadCreateJoinMenu.h"
|
||||
#include "UIScene_CreateWorldMenu.h"
|
||||
#include "UIScene_LaunchMoreOptionsMenu.h"
|
||||
#include "UIScene_FullscreenProgress.h"
|
||||
|
|
@ -127,4 +128,4 @@
|
|||
#include "UIScene_EULA.h"
|
||||
#include "UIScene_NewUpdateMessage.h"
|
||||
|
||||
extern ConsoleUIController ui;
|
||||
extern ConsoleUIController ui;
|
||||
|
|
|
|||
|
|
@ -609,6 +609,14 @@ void UIController::loadSkins()
|
|||
m_iggyLibraries[eLibrary_Tooltips] = loadSkin(L"skinHDTooltips.swf", L"skinHDTooltips.swf");
|
||||
m_iggyLibraries[eLibrary_Default] = loadSkin(L"skinHD.swf", L"skinHD.swf");
|
||||
|
||||
// Some 1080p menu ports (such as LoadCreateJoin) may import DR-specific HD
|
||||
// libraries by distinct names. Load them opportunistically when present so
|
||||
// those SWFs can resolve their imports without replacing the normal Windows
|
||||
// skin set.
|
||||
m_iggyLibraries[eLibraryDR_GraphicsDefault] = loadSkin(L"skinHDGraphicsDR.swf", L"skinHDGraphicsDR.swf");
|
||||
m_iggyLibraries[eLibraryDR_Labels] = loadSkin(L"skinHDLabelsDR.swf", L"skinHDLabelsDR.swf");
|
||||
m_iggyLibraries[eLibraryDR_Default] = loadSkin(L"skinHDDR.swf", L"skinHDDR.swf");
|
||||
|
||||
#elif defined _DURANGO
|
||||
m_iggyLibraries[eLibrary_Platform] = loadSkin(L"skinHDDurango.swf", L"platformskinHD.swf");
|
||||
|
||||
|
|
@ -979,8 +987,16 @@ void UIController::tickInput()
|
|||
{
|
||||
// ButtonList manages focus internally via Flash —
|
||||
// pass mouse coords so it can highlight the right item.
|
||||
S32 adjustedMouseY = static_cast<S32>(sceneMouseY);
|
||||
if (pScene->getSceneType() == eUIScene_LoadCreateJoinMenu)
|
||||
{
|
||||
const S32 visibleRows = 7;
|
||||
const S32 rowHeight = (visibleRows > 0) ? (ch / visibleRows) : 0;
|
||||
if (rowHeight > 0)
|
||||
adjustedMouseY -= rowHeight;
|
||||
}
|
||||
static_cast<UIControl_ButtonList*>(ctrl)->SetTouchFocus(
|
||||
static_cast<S32>(sceneMouseX), static_cast<S32>(sceneMouseY), false);
|
||||
static_cast<S32>(sceneMouseX), adjustedMouseY, false);
|
||||
hitControlId = -1;
|
||||
hitArea = INT_MAX;
|
||||
hitCtrl = NULL;
|
||||
|
|
|
|||
|
|
@ -116,6 +116,13 @@ private:
|
|||
eLibraryFallback_HUD,
|
||||
eLibraryFallback_Tooltips,
|
||||
eLibraryFallback_Default,
|
||||
|
||||
// Optional DR-specific HD libraries used by some 1080p menu SWFs.
|
||||
// Keep these after the normal HD and fallback sets so they don't disturb
|
||||
// existing references and can be loaded only when the files exist.
|
||||
eLibraryDR_GraphicsDefault,
|
||||
eLibraryDR_Labels,
|
||||
eLibraryDR_Default,
|
||||
#endif
|
||||
|
||||
eLibrary_Count,
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ enum EUIScene
|
|||
eUIScene_InGamePlayerOptionsMenu,
|
||||
eUIScene_CreativeMenu,
|
||||
eUIScene_LaunchMoreOptionsMenu,
|
||||
eUIScene_LoadCreateJoinMenu,
|
||||
eUIScene_DLCMainMenu,
|
||||
eUIScene_NewUpdateMessage,
|
||||
eUIScene_EnchantingMenu,
|
||||
|
|
|
|||
|
|
@ -376,6 +376,9 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData)
|
|||
case eUIScene_LoadOrJoinMenu:
|
||||
newScene = new UIScene_LoadOrJoinMenu(iPad, initData, this);
|
||||
break;
|
||||
case eUIScene_LoadCreateJoinMenu:
|
||||
newScene = new UIScene_LoadCreateJoinMenu(iPad, initData, this);
|
||||
break;
|
||||
case eUIScene_LoadMenu:
|
||||
newScene = new UIScene_LoadMenu(iPad, initData, this);
|
||||
break;
|
||||
|
|
@ -912,4 +915,4 @@ UIScene *UILayer::FindScene(EUIScene sceneType)
|
|||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -352,6 +352,14 @@ void UIScene::loadMovie()
|
|||
// Read movie dimensions from the SWF header (available immediately after
|
||||
// CreateFromMemory, no init tick needed).
|
||||
IggyProperties *properties = IggyPlayerProperties ( swf );
|
||||
if(!properties)
|
||||
{
|
||||
app.DebugPrintf("ERROR: IggyPlayerProperties returned null for scene '%ls'\n", moviePath.c_str());
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
__debugbreak();
|
||||
#endif
|
||||
app.FatalLoadError();
|
||||
}
|
||||
m_movieHeight = properties->movie_height_in_pixels;
|
||||
m_movieWidth = properties->movie_width_in_pixels;
|
||||
m_renderWidth = m_movieWidth;
|
||||
|
|
@ -1468,4 +1476,4 @@ size_t UIScene::GetCallbackUniqueId()
|
|||
bool UIScene::isReadyToDelete()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#include "stdafx.h"
|
||||
#include "Common\UI\UI.h"
|
||||
#include "Common/UI/UI.h"
|
||||
#include "UIScene_BookAndQuillMenu.h"
|
||||
#include "PlayerConnection.h"
|
||||
#include "LocalPlayer.h"
|
||||
#include "ClientConnection.h"
|
||||
#include "..\Minecraft.Client\PlayerList.h"
|
||||
#include "..\Minecraft.Client\ServerPlayer.h"
|
||||
#include "..\Minecraft.Client\MultiPlayerLocalPlayer.h"
|
||||
#include "../Minecraft.Client/PlayerList.h"
|
||||
#include "../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../Minecraft.Client/MultiPlayerLocalPlayer.h"
|
||||
|
||||
UIScene_BookAndQuillMenu::UIScene_BookAndQuillMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -437,9 +437,6 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
|
|||
if (isDirectEditBlocking()) return;
|
||||
#endif
|
||||
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
switch(static_cast<int>(controlId))
|
||||
{
|
||||
case eControl_EditWorldName:
|
||||
|
|
@ -492,11 +489,13 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
|
|||
break;
|
||||
case eControl_TexturePackList:
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
UpdateCurrentTexturePack(static_cast<int>(childId));
|
||||
}
|
||||
break;
|
||||
case eControl_NewWorld:
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
#ifdef _DURANGO
|
||||
if(m_MoreOptionsParams.bOnlineGame)
|
||||
{
|
||||
|
|
|
|||
9440
Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp
Normal file
9440
Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp
Normal file
File diff suppressed because it is too large
Load diff
413
Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.h
Normal file
413
Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.h
Normal file
|
|
@ -0,0 +1,413 @@
|
|||
#pragma once
|
||||
|
||||
#include "UIScene.h"
|
||||
|
||||
class LevelGenerationOptions;
|
||||
class C4JThread;
|
||||
|
||||
|
||||
#if defined __PS3__ || defined __ORBIS__ || defined(__PSVITA__)
|
||||
#define SONY_REMOTE_STORAGE_DOWNLOAD
|
||||
#endif
|
||||
#if defined __PS3__ || __PSVITA__
|
||||
#define SONY_REMOTE_STORAGE_UPLOAD
|
||||
#endif
|
||||
|
||||
|
||||
class UIScene_LoadCreateJoinMenu : public UIScene
|
||||
{
|
||||
private:
|
||||
enum EControls
|
||||
{
|
||||
eControl_SavesList,
|
||||
eControl_NewGamesList,
|
||||
eControl_GamesList,
|
||||
eControl_TabLoad,
|
||||
eControl_TabCreate,
|
||||
eControl_TabJoin,
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
eControl_SpaceIndicator,
|
||||
#endif
|
||||
};
|
||||
|
||||
enum ELoadCreateJoinTab
|
||||
{
|
||||
eTab_Load = 0,
|
||||
eTab_Create,
|
||||
eTab_Join,
|
||||
};
|
||||
|
||||
enum EState
|
||||
{
|
||||
e_SavesIdle,
|
||||
e_SavesRepopulate,
|
||||
e_SavesRepopulateAfterMashupHide,
|
||||
e_SavesRepopulateAfterDelete,
|
||||
e_SavesRepopulateAfterTransferDownload,
|
||||
};
|
||||
|
||||
enum eActions
|
||||
{
|
||||
eAction_None=0,
|
||||
eAction_ViewInvites,
|
||||
eAction_JoinGame,
|
||||
};
|
||||
eActions m_eAction;
|
||||
|
||||
static const int JOIN_LOAD_CREATE_BUTTON_INDEX = 0;
|
||||
|
||||
SaveListDetails *m_saveDetails;
|
||||
int m_iSaveDetailsCount;
|
||||
|
||||
protected:
|
||||
UIControl m_controlMainPanel;
|
||||
UIControl m_controlLoadGame;
|
||||
UIControl m_controlLoadGamePanel;
|
||||
UIControl m_controlNewGame;
|
||||
UIControl m_controlNewGamePanel;
|
||||
UIControl m_controlJoinGame;
|
||||
UIControl m_controlJoinGamePanel;
|
||||
UIControl_SaveList m_buttonListSaves;
|
||||
UIControl_SaveList m_buttonListNewGames;
|
||||
UIControl_SaveList m_buttonListGames;
|
||||
UIControl_Button m_tabLoad, m_tabCreate, m_tabJoin;
|
||||
UIControl_Label m_labelSavesListTitle, m_labelCreateListTitle, m_labelJoinListTitle, m_labelNoGames;
|
||||
UIControl m_controlSavesTimer, m_controlNewGameTimer, m_controlJoinTimer;
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
UIControl_SpaceIndicatorBar m_spaceIndicatorSaves;
|
||||
#endif
|
||||
|
||||
IggyName m_funcSetActiveTab, m_funcSetMatchesAvailable, m_funcShowSaveSizeBar;
|
||||
bool m_hasMainPanel;
|
||||
bool m_hasNewGameList;
|
||||
bool m_hasNoGamesLabel;
|
||||
bool m_hasTabButtons;
|
||||
ELoadCreateJoinTab m_activeTab;
|
||||
IggyValuePath m_loadGamePath;
|
||||
IggyValuePath m_newGamePath;
|
||||
IggyValuePath m_joinGamePath;
|
||||
bool m_hasLoadGamePath;
|
||||
bool m_hasNewGamePath;
|
||||
bool m_hasJoinGamePath;
|
||||
|
||||
private:
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
UI_MAP_ELEMENT( m_controlMainPanel, "MainPanel")
|
||||
UI_MAP_ELEMENT( m_controlLoadGame, "LoadGame")
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlLoadGame )
|
||||
UI_MAP_ELEMENT( m_controlLoadGamePanel, "LoadGameListRecessPanel")
|
||||
UI_MAP_ELEMENT( m_buttonListSaves, "LoadGameList")
|
||||
UI_MAP_ELEMENT( m_controlSavesTimer, "LoadGameTimer")
|
||||
UI_MAP_ELEMENT( m_tabLoad, "TouchTabLoad")
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
UI_MAP_ELEMENT( m_spaceIndicatorSaves, "SaveSizeBar")
|
||||
#endif
|
||||
UI_END_MAP_CHILD_ELEMENTS()
|
||||
|
||||
UI_MAP_ELEMENT( m_controlNewGame, "NewGame")
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlNewGame )
|
||||
UI_MAP_ELEMENT( m_controlNewGamePanel, "NewGameListRecessPanel")
|
||||
UI_MAP_ELEMENT( m_buttonListNewGames, "NewGameList")
|
||||
UI_MAP_ELEMENT( m_controlNewGameTimer, "NewGameTimer")
|
||||
UI_MAP_ELEMENT( m_tabCreate, "TouchTabCreate")
|
||||
UI_END_MAP_CHILD_ELEMENTS()
|
||||
|
||||
UI_MAP_ELEMENT( m_controlJoinGame, "JoinGame")
|
||||
UI_BEGIN_MAP_CHILD_ELEMENTS( m_controlJoinGame )
|
||||
UI_MAP_ELEMENT( m_controlJoinGamePanel, "GamesPanel")
|
||||
UI_MAP_ELEMENT( m_buttonListGames, "JoinGameGamesList")
|
||||
UI_MAP_ELEMENT( m_controlJoinTimer, "JoinGamesTimer")
|
||||
UI_MAP_ELEMENT( m_tabJoin, "TouchTabJoin")
|
||||
UI_END_MAP_CHILD_ELEMENTS()
|
||||
|
||||
UI_MAP_ELEMENT( m_labelSavesListTitle, "LoadGameTabTitle")
|
||||
UI_MAP_ELEMENT( m_labelCreateListTitle, "NewGameTabTitle")
|
||||
UI_MAP_ELEMENT( m_labelJoinListTitle, "JoinGameTabTitle")
|
||||
UI_MAP_ELEMENT( m_labelNoGames, "NoGames")
|
||||
UI_MAP_NAME( m_funcSetActiveTab, L"SetActiveTab")
|
||||
UI_MAP_NAME( m_funcSetMatchesAvailable, L"SetMatchesAvailable")
|
||||
UI_MAP_NAME( m_funcShowSaveSizeBar, L"ShowSaveSizeBar")
|
||||
UI_END_MAP_ELEMENTS_AND_NAMES()
|
||||
|
||||
int m_iDefaultButtonsC;
|
||||
int m_iMashUpButtonsC;
|
||||
int m_iState;
|
||||
|
||||
vector<FriendSessionInfo *> *m_currentSessions;
|
||||
vector<LevelGenerationOptions *> m_generators;
|
||||
vector<File *> *m_saves;
|
||||
|
||||
bool m_bIgnoreInput;
|
||||
bool m_bAllLoaded;
|
||||
bool m_bRetrievingSaveThumbnails;
|
||||
bool m_bSaveThumbnailReady;
|
||||
bool m_bShowingPartyGamesOnly;
|
||||
bool m_bInParty;
|
||||
JoinMenuInitData *m_initData;
|
||||
bool m_bMultiplayerAllowed;
|
||||
int m_iTexturePacksNotInstalled;
|
||||
int m_iRequestingThumbnailId;
|
||||
SAVE_DETAILS *m_pSaveDetails;
|
||||
bool m_bSavesDisplayed;
|
||||
bool m_bExitScene;
|
||||
bool m_bCopying;
|
||||
bool m_bCopyingCancelled;
|
||||
int m_iSaveInfoC;
|
||||
int m_iSaveListIndex;
|
||||
int m_iGameListIndex;
|
||||
//int *m_iConfigA; // track the texture packs that we don't have installed
|
||||
#ifndef _XBOX_ONE
|
||||
bool m_bSaveTransferInProgress;
|
||||
bool m_bSaveTransferCancelled;
|
||||
#endif
|
||||
bool m_bUpdateSaveSize;
|
||||
bool m_bPendingSaveSizeBarRefresh;
|
||||
bool m_bPendingJoinTabAvailabilityRefresh;
|
||||
bool m_bHasNoGamesLabel;
|
||||
int m_iNewGameListIndex;
|
||||
#ifdef _WINDOWS64
|
||||
int m_lastHoverMouseX;
|
||||
int m_lastHoverMouseY;
|
||||
bool m_mouseHoverTracked;
|
||||
int m_hoverBaseIndexLoad;
|
||||
int m_hoverBaseIndexCreate;
|
||||
int m_hoverBaseIndexJoin;
|
||||
#endif
|
||||
|
||||
public:
|
||||
UIScene_LoadCreateJoinMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
virtual ~UIScene_LoadCreateJoinMenu();
|
||||
|
||||
virtual void updateTooltips();
|
||||
virtual void updateComponents();
|
||||
virtual UIControl* GetMainPanel();
|
||||
|
||||
virtual void handleDestroy();
|
||||
virtual void handleLoseFocus();
|
||||
virtual void handleGainFocus(bool navBack);
|
||||
virtual void handleTimerComplete(int id);
|
||||
// INPUT
|
||||
virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled);
|
||||
virtual void handleFocusChange(F64 controlId, F64 childId);
|
||||
virtual void handleInitFocus(F64 controlId, F64 childId);
|
||||
|
||||
virtual EUIScene getSceneType() { return eUIScene_LoadCreateJoinMenu; }
|
||||
|
||||
static void UpdateGamesListCallback(LPVOID pParam);
|
||||
#ifdef _XBOX_ONE
|
||||
void HandleDLCLicenseChange();
|
||||
#endif
|
||||
virtual void tick();
|
||||
|
||||
private:
|
||||
void Initialise();
|
||||
void GetSaveInfo();
|
||||
void UpdateGamesList();
|
||||
void AddDefaultButtons();
|
||||
bool DoesSavesListHaveFocus();
|
||||
bool DoesMashUpWorldHaveFocus();
|
||||
bool DoesGamesListHaveFocus();
|
||||
bool DoesNewGamesListHaveFocus();
|
||||
int GetMovieTabFromFocus();
|
||||
void SyncMovieTab();
|
||||
void SetMovieTab(int tab);
|
||||
void SetActiveTab(ELoadCreateJoinTab tab, bool setFocus);
|
||||
void ApplyTabVisibility(bool setFocus);
|
||||
void UpdateJoinTabAvailability();
|
||||
void UpdateSaveSizeBarVisibility();
|
||||
#ifdef _WINDOWS64
|
||||
void UpdateMouseHoverForActiveTab();
|
||||
bool ConvertMouseToSceneCoords(float &sceneMouseX, float &sceneMouseY);
|
||||
void GetAbsoluteControlRect(UIControl *pControl, S32 &x, S32 &y, S32 &w, S32 &h);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// TODO: This should be pure virtual in this class
|
||||
virtual wstring getMoviePath();
|
||||
|
||||
public:
|
||||
static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes);
|
||||
static int LoadSaveCallback(LPVOID lpParam,bool bRes);
|
||||
static int DeleteSaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int SaveOptionsDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int DeleteSaveDataReturned(LPVOID lpParam,bool bRes);
|
||||
static int RenameSaveDataReturned(LPVOID lpParam,bool bRes);
|
||||
static int KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes);
|
||||
#ifdef __PSVITA__
|
||||
static int MustSignInTexturePack(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int MustSignInReturnedTexturePack(void *pParam,bool bContinue, int iPad);
|
||||
static int SignInAdhocReturned(void *pParam,bool bContinue, int iPad);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void handlePress(F64 controlId, F64 childId);
|
||||
void LoadLevelGen(LevelGenerationOptions *levelGen);
|
||||
void LoadSaveFromDisk(File *saveFile, ESavePlatform savePlatform = SAVE_FILE_PLATFORM_LOCAL);
|
||||
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
|
||||
void LoadSaveFromCloud();
|
||||
#endif
|
||||
public:
|
||||
virtual void HandleDLCMountingComplete();
|
||||
|
||||
#ifdef __ORBIS__
|
||||
void LoadRemoteFileFromDisk(char* remoteFilename);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void CheckAndJoinGame(int gameIndex);
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
static const int ADD_SERVER_BUTTON_INDEX = 0;
|
||||
enum eAddServerPhase { eAddServer_Idle, eAddServer_IP, eAddServer_Port, eAddServer_Name };
|
||||
eAddServerPhase m_addServerPhase;
|
||||
wstring m_addServerIP;
|
||||
wstring m_addServerPort;
|
||||
void BeginAddServer();
|
||||
void AppendServerToFile(const wstring& ip, const wstring& port, const wstring& name);
|
||||
static int AddServerKeyboardCallback(LPVOID lpParam, bool bRes);
|
||||
#endif
|
||||
|
||||
#if defined(__PS3__) || defined(__PSVITA__) || defined(__ORBIS__)
|
||||
static int MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int PSN_SignInReturned(void *pParam,bool bContinue, int iPad);
|
||||
static void remoteStorageGetSaveCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code);
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
//static int PSPlusReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
#endif
|
||||
#ifdef _XBOX_ONE
|
||||
typedef struct _SaveTransferStateContainer
|
||||
{
|
||||
int m_iProgress;
|
||||
bool m_bSaveTransferInProgress;
|
||||
bool m_bSaveTransferCancelled;
|
||||
int m_iPad;
|
||||
C4JStorage::eSaveTransferState m_eSaveTransferState;
|
||||
UIScene_LoadCreateJoinMenu *m_pClass;
|
||||
} SaveTransferStateContainer;
|
||||
enum ESaveTransferFiles
|
||||
{
|
||||
eSaveTransferFile_Marker,
|
||||
eSaveTransferFile_Metadata,
|
||||
eSaveTransferFile_SaveData,
|
||||
};
|
||||
static ESaveTransferFiles s_eSaveTransferFile;
|
||||
static unsigned long s_ulFileSize;
|
||||
static byteArray s_transferData;
|
||||
static wstring m_wstrStageText;
|
||||
LoadMenuInitData *m_loadMenuInitData;
|
||||
|
||||
#ifdef _DEBUG_MENUS_ENABLED
|
||||
static C4JStorage::SAVETRANSFER_FILE_DETAILS m_debugTransferDetails;
|
||||
#endif
|
||||
|
||||
void LaunchSaveTransfer();
|
||||
static int DownloadXbox360SaveThreadProc( LPVOID lpParameter );
|
||||
static void RequestFileSize( SaveTransferStateContainer *pClass, wchar_t *filename );
|
||||
static void RequestFileData( SaveTransferStateContainer *pClass, wchar_t *filename );
|
||||
static int SaveTransferReturned(LPVOID lpParam,C4JStorage::SAVETRANSFER_FILE_DETAILS *pSaveTransferDetails);
|
||||
static int SaveTransferUpdateProgress(LPVOID lpParam,unsigned long ulBytesReceived);
|
||||
static void CancelSaveTransferCallback(LPVOID lpParam);
|
||||
static int NeedSyncMessageReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int CancelSaveTransferCompleteCallback(LPVOID lpParam);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef SONY_REMOTE_STORAGE_DOWNLOAD
|
||||
enum eSaveTransferState
|
||||
{
|
||||
eSaveTransfer_Idle,
|
||||
eSaveTransfer_Busy,
|
||||
eSaveTransfer_GetRemoteSaveInfo,
|
||||
eSaveTransfer_GettingRemoteSaveInfo,
|
||||
eSaveTransfer_CreateDummyFile,
|
||||
eSaveTransfer_CreatingDummyFile,
|
||||
eSaveTransfer_GettingFileSize,
|
||||
eSaveTransfer_FileSizeRetrieved,
|
||||
eSaveTransfer_GetFileData,
|
||||
eSaveTransfer_GettingFileData,
|
||||
eSaveTransfer_FileDataRetrieved,
|
||||
eSaveTransfer_GetSavesInfo,
|
||||
eSaveTransfer_GettingSavesInfo,
|
||||
eSaveTransfer_LoadSaveFromDisc,
|
||||
eSaveTransfer_LoadingSaveFromDisc,
|
||||
eSaveTransfer_CreatingNewSave,
|
||||
eSaveTransfer_Converting,
|
||||
eSaveTransfer_Saving,
|
||||
eSaveTransfer_Succeeded,
|
||||
eSaveTransfer_Cancelled,
|
||||
eSaveTransfer_Error,
|
||||
eSaveTransfer_ErrorDeletingSave,
|
||||
eSaveTransfer_ErrorMesssage,
|
||||
eSaveTransfer_Finished,
|
||||
|
||||
};
|
||||
eSaveTransferState m_eSaveTransferState;
|
||||
static unsigned long m_ulFileSize;
|
||||
static wstring m_wstrStageText;
|
||||
static bool m_bSaveTransferRunning;
|
||||
int m_iProgress;
|
||||
char m_downloadedUniqueFilename[64];//SCE_SAVE_DATA_DIRNAME_DATA_MAXSIZE];
|
||||
bool m_saveTransferDownloadCancelled;
|
||||
void LaunchSaveTransfer();
|
||||
static int CreateDummySaveDataCallback(LPVOID lpParam,bool bRes);
|
||||
static int CrossSaveGetSavesInfoCallback(LPVOID lpParam, SAVE_DETAILS *pSaveDetails,bool bRes);
|
||||
static int LoadCrossSaveDataCallback(void *pParam,bool bIsCorrupt, bool bIsOwner);
|
||||
static int CrossSaveFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int CrossSaveDeleteOnErrorReturned(LPVOID lpParam,bool bRes);
|
||||
static int RemoteSaveNotFoundCallback(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int DownloadSonyCrossSaveThreadProc( LPVOID lpParameter );
|
||||
static void SaveTransferReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code);
|
||||
static ConsoleSaveFile* SonyCrossSaveConvert();
|
||||
|
||||
static void CancelSaveTransferCallback(LPVOID lpParam);
|
||||
public:
|
||||
static bool isSaveTransferRunning() { return m_bSaveTransferRunning; }
|
||||
private:
|
||||
#endif
|
||||
|
||||
#ifdef SONY_REMOTE_STORAGE_UPLOAD
|
||||
enum eSaveUploadState
|
||||
{
|
||||
eSaveUpload_Idle,
|
||||
eSaveUpload_UploadingFileData,
|
||||
eSaveUpload_FileDataUploaded,
|
||||
eSaveUpload_Cancelled,
|
||||
eSaveUpload_Error,
|
||||
esaveUpload_Finished
|
||||
};
|
||||
|
||||
eSaveUploadState m_eSaveUploadState;
|
||||
bool m_saveTransferUploadCancelled;
|
||||
|
||||
void LaunchSaveUpload();
|
||||
static int UploadSonyCrossSaveThreadProc( LPVOID lpParameter );
|
||||
static void SaveUploadReturned(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code);
|
||||
static void CancelSaveUploadCallback(LPVOID lpParam);
|
||||
static int SaveTransferDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int CrossSaveUploadFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
#endif
|
||||
|
||||
#if defined _XBOX_ONE || defined __ORBIS__
|
||||
static int CopySaveDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int CopySaveThreadProc( LPVOID lpParameter );
|
||||
static int CopySaveDataReturned( LPVOID lpParameter, bool success, C4JStorage::ESaveGameState state );
|
||||
static bool CopySaveDataProgress(LPVOID lpParam, int percent);
|
||||
static void CancelCopySaveCallback(LPVOID lpParam);
|
||||
static int CopySaveErrorDialogFinishedCallback(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -267,11 +267,10 @@ UIScene_LoadMenu::UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLaye
|
|||
}
|
||||
if (params->saveDetails != nullptr)
|
||||
{
|
||||
// Set thumbnail name from save filename (needed for texture display in tick)
|
||||
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
ZeroMemory(wFilename, sizeof(wFilename));
|
||||
mbstowcs(wFilename, params->saveDetails->UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
m_thumbnailName = wFilename;
|
||||
// Use a stable texture key for saves so the icon survives save/quit refreshes.
|
||||
wchar_t textureName[64];
|
||||
swprintf(textureName, 64, L"loadsave_large_%08x", m_iSaveGameInfoIndex);
|
||||
m_thumbnailName = textureName;
|
||||
|
||||
if (params->saveDetails->pbThumbnailData && params->saveDetails->dwThumbnailSize > 0)
|
||||
{
|
||||
|
|
@ -742,9 +741,6 @@ void UIScene_LoadMenu::handlePress(F64 controlId, F64 childId)
|
|||
{
|
||||
if(m_bIgnoreInput) return;
|
||||
|
||||
//CD - Added for audio
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
switch(static_cast<int>(controlId))
|
||||
{
|
||||
// case eControl_GameMode:
|
||||
|
|
@ -776,11 +772,13 @@ void UIScene_LoadMenu::handlePress(F64 controlId, F64 childId)
|
|||
break;
|
||||
case eControl_TexturePackList:
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
UpdateCurrentTexturePack(static_cast<int>(childId));
|
||||
}
|
||||
break;
|
||||
case eControl_LoadWorld:
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
#ifdef _DURANGO
|
||||
if(m_MoreOptionsParams.bOnlineGame)
|
||||
{
|
||||
|
|
@ -1962,4 +1960,4 @@ int UIScene_LoadMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStorage::EM
|
|||
// pClass->m_bIgnoreInput=false;
|
||||
// return 0;
|
||||
// }
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -801,7 +801,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
|||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadCreateJoinMenu);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -864,7 +864,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
|||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadCreateJoinMenu);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -878,7 +878,7 @@ int UIScene_MainMenu::CreateLoad_SignInReturned(void *pParam, bool bContinue, in
|
|||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadCreateJoinMenu);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -1438,7 +1438,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad)
|
|||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadCreateJoinMenu);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
@ -1510,7 +1510,7 @@ void UIScene_MainMenu::RunPlayGame(int iPad)
|
|||
#ifdef _XBOX_ONE
|
||||
ui.ShowPlayerDisplayname(true);
|
||||
#endif
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadOrJoinMenu);
|
||||
proceedToScene(ProfileManager.GetPrimaryPad(), eUIScene_LoadCreateJoinMenu);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "XUI_Chat.h"
|
||||
#include "../../Minecraft.h"
|
||||
#include "../../Gui.h"
|
||||
#include "../../../Minecraft.World\ArabicShaping.h"
|
||||
#include "../../../Minecraft.World/ArabicShaping.h"
|
||||
|
||||
HRESULT CScene_Chat::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "stdafx.h"
|
||||
#include "EndermiteModel.h"
|
||||
#include "Cube.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "../Minecraft.World/Mth.h"
|
||||
#include "ModelPart.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "EndermiteRenderer.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.monster.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.monster.h"
|
||||
#include "EndermiteModel.h"
|
||||
|
||||
ResourceLocation EndermiteRenderer::ENDERMITE_LOCATION(TN_MOB_ENDERMITE);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "stdafx.h"
|
||||
#include "GuardianModel.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "../Minecraft.World/Mth.h"
|
||||
#include "ModelPart.h"
|
||||
#include "..\Minecraft.World\Guardian.h"
|
||||
#include "../Minecraft.World/Guardian.h"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#include "stdafx.h"
|
||||
#include "GuardianRenderer.h"
|
||||
#include "GuardianModel.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
|
||||
#include "../Minecraft.World/Mth.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
|
||||
#include "../Minecraft.World/Guardian.h"
|
||||
#include "..\Minecraft.World\Level.h"
|
||||
#include "../Minecraft.World/Level.h"
|
||||
#include "Tesselator.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "../Minecraft.Server/ServerLogManager.h"
|
||||
#include "../Minecraft.Server/Access/Access.h"
|
||||
#include "..\Minecraft.Server/Security/SecurityConfig.h"
|
||||
#include "../Minecraft.Server/Security/SecurityConfig.h"
|
||||
#include "../Minecraft.World/Socket.h"
|
||||
#include <FourKitBridge.h>
|
||||
#include <Windows64/Network/WinsockNetLayer.h>
|
||||
|
|
|
|||
357
Minecraft.Client/Platform_Libs/Dev/Storage/4J_Storage.cpp
Normal file
357
Minecraft.Client/Platform_Libs/Dev/Storage/4J_Storage.cpp
Normal file
|
|
@ -0,0 +1,357 @@
|
|||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Patoke
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../Windows64/4JLibs/inc/4J_Storage.h"
|
||||
#include "STO_Main.h"
|
||||
|
||||
C4JStorage StorageManager;
|
||||
XMARKETPLACE_CONTENTOFFER_INFO InternalContentOfferInfo;
|
||||
|
||||
C4JStorage::C4JStorage() {}
|
||||
|
||||
void C4JStorage::Tick(void)
|
||||
{
|
||||
InternalStorageManager.Tick();
|
||||
}
|
||||
|
||||
C4JStorage::EMessageResult C4JStorage::RequestMessageBox(UINT uiTitle, UINT uiText, UINT *uiOptionA, UINT uiOptionC, DWORD dwPad,
|
||||
int (*Func)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID lpParam,
|
||||
C4JStringTable *pStringTable, WCHAR *pwchFormatString, DWORD dwFocusButton)
|
||||
{
|
||||
return EMessage_Undefined;
|
||||
}
|
||||
|
||||
C4JStorage::EMessageResult C4JStorage::GetMessageBoxResult()
|
||||
{
|
||||
return EMessage_Undefined;
|
||||
}
|
||||
|
||||
bool C4JStorage::SetSaveDevice(int (*Func)(LPVOID, const bool), LPVOID lpParam, bool bForceResetOfSaveDevice)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void C4JStorage::Init(unsigned int uiSaveVersion, LPCWSTR pwchDefaultSaveName, char *pszSavePackName, int iMinimumSaveSize,
|
||||
int (*Func)(LPVOID, const ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID)
|
||||
{
|
||||
InternalStorageManager.Init(Func, lpParam, szGroupID);
|
||||
}
|
||||
|
||||
void C4JStorage::ResetSaveData()
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.ResetSaveData();
|
||||
}
|
||||
|
||||
void C4JStorage::SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveTitle(LPCWSTR pwchDefaultSaveName)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveTitle(pwchDefaultSaveName);
|
||||
}
|
||||
|
||||
LPCWSTR C4JStorage::GetSaveTitle()
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveTitle();
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveUniqueNumber(INT *piVal)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveUniqueNumber(piVal);
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveUniqueFilename(char *pszName)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveUniqueFilename(pszName);
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveUniqueFilename(char *szFilename)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveUniqueFilename(szFilename);
|
||||
}
|
||||
|
||||
void C4JStorage::SetState(ESaveGameControlState eControlState, int (*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveDisabled(bool bDisable)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveDisabled(bDisable);
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveDisabled(void)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveDisabled();
|
||||
}
|
||||
|
||||
unsigned int C4JStorage::GetSaveSize()
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSaveSize();
|
||||
}
|
||||
|
||||
void C4JStorage::GetSaveData(void *pvData, unsigned int *puiBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.GetSaveData(pvData, puiBytes);
|
||||
}
|
||||
|
||||
PVOID C4JStorage::AllocateSaveData(unsigned int uiBytes)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.AllocateSaveData(uiBytes);
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage, DWORD dwImageBytes, PBYTE pbTextData, DWORD dwTextDataBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetSaveImages(pbThumbnail, dwThumbnailBytes, pbImage, dwImageBytes, pbTextData, dwTextDataBytes);
|
||||
}
|
||||
|
||||
void C4JStorage::SetDefaultImages(PBYTE pbOptionsImage, DWORD dwOptionsImageBytes, PBYTE pbSaveImage, DWORD dwSaveImageBytes, PBYTE pbSaveThumbnail, DWORD dwSaveThumbnailBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.SetDefaultImages(pbOptionsImage, dwOptionsImageBytes, pbSaveImage, dwSaveImageBytes, pbSaveThumbnail, dwSaveThumbnailBytes);
|
||||
}
|
||||
|
||||
void C4JStorage::GetDefaultSaveImage(PBYTE *ppbSaveImage, DWORD *pdwSaveImageBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.GetDefaultSaveImage(ppbSaveImage, pdwSaveImageBytes);
|
||||
}
|
||||
|
||||
void C4JStorage::GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail, DWORD *pdwSaveThumbnailBytes)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.GetDefaultSaveThumbnail(ppbSaveThumbnail, pdwSaveThumbnailBytes);
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::SaveSaveData(int (*Func)(LPVOID, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.SaveSaveData(Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail, WCHAR *wchNewName, int (*Func)(LPVOID lpParam, bool), LPVOID lpParam)
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.CopySaveDataToNewSave(pbThumbnail, cbThumbnail, wchNewName, Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveDeviceSelected(unsigned int uiPad, bool bSelected)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
bool C4JStorage::GetSaveDeviceSelected(unsigned int iPad)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::DoesSaveExist(bool *pbExists)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.DoesSaveExist(pbExists);
|
||||
}
|
||||
|
||||
bool C4JStorage::EnoughSpaceForAMinSaveGame()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void C4JStorage::SetMaxSaves(int iMaxC)
|
||||
{
|
||||
(void)iMaxC;
|
||||
}
|
||||
|
||||
void C4JStorage::SetIncompleteSaveCallback(void (*Func)(LPVOID, const ESaveIncompleteType, int blocksRequired), LPVOID param)
|
||||
{
|
||||
(void)Func;
|
||||
(void)param;
|
||||
}
|
||||
|
||||
void C4JStorage::ContinueIncompleteOperation()
|
||||
{
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSaveState()
|
||||
{
|
||||
return C4JStorage::ESaveGame_Idle;
|
||||
}
|
||||
|
||||
void C4JStorage::SetSaveMessageVPosition(float fY)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, const bool), LPVOID lpParam,
|
||||
char *pszSavePackName)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.GetSavesInfo(iPad, Func, lpParam, pszSavePackName);
|
||||
}
|
||||
|
||||
PSAVE_DETAILS C4JStorage::ReturnSavesInfo()
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.ReturnSavesInfo();
|
||||
}
|
||||
|
||||
void C4JStorage::ClearSavesInfo()
|
||||
{
|
||||
InternalStorageManager.m_SaveGame.ClearSavesInfo();
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo,
|
||||
int (*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.LoadSaveDataThumbnail(pSaveInfo, Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, XCONTENT_DATA &xContentData)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::GetSaveCacheFileInfo(DWORD dwFile, PBYTE *ppbImageData, DWORD *pdwImageBytes)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::LoadSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.LoadSaveData(pSaveInfo, Func, lpParam);
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::DeleteSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.DeleteSaveData(pSaveInfo, Func, lpParam);
|
||||
}
|
||||
|
||||
C4JStorage::ESaveGameState C4JStorage::RenameSaveData(int iRenameIndex, uint16_t *pui16NewName, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_SaveGame.RenameSaveData(iRenameIndex, pui16NewName, Func, lpParam);
|
||||
}
|
||||
|
||||
void C4JStorage::RegisterMarketplaceCountsCallback(int (*Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
void C4JStorage::SetDLCPackageRoot(char *pszDLCRoot)
|
||||
{
|
||||
InternalStorageManager.m_DLC.SetPackageRoot(pszDLCRoot);
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus C4JStorage::GetDLCOffers(int iPad, int (*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask)
|
||||
{
|
||||
return EDLC_Idle;
|
||||
}
|
||||
|
||||
DWORD C4JStorage::CancelGetDLCOffers()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void C4JStorage::ClearDLCOffers()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
XMARKETPLACE_CONTENTOFFER_INFO &C4JStorage::GetOffer(DWORD dw)
|
||||
{
|
||||
return InternalContentOfferInfo;
|
||||
}
|
||||
|
||||
int C4JStorage::GetOfferCount()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD C4JStorage::InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA, int (*Func)(LPVOID, int, int), LPVOID lpParam, bool bTrial)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD C4JStorage::GetAvailableDLCCount(int iPad)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetAvailableDLCCount(iPad);
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus C4JStorage::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetInstalledDLC(iPad, Func, lpParam);
|
||||
}
|
||||
|
||||
XCONTENT_DATA &C4JStorage::GetDLC(DWORD dw)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetDLC(dw);
|
||||
}
|
||||
|
||||
DWORD C4JStorage::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.MountInstalledDLC(iPad, dwDLC, Func, lpParam, szMountDrive);
|
||||
}
|
||||
|
||||
DWORD C4JStorage::UnmountInstalledDLC(LPCSTR szMountDrive)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.UnmountInstalledDLC(szMountDrive);
|
||||
}
|
||||
|
||||
void C4JStorage::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList)
|
||||
{
|
||||
InternalStorageManager.m_DLC.GetMountedDLCFileList(szMountDrive, fileList);
|
||||
}
|
||||
|
||||
std::string C4JStorage::GetMountedPath(std::string szMount)
|
||||
{
|
||||
return InternalStorageManager.m_DLC.GetMountedPath(szMount);
|
||||
}
|
||||
|
||||
C4JStorage::ETMSStatus C4JStorage::ReadTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, C4JStorage::eTMS_FileType eFileType,
|
||||
WCHAR *pwchFilename, BYTE **ppBuffer, DWORD *pdwBufferSize,
|
||||
int (*Func)(LPVOID, WCHAR *, int, bool, int), LPVOID lpParam, int iAction)
|
||||
{
|
||||
return ETMSStatus_Idle;
|
||||
}
|
||||
|
||||
bool C4JStorage::WriteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR *pwchFilename, BYTE *pBuffer, DWORD dwBufferSize)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool C4JStorage::DeleteTMSFile(int iQuadrant, eGlobalStorage eStorageFacility, WCHAR *pwchFilename)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void C4JStorage::StoreTMSPathName(WCHAR *pwchName)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::ETMSStatus C4JStorage::TMSPP_ReadFile(int iPad, C4JStorage::eGlobalStorage eStorageFacility, C4JStorage::eTMS_FILETYPEVAL eFileTypeVal,
|
||||
LPCSTR szFilename, int (*Func)(LPVOID, int, int, PTMSPP_FILEDATA, LPCSTR), LPVOID lpParam,
|
||||
int iUserData)
|
||||
{
|
||||
return ETMSStatus_Idle;
|
||||
}
|
||||
|
||||
unsigned int C4JStorage::CRC(unsigned char *buf, int len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
344
Minecraft.Client/Platform_Libs/Dev/Storage/STO_DLC.cpp
Normal file
344
Minecraft.Client/Platform_Libs/Dev/Storage/STO_DLC.cpp
Normal file
|
|
@ -0,0 +1,344 @@
|
|||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Patoke
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "STO_DLC.h"
|
||||
#include "STO_Main.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
XCONTENT_DATA &CDLC::GetDLC(DWORD dw)
|
||||
{
|
||||
return m_vInstalledDLCs[dw];
|
||||
}
|
||||
|
||||
CDLC::CDLC(void) : m_vInstalledDLCs(), m_szMountPath(), m_vDLCDriveMappings()
|
||||
{
|
||||
m_iHasNewInstalledDLCs = false;
|
||||
dword0 = 0;
|
||||
dwordC0 = 0;
|
||||
m_iHasNewMountedDLCs = false; // @Patoke fix
|
||||
|
||||
ZeroMemory(m_szDLCProductCode, sizeof(m_szDLCProductCode));
|
||||
ZeroMemory(m_szProductUpgradeKey, sizeof(m_szProductUpgradeKey));
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus CDLC::GetOffers(int iPad, int (*Func)(LPVOID, int, DWORD, int), LPVOID lpParam, DWORD dwOfferTypesBitmask)
|
||||
{
|
||||
return C4JStorage::EDLC_NoOffers;
|
||||
}
|
||||
|
||||
void CDLC::ClearOffers()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
C4JStorage::EDLCStatus CDLC::GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam)
|
||||
{
|
||||
if (m_iHasNewInstalledDLCs)
|
||||
{
|
||||
return C4JStorage::EDLC_Pending;
|
||||
}
|
||||
|
||||
m_pInstalledDLCFunc = Func;
|
||||
m_pInstalledDLCParam = lpParam;
|
||||
m_iHasNewInstalledDLCs = true;
|
||||
|
||||
#ifdef __linux__
|
||||
const char *dlcDir = NULL;
|
||||
struct stat stDir;
|
||||
if (stat("Windows64Media/DLC", &stDir) == 0 && S_ISDIR(stDir.st_mode))
|
||||
{
|
||||
dlcDir = "Windows64Media/DLC";
|
||||
}
|
||||
else if (stat("Windows64/DLC", &stDir) == 0 && S_ISDIR(stDir.st_mode))
|
||||
{
|
||||
dlcDir = "Windows64/DLC";
|
||||
}
|
||||
|
||||
if (!dlcDir)
|
||||
{
|
||||
InternalStorageManager.DebugPrintf("No DLC directory, can't have any DLC installed\n");
|
||||
return C4JStorage::EDLC_Error;
|
||||
}
|
||||
|
||||
DIR *dir = opendir(dlcDir);
|
||||
if (dir)
|
||||
{
|
||||
struct dirent *entry;
|
||||
while ((entry = readdir(dir)) != NULL)
|
||||
{
|
||||
if (entry->d_name[0] == '.')
|
||||
continue;
|
||||
char fullPath[512];
|
||||
snprintf(fullPath, sizeof(fullPath), "%s/%s", dlcDir, entry->d_name);
|
||||
struct stat stEntry;
|
||||
if (stat(fullPath, &stEntry) == 0 && S_ISDIR(stEntry.st_mode))
|
||||
{
|
||||
XCONTENT_DATA data;
|
||||
snprintf(data.szFileName, sizeof(data.szFileName), "%s/%s", dlcDir, entry->d_name);
|
||||
swprintf(data.szDisplayName, 256, L"%s", entry->d_name);
|
||||
data.DeviceID = 0;
|
||||
data.dwContentType = 0;
|
||||
AddInstalled(&data);
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
#else
|
||||
bool ret = false;
|
||||
DWORD atts = GetFileAttributesA("Windows64Media/DLC");
|
||||
if (atts == -1)
|
||||
{
|
||||
atts = GetFileAttributesA("Windows64/DLC");
|
||||
ret = true;
|
||||
}
|
||||
|
||||
bool validDir = atts != -1 && (atts & FILE_ATTRIBUTE_DIRECTORY);
|
||||
if (!validDir)
|
||||
{
|
||||
InternalStorageManager.DebugPrintf("No DLC directory, can't have any DLC installed\n");
|
||||
return C4JStorage::EDLC_Error;
|
||||
}
|
||||
|
||||
_WIN32_FIND_DATAA hFind;
|
||||
HANDLE hFindFile;
|
||||
if (ret)
|
||||
{
|
||||
hFindFile = FindFirstFileA("Windows64/DLC/*", &hFind);
|
||||
}
|
||||
else
|
||||
{
|
||||
hFindFile = FindFirstFileA("Windows64Media/DLC/*", &hFind);
|
||||
}
|
||||
|
||||
if (hFindFile != (HANDLE)-1LL)
|
||||
{
|
||||
do
|
||||
{
|
||||
atts = hFind.dwFileAttributes;
|
||||
|
||||
bool isArt = hFind.dwFileAttributes != -1 && (hFind.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
if (isArt && hFind.cFileName[0] != '.')
|
||||
{
|
||||
XCONTENT_DATA data;
|
||||
|
||||
if (ret)
|
||||
{
|
||||
sprintf(data.szFileName, "Windows64/DLC/%s", hFind.cFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(data.szFileName, "Windows64Media/DLC/%s", hFind.cFileName);
|
||||
}
|
||||
|
||||
swprintf(data.szDisplayName, 256, L"%s", hFind.cFileName);
|
||||
int displayNameLen = wcslen(data.szDisplayName);
|
||||
|
||||
data.DeviceID = 0;
|
||||
data.dwContentType = 0;
|
||||
|
||||
AddInstalled(&data);
|
||||
}
|
||||
} while (FindNextFileA(hFindFile, &hFind));
|
||||
FindClose(hFindFile);
|
||||
}
|
||||
#endif
|
||||
|
||||
return C4JStorage::EDLC_Idle;
|
||||
}
|
||||
|
||||
DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive)
|
||||
{
|
||||
this->m_pMountedDLCFunc = Func;
|
||||
this->m_pMountedDLCParam = lpParam;
|
||||
|
||||
if (szMountDrive)
|
||||
{
|
||||
m_szMountPath = szMountDrive;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_szMountPath = this->m_szPackageRoot;
|
||||
}
|
||||
|
||||
this->m_uiCurrentMappedDLC = dwDLC;
|
||||
|
||||
char *dlcdirPath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName;
|
||||
m_vDLCDriveMappings.push_back(DriveMapping(m_szMountPath, dlcdirPath));
|
||||
|
||||
dword94 = 0xFFFFFFFF;
|
||||
m_iHasNewMountedDLCs = true;
|
||||
|
||||
return 997;
|
||||
}
|
||||
|
||||
DWORD CDLC::UnmountInstalledDLC(LPCSTR szMountDrive)
|
||||
{
|
||||
LPCSTR szDrive = nullptr;
|
||||
|
||||
if (szMountDrive)
|
||||
{
|
||||
szDrive = szMountDrive;
|
||||
}
|
||||
else
|
||||
{
|
||||
szDrive = this->m_szPackageRoot;
|
||||
}
|
||||
|
||||
for (int i = 0; i < this->m_vDLCDriveMappings.size(); i++)
|
||||
{
|
||||
if (m_vDLCDriveMappings[i].m_szDirectoryPath == szDrive)
|
||||
{
|
||||
m_vDLCDriveMappings.erase(m_vDLCDriveMappings.begin() + i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CDLC::GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList)
|
||||
{
|
||||
#ifdef __linux__
|
||||
const char *basePath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName;
|
||||
DIR *dir = opendir(basePath);
|
||||
if (dir)
|
||||
{
|
||||
struct dirent *entry;
|
||||
while ((entry = readdir(dir)) != NULL)
|
||||
{
|
||||
if (entry->d_name[0] == '.')
|
||||
continue;
|
||||
char fullPath[256];
|
||||
snprintf(fullPath, sizeof(fullPath), "%s/%s", basePath, entry->d_name);
|
||||
struct stat st;
|
||||
if (stat(fullPath, &st) == 0 && !S_ISDIR(st.st_mode))
|
||||
{
|
||||
fileList.push_back(fullPath);
|
||||
}
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
#else
|
||||
char *dlcdirPath = new char[256];
|
||||
sprintf(dlcdirPath, "%s/*", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName);
|
||||
|
||||
_WIN32_FIND_DATAA atts;
|
||||
HANDLE hFind = FindFirstFileA(dlcdirPath, &atts);
|
||||
if (hFind != (HANDLE)-1LL)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (atts.dwFileAttributes == -1 || (atts.dwFileAttributes & 0x10) != 0x10)
|
||||
{
|
||||
char dir[256];
|
||||
sprintf(dir, "%s/%s", m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName, atts.cFileName);
|
||||
|
||||
fileList.push_back(dir);
|
||||
}
|
||||
} while (FindNextFileA(hFind, &atts));
|
||||
FindClose(hFind);
|
||||
}
|
||||
delete[] dlcdirPath;
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string CDLC::GetMountedPath(std::string szMount)
|
||||
{
|
||||
for (int ch = 0; ch < szMount.size(); ++ch)
|
||||
{
|
||||
if (szMount[ch] == '/' || szMount[ch] == '\\')
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if (szMount[ch] == ':')
|
||||
{
|
||||
std::string driveName = szMount.substr(0, ch);
|
||||
for (int i = 0; i < m_vDLCDriveMappings.size(); ++i)
|
||||
{
|
||||
if (m_vDLCDriveMappings[i].m_szDirectoryPath == driveName)
|
||||
{
|
||||
std::string newPath = m_vDLCDriveMappings[i].m_szMountPath;
|
||||
|
||||
newPath.append(szMount.substr(ch + 1, -1));
|
||||
|
||||
return newPath;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void CDLC::SetDLCProductCode(const char *szProductCode)
|
||||
{
|
||||
strcpy(m_szDLCProductCode, szProductCode);
|
||||
}
|
||||
|
||||
void CDLC::SetProductUpgradeKey(const char *szProductCode)
|
||||
{
|
||||
strcpy(m_szProductUpgradeKey, szProductCode);
|
||||
}
|
||||
|
||||
int CDLC::GetAvailableDLCCount(int iPad)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CDLC::SetPackageRoot(char *pszDLCRoot)
|
||||
{
|
||||
strcpy(this->m_szPackageRoot, pszDLCRoot);
|
||||
}
|
||||
|
||||
void CDLC::Tick(void)
|
||||
{
|
||||
if (m_iHasNewInstalledDLCs)
|
||||
{
|
||||
m_iHasNewInstalledDLCs = false;
|
||||
m_pInstalledDLCFunc(m_pInstalledDLCParam, m_vInstalledDLCs.size(), 0);
|
||||
}
|
||||
if (m_iHasNewMountedDLCs)
|
||||
{
|
||||
m_iHasNewMountedDLCs = false;
|
||||
m_pMountedDLCFunc(m_pMountedDLCParam, 0, 0, dword94);
|
||||
}
|
||||
}
|
||||
|
||||
void CDLC::AddInstalled(XCONTENT_DATA *data)
|
||||
{
|
||||
m_vInstalledDLCs.push_back(*data);
|
||||
}
|
||||
|
||||
DWORD CDLC::CancelOffers(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
81
Minecraft.Client/Platform_Libs/Dev/Storage/STO_DLC.h
Normal file
81
Minecraft.Client/Platform_Libs/Dev/Storage/STO_DLC.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#pragma once
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Patoke
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../Windows64/4JLibs/inc/4J_Storage.h"
|
||||
|
||||
class CDLC
|
||||
{
|
||||
public:
|
||||
struct DriveMapping
|
||||
{
|
||||
DriveMapping(std::string szDirectoryPath, std::string szMountPath) : m_szDirectoryPath(szDirectoryPath), m_szMountPath(szMountPath)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
std::string m_szDirectoryPath;
|
||||
std::string m_szMountPath;
|
||||
};
|
||||
|
||||
XCONTENT_DATA &GetDLC(DWORD dw);
|
||||
CDLC(void);
|
||||
|
||||
C4JStorage::EDLCStatus GetOffers(int iPad, int (*Func)(LPVOID, int, DWORD, int), LPVOID lpParam,
|
||||
DWORD dwOfferTypesBitmask = XMARKETPLACE_OFFERING_TYPE_CONTENT);
|
||||
void ClearOffers();
|
||||
C4JStorage::EDLCStatus GetInstalledDLC(int iPad, int (*Func)(LPVOID, int, int), LPVOID lpParam);
|
||||
DWORD MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DWORD, DWORD), LPVOID lpParam, LPCSTR szMountDrive = NULL);
|
||||
DWORD UnmountInstalledDLC(LPCSTR szMountDrive = NULL);
|
||||
void GetMountedDLCFileList(const char *szMountDrive, std::vector<std::string> &fileList);
|
||||
std::string GetMountedPath(std::string szMount);
|
||||
|
||||
void SetDLCProductCode(const char *szProductCode);
|
||||
void SetProductUpgradeKey(const char *szProductCode);
|
||||
int GetAvailableDLCCount(int iPad);
|
||||
void SetPackageRoot(char *pszDLCRoot);
|
||||
|
||||
void Tick(void);
|
||||
void AddInstalled(XCONTENT_DATA *data);
|
||||
DWORD CancelOffers(void);
|
||||
|
||||
DWORD dword0;
|
||||
int (*m_pInstalledDLCFunc)(LPVOID, int, int);
|
||||
LPVOID m_pInstalledDLCParam;
|
||||
BYTE gap18[16];
|
||||
int m_iHasNewInstalledDLCs;
|
||||
std::vector<XCONTENT_DATA> m_vInstalledDLCs;
|
||||
BYTE gap48[4];
|
||||
DWORD m_iHasNewMountedDLCs;
|
||||
int (*m_pMountedDLCFunc)(LPVOID, int, DWORD, DWORD);
|
||||
LPVOID m_pMountedDLCParam;
|
||||
std::string m_szMountPath;
|
||||
DWORD m_uiCurrentMappedDLC;
|
||||
DWORD dword94;
|
||||
char m_szPackageRoot[40];
|
||||
DWORD dwordC0;
|
||||
std::vector<DriveMapping> m_vDLCDriveMappings;
|
||||
char m_szDLCProductCode[16];
|
||||
char m_szProductUpgradeKey[60];
|
||||
};
|
||||
94
Minecraft.Client/Platform_Libs/Dev/Storage/STO_Main.cpp
Normal file
94
Minecraft.Client/Platform_Libs/Dev/Storage/STO_Main.cpp
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Patoke
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "STO_Main.h"
|
||||
#include "../../../Windows64/4JLibs/inc/4J_Storage.h"
|
||||
|
||||
CStorage InternalStorageManager;
|
||||
|
||||
CStorage::CStorage(void)
|
||||
{
|
||||
m_SaveGame = CSaveGame();
|
||||
m_DLC = CDLC();
|
||||
}
|
||||
|
||||
void CStorage::Init(int (*Func)(LPVOID, const C4JStorage::ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID) {}
|
||||
|
||||
void CStorage::Tick(void)
|
||||
{
|
||||
m_DLC.Tick();
|
||||
}
|
||||
|
||||
unsigned int CStorage::CRC(unsigned char *buf, int len)
|
||||
{
|
||||
return ~UpdateCRC(0xFFFFFFFF, buf, len);
|
||||
}
|
||||
|
||||
void CStorage::MakeCRCTable(void)
|
||||
{
|
||||
for (int c = 0; c < 256; ++c)
|
||||
{
|
||||
unsigned int k = c;
|
||||
for (int n = 0; n < 8; ++n)
|
||||
{
|
||||
if ((k & 1) != 0)
|
||||
{
|
||||
k = (k >> 1) ^ 0xEDB88320;
|
||||
}
|
||||
else
|
||||
{
|
||||
k >>= 1;
|
||||
}
|
||||
}
|
||||
m_CRCTable[c] = k;
|
||||
}
|
||||
m_bHasCRCTable = true;
|
||||
}
|
||||
|
||||
unsigned int CStorage::UpdateCRC(unsigned int crc, unsigned __int8 *buf, int len)
|
||||
{
|
||||
if (!m_bHasCRCTable)
|
||||
{
|
||||
MakeCRCTable();
|
||||
}
|
||||
|
||||
for (int c = 0; c < len; ++c)
|
||||
{
|
||||
crc = (crc >> 8) ^ m_CRCTable[(unsigned __int8)(buf[c] ^ crc)];
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void CStorage::DebugPrintf(const char *szFormat, ...)
|
||||
{
|
||||
char buf[1024];
|
||||
|
||||
va_list va;
|
||||
va_start(va, szFormat);
|
||||
|
||||
vsnprintf(buf, 1024, szFormat, va);
|
||||
|
||||
va_end(va);
|
||||
}
|
||||
49
Minecraft.Client/Platform_Libs/Dev/Storage/STO_Main.h
Normal file
49
Minecraft.Client/Platform_Libs/Dev/Storage/STO_Main.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#pragma once
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Patoke
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "STO_DLC.h"
|
||||
#include "STO_SaveGame.h"
|
||||
|
||||
class CStorage
|
||||
{
|
||||
public:
|
||||
CStorage(void);
|
||||
|
||||
void Init(int (*Func)(LPVOID, const C4JStorage::ESavingMessage, int), LPVOID lpParam, LPCSTR szGroupID);
|
||||
void Tick(void);
|
||||
unsigned int CRC(unsigned char *buf, int len);
|
||||
void MakeCRCTable(void);
|
||||
unsigned int UpdateCRC(unsigned int crc, unsigned __int8 *buf, int len);
|
||||
void DebugPrintf(const char *szFormat, ...);
|
||||
|
||||
BYTE gap0[8];
|
||||
CSaveGame m_SaveGame;
|
||||
CDLC m_DLC;
|
||||
BYTE gap278[0x10];
|
||||
DWORD m_CRCTable[256];
|
||||
bool m_bHasCRCTable;
|
||||
};
|
||||
|
||||
extern CStorage InternalStorageManager;
|
||||
1227
Minecraft.Client/Platform_Libs/Dev/Storage/STO_SaveGame.cpp
Normal file
1227
Minecraft.Client/Platform_Libs/Dev/Storage/STO_SaveGame.cpp
Normal file
File diff suppressed because it is too large
Load diff
81
Minecraft.Client/Platform_Libs/Dev/Storage/STO_SaveGame.h
Normal file
81
Minecraft.Client/Platform_Libs/Dev/Storage/STO_SaveGame.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#pragma once
|
||||
/*
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Patoke
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "../../../Windows64/4JLibs/inc/4J_Storage.h"
|
||||
|
||||
class CSaveGame
|
||||
{
|
||||
public:
|
||||
CSaveGame();
|
||||
void SetSaveDisabled(bool bDisable);
|
||||
bool GetSaveDisabled(void);
|
||||
|
||||
void ResetSaveData();
|
||||
C4JStorage::ESaveGameState GetSavesInfo(int iPad, int (*Func)(LPVOID lpParam, SAVE_DETAILS *pSaveDetails, const bool), LPVOID lpParam,
|
||||
char *pszSavePackName);
|
||||
PSAVE_DETAILS ReturnSavesInfo();
|
||||
void ClearSavesInfo();
|
||||
C4JStorage::ESaveGameState LoadSaveDataThumbnail(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, PBYTE pbThumbnail, DWORD dwThumbnailBytes),
|
||||
LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool, const bool), LPVOID lpParam);
|
||||
unsigned int GetSaveSize();
|
||||
void GetSaveData(void *pvData, unsigned int *puiBytes);
|
||||
bool GetSaveUniqueNumber(INT *piVal);
|
||||
bool GetSaveUniqueFilename(char *pszName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
void SetSaveImages(PBYTE pbThumbnail, DWORD dwThumbnailBytes, PBYTE pbImage, DWORD dwImageBytes, PBYTE pbTextData, DWORD dwTextDataBytes);
|
||||
C4JStorage::ESaveGameState SaveSaveData(int (*Func)(LPVOID, const bool), LPVOID lpParam);
|
||||
void CopySaveDataToNewSave(PBYTE pbThumbnail, DWORD cbThumbnail, WCHAR *wchNewName, int (*Func)(LPVOID lpParam, bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex, uint16_t *pui16NewName, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
|
||||
void SetSaveUniqueFilename(char *szFilename);
|
||||
LPCWSTR GetSaveTitle();
|
||||
|
||||
void CreateSaveUniqueName(void);
|
||||
void SaveTitleFile(const char *saveDirPath);
|
||||
static bool LoadTitleFromFile(const char *saveDirPath, char *outUTF8Title, int maxLen);
|
||||
|
||||
void SetDefaultImages(PBYTE pbOptionsImage, DWORD dwOptionsImageBytes, PBYTE pbSaveImage, DWORD dwSaveImageBytes, PBYTE pbSaveThumbnail, DWORD dwSaveThumbnailBytes);
|
||||
void GetDefaultSaveImage(PBYTE *ppbSaveImage, DWORD *pdwSaveImageBytes);
|
||||
void GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail, DWORD *pdwSaveThumbnailBytes);
|
||||
|
||||
void *m_pSaveData;
|
||||
unsigned int m_uiSaveSize;
|
||||
char m_szSaveUniqueName[32];
|
||||
wchar_t m_wszSaveTitle[MAX_DISPLAYNAME_LENGTH];
|
||||
bool m_bIsSafeDisabled;
|
||||
bool m_bHasSaveDetails;
|
||||
SAVE_DETAILS *m_pSaveDetails;
|
||||
|
||||
PBYTE m_pbThumbnail;
|
||||
DWORD m_dwThumbnailBytes;
|
||||
|
||||
PBYTE m_pbDefaultThumbnail;
|
||||
DWORD m_dwDefaultThumbnailBytes;
|
||||
PBYTE m_pbDefaultSaveImage;
|
||||
DWORD m_dwDefaultSaveImageBytes;
|
||||
};
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
#include "../Minecraft.World/GenericStats.h"
|
||||
#include "../Minecraft.World/JavaMath.h"
|
||||
|
||||
#include "..\Minecraft.World\ListTag.h"
|
||||
#include "../Minecraft.World/ListTag.h"
|
||||
// 4J Added
|
||||
#include "../Minecraft.World/net.minecraft.world.item.crafting.h"
|
||||
#include "Options.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "stdafx.h"
|
||||
#include "RabbitModel.h"
|
||||
#include "ModelPart.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "../Minecraft.World/Mth.h"
|
||||
#include "../Minecraft.World/Rabbit.h"
|
||||
|
||||
#define PI 3.14159265358979323846f
|
||||
|
|
|
|||
|
|
@ -151,6 +151,11 @@ public:
|
|||
EDeleteGame_InProgress,
|
||||
};
|
||||
|
||||
enum ESaveIncompleteType
|
||||
{
|
||||
ESaveIncomplete_None = 0,
|
||||
};
|
||||
|
||||
|
||||
enum ESGIStatus
|
||||
{
|
||||
|
|
@ -252,6 +257,7 @@ public:
|
|||
void ResetSaveData(); // Call before a new save to clear out stored save file name
|
||||
void SetDefaultSaveNameForKeyboardDisplay(LPCWSTR pwchDefaultSaveName);
|
||||
void SetSaveTitle(LPCWSTR pwchDefaultSaveName);
|
||||
LPCWSTR GetSaveTitle();
|
||||
bool GetSaveUniqueNumber(INT *piVal);
|
||||
bool GetSaveUniqueFilename(char *pszName);
|
||||
void SetSaveUniqueFilename(char *szFilename);
|
||||
|
|
@ -262,12 +268,19 @@ public:
|
|||
void GetSaveData(void *pvData,unsigned int *puiBytes);
|
||||
PVOID AllocateSaveData(unsigned int uiBytes);
|
||||
void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png
|
||||
void SetDefaultImages(PBYTE pbOptionsImage, DWORD dwOptionsImageBytes, PBYTE pbSaveImage, DWORD dwSaveImageBytes, PBYTE pbSaveThumbnail, DWORD dwSaveThumbnailBytes);
|
||||
void GetDefaultSaveImage(PBYTE *ppbSaveImage, DWORD *pdwSaveImageBytes);
|
||||
void GetDefaultSaveThumbnail(PBYTE *ppbSaveThumbnail, DWORD *pdwSaveThumbnailBytes);
|
||||
C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam);
|
||||
void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam);
|
||||
void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected);
|
||||
bool GetSaveDeviceSelected(unsigned int iPad);
|
||||
C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists);
|
||||
bool EnoughSpaceForAMinSaveGame();
|
||||
void SetMaxSaves(int iMaxC);
|
||||
void SetIncompleteSaveCallback(void (*Func)(LPVOID, const ESaveIncompleteType, int blocksRequired), LPVOID param);
|
||||
void ContinueIncompleteOperation();
|
||||
C4JStorage::ESaveGameState GetSaveState();
|
||||
|
||||
void SetSaveMessageVPosition(float fY); // The 'Saving' message will display at a default position unless changed
|
||||
// Get the info for the saves
|
||||
|
|
@ -282,6 +295,7 @@ public:
|
|||
// Load the save. Need to call GetSaveData once the callback is called
|
||||
C4JStorage::ESaveGameState LoadSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool, const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState DeleteSaveData(PSAVE_INFO pSaveInfo,int( *Func)(LPVOID lpParam,const bool), LPVOID lpParam);
|
||||
C4JStorage::ESaveGameState RenameSaveData(int iRenameIndex, uint16_t *pui16NewName, int (*Func)(LPVOID lpParam, const bool), LPVOID lpParam);
|
||||
|
||||
// DLC
|
||||
void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam );
|
||||
|
|
|
|||
|
|
@ -9390,4 +9390,7 @@ All Ender Chests in a world are linked. Items placed into an Ender Chest are acc
|
|||
<data name="IDS_ENCHANTMENT_LUCK_OF_THE_SEA">
|
||||
<value>Luck of the Sea</value>
|
||||
</data>
|
||||
<data name="IDS_TILE_STONESLAB_REDSAND">
|
||||
<value>Red Sandstone Slab</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
|||
|
|
@ -255,6 +255,7 @@ WCHAR *CConsoleMinecraftApp::wchSceneA[]=
|
|||
L"xuiscene_ingame_player_options",
|
||||
L"xuiscene_inventory_creative",
|
||||
L"xuiscene_multi_launch_more_options",
|
||||
L"xuiscene_multi_joinload",
|
||||
|
||||
L"xuiscene_DLCMain",
|
||||
L"xuiscene_NewUpdateMessage",
|
||||
|
|
@ -1658,7 +1659,7 @@ HRESULT CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *in
|
|||
// If you're navigating to the multigamejoinload, and the player hasn't seen the updates message yet, display it now
|
||||
// display this message the first 3 times
|
||||
// todo: re-enable if we fix this menu, for now its just blank!
|
||||
if(false && (eScene==eUIScene_LoadOrJoinMenu) && (bSeenUpdateTextThisSession==false) && ( app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplayUpdateMessage)!=0))
|
||||
if(false && ((eScene==eUIScene_LoadOrJoinMenu) || (eScene==eUIScene_LoadCreateJoinMenu)) && (bSeenUpdateTextThisSession==false) && ( app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplayUpdateMessage)!=0))
|
||||
{
|
||||
eScene=eUIScene_NewUpdateMessage;
|
||||
bSeenUpdateTextThisSession=true;
|
||||
|
|
@ -1738,6 +1739,7 @@ HRESULT CConsoleMinecraftApp::NavigateToScene(int iPad,EUIScene eScene, void *in
|
|||
case eUIScene_Credits:
|
||||
case eUIScene_CreateWorldMenu:
|
||||
case eUIScene_LoadOrJoinMenu:
|
||||
case eUIScene_LoadCreateJoinMenu:
|
||||
case eUIScene_JoinMenu:
|
||||
case eUIScene_DLCOffersMenu:
|
||||
case eUIScene_DLCMainMenu:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,12 @@
|
|||
set(BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Windows64/")
|
||||
|
||||
set(_MINECRAFT_CLIENT_WINDOWS_COMMON_RES_AUDIO
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/res/audio/minecraft.xsb"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/res/audio/resident.xwb"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/res/audio/streamed.xwb"
|
||||
)
|
||||
source_group("Common/res/audio" FILES ${_MINECRAFT_CLIENT_WINDOWS_COMMON_RES_AUDIO})
|
||||
|
||||
set(_MINECRAFT_CLIENT_WINDOWS_COMMON_AUDIO
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Audio/SoundEngine.cpp"
|
||||
)
|
||||
|
|
@ -17,8 +24,6 @@ set(_MINECRAFT_CLIENT_WINDOWS_COMMON_UI
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIBitmapFont.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIController.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIController.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIUnicodeBitmapFont.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIUnicodeBitmapFont.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIGroup.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIGroup.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UILayer.cpp"
|
||||
|
|
@ -27,6 +32,8 @@ set(_MINECRAFT_CLIENT_WINDOWS_COMMON_UI
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UITTFFont.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UITTFFont.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIUnicodeBitmapFont.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIUnicodeBitmapFont.h"
|
||||
)
|
||||
source_group("Common/UI" FILES ${_MINECRAFT_CLIENT_WINDOWS_COMMON_UI})
|
||||
|
||||
|
|
@ -160,6 +167,8 @@ set(_MINECRAFT_CLIENT_WINDOWS_COMMON_UI_SCENES_FRONTEND_MENU_SCREENS
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LaunchMoreOptionsMenu.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LeaderboardsMenu.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LeaderboardsMenu.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LoadCreateJoinMenu.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LoadCreateJoinMenu.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LoadMenu.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LoadMenu.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/UI/UIScene_LoadOrJoinMenu.cpp"
|
||||
|
|
@ -337,6 +346,17 @@ set(_MINECRAFT_CLIENT_WINDOWS_SOURCE_FILES
|
|||
)
|
||||
source_group("Source Files" FILES ${_MINECRAFT_CLIENT_WINDOWS_SOURCE_FILES})
|
||||
|
||||
set(_MINECRAFT_CLIENT_WINDOWS_PLATFORM_LIBS_DEV_STORAGE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/4J_Storage.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/STO_DLC.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/STO_DLC.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/STO_Main.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/STO_Main.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/STO_SaveGame.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Platform_Libs/Dev/Storage/STO_SaveGame.h"
|
||||
)
|
||||
source_group("Platform_Libs/Dev/Storage" FILES ${_MINECRAFT_CLIENT_WINDOWS_PLATFORM_LIBS_DEV_STORAGE})
|
||||
|
||||
set(_MINECRAFT_CLIENT_WINDOWS_WINDOWS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Xbox/MinecraftWindows.rc"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Xbox/Resource.h"
|
||||
|
|
@ -472,6 +492,7 @@ set(_MINECRAFT_CLIENT_WINDOWS_NET_MINECRAFT_STATS
|
|||
source_group("net/minecraft/stats" FILES ${_MINECRAFT_CLIENT_WINDOWS_NET_MINECRAFT_STATS})
|
||||
|
||||
set(MINECRAFT_CLIENT_WINDOWS
|
||||
${_MINECRAFT_CLIENT_WINDOWS_COMMON_RES_AUDIO}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_COMMON_AUDIO}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_COMMON_NETWORK}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_COMMON_UI}
|
||||
|
|
@ -489,6 +510,7 @@ set(MINECRAFT_CLIENT_WINDOWS
|
|||
${_MINECRAFT_CLIENT_WINDOWS_DURANGO_IGGY_INCLUDE}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_PS3_IGGY_INCLUDE}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_PS3_PS3EXTRAS}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_PLATFORM_LIBS_DEV_STORAGE}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_SOURCE_FILES}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_WINDOWS}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_WINDOWS64}
|
||||
|
|
@ -506,3 +528,6 @@ set(MINECRAFT_CLIENT_WINDOWS
|
|||
${_MINECRAFT_CLIENT_WINDOWS_XBOX_SENTIENT_DYNAMICCONF}
|
||||
${_MINECRAFT_CLIENT_WINDOWS_NET_MINECRAFT_STATS}
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -166,11 +166,11 @@ public enum Material
|
|||
DROPPER = 158,
|
||||
STAINED_CLAY = 159,
|
||||
STAINED_GLASS_PANE = 160,
|
||||
LEAVES2 = 161,
|
||||
LOG2 = 162,
|
||||
ACACIA_WOOD_STAIRS = 163,
|
||||
DARK_OAK_WOOD_STAIRS = 164,
|
||||
IRON_TRAP_DOOR = 167,
|
||||
LEAVES_2 = 161,
|
||||
LOG_2 = 162,
|
||||
ACACIA_STAIRS = 163,
|
||||
DARK_OAK_STAIRS = 164,
|
||||
IRON_TRAPDOOR = 167,
|
||||
PRISMARINE = 168,
|
||||
SEA_LANTERN = 169,
|
||||
HAY_BLOCK = 170,
|
||||
|
|
@ -178,10 +178,12 @@ public enum Material
|
|||
HARD_CLAY = 172,
|
||||
COAL_BLOCK = 173,
|
||||
PACKED_ICE = 174,
|
||||
TALL_GRASS2 = 175,
|
||||
INVERTED_DAYLIGHT_DETECTOR = 178,
|
||||
DOUBLE_PLANT = 175,
|
||||
DAYLIGHT_DETECTOR_INVERTED = 178,
|
||||
RED_SANDSTONE = 179,
|
||||
RED_SANDSTONE_STAIRS = 180,
|
||||
DOUBLE_STONE_SLAB2 = 181,
|
||||
STONE_SLAB = 182,
|
||||
SPRUCE_FENCE_GATE = 183,
|
||||
BIRCH_FENCE_GATE = 184,
|
||||
JUNGLE_FENCE_GATE = 185,
|
||||
|
|
@ -192,6 +194,11 @@ public enum Material
|
|||
JUNGLE_FENCE = 190,
|
||||
DARK_OAK_FENCE = 191,
|
||||
ACACIA_FENCE = 192,
|
||||
SPRUCE_DOOR = 193,
|
||||
BIRCH_DOOR = 194,
|
||||
JUNGLE_DOOR = 195,
|
||||
ACACIA_DOOR = 196,
|
||||
DARK_OAK_DOOR = 197,
|
||||
|
||||
|
||||
// items
|
||||
|
|
@ -349,9 +356,9 @@ public enum Material
|
|||
HOPPER_MINECART = 408,
|
||||
PRISMARINE_SHARD = 409,
|
||||
PRISMARINE_CRYSTAL = 410,
|
||||
RAW_RABBIT = 411,
|
||||
RABBIT = 411,
|
||||
COOKED_RABBIT = 412,
|
||||
RABBITS_FOOT = 414,
|
||||
RABBIT_FOOT = 414,
|
||||
RABBIT_HIDE = 415,
|
||||
ARMOR_STAND = 416,
|
||||
IRON_BARDING = 417,
|
||||
|
|
@ -359,13 +366,13 @@ public enum Material
|
|||
DIAMOND_BARDING = 419,
|
||||
LEASH = 420,
|
||||
NAME_TAG = 421,
|
||||
RAW_MUTTON = 423,
|
||||
MUTTON = 423,
|
||||
COOKED_MUTTON = 424,
|
||||
SPRUCE_DOOR = 427,
|
||||
BIRCH_DOOR = 428,
|
||||
JUNGLE_DOOR = 429,
|
||||
ACACIA_DOOR = 430,
|
||||
DARK_OAK_DOOR = 431,
|
||||
SPRUCE_DOOR_ITEM = 427,
|
||||
BIRCH_DOOR_ITEM = 428,
|
||||
JUNGLE_DOOR_ITEM = 429,
|
||||
ACACIA_DOOR_ITEM = 430,
|
||||
DARK_OAK_DOOR_ITEM = 431,
|
||||
GOLD_RECORD = 2256,
|
||||
GREEN_RECORD = 2257,
|
||||
RECORD_3 = 2258,
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ set(_MINECRAFT_SERVER_COMMON_ROOT
|
|||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp"
|
||||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp"
|
||||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_LeaderboardsMenu.cpp"
|
||||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_LoadCreateJoinMenu.cpp"
|
||||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_LoadMenu.cpp"
|
||||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp"
|
||||
"${_MS_SRC}/../Minecraft.Client/Common/UI/UIScene_MainMenu.cpp"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "SharedMonsterAttributes.h"
|
||||
#include "ArmorStand.h"
|
||||
#include "BlockPos.h"
|
||||
#include "..\Minecraft.Client\ServerLevel.h"
|
||||
#include "../Minecraft.Client/ServerLevel.h"
|
||||
#include "ParticleTypes.h"
|
||||
#include "Random.h"
|
||||
#include "AABB.h"
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include "net.minecraft.world.item.h"
|
||||
#include "Mth.h"
|
||||
#include "ArmorStandItem.h"
|
||||
#include "..\Minecraft.World\ArmorStand.h"
|
||||
#include "..\Minecraft.World\Entity.h"
|
||||
#include "../Minecraft.World/ArmorStand.h"
|
||||
#include "../Minecraft.World/Entity.h"
|
||||
|
||||
|
||||
ArmorStandItem::ArmorStandItem(int id) : Item(id)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "net.minecraft.world.entity.ai.attributes.h"
|
||||
#include "net.minecraft.world.entity.monster.h"
|
||||
#include "net.minecraft.h"
|
||||
#include "..\Minecraft.Client\Textures.h"
|
||||
#include "../Minecraft.Client/Textures.h"
|
||||
#include "Endermite.h"
|
||||
#include "SoundTypes.h"
|
||||
#include "Random.h"
|
||||
|
|
|
|||
|
|
@ -21,4 +21,9 @@ const int Facing::STEP_Z[6] =
|
|||
0, 0, -1, 1, 0, 0
|
||||
};
|
||||
|
||||
const wstring Facing::NAMES[] = {L"DOWN", L"UP", L"NORTH", L"SOUTH", L"WEST", L"EAST"};
|
||||
const wstring Facing::NAMES[] = {L"DOWN", L"UP", L"NORTH", L"SOUTH", L"WEST", L"EAST"};
|
||||
|
||||
int Facing::getOpposite(int facing)
|
||||
{
|
||||
return OPPOSITE_FACING[facing];
|
||||
}
|
||||
|
|
@ -16,4 +16,5 @@ public:
|
|||
static const int STEP_Z[6];
|
||||
|
||||
static const wstring NAMES[];
|
||||
static int getOpposite(int facing);
|
||||
};
|
||||
|
|
@ -11,9 +11,9 @@
|
|||
#include "net.minecraft.world.damagesource.h"
|
||||
#include "SharedConstants.h"
|
||||
#include "Guardian.h"
|
||||
#include "..\Minecraft.Client\Textures.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.animal.h"
|
||||
#include "../Minecraft.Client/Textures.h"
|
||||
#include "../Minecraft.World/Mth.h"
|
||||
#include "../Minecraft.World/net.minecraft.world.entity.animal.h"
|
||||
#include "MobEffect.h"
|
||||
#include "MobEffectInstance.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,152 +1,172 @@
|
|||
#include "stdafx.h"
|
||||
#include "HalfSlabTile.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.biome.h"
|
||||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.stats.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.h"
|
||||
#include "Facing.h"
|
||||
|
||||
|
||||
HalfSlabTile::HalfSlabTile(int id, bool fullSize, Material *material) : Tile(id, material, fullSize)
|
||||
HalfSlabTile::HalfSlabTile(int id, Material *material)
|
||||
: Tile(id, material, true)
|
||||
{
|
||||
this->fullSize = fullSize;
|
||||
|
||||
if (fullSize)
|
||||
{
|
||||
solid[id] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
setShape(0, 0, 0, 1, 0.5f, 1);
|
||||
}
|
||||
setLightBlock(255);
|
||||
|
||||
Tile::lightBlock[id] = 0xFF;
|
||||
}
|
||||
|
||||
void HalfSlabTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr<TileEntity> forceEntity) // 4J added forceData, forceEntity param
|
||||
void HalfSlabTile::DerivedInit()
|
||||
{
|
||||
if (fullSize)
|
||||
{
|
||||
setShape(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool upper = (level->getData(x, y, z) & TOP_SLOT_BIT) != 0;
|
||||
if (upper)
|
||||
{
|
||||
setShape(0, 0.5f, 0, 1, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setShape(0, 0, 0, 1, 0.5f, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFullSize())
|
||||
setShape(0.0f, 0.0f, 0.0f, 1.0f, 0.5f, 1.0f);
|
||||
else
|
||||
Tile::solid[id] = true;
|
||||
}
|
||||
|
||||
void HalfSlabTile::updateDefaultShape()
|
||||
void HalfSlabTile::updateDefaultShape()
|
||||
{
|
||||
if (fullSize)
|
||||
{
|
||||
setShape(0, 0, 0, 1, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setShape(0, 0, 0, 1, 0.5f, 1);
|
||||
}
|
||||
|
||||
if (isFullSize())
|
||||
setShape(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
else
|
||||
setShape(0.0f, 0.0f, 0.0f, 1.0f, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
void HalfSlabTile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source)
|
||||
void HalfSlabTile::updateShape(
|
||||
LevelSource *level, int x, int y, int z,
|
||||
int forceData, shared_ptr<TileEntity> forceEntity)
|
||||
{
|
||||
updateShape(level, x, y, z);
|
||||
Tile::addAABBs(level, x, y, z, box, boxes, source);
|
||||
|
||||
if (isFullSize())
|
||||
{
|
||||
setShape(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
int data = (forceData >= 0) ? forceData : level->getData(x, y, z);
|
||||
bool isUpper = (data & TOP_SLOT_BIT) != 0;
|
||||
|
||||
if (isUpper)
|
||||
setShape(0.0f, 0.5f, 0.0f, 1.0f, 1.0f, 1.0f);
|
||||
else
|
||||
setShape(0.0f, 0.0f, 0.0f, 1.0f, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
bool HalfSlabTile::isSolidRender(bool isServerLevel)
|
||||
void HalfSlabTile::addAABBs(
|
||||
Level *level, int x, int y, int z,
|
||||
AABB *box, AABBList *boxes, shared_ptr<Entity> source)
|
||||
{
|
||||
return fullSize;
|
||||
|
||||
updateShape(level, x, y, z);
|
||||
Tile::addAABBs(level, x, y, z, box, boxes, source);
|
||||
}
|
||||
|
||||
int HalfSlabTile::getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue)
|
||||
bool HalfSlabTile::isSolidRender(bool isServerLevel)
|
||||
{
|
||||
if (fullSize) return itemValue;
|
||||
|
||||
if (face == Facing::DOWN || (face != Facing::UP && clickY > 0.5))
|
||||
{
|
||||
return itemValue | TOP_SLOT_BIT;
|
||||
}
|
||||
return itemValue;
|
||||
|
||||
return isFullSize() != 0;
|
||||
}
|
||||
|
||||
int HalfSlabTile::getResourceCount(Random *random)
|
||||
bool HalfSlabTile::isSilkTouchable()
|
||||
{
|
||||
if (fullSize)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
return 1;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int HalfSlabTile::getSpawnResourcesAuxValue(int data)
|
||||
int HalfSlabTile::getResourceCount(Random *random)
|
||||
{
|
||||
return data & TYPE_MASK;
|
||||
|
||||
return isFullSize() ? 2 : 1;
|
||||
}
|
||||
|
||||
bool HalfSlabTile::isCubeShaped()
|
||||
bool HalfSlabTile::isCubeShaped()
|
||||
{
|
||||
return fullSize;
|
||||
|
||||
return isFullSize() != 0;
|
||||
}
|
||||
|
||||
bool HalfSlabTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)
|
||||
bool HalfSlabTile::shouldRenderFace(
|
||||
LevelSource *level, int x, int y, int z, int face)
|
||||
{
|
||||
if (fullSize) return Tile::shouldRenderFace(level, x, y, z, face);
|
||||
|
||||
if (isFullSize())
|
||||
return Tile::shouldRenderFace(level, x, y, z, face);
|
||||
|
||||
if (face != Facing::UP && face != Facing::DOWN && !Tile::shouldRenderFace(level, x, y, z, face))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (face != Facing::UP && face != Facing::DOWN
|
||||
&& !Tile::shouldRenderFace(level, x, y, z, face))
|
||||
return false;
|
||||
|
||||
int ox = x, oy = y, oz = z;
|
||||
ox += Facing::STEP_X[Facing::OPPOSITE_FACING[face]];
|
||||
oy += Facing::STEP_Y[Facing::OPPOSITE_FACING[face]];
|
||||
oz += Facing::STEP_Z[Facing::OPPOSITE_FACING[face]];
|
||||
int oppFace = Facing::getOpposite(face);
|
||||
int nx = x, ny = y, nz = z;
|
||||
|
||||
if (oppFace == Facing::DOWN) ny--;
|
||||
if (oppFace == Facing::UP) ny++;
|
||||
if (oppFace == Facing::NORTH) nz--;
|
||||
if (oppFace == Facing::SOUTH) nz++;
|
||||
if (oppFace == Facing::WEST) nx--;
|
||||
if (oppFace == Facing::EAST) nx++;
|
||||
|
||||
boolean isUpper = (level->getData(ox, oy, oz) & TOP_SLOT_BIT) != 0;
|
||||
if (isUpper)
|
||||
{
|
||||
if (face == Facing::DOWN) return true;
|
||||
if (face == Facing::UP && Tile::shouldRenderFace(level, x, y, z, face)) return true;
|
||||
return !(isHalfSlab(level->getTile(x, y, z)) && (level->getData(x, y, z) & TOP_SLOT_BIT) != 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (face == Facing::UP) return true;
|
||||
if (face == Facing::DOWN && Tile::shouldRenderFace(level, x, y, z, face)) return true;
|
||||
return !(isHalfSlab(level->getTile(x, y, z)) && (level->getData(x, y, z) & TOP_SLOT_BIT) == 0);
|
||||
}
|
||||
int currentData = level->getData(x, y, z);
|
||||
int neighborData = level->getData(nx, ny, nz);
|
||||
int currentTile = level->getTile(x, y, z);
|
||||
int neighborTile = level->getTile(nx, ny, nz);
|
||||
|
||||
bool currentIsUpper = (currentData & TOP_SLOT_BIT) != 0;
|
||||
bool neighborIsUpper = (neighborData & TOP_SLOT_BIT) != 0;
|
||||
|
||||
bool currentIsSlab = isHalfSlab(currentTile);
|
||||
bool neighborIsSlab = isHalfSlab(neighborTile);
|
||||
|
||||
|
||||
if (neighborIsSlab && neighborIsUpper)
|
||||
{
|
||||
if (face == Facing::DOWN)
|
||||
return true;
|
||||
if (face == Facing::UP && !Tile::shouldRenderFace(level, x, y, z, face))
|
||||
return currentIsSlab && !currentIsUpper ? false : true;
|
||||
return !(currentIsSlab && currentIsUpper);
|
||||
}
|
||||
|
||||
if (face == Facing::UP || (face == Facing::DOWN
|
||||
&& Tile::shouldRenderFace(level, x, y, z, face)))
|
||||
return true;
|
||||
|
||||
return !(currentIsSlab && !currentIsUpper);
|
||||
}
|
||||
|
||||
bool HalfSlabTile::isHalfSlab(int tileId)
|
||||
int HalfSlabTile::getSpawnResourcesAuxValue(int data)
|
||||
{
|
||||
return tileId == Tile::stoneSlabHalf_Id || tileId == Tile::woodSlabHalf_Id;
|
||||
return data & TYPE_MASK;
|
||||
}
|
||||
|
||||
int HalfSlabTile::cloneTileData(Level *level, int x, int y, int z)
|
||||
{
|
||||
return Tile::cloneTileData(level, x, y, z) & TYPE_MASK;
|
||||
|
||||
return level->getData(x, y, z) & TYPE_MASK;
|
||||
}
|
||||
|
||||
int HalfSlabTile::cloneTileId(Level *level, int x, int y, int z)
|
||||
{
|
||||
if (isHalfSlab(id))
|
||||
{
|
||||
return id;
|
||||
}
|
||||
if (id == Tile::stoneSlab_Id)
|
||||
{
|
||||
return Tile::stoneSlabHalf_Id;
|
||||
}
|
||||
if (id == Tile::woodSlab_Id)
|
||||
{
|
||||
return Tile::woodSlabHalf_Id;
|
||||
}
|
||||
return Tile::stoneSlabHalf_Id;
|
||||
return id;
|
||||
}
|
||||
|
||||
int HalfSlabTile::getPlacedOnFaceDataValue(
|
||||
Level *level, int x, int y, int z,
|
||||
int face, float clickX, float clickY, float clickZ,
|
||||
int itemValue)
|
||||
{
|
||||
|
||||
if (face == Facing::DOWN)
|
||||
return itemValue | TOP_SLOT_BIT;
|
||||
if (face == Facing::UP)
|
||||
return itemValue;
|
||||
|
||||
return (clickY > 0.5f) ? (itemValue | TOP_SLOT_BIT) : itemValue;
|
||||
}
|
||||
|
||||
bool HalfSlabTile::isHalfSlab(int tileId)
|
||||
{
|
||||
if (tileId <= 0 || Tile::tiles[tileId] == nullptr)
|
||||
return false;
|
||||
return dynamic_cast<HalfSlabTile *>(Tile::tiles[tileId]) != nullptr
|
||||
&& !Tile::tiles[tileId]->isCubeShaped();
|
||||
}
|
||||
|
|
@ -1,33 +1,57 @@
|
|||
#pragma once
|
||||
|
||||
#include "Tile.h"
|
||||
|
||||
|
||||
class HalfSlabTile : public Tile
|
||||
class HalfSlabTile : public Tile
|
||||
{
|
||||
public:
|
||||
static const int TYPE_MASK = 7;
|
||||
static const int TOP_SLOT_BIT = 8;
|
||||
static const int TYPE_MASK = 7;
|
||||
static const int TOP_SLOT_BIT = 8;
|
||||
|
||||
protected:
|
||||
bool fullSize;
|
||||
|
||||
enum class Half
|
||||
{
|
||||
TOP,
|
||||
BOTTOM
|
||||
};
|
||||
|
||||
public:
|
||||
HalfSlabTile(int id, bool fullSize, Material *material);
|
||||
virtual void updateShape(LevelSource *level, int x, int y, int z, int forceData = -1, shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()); // 4J added forceData, forceEntity param
|
||||
virtual void updateDefaultShape();
|
||||
virtual void addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr<Entity> source);
|
||||
virtual bool isSolidRender(bool isServerLevel);
|
||||
virtual int getPlacedOnFaceDataValue(Level *level, int x, int y, int z, int face, float clickX, float clickY, float clickZ, int itemValue);
|
||||
virtual int getResourceCount(Random *random);
|
||||
virtual int getSpawnResourcesAuxValue(int data);
|
||||
virtual bool isCubeShaped();
|
||||
virtual bool shouldRenderFace(LevelSource *level, int x, int y, int z, int face);
|
||||
HalfSlabTile(int id, Material *material);
|
||||
|
||||
virtual void DerivedInit();
|
||||
|
||||
virtual int isFullSize() = 0;
|
||||
|
||||
virtual void updateShape(
|
||||
LevelSource *level, int x, int y, int z,
|
||||
int forceData = -1,
|
||||
shared_ptr<TileEntity> forceEntity = shared_ptr<TileEntity>()) override;
|
||||
|
||||
virtual void updateDefaultShape() override;
|
||||
|
||||
virtual void addAABBs(
|
||||
Level *level, int x, int y, int z,
|
||||
AABB *box, AABBList *boxes,
|
||||
shared_ptr<Entity> source) override;
|
||||
|
||||
virtual bool isSolidRender(bool isServerLevel = false) override;
|
||||
virtual bool isSilkTouchable() override;
|
||||
|
||||
virtual int getPlacedOnFaceDataValue(
|
||||
Level *level, int x, int y, int z,
|
||||
int face, float clickX, float clickY, float clickZ,
|
||||
int itemValue) override;
|
||||
|
||||
virtual int getResourceCount(Random *random) override;
|
||||
virtual int getSpawnResourcesAuxValue(int data) override;
|
||||
virtual bool isCubeShaped() override;
|
||||
virtual bool shouldRenderFace(
|
||||
LevelSource *level, int x, int y, int z, int face) override;
|
||||
|
||||
virtual int cloneTileData(Level *level, int x, int y, int z) override;
|
||||
virtual int cloneTileId(Level *level, int x, int y, int z) override;
|
||||
|
||||
virtual int getAuxName(int auxValue) = 0;
|
||||
|
||||
private:
|
||||
static bool isHalfSlab(int tileId);
|
||||
public:
|
||||
virtual int getAuxName(int auxValue) = 0;
|
||||
|
||||
virtual int cloneTileData(Level *level, int x, int y, int z);
|
||||
virtual int cloneTileId(Level *level, int x, int y, int z);
|
||||
static bool isHalfSlab(int tileId);
|
||||
};
|
||||
|
|
@ -411,6 +411,14 @@ Recipes::Recipes()
|
|||
|
||||
L'#', Tile::sandStone,
|
||||
L'S');
|
||||
addShapedRecipy(new ItemInstance(Tile::stairs_red_sandstone, 4), //
|
||||
L"sssctg",
|
||||
L"# ", //
|
||||
L"## ", //
|
||||
L"###", //
|
||||
|
||||
L'#', Tile::red_sandstone,
|
||||
L'S');
|
||||
|
||||
addShapedRecipy(new ItemInstance(Tile::woodStairsBirch, 4), //
|
||||
L"sssczg",
|
||||
|
|
@ -555,6 +563,12 @@ Recipes::Recipes()
|
|||
|
||||
L'#', Tile::sandStone,
|
||||
L'S');
|
||||
addShapedRecipy(new ItemInstance(Tile::stoneSlab2Half, 6, StoneSlabTile2::RED_SANDSTONE_SLAB), //
|
||||
L"sctg",
|
||||
L"###", //
|
||||
|
||||
L'#', Tile::red_sandstone,
|
||||
L'S');
|
||||
|
||||
addShapedRecipy(new ItemInstance(Tile::stoneSlabHalf, 6, StoneSlabTile::STONE_SLAB), //
|
||||
L"sctg",
|
||||
|
|
|
|||
|
|
@ -5,80 +5,78 @@
|
|||
#include "net.minecraft.world.h"
|
||||
#include "StoneSlabTile.h"
|
||||
|
||||
const unsigned int StoneSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = {
|
||||
IDS_TILE_STONESLAB_STONE,
|
||||
IDS_TILE_STONESLAB_SAND,
|
||||
IDS_TILE_STONESLAB_WOOD,
|
||||
IDS_TILE_STONESLAB_COBBLE,
|
||||
IDS_TILE_STONESLAB_BRICK,
|
||||
IDS_TILE_STONESLAB_SMOOTHBRICK,
|
||||
IDS_TILE_STONESLAB_NETHERBRICK,
|
||||
IDS_TILE_STONESLAB_QUARTZ,
|
||||
};
|
||||
|
||||
const unsigned int StoneSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = { IDS_TILE_STONESLAB_STONE,
|
||||
IDS_TILE_STONESLAB_SAND,
|
||||
IDS_TILE_STONESLAB_WOOD,
|
||||
IDS_TILE_STONESLAB_COBBLE,
|
||||
IDS_TILE_STONESLAB_BRICK,
|
||||
IDS_TILE_STONESLAB_SMOOTHBRICK,
|
||||
IDS_TILE_STONESLAB_NETHERBRICK,
|
||||
IDS_TILE_STONESLAB_QUARTZ,
|
||||
};
|
||||
|
||||
StoneSlabTile::StoneSlabTile(int id, bool fullSize) : HalfSlabTile(id, fullSize, Material::stone)
|
||||
StoneSlabTile::StoneSlabTile(int id)
|
||||
: HalfSlabTile(id, Material::stone)
|
||||
{
|
||||
}
|
||||
|
||||
Icon *StoneSlabTile::getTexture(int face, int data)
|
||||
{
|
||||
int type = data & TYPE_MASK;
|
||||
if (fullSize && (data & TOP_SLOT_BIT) != 0)
|
||||
{
|
||||
face = Facing::UP;
|
||||
}
|
||||
switch(type)
|
||||
{
|
||||
case STONE_SLAB:
|
||||
if (face == Facing::UP || face == Facing::DOWN) return icon;
|
||||
return iconSide;
|
||||
break;
|
||||
case SAND_SLAB:
|
||||
return Tile::sandStone->getTexture(face);
|
||||
case WOOD_SLAB:
|
||||
return Tile::wood->getTexture(face);
|
||||
case COBBLESTONE_SLAB:
|
||||
return Tile::cobblestone->getTexture(face);
|
||||
case BRICK_SLAB:
|
||||
return Tile::redBrick->getTexture(face);
|
||||
case SMOOTHBRICK_SLAB:
|
||||
return Tile::stoneBrick->getTexture(face, SmoothStoneBrickTile::TYPE_DEFAULT);
|
||||
case NETHERBRICK_SLAB:
|
||||
return Tile::netherBrick->getTexture(Facing::UP);
|
||||
case QUARTZ_SLAB:
|
||||
return Tile::quartzBlock->getTexture(face);
|
||||
}
|
||||
|
||||
return icon;
|
||||
int type = data & TYPE_MASK;
|
||||
|
||||
if (isFullSize() && (data & TOP_SLOT_BIT) != 0)
|
||||
face = Facing::UP;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case STONE_SLAB:
|
||||
if (face == Facing::UP || face == Facing::DOWN) return icon;
|
||||
return iconSide;
|
||||
case SAND_SLAB:
|
||||
return Tile::sandStone->getTexture(face);
|
||||
case WOOD_SLAB:
|
||||
return Tile::wood->getTexture(face);
|
||||
case COBBLESTONE_SLAB:
|
||||
return Tile::cobblestone->getTexture(face);
|
||||
case BRICK_SLAB:
|
||||
return Tile::redBrick->getTexture(face);
|
||||
case SMOOTHBRICK_SLAB:
|
||||
return Tile::stoneBrick->getTexture(face, SmoothStoneBrickTile::TYPE_DEFAULT);
|
||||
case NETHERBRICK_SLAB:
|
||||
return Tile::netherBrick->getTexture(Facing::UP);
|
||||
case QUARTZ_SLAB:
|
||||
return Tile::quartzBlock->getTexture(face);
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
void StoneSlabTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
icon = iconRegister->registerIcon(L"stoneslab_top");
|
||||
iconSide = iconRegister->registerIcon(L"stoneslab_side");
|
||||
icon = iconRegister->registerIcon(L"stoneslab_top");
|
||||
iconSide = iconRegister->registerIcon(L"stoneslab_side");
|
||||
}
|
||||
|
||||
int StoneSlabTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
return Tile::stoneSlabHalf_Id;
|
||||
return Tile::stoneSlabHalf_Id;
|
||||
}
|
||||
|
||||
unsigned int StoneSlabTile::getDescriptionId(int iData /*= -1*/)
|
||||
unsigned int StoneSlabTile::getDescriptionId(int iData)
|
||||
{
|
||||
if(iData < 0 ) iData = 0;
|
||||
return StoneSlabTile::SLAB_NAMES[iData];
|
||||
if (iData < 0) iData = 0;
|
||||
return StoneSlabTile::SLAB_NAMES[iData];
|
||||
}
|
||||
|
||||
int StoneSlabTile::getAuxName(int auxValue)
|
||||
int StoneSlabTile::getAuxName(int auxValue)
|
||||
{
|
||||
if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH)
|
||||
{
|
||||
auxValue = 0;
|
||||
}
|
||||
return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue];
|
||||
if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH)
|
||||
auxValue = 0;
|
||||
return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue];
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> StoneSlabTile::getSilkTouchItemInstance(int data)
|
||||
{
|
||||
return std::make_shared<ItemInstance>(Tile::stoneSlabHalf_Id, 2, data & TYPE_MASK);
|
||||
}
|
||||
return make_shared<ItemInstance>(Tile::stoneSlabHalf_Id, 2, data & TYPE_MASK);
|
||||
}
|
||||
|
|
@ -1,39 +1,53 @@
|
|||
#pragma once
|
||||
using namespace std;
|
||||
|
||||
#include "HalfSlabTile.h"
|
||||
|
||||
class ChunkRebuildData;
|
||||
|
||||
class StoneSlabTile : public HalfSlabTile
|
||||
{
|
||||
friend ChunkRebuildData;
|
||||
friend class ChunkRebuildData;
|
||||
public:
|
||||
static const int STONE_SLAB = 0;
|
||||
static const int SAND_SLAB = 1;
|
||||
static const int WOOD_SLAB = 2;
|
||||
static const int COBBLESTONE_SLAB = 3;
|
||||
static const int BRICK_SLAB = 4;
|
||||
static const int SMOOTHBRICK_SLAB = 5;
|
||||
static const int NETHERBRICK_SLAB = 6;
|
||||
static const int QUARTZ_SLAB = 7;
|
||||
|
||||
static const int SLAB_NAMES_LENGTH = 8;
|
||||
|
||||
static const unsigned int SLAB_NAMES[SLAB_NAMES_LENGTH];
|
||||
static const int STONE_SLAB = 0;
|
||||
static const int SAND_SLAB = 1;
|
||||
static const int WOOD_SLAB = 2;
|
||||
static const int COBBLESTONE_SLAB = 3;
|
||||
static const int BRICK_SLAB = 4;
|
||||
static const int SMOOTHBRICK_SLAB = 5;
|
||||
static const int NETHERBRICK_SLAB = 6;
|
||||
static const int QUARTZ_SLAB = 7;
|
||||
static const int SLAB_NAMES_LENGTH = 8;
|
||||
static const unsigned int SLAB_NAMES[SLAB_NAMES_LENGTH];
|
||||
|
||||
private:
|
||||
Icon *iconSide;
|
||||
Icon *iconSide;
|
||||
|
||||
public:
|
||||
StoneSlabTile(int id, bool fullSize);
|
||||
StoneSlabTile(int id);
|
||||
|
||||
virtual Icon *getTexture(int face, int data);
|
||||
virtual int isFullSize() = 0;
|
||||
|
||||
virtual Icon *getTexture(int face, int data) override;
|
||||
virtual void registerIcons(IconRegister *iconRegister) override;
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel) override;
|
||||
virtual unsigned int getDescriptionId(int iData = -1) override;
|
||||
virtual int getAuxName(int auxValue) override;
|
||||
|
||||
void registerIcons(IconRegister *iconRegister);
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel);
|
||||
virtual unsigned int getDescriptionId(int iData = -1);
|
||||
virtual int getAuxName(int auxValue);
|
||||
protected:
|
||||
virtual shared_ptr<ItemInstance> getSilkTouchItemInstance(int data);
|
||||
virtual shared_ptr<ItemInstance> getSilkTouchItemInstance(int data) override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class HalfStoneSlabTile : public StoneSlabTile
|
||||
{
|
||||
public:
|
||||
HalfStoneSlabTile(int id) : StoneSlabTile(id) { DerivedInit(); }
|
||||
virtual int isFullSize() override { return 0; }
|
||||
};
|
||||
|
||||
class FullStoneSlabTile : public StoneSlabTile
|
||||
{
|
||||
public:
|
||||
FullStoneSlabTile(int id) : StoneSlabTile(id) { DerivedInit(); }
|
||||
virtual int isFullSize() override { return 1; }
|
||||
};
|
||||
61
Minecraft.World/StoneSlabTile2.cpp
Normal file
61
Minecraft.World/StoneSlabTile2.cpp
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#include "stdafx.h"
|
||||
#include "net.minecraft.h"
|
||||
#include "net.minecraft.world.level.h"
|
||||
#include "net.minecraft.world.level.tile.h"
|
||||
#include "net.minecraft.world.h"
|
||||
#include "StoneSlabTile2.h"
|
||||
#include "RedSandStoneTile.h"
|
||||
|
||||
const unsigned int StoneSlabTile2::SLAB_NAMES[SLAB_NAMES_LENGTH] = {
|
||||
IDS_TILE_STONESLAB_REDSAND,
|
||||
};
|
||||
|
||||
StoneSlabTile2::StoneSlabTile2(int id)
|
||||
: HalfSlabTile(id, Material::stone)
|
||||
{
|
||||
}
|
||||
|
||||
Icon *StoneSlabTile2::getTexture(int face, int data)
|
||||
{
|
||||
int type = data & TYPE_MASK;
|
||||
|
||||
if (isFullSize() && (data & TOP_SLOT_BIT) != 0)
|
||||
face = Facing::UP;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case RED_SANDSTONE_SLAB:
|
||||
return Tile::red_sandstone->getTexture(face);
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
void StoneSlabTile2::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
icon = iconRegister->registerIcon(L"red_sandstone_top");
|
||||
iconSide = iconRegister->registerIcon(L"red_sandstone_normal");
|
||||
}
|
||||
|
||||
int StoneSlabTile2::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
return Tile::stone_slab2_Id;
|
||||
}
|
||||
|
||||
unsigned int StoneSlabTile2::getDescriptionId(int iData)
|
||||
{
|
||||
if (iData < 0) iData = 0;
|
||||
return StoneSlabTile2::SLAB_NAMES[iData];
|
||||
}
|
||||
|
||||
int StoneSlabTile2::getAuxName(int auxValue)
|
||||
{
|
||||
if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH)
|
||||
auxValue = 0;
|
||||
return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue];
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> StoneSlabTile2::getSilkTouchItemInstance(int data)
|
||||
{
|
||||
return make_shared<ItemInstance>(Tile::stone_slab2_Id, 2, data & TYPE_MASK);
|
||||
}
|
||||
44
Minecraft.World/StoneSlabTile2.h
Normal file
44
Minecraft.World/StoneSlabTile2.h
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
#include "HalfSlabTile.h"
|
||||
|
||||
class ChunkRebuildData;
|
||||
|
||||
class StoneSlabTile2 : public HalfSlabTile
|
||||
{
|
||||
friend class ChunkRebuildData;
|
||||
public:
|
||||
static const int RED_SANDSTONE_SLAB = 0;
|
||||
static const int SLAB_NAMES_LENGTH = 1;
|
||||
static const unsigned int SLAB_NAMES[SLAB_NAMES_LENGTH];
|
||||
|
||||
private:
|
||||
Icon *iconSide;
|
||||
|
||||
public:
|
||||
StoneSlabTile2(int id);
|
||||
|
||||
virtual int isFullSize() = 0;
|
||||
|
||||
virtual Icon *getTexture(int face, int data) override;
|
||||
virtual void registerIcons(IconRegister *iconRegister) override;
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel) override;
|
||||
virtual unsigned int getDescriptionId(int iData = -1) override;
|
||||
virtual int getAuxName(int auxValue) override;
|
||||
|
||||
protected:
|
||||
virtual shared_ptr<ItemInstance> getSilkTouchItemInstance(int data) override;
|
||||
};
|
||||
|
||||
class HalfStoneSlabTile2 : public StoneSlabTile2
|
||||
{
|
||||
public:
|
||||
HalfStoneSlabTile2(int id) : StoneSlabTile2(id) { DerivedInit(); }
|
||||
virtual int isFullSize() override { return 0; }
|
||||
};
|
||||
|
||||
class FullStoneSlabTile2 : public StoneSlabTile2
|
||||
{
|
||||
public:
|
||||
FullStoneSlabTile2(int id) : StoneSlabTile2(id) { DerivedInit(); }
|
||||
virtual int isFullSize() override { return 1; }
|
||||
};
|
||||
|
|
@ -15,6 +15,7 @@ void StructureRecipies::addRecipes(Recipes *r)
|
|||
L'#', Tile::sand,
|
||||
L'S');
|
||||
|
||||
|
||||
r->addShapedRecipy(new ItemInstance(Tile::sandStone, 4, SandStoneTile::TYPE_SMOOTHSIDE), //
|
||||
L"ssczg",
|
||||
L"##", //
|
||||
|
|
@ -31,6 +32,35 @@ void StructureRecipies::addRecipes(Recipes *r)
|
|||
L'#', new ItemInstance(Tile::stoneSlabHalf, 1, StoneSlabTile::SAND_SLAB),
|
||||
L'S');
|
||||
|
||||
|
||||
r->addShapedRecipy(new ItemInstance(Tile::red_sandstone), //
|
||||
L"ssczg",
|
||||
L"##", //
|
||||
L"##", //
|
||||
|
||||
L'#',new ItemInstance(Tile::sand, 1, SandTile::RED_SAND),
|
||||
L'S');
|
||||
|
||||
r->addShapedRecipy(new ItemInstance(Tile::red_sandstone, 4, RedSandStoneTile::TYPE_SMOOTHSIDE), //
|
||||
L"ssczg",
|
||||
L"##", //
|
||||
L"##", //
|
||||
|
||||
L'#', new ItemInstance(Tile::red_sandstone),
|
||||
L'S');
|
||||
|
||||
|
||||
r->addShapedRecipy(new ItemInstance(Tile::red_sandstone, 1, RedSandStoneTile::TYPE_HEIROGLYPHS), //
|
||||
L"ssczg",
|
||||
L"#", //
|
||||
L"#", //
|
||||
|
||||
L'#', new ItemInstance(Tile::stoneSlab2Half, 1, StoneSlabTile2::RED_SANDSTONE_SLAB),
|
||||
L'S');
|
||||
|
||||
|
||||
|
||||
|
||||
r->addShapedRecipy(new ItemInstance(Tile::quartzBlock, 1, QuartzBlockTile::TYPE_CHISELED), //
|
||||
L"ssczg",
|
||||
L"#", //
|
||||
|
|
@ -47,6 +77,7 @@ void StructureRecipies::addRecipes(Recipes *r)
|
|||
L'#', new ItemInstance(Tile::quartzBlock, 1, QuartzBlockTile::TYPE_DEFAULT),
|
||||
L'S');
|
||||
|
||||
|
||||
|
||||
// 4J Stu - Changed the order, as the blocks that go with sandstone cause a 3-icon scroll
|
||||
// that touches the text "Structures" in the title in 720 fullscreen.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.world.h"
|
||||
#include "net.minecraft.h"
|
||||
#include "..\Minecraft.Client\Minecraft.h"
|
||||
#include "../Minecraft.Client/Minecraft.h"
|
||||
#include "net.minecraft.stats.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -256,6 +256,8 @@ Tile* Tile::darkGate = nullptr;
|
|||
Tile* Tile::invertedDaylightDetector = nullptr;
|
||||
Tile* Tile::red_sandstone = nullptr;
|
||||
Tile* Tile::stairs_red_sandstone = nullptr;
|
||||
HalfSlabTile* Tile::stoneSlab2 = nullptr;
|
||||
HalfSlabTile* Tile::stoneSlab2Half = nullptr;
|
||||
Tile* Tile::seaLantern = nullptr;
|
||||
Tile* Tile::prismarine = nullptr;
|
||||
|
||||
|
|
@ -370,8 +372,8 @@ void Tile::staticCtor()
|
|||
|
||||
Tile::goldBlock = (new MetalTile(41)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_gold)->setDestroyTime(3.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_METAL)->setIconName(L"gold_block")->setDescriptionId(IDS_TILE_BLOCK_GOLD)->setUseDescriptionId(IDS_DESC_BLOCK_GOLD);
|
||||
Tile::ironBlock = (new MetalTile(42)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_iron)->setDestroyTime(5.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_METAL)->setIconName(L"iron_block")->setDescriptionId(IDS_TILE_BLOCK_IRON)->setUseDescriptionId(IDS_DESC_BLOCK_IRON);
|
||||
Tile::stoneSlab = static_cast<HalfSlabTile *>((new StoneSlabTile(Tile::stoneSlab_Id, true))->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setIconName(L"stoneSlab")->setDescriptionId(IDS_TILE_STONESLAB)->setUseDescriptionId(IDS_DESC_SLAB));
|
||||
Tile::stoneSlabHalf = static_cast<HalfSlabTile *>((new StoneSlabTile(Tile::stoneSlabHalf_Id, false))->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setIconName(L"stoneSlab")->setDescriptionId(IDS_TILE_STONESLAB)->setUseDescriptionId(IDS_DESC_HALFSLAB));
|
||||
Tile::stoneSlab = static_cast<HalfSlabTile *>((new FullStoneSlabTile(Tile::stoneSlab_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setIconName(L"stoneSlab")->setDescriptionId(IDS_TILE_STONESLAB)->setUseDescriptionId(IDS_DESC_SLAB));
|
||||
Tile::stoneSlabHalf = static_cast<HalfSlabTile *>((new HalfStoneSlabTile(Tile::stoneSlabHalf_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setIconName(L"stoneSlab")->setDescriptionId(IDS_TILE_STONESLAB)->setUseDescriptionId(IDS_DESC_HALFSLAB));
|
||||
Tile::redBrick = (new Tile(45, Material::stone)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_brick)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setIconName(L"brick")->setDescriptionId(IDS_TILE_BRICK)->setUseDescriptionId(IDS_DESC_BRICK);
|
||||
Tile::tnt = (new TntTile(46)) ->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setIconName(L"tnt")->setDescriptionId(IDS_TILE_TNT)->setUseDescriptionId(IDS_DESC_TNT);
|
||||
Tile::bookshelf = (new BookshelfTile(47)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_paper, Item::eMaterial_bookshelf)->setDestroyTime(1.5f)->setSoundType(Tile::SOUND_WOOD)->setIconName(L"bookshelf")->setDescriptionId(IDS_TILE_BOOKSHELF)->setUseDescriptionId(IDS_DESC_BOOKSHELF);
|
||||
|
|
@ -470,8 +472,9 @@ void Tile::staticCtor()
|
|||
Tile::dragonEgg = (new EggTile(122)) ->setDestroyTime(3.0f)->setExplodeable(15)->setSoundType(SOUND_STONE)->setLightEmission(2.0f / 16.0f)->setIconName(L"dragon_egg")->setDescriptionId(IDS_TILE_DRAGONEGG)->setUseDescriptionId(IDS_DESC_DRAGONEGG);
|
||||
Tile::redstoneLight = (new RedlightTile(123, false)) ->setDestroyTime(0.3f)->setSoundType(SOUND_GLASS)->setIconName(L"redstone_lamp_off")->setDescriptionId(IDS_TILE_REDSTONE_LIGHT)->setUseDescriptionId(IDS_DESC_REDSTONE_LIGHT);
|
||||
Tile::redstoneLight_lit = (new RedlightTile(124, true)) ->setDestroyTime(0.3f)->setSoundType(SOUND_GLASS)->setIconName(L"redstone_lamp_on")->setDescriptionId(IDS_TILE_REDSTONE_LIGHT)->setUseDescriptionId(IDS_DESC_REDSTONE_LIGHT);
|
||||
Tile::woodSlab = static_cast<HalfSlabTile *>((new WoodSlabTile(Tile::woodSlab_Id, true))->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_wood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"woodSlab")->setDescriptionId(IDS_DESC_WOODSLAB)->setUseDescriptionId(IDS_DESC_WOODSLAB));
|
||||
Tile::woodSlabHalf = static_cast<HalfSlabTile *>((new WoodSlabTile(Tile::woodSlabHalf_Id, false))->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_wood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"woodSlab")->setDescriptionId(IDS_DESC_WOODSLAB)->setUseDescriptionId(IDS_DESC_WOODSLAB));
|
||||
Tile::woodSlab = static_cast<HalfSlabTile *>((new FullWoodSlabTile(Tile::woodSlab_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_wood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"woodSlab")->setDescriptionId(IDS_DESC_WOODSLAB)->setUseDescriptionId(IDS_DESC_WOODSLAB));
|
||||
Tile::woodSlabHalf = static_cast<HalfSlabTile *>((new HalfWoodSlabTile(Tile::woodSlabHalf_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_wood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"woodSlab")->setDescriptionId(IDS_DESC_WOODSLAB)->setUseDescriptionId(IDS_DESC_WOODSLAB));
|
||||
|
||||
Tile::cocoa = (new CocoaTile(127)) ->setDestroyTime(0.2f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"cocoa")->sendTileData()->setDescriptionId(IDS_TILE_COCOA)->setUseDescriptionId(IDS_DESC_COCOA);
|
||||
Tile::stairs_sandstone = (new StairTile(128, Tile::sandStone,0)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_stairs, Item::eMaterial_sand) ->setIconName(L"stairsSandstone")->setDescriptionId(IDS_TILE_STAIRS_SANDSTONE) ->sendTileData()->setUseDescriptionId(IDS_DESC_STAIRS);
|
||||
Tile::emeraldOre = (new OreTile(129)) ->setDestroyTime(3.0f)->setExplodeable(5)->setSoundType(SOUND_STONE)->setIconName(L"emerald_ore")->setDescriptionId(IDS_TILE_EMERALDORE)->setUseDescriptionId(IDS_DESC_EMERALDORE);
|
||||
|
|
@ -525,9 +528,12 @@ void Tile::staticCtor()
|
|||
Tile::packedIce = (new PackedIceTile(174))->setDestroyTime(0.5f)->setSoundType(SOUND_GLASS)->setIconName(L"packed_ice")->setDescriptionId(IDS_TILE_PACKED_ICE)->setUseDescriptionId(IDS_DESC_PACKED_ICE);
|
||||
|
||||
Tile::invertedDaylightDetector = static_cast<DaylightDetectorTile*>((new DaylightDetectorTile(178, true))->setDestroyTime(0.2f)->setSoundType(SOUND_WOOD)->setIconName(L"daylight_detector")->setDescriptionId(IDS_TILE_DAYLIGHT_DETECTOR)->setUseDescriptionId(IDS_DESC_DAYLIGHT_DETECTOR));
|
||||
Tile::red_sandstone = (new RedSandStoneTile(179))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_sand)->setSoundType(Tile::SOUND_STONE)->setDestroyTime(0.8f)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_RED_SANDSTONE)->sendTileData();
|
||||
Tile::stairs_red_sandstone = (new StairTile(180, Tile::red_sandstone, 0))->setBaseItemTypeAndMaterial(Item::eBaseItemType_stairs, Item::eMaterial_sand)->setIconName(L"stairsRedSandstone")->setDescriptionId(IDS_TILE_STAIRS_RED_SANDSTONE)->sendTileData()->setUseDescriptionId(IDS_DESC_STAIRS);
|
||||
Tile::red_sandstone = (new RedSandStoneTile(red_sandstone_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_sand)->setSoundType(Tile::SOUND_STONE)->setDestroyTime(0.8f)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_RED_SANDSTONE)->sendTileData();
|
||||
Tile::stairs_red_sandstone = (new StairTile(stairs_red_sandstone_Id, Tile::red_sandstone, 0))->setBaseItemTypeAndMaterial(Item::eBaseItemType_stairs, Item::eMaterial_sand)->setIconName(L"stairsRedSandstone")->setDescriptionId(IDS_TILE_STAIRS_RED_SANDSTONE)->sendTileData()->setUseDescriptionId(IDS_DESC_STAIRS);
|
||||
Tile::stoneSlab2 = static_cast<HalfSlabTile *>((new FullStoneSlabTile2(double_stone_slab2_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_SLAB));
|
||||
|
||||
Tile::stoneSlab2Half = static_cast<HalfSlabTile *>((new HalfStoneSlabTile2(stone_slab2_Id))->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->sendTileData()->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_HALFSLAB));
|
||||
|
||||
Tile::spruceGate = (new FenceGateTile(183))->setBaseItemTypeAndMaterial(Item::eBaseItemType_fenceGate, Item::eMaterial_sprucewood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"planks_spruce")->setDescriptionId(IDS_TILE_SPRUCE_GATE)->sendTileData()->setUseDescriptionId(IDS_DESC_FENCE_GATE);
|
||||
Tile::birchGate = (new FenceGateTile(184))->setBaseItemTypeAndMaterial(Item::eBaseItemType_fenceGate, Item::eMaterial_birchwood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"planks_birch")->setDescriptionId(IDS_TILE_BIRCH_GATE)->sendTileData()->setUseDescriptionId(IDS_DESC_FENCE_GATE);
|
||||
Tile::jungleGate = (new FenceGateTile(185))->setBaseItemTypeAndMaterial(Item::eBaseItemType_fenceGate, Item::eMaterial_junglewood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setIconName(L"planks_jungle")->setDescriptionId(IDS_TILE_JUNGLE_GATE)->sendTileData()->setUseDescriptionId(IDS_DESC_FENCE_GATE);
|
||||
|
|
@ -580,7 +586,9 @@ void Tile::staticCtor()
|
|||
|
||||
Item::items[rose_Id] = (new MultiTextureTileItem(Tile::rose_Id - 256, rose, (int*)Rose::FLOWER_NAMES, Rose::FLOWER_NAMES_LENGTH))->setIconName(L"flower_rose")->setDescriptionId(IDS_TILE_ROSE)->setUseDescriptionId(IDS_DESC_FLOWER);
|
||||
Item::items[sand_Id] = (new MultiTextureTileItem(Tile::sand_Id - 256, sand, (int*)SandTile::SAND_NAMES, SandTile::SAND_NAMES_LENGTH))->setIconName(L"sand")->setDescriptionId(IDS_TILE_SAND)->setUseDescriptionId(IDS_DESC_SAND);
|
||||
Item::items[red_sandstone_Id] = (new MultiTextureTileItem(Tile::red_sandstone_Id - 256, red_sandstone, (int*)RedSandStoneTile::SANDSTONE_NAMES, RedSandStoneTile::SANDSTONE_BLOCK_NAMES))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_SANDSTONE)->setUseDescriptionId(IDS_DESC_SANDSTONE);
|
||||
Item::items[red_sandstone_Id] = (new MultiTextureTileItem(Tile::red_sandstone_Id - 256, red_sandstone, (int*)RedSandStoneTile::SANDSTONE_NAMES, RedSandStoneTile::SANDSTONE_BLOCK_NAMES))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_SANDSTONE);
|
||||
Item::items[stone_slab2_Id] = (new StoneSlabTileItem(Tile::stone_slab2_Id - 256, Tile::stoneSlab2Half, Tile::stoneSlab2, false))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_HALFSLAB);
|
||||
Item::items[double_stone_slab2_Id] = (new StoneSlabTileItem(Tile::double_stone_slab2_Id - 256, Tile::stoneSlab2Half, Tile::stoneSlab2, true))->setIconName(L"red_sandstone")->setDescriptionId(IDS_TILE_RED_SANDSTONE)->setUseDescriptionId(IDS_DESC_SLAB);
|
||||
Item::items[tree2Trunk_Id] = (new MultiTextureTileItem(Tile::tree2Trunk_Id - 256, tree2Trunk, (int*)TreeTile2::TREE_NAMES, TreeTile2::TREE_NAMES_LENGTH))->setIconName(L"log")->setDescriptionId(IDS_TILE_LOG)->setUseDescriptionId(IDS_DESC_LOG);
|
||||
Item::items[sponge_Id] = (new MultiTextureTileItem(Tile::sponge_Id - 256, sponge, (int*)Sponge::SPONGE_NAMES, Sponge::SPONGE_NAMES_LENGTH))->setIconName(L"sponge")->setDescriptionId(IDS_TILE_SPONGE)->setUseDescriptionId(IDS_DESC_SPONGE);
|
||||
|
||||
|
|
|
|||
|
|
@ -388,8 +388,8 @@ public:
|
|||
static const int invertedDaylightDetector_Id = 178;
|
||||
static const int red_sandstone_Id = 179;
|
||||
static const int stairs_red_sandstone_Id = 180;
|
||||
//181 double_stone_slab2 : sandstoneslab
|
||||
//182 stone_slab2 : sandstoneslab
|
||||
static const int double_stone_slab2_Id = 181;
|
||||
static const int stone_slab2_Id = 182;
|
||||
static const int spruceGate_Id = 183;
|
||||
static const int birchGate_Id = 184;
|
||||
static const int jungleGate_Id = 185;
|
||||
|
|
@ -629,6 +629,8 @@ public:
|
|||
static Tile* invertedDaylightDetector;
|
||||
static Tile* red_sandstone;
|
||||
static Tile* stairs_red_sandstone;
|
||||
static HalfSlabTile* stoneSlab2;
|
||||
static HalfSlabTile* stoneSlab2Half;
|
||||
static Tile* tree2Trunk;
|
||||
static Tile* packedIce;
|
||||
static Tile* seaLantern;
|
||||
|
|
|
|||
|
|
@ -7,47 +7,44 @@
|
|||
#include "net.minecraft.world.item.h"
|
||||
#include "net.minecraft.stats.h"
|
||||
|
||||
const unsigned int WoodSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = { IDS_TILE_STONESLAB_OAK,
|
||||
IDS_TILE_STONESLAB_SPRUCE,
|
||||
IDS_TILE_STONESLAB_BIRCH,
|
||||
IDS_TILE_STONESLAB_JUNGLE,
|
||||
IDS_TILE_STONESLAB_ACACIA,
|
||||
IDS_TILE_STONESLAB_DARK_OAK
|
||||
const unsigned int WoodSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = {
|
||||
IDS_TILE_STONESLAB_OAK,
|
||||
IDS_TILE_STONESLAB_SPRUCE,
|
||||
IDS_TILE_STONESLAB_BIRCH,
|
||||
IDS_TILE_STONESLAB_JUNGLE,
|
||||
IDS_TILE_STONESLAB_ACACIA,
|
||||
IDS_TILE_STONESLAB_DARK_OAK
|
||||
};
|
||||
|
||||
// public static final String[] WOOD_NAMES = {
|
||||
// "oak", "spruce", "birch", "jungle"
|
||||
// };
|
||||
|
||||
WoodSlabTile::WoodSlabTile(int id, bool fullSize) : HalfSlabTile(id, fullSize, Material::wood)
|
||||
WoodSlabTile::WoodSlabTile(int id)
|
||||
: HalfSlabTile(id, Material::wood)
|
||||
{
|
||||
}
|
||||
|
||||
Icon *WoodSlabTile::getTexture(int face, int data)
|
||||
{
|
||||
return Tile::wood->getTexture(face, data & TYPE_MASK);
|
||||
|
||||
return Tile::wood->getTexture(face, data & TYPE_MASK);
|
||||
}
|
||||
|
||||
int WoodSlabTile::getResource(int data, Random *random, int playerBonusLevel)
|
||||
{
|
||||
return Tile::woodSlabHalf_Id;
|
||||
return Tile::woodSlabHalf_Id;
|
||||
}
|
||||
|
||||
shared_ptr<ItemInstance> WoodSlabTile::getSilkTouchItemInstance(int data)
|
||||
{
|
||||
return std::make_shared<ItemInstance>(Tile::woodSlabHalf, 2, data & TYPE_MASK);
|
||||
return std::make_shared<ItemInstance>(Tile::woodSlabHalf, 2, data & TYPE_MASK);
|
||||
}
|
||||
|
||||
int WoodSlabTile::getAuxName(int auxValue)
|
||||
{
|
||||
if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH)
|
||||
{
|
||||
auxValue = 0;
|
||||
}
|
||||
return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue];
|
||||
if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH)
|
||||
auxValue = 0;
|
||||
return SLAB_NAMES[auxValue];
|
||||
}
|
||||
|
||||
void WoodSlabTile::registerIcons(IconRegister *iconRegister)
|
||||
{
|
||||
// None
|
||||
|
||||
}
|
||||
|
|
@ -1,25 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include "Tile.h"
|
||||
#include "HalfSlabTile.h"
|
||||
|
||||
class Player;
|
||||
|
||||
class WoodSlabTile : HalfSlabTile
|
||||
{
|
||||
|
||||
friend class Tile;
|
||||
class WoodSlabTile : public HalfSlabTile
|
||||
{
|
||||
friend class Tile;
|
||||
public:
|
||||
static const int TYPE_MASK = 7;
|
||||
static const int TOP_SLOT_BIT = 8;
|
||||
static const int SLAB_NAMES_LENGTH = 6;
|
||||
static const unsigned int SLAB_NAMES[SLAB_NAMES_LENGTH];
|
||||
static const int SLAB_NAMES_LENGTH = 6;
|
||||
static const unsigned int SLAB_NAMES[SLAB_NAMES_LENGTH];
|
||||
|
||||
WoodSlabTile(int id, bool fullSize);
|
||||
virtual Icon *getTexture(int face, int data);
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel);
|
||||
virtual int getAuxName(int auxValue);
|
||||
public:
|
||||
WoodSlabTile(int id);
|
||||
|
||||
virtual shared_ptr<ItemInstance> getSilkTouchItemInstance(int data);
|
||||
void registerIcons(IconRegister *iconRegister);
|
||||
virtual int isFullSize() = 0;
|
||||
|
||||
virtual Icon *getTexture(int face, int data) override;
|
||||
virtual int getResource(int data, Random *random, int playerBonusLevel) override;
|
||||
virtual int getAuxName(int auxValue) override;
|
||||
virtual void registerIcons(IconRegister *iconRegister) override;
|
||||
|
||||
protected:
|
||||
virtual shared_ptr<ItemInstance> getSilkTouchItemInstance(int data) override;
|
||||
};
|
||||
|
||||
|
||||
class HalfWoodSlabTile : public WoodSlabTile
|
||||
{
|
||||
public:
|
||||
HalfWoodSlabTile(int id) : WoodSlabTile(id) { DerivedInit(); }
|
||||
virtual int isFullSize() override { return 0; }
|
||||
};
|
||||
|
||||
class FullWoodSlabTile : public WoodSlabTile
|
||||
{
|
||||
public:
|
||||
FullWoodSlabTile(int id) : WoodSlabTile(id) { DerivedInit(); }
|
||||
virtual int isFullSize() override { return 1; }
|
||||
};
|
||||
|
|
@ -1966,6 +1966,8 @@ set(_MINECRAFT_WORLD_COMMON_NET_MINECRAFT_WORLD_LEVEL_TILE
|
|||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneMonsterTile.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneSlabTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneSlabTile.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneSlabTile2.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneSlabTile2.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneTile.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/StoneTile.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/TallGrass.cpp"
|
||||
|
|
|
|||
|
|
@ -141,5 +141,6 @@
|
|||
#include "TallGrass2.h"
|
||||
|
||||
#include "PackedIceTile.h"
|
||||
#include "StoneSlabTile2.h"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue