the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 61 lines 1.1 kB view raw
1#include "stdafx.h" 2#include "XUI_Ctrl_4JIcon.h" 3 4HRESULT CXuiCtrl4JIcon::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) 5{ 6 m_hBrush=NULL; 7 return S_OK; 8} 9 10HRESULT CXuiCtrl4JIcon::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourceImageData,BOOL& bHandled) 11{ 12 XUIMessage Message; 13 XUIMessageGetSourceImage MsgGetImage; 14 HRESULT hr; 15 HXUIOBJ hObj; 16 17 if(m_hBrush) 18 { 19 pGetSourceImageData->hBrush = m_hBrush; 20 bHandled = TRUE; 21 } 22 else 23 { 24 XuiMessageGetSourceImage(&Message, &MsgGetImage, pGetSourceImageData->iItem, pGetSourceImageData->iData, TRUE); 25 26 hr = GetParent(&hObj); 27 28 if (HRESULT_SUCCEEDED(hr)) 29 { 30 hr = XuiBubbleMessage(hObj, &Message); 31 32 if (Message.bHandled) 33 { 34 pGetSourceImageData->hBrush = MsgGetImage.hBrush; 35 bHandled = TRUE; 36 } 37 } 38 } 39 return S_OK; 40} 41 42HRESULT CXuiCtrl4JIcon::UseBrush(HXUIBRUSH hBrush) 43{ 44 if( m_hBrush ) 45 { 46 XuiDestroyBrush( m_hBrush ); 47 } 48 m_hBrush = hBrush; 49 return XuiControlSetImageBrush(m_hObj,hBrush); 50} 51 52HRESULT CXuiCtrl4JIcon::OnDestroy() 53{ 54 55 if( m_hBrush ) 56 { 57 XuiDestroyBrush( m_hBrush ); 58 } 59 60 return S_OK; 61}