the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 106 lines 3.0 kB view raw
1#pragma once 2 3#include <string> 4#include <XuiApp.h> 5#include "..\..\Textures.h" 6//#include "..\..\Xbox\DLC\DLCSkinFile.h" 7#include "..\..\Model.h" 8 9using namespace std; 10 11class EntityRenderer; 12 13//----------------------------------------------------------------------------- 14// CXuiCtrlMinecraftSkinPreview class 15//----------------------------------------------------------------------------- 16class CXuiCtrlMinecraftSkinPreview : public CXuiControlImpl 17{ 18private: 19 static const int LOOK_LEFT_EXTENT = 45; 20 static const int LOOK_RIGHT_EXTENT = -45; 21 22 static const int CHANGING_SKIN_FRAMES = 15; 23 24 enum ESkinPreviewAnimations 25 { 26 e_SkinPreviewAnimation_Walking, 27 e_SkinPreviewAnimation_Sneaking, 28 e_SkinPreviewAnimation_Attacking, 29 30 e_SkinPreviewAnimation_Count, 31 }; 32public: 33 enum ESkinPreviewFacing 34 { 35 e_SkinPreviewFacing_Forward, 36 e_SkinPreviewFacing_Left, 37 e_SkinPreviewFacing_Right, 38 }; 39public: 40 XUI_IMPLEMENT_CLASS(CXuiCtrlMinecraftSkinPreview, L"CXuiCtrlMinecraftSkinPreview", XUI_CLASS_LABEL) 41 42 CXuiCtrlMinecraftSkinPreview(); 43 virtual ~CXuiCtrlMinecraftSkinPreview() { }; 44 45 void SetTexture(const wstring &url, TEXTURE_NAME backupTexture = TN_MOB_CHAR); 46 void SetCapeTexture(const wstring &url) { m_capeTextureUrl = url; } 47 void ResetRotation() { m_xRot = 0; m_yRot = 0; } 48 void IncrementYRotation() { m_yRot = (m_yRot+4); if(m_yRot >= 180) m_yRot = -180; } 49 void DecrementYRotation() { m_yRot = (m_yRot-4); if(m_yRot <= -180) m_yRot = 180; } 50 void IncrementXRotation() { m_xRot = (m_xRot+2); if(m_xRot > 22) m_xRot = 22; } 51 void DecrementXRotation() { m_xRot = (m_xRot-2); if(m_xRot < -22) m_xRot = -22; } 52 void SetAutoRotate(bool autoRotate) { m_bAutoRotate = autoRotate; } 53 void SetFacing(ESkinPreviewFacing facing, bool bAnimate = false); 54 55 void CycleNextAnimation(); 56 void CyclePreviousAnimation(); 57 58 bool m_incXRot, m_decXRot; 59 bool m_incYRot, m_decYRot; 60 61protected: 62 63 XUI_BEGIN_MSG_MAP() 64 XUI_ON_XM_INIT(OnInit) 65 XUI_ON_XM_RENDER(OnRender) 66 XUI_END_MSG_MAP() 67 68 HRESULT OnInit(XUIMessageInit* pInitData, BOOL& rfHandled); 69 HRESULT OnRender(XUIMessageRender *pRenderData, BOOL &rfHandled); 70 71private: 72 void render(EntityRenderer *renderer, double x, double y, double z, float rot, float a); 73 bool bindTexture(const wstring& urlTexture, int backupTexture); 74 bool bindTexture(const wstring& urlTexture, const wstring& backupTexture); 75 76 BOOL m_bDirty; 77 float m_fScale,m_fAlpha; 78 79 wstring m_customTextureUrl; 80 TEXTURE_NAME m_backupTexture; 81 wstring m_capeTextureUrl; 82 unsigned int m_uiAnimOverrideBitmask; 83 84 float m_fScreenWidth,m_fScreenHeight; 85 float m_fRawWidth,m_fRawHeight; 86 87 int m_yRot,m_xRot; 88 89 float m_bobTick; 90 91 float m_walkAnimSpeedO; 92 float m_walkAnimSpeed; 93 float m_walkAnimPos; 94 95 bool m_bAutoRotate, m_bRotatingLeft; 96 BYTE m_rotateTick; 97 float m_fTargetRotation, m_fOriginalRotation; 98 int m_framesAnimatingRotation; 99 bool m_bAnimatingToFacing; 100 101 float m_swingTime; 102 103 ESkinPreviewAnimations m_currentAnimation; 104 //vector<Model::SKIN_BOX *> *m_pvAdditionalBoxes; 105 vector<ModelPart *> *m_pvAdditionalModelParts; 106};