the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 77 lines 2.0 kB view raw
1#pragma once 2#include "TexturePack.h" 3using namespace std; 4 5class Minecraft; 6 7class TexturePackRepository 8{ 9public: 10 static const DWORD DEFAULT_TEXTURE_PACK_ID = 0; 11 static const DWORD FOLDER_TEST_TEXTURE_PACK_ID = 1; 12 static const DWORD DLC_TEST_TEXTURE_PACK_ID = 2; 13private: 14 static TexturePack *DEFAULT_TEXTURE_PACK; 15 TexturePack *m_dummyTexturePack; 16 TexturePack *m_dummyDLCTexturePack; 17 18 Minecraft *minecraft; 19 File workDir; 20 File multiplayerDir; 21 vector<TexturePack *> *texturePacks; 22 vector<TexturePack *> m_texturePacksToDelete; 23 24 unordered_map<DWORD, TexturePack *> cacheById; 25 26 TexturePack *selected; 27 TexturePack *lastSelected; 28 bool usingWeb; 29 static const int MAX_WEB_FILESIZE = 10 * 1000 * 1000; // 10 Megabytes 30 31public: 32 TexturePackRepository(File workingDirectory, Minecraft *minecraft); 33 void addDebugPacks(); 34private: 35 void createWorkingDirecoryUnlessExists(); 36 37public: 38 bool selectSkin(TexturePack *skin); 39 40 void selectWebSkin(const wstring &url); 41 42private: 43 void downloadWebSkin(const wstring &url, File file); 44 45public: 46 bool isUsingWebSkin(); 47 void resetWebSkin(); 48 void updateList(); 49 50private: 51 wstring getIdOrNull(File file); 52 vector<File> getWorkDirContents(); 53 54public: 55 vector<TexturePack *> *getAll(); 56 57 TexturePack *getSelected(); 58 bool shouldPromptForWebSkin(); 59 bool canUseWebSkin(); 60 bool isUsingDefaultSkin() { return selected == DEFAULT_TEXTURE_PACK; } // 4J Added 61 TexturePack *getDefault() { return DEFAULT_TEXTURE_PACK; } // 4J Added 62 63 vector< pair<DWORD,wstring> > *getTexturePackIdNames(); 64 bool selectTexturePackById(DWORD id); // 4J Added 65 TexturePack *getTexturePackById(DWORD id); // 4J Added 66 67 TexturePack *addTexturePackFromDLC(DLCPack *dlcPack, DWORD id); 68 void clearInvalidTexturePacks(); 69 void updateUI(); 70 bool needsUIUpdate(); 71private: 72 void removeTexturePackById(DWORD id); 73public: 74 unsigned int getTexturePackCount(); 75 TexturePack *getTexturePackByIndex(unsigned int index); 76 unsigned int getTexturePackIndex(unsigned int id); 77};