the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 101 lines 3.0 kB view raw
1#pragma once 2using namespace std; 3#include <vector> 4class DLCPack; 5class DLCSkinFile; 6 7class DLCManager 8{ 9public: 10 enum EDLCType 11 { 12 e_DLCType_Skin = 0, 13 e_DLCType_Cape, 14 e_DLCType_Texture, 15 e_DLCType_UIData, 16 e_DLCType_PackConfig, 17 e_DLCType_TexturePack, 18 e_DLCType_LocalisationData, 19 e_DLCType_GameRules, 20 e_DLCType_Audio, 21 e_DLCType_ColourTable, 22 e_DLCType_GameRulesHeader, 23 24 e_DLCType_Max, 25 e_DLCType_All, 26 }; 27 28 // If you add to the Enum,then you need to add the array of type names 29 // These are the names used in the XML for the parameters 30 enum EDLCParameterType 31 { 32 e_DLCParamType_Invalid = -1, 33 34 e_DLCParamType_DisplayName = 0, 35 e_DLCParamType_ThemeName, 36 e_DLCParamType_Free, // identify free skins 37 e_DLCParamType_Credit, // legal credits for DLC 38 e_DLCParamType_Cape, 39 e_DLCParamType_Box, 40 e_DLCParamType_Anim, 41 e_DLCParamType_PackId, 42 e_DLCParamType_NetherParticleColour, 43 e_DLCParamType_EnchantmentTextColour, 44 e_DLCParamType_EnchantmentTextFocusColour, 45 e_DLCParamType_DataPath, 46 e_DLCParamType_PackVersion, 47 48 e_DLCParamType_Max, 49 50 }; 51 static WCHAR *wchTypeNamesA[e_DLCParamType_Max]; 52 53private: 54 vector<DLCPack *> m_packs; 55 //bool m_bNeedsUpdated; 56 bool m_bNeedsCorruptCheck; 57 DWORD m_dwUnnamedCorruptDLCCount; 58public: 59 DLCManager(); 60 ~DLCManager(); 61 62 static EDLCParameterType getParameterType(const wstring &paramName); 63 64 DWORD getPackCount(EDLCType type = e_DLCType_All); 65 66 //bool NeedsUpdated() { return m_bNeedsUpdated; } 67 //void SetNeedsUpdated(bool val) { m_bNeedsUpdated = val; } 68 69 bool NeedsCorruptCheck() { return m_bNeedsCorruptCheck; } 70 void SetNeedsCorruptCheck(bool val) { m_bNeedsCorruptCheck = val; } 71 72 void resetUnnamedCorruptCount() { m_dwUnnamedCorruptDLCCount = 0; } 73 void incrementUnnamedCorruptCount() { ++m_dwUnnamedCorruptDLCCount; } 74 75 void addPack(DLCPack *pack); 76 void removePack(DLCPack *pack); 77 void removeAllPacks(void); 78 void LanguageChanged(void); 79 80 DLCPack *getPack(const wstring &name); 81#ifdef _XBOX_ONE 82 DLCPack *DLCManager::getPackFromProductID(const wstring &productID); 83#endif 84 DLCPack *getPack(DWORD index, EDLCType type = e_DLCType_All); 85 DWORD getPackIndex(DLCPack *pack, bool &found, EDLCType type = e_DLCType_All); 86 DLCSkinFile *getSkinFile(const wstring &path); // Will hunt all packs of type skin to find the right skinfile 87 88 DLCPack *getPackContainingSkin(const wstring &path); 89 DWORD getPackIndexContainingSkin(const wstring &path, bool &found); 90 91 DWORD checkForCorruptDLCAndAlert(bool showMessage = true); 92 93 bool readDLCDataFile(DWORD &dwFilesProcessed, const wstring &path, DLCPack *pack, bool fromArchive = false); 94 bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false); 95 DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack); 96 97private: 98 bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack); 99 100 DWORD retrievePackID(PBYTE pbData, DWORD dwLength, DLCPack *pack); 101};