the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 193 lines 5.7 kB view raw
1#pragma once 2 3#define XM_SPLITSCREENPLAYER_MESSAGE XM_USER 4#define XM_FONTRENDERERCHANGE_MESSAGE XM_USER + 1 5#define XM_DLCMOUNTED_MESSAGE XM_USER + 2 6#define XM_BASE_POSITION_CHANGED_MESSAGE XM_USER + 3 7#define XM_DLCSINSTALLED_MESSAGE XM_USER + 4 8#define XM_INVENTORYUPDATED_MESSAGE XM_USER + 5 9#define XM_TMS_DLCFILE_RETRIEVED_MESSAGE XM_USER + 6 10#define XM_TMS_BANFILE_RETRIEVED_MESSAGE XM_USER + 7 11#define XM_TMS_ALLFILES_RETRIEVED_MESSAGE XM_USER + 8 12#define XM_CUSTOMTICKSCENE_MESSAGE XM_USER + 9 13#define XM_GETSLOTITEM_MESSAGE XM_USER + 10 14 15typedef struct 16{ 17 shared_ptr<ItemInstance> item; 18 19 // Legacy values for compatibility 20 int iDataBitField; 21 int iItemBitField; 22 LPCWSTR szPath; 23 BOOL bDirty; 24} 25CustomMessage_GetSlotItem_Struct; 26 27 28// Define the prototype for your handler function 29// Sig: HRESULT OnCustomMessage_GetSlotItem(CustomMessage_GetSlotItem_Struct *pData, BOOL& bHandled) 30 31// Define the message map macro 32#define XUI_ON_XM_GETSLOTITEM_MESSAGE(MemberFunc)\ 33 if (pMessage->dwMessage == XM_GETSLOTITEM_MESSAGE)\ 34{\ 35 CustomMessage_GetSlotItem_Struct *pData = (CustomMessage_GetSlotItem_Struct *) pMessage->pvData;\ 36 return MemberFunc(pData, pMessage->bHandled);\ 37} 38 39static __declspec(noinline) void CustomMessage_GetSlotItem(XUIMessage *pMsg, CustomMessage_GetSlotItem_Struct* pData, int iDataBitField, int iItemBitField) 40{ 41 XuiMessage(pMsg,XM_GETSLOTITEM_MESSAGE); 42 _XuiMessageExtra(pMsg,(XUIMessageData*) pData, sizeof(*pData)); 43 pData->item = nullptr; 44 pData->iDataBitField = iDataBitField; 45 pData->iItemBitField = iItemBitField; 46 pData->szPath = NULL; 47 pData->bDirty = false; 48} 49 50typedef struct 51{ 52 bool bJoining; // if you're not joining, your leaving 53} 54CustomMessage_Splitscreenplayer_Struct; 55 56 57// Define the prototype for your handler function 58// Sig: HRESULT OnCustomMessage_Splitscreenplayer(bool bJoining, BOOL& bHandled) 59 60// Define the message map macro 61#define XUI_ON_XM_SPLITSCREENPLAYER_MESSAGE(MemberFunc)\ 62 if (pMessage->dwMessage == XM_SPLITSCREENPLAYER_MESSAGE)\ 63{\ 64 CustomMessage_Splitscreenplayer_Struct *pData = (CustomMessage_Splitscreenplayer_Struct *) pMessage->pvData;\ 65 return MemberFunc(pData->bJoining, pMessage->bHandled);\ 66} 67 68static __declspec(noinline) void CustomMessage_Splitscreenplayer(XUIMessage *pMsg, CustomMessage_Splitscreenplayer_Struct* pData, bool bJoining) 69{ 70 XuiMessage(pMsg,XM_SPLITSCREENPLAYER_MESSAGE); 71 _XuiMessageExtra(pMsg,(XUIMessageData*) pData, sizeof(*pData)); 72 pData->bJoining = bJoining; 73} 74 75// Define the prototype for your handler function 76// Sig: HRESULT OnFontRendererChange() 77 78// Define the message map macro 79#define XUI_ON_XM_FONTRENDERERCHANGE_MESSAGE(MemberFunc)\ 80 if (pMessage->dwMessage == XM_FONTRENDERERCHANGE_MESSAGE)\ 81{\ 82 return MemberFunc();\ 83} 84 85static __declspec(noinline) void CustomMessage_FontRendererChange(XUIMessage *pMsg) 86{ 87 XuiMessage(pMsg,XM_FONTRENDERERCHANGE_MESSAGE); 88} 89 90// Define the prototype for your handler function 91// Sig: HRESULT OnDLCMounted() 92 93// Define the message map macro 94#define XUI_ON_XM_DLCLOADED_MESSAGE(MemberFunc)\ 95 if (pMessage->dwMessage == XM_DLCMOUNTED_MESSAGE)\ 96{\ 97 return MemberFunc();\ 98} 99 100static __declspec(noinline) void CustomMessage_DLCMountingComplete(XUIMessage *pMsg) 101{ 102 XuiMessage(pMsg,XM_DLCMOUNTED_MESSAGE); 103} 104 105// Define the prototype for your handler function 106// Sig: HRESULT OnBasePositionChanged() 107 108// Define the message map macro 109#define XUI_ON_XM_BASE_POSITION_CHANGED_MESSAGE(MemberFunc)\ 110 if (pMessage->dwMessage == XM_BASE_POSITION_CHANGED_MESSAGE)\ 111{\ 112 return MemberFunc();\ 113} 114 115static __declspec(noinline) void CustomMessage_BasePositionChanged(XUIMessage *pMsg) 116{ 117 XuiMessage(pMsg,XM_BASE_POSITION_CHANGED_MESSAGE); 118} 119 120// the prototype for your handler function 121// Sig: HRESULT OnDLCInstalled() 122 123// Define the message map macro 124#define XUI_ON_XM_DLCINSTALLED_MESSAGE(MemberFunc)\ 125 if (pMessage->dwMessage == XM_DLCSINSTALLED_MESSAGE)\ 126{\ 127 return MemberFunc();\ 128} 129 130static __declspec(noinline) void CustomMessage_DLCInstalled(XUIMessage *pMsg) 131{ 132 XuiMessage(pMsg,XM_DLCSINSTALLED_MESSAGE); 133} 134 135// the prototype for your handler function 136// Sig: HRESULT OnCustomMessage_InventoryUpdated() 137 138// Define the message map macro 139#define XUI_ON_XM_INVENTORYUPDATED_MESSAGE(MemberFunc)\ 140 if (pMessage->dwMessage == XM_INVENTORYUPDATED_MESSAGE)\ 141{\ 142 return MemberFunc();\ 143} 144 145static __declspec(noinline) void CustomMessage_InventoryUpdated(XUIMessage *pMsg) 146{ 147 XuiMessage(pMsg,XM_INVENTORYUPDATED_MESSAGE); 148} 149 150// the prototype for your handler function 151// Sig: HRESULT OnCustomMessage_() 152 153// Define the message map macro 154#define XUI_ON_XM_TMS_DLCFILE_RETRIEVED_MESSAGE(MemberFunc)\ 155 if (pMessage->dwMessage == XM_TMS_DLCFILE_RETRIEVED_MESSAGE)\ 156{\ 157 return MemberFunc();\ 158} 159 160static __declspec(noinline) void CustomMessage_TMS_DLCFileRetrieved(XUIMessage *pMsg) 161{ 162 XuiMessage(pMsg,XM_TMS_DLCFILE_RETRIEVED_MESSAGE); 163} 164 165// the prototype for your handler function 166// Sig: HRESULT OnCustomMessage_() 167 168// Define the message map macro 169#define XUI_ON_XM_TMS_BANFILE_RETRIEVED_MESSAGE(MemberFunc)\ 170 if (pMessage->dwMessage == XM_TMS_BANFILE_RETRIEVED_MESSAGE)\ 171{\ 172 return MemberFunc();\ 173} 174 175static __declspec(noinline) void CustomMessage_TMS_BanFileRetrieved(XUIMessage *pMsg) 176{ 177 XuiMessage(pMsg,XM_TMS_BANFILE_RETRIEVED_MESSAGE); 178} 179 180// Define the prototype for your handler function 181// Sig: HRESULT OnCustomMessage_TickScene() 182 183// Define the message map macro 184#define XUI_ON_XM_CUSTOMTICKSCENE_MESSAGE(MemberFunc)\ 185 if (pMessage->dwMessage == XM_CUSTOMTICKSCENE_MESSAGE)\ 186{\ 187 return MemberFunc();\ 188} 189 190static __declspec(noinline) void CustomMessage_TickScene(XUIMessage *pMsg) 191{ 192 XuiMessage(pMsg,XM_CUSTOMTICKSCENE_MESSAGE); 193}