the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 71 lines 1.4 kB view raw
1#include "stdafx.h" 2#include "XUI_Ctrl_MobEffect.h" 3 4LPCWSTR CXuiCtrlMobEffect::iconFrameNames[MobEffect::e_MobEffectIcon_COUNT]= 5{ 6 L"Normal", 7 L"Blindness", 8 L"Fire_Resistance", 9 L"Haste", 10 L"Hunger", 11 L"Invisibility", 12 L"Jump_Boost", 13 L"Mining_Fatigue", 14 L"Nausea", 15 L"Night_Vision", 16 L"Poison", 17 L"Regeneration", 18 L"Resistance", 19 L"Slowness", 20 L"Speed", 21 L"Strength", 22 L"Water_Breathing", 23 L"Weakness", 24}; 25 26HRESULT CXuiCtrlMobEffect::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled) 27{ 28 m_icon = MobEffect::e_MobEffectIcon_None; 29 m_name = L""; 30 m_duration = L""; 31 return S_OK; 32} 33 34HRESULT CXuiCtrlMobEffect::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceTextData, BOOL& bHandled) 35{ 36 if( pGetSourceTextData->iData == 1 ) 37 { 38 pGetSourceTextData->szText = m_name.c_str(); 39 pGetSourceTextData->bDisplay = TRUE; 40 41 if(FAILED(PlayVisualRange(iconFrameNames[m_icon],NULL,iconFrameNames[m_icon]))) 42 { 43 PlayVisualRange(L"Normal",NULL,L"Normal"); 44 } 45 46 bHandled = TRUE; 47 } 48 else if( pGetSourceTextData->iData == 2 ) 49 { 50 pGetSourceTextData->szText = m_duration.c_str(); 51 pGetSourceTextData->bDisplay = TRUE; 52 53 bHandled = TRUE; 54 } 55 return S_OK; 56} 57 58void CXuiCtrlMobEffect::setIcon(MobEffect::EMobEffectIcon icon) 59{ 60 m_icon = icon; 61} 62 63void CXuiCtrlMobEffect::setName(const wstring &name) 64{ 65 m_name = name; 66} 67 68void CXuiCtrlMobEffect::setDuration(const wstring &duration) 69{ 70 m_duration = duration; 71}