Skip to content

Commit

Permalink
0.7.2.775 support
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestionableM committed Dec 9, 2024
1 parent 50b3a62 commit 23536bb
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
11 changes: 8 additions & 3 deletions Code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ static bool ms_mhHooksAttached = false;
#define DEFINE_HOOK(address, detour, original) \
MH_CreateHook((LPVOID)(v_mod_base + address), (LPVOID)detour, (LPVOID*)&original)

#if _SM_VERSION_NUM == 071772
#if _SM_VERSION_NUM == 072775
# define BPT_PROCESS_INPUTS_FUNC 0x53BD80
# define BPT_GUI_INITIALIZE_FUNC 0x3C0800
# define BPT_INITIALIZE_FUNC 0x3DF950
# define BPT_UPDATE_FUNC 0x3DEE80
#elif _SM_VERSION_NUM == 071772
# define BPT_PROCESS_INPUTS_FUNC 0x53BD60
# define BPT_GUI_INITIALIZE_FUNC 0x3C07E0
# define BPT_INITIALIZE_FUNC 0x3DF930
Expand All @@ -37,11 +42,11 @@ void process_attach()
{
AttachDebugConsole();

if (!SmSdk::CheckTimestamp(_SM_TIMESTAMP_071_772))
if (!SmSdk::CheckTimestamp(_SM_TIMESTAMP_072_775))
{
MessageBoxA(
NULL,
"Your game version is not supported by Better Paint Tool. The current version of the mod has been built for Scrap Mechanic 0.7.1.772\n\nPress OK to continue loading without the mod.",
"Your game version is not supported by Better Paint Tool. The current version of the mod has been built for Scrap Mechanic 0.7.2.775\n\nPress OK to continue loading without the mod.",
"Unsupported Version",
MB_ICONWARNING);
return;
Expand Down
1 change: 1 addition & 0 deletions Dependencies/SmSdk/include/SmSdk/TimestampCheck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#define _SM_TIMESTAMP_070_771 1733399248
#define _SM_TIMESTAMP_071_772 1733491522
#define _SM_TIMESTAMP_072_775 1733754961

namespace SmSdk
{
Expand Down
33 changes: 23 additions & 10 deletions Dependencies/SmSdk/include/SmSdk/offsets.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#pragma once

#define _SM_VERSION_NUM 071772
#define _SM_VERSION_NUM 072775

///////STATIC VALUE OFFSETS

#if _SM_VERSION_NUM == 071772
#if _SM_VERSION_NUM == 071772 || _SM_VERSION_NUM == 072775
# define SM_CURRENT_GAME_STATE_OFFSET 0x1267518
# define SM_IN_GAME_GUI_MANAGER_OFFSET 0x12674F0
# define SM_GUI_SYSTEM_MANAGER_OFFSET 0x1267668
Expand Down Expand Up @@ -65,7 +65,7 @@

//////VFTABLE OFFSETS

#if _SM_VERSION_NUM == 071772
#if _SM_VERSION_NUM == 071772 || _SM_VERSION_NUM == 072775
# define SM_VTBL_GAME_STATE_OFFSET 0xF889B0
# define SM_VTBL_OPTIONS_MENU_OFFSET 0xF82498
# define SM_VTBL_GAMEPLAY_OPTIONS_MENU_OFFSET 0xF82438
Expand All @@ -87,7 +87,15 @@

//////CONSTRUCTOR OFFSETS

#if _SM_VERSION_NUM == 071772
#if _SM_VERSION_NUM == 072775
# define SM_CONSTRUCTOR_OPTIONS_SUB_MENU_BASE_OFFSET 0x3BF910
# define SM_CONSTRUCTOR_CONTROL_OPTIONS_MENU_OFFSET 0x3286A0
# define SM_CONSTRUCTOR_DISPLAY_OPTIONS_MENU_OFFSET 0x338040
# define SM_CONSTRUCTOR_GRAPHICS_OPTIONS_MENU_OFFSET 0x351DA0
# define SM_CONSTRUCTOR_COMPOUND_BUTTON_OFFSET 0x644AF0
# define SM_CONSTRUCTOR_RADIO_BUTTON_SET_OFFSET 0x28C730
# define SM_CONSTRUCTOR_OPTIONS_ITEM_SLIDER_OFFSET 0x3BBEA0
#elif _SM_VERSION_NUM == 071772
# define SM_CONSTRUCTOR_OPTIONS_SUB_MENU_BASE_OFFSET 0x3BF8F0
# define SM_CONSTRUCTOR_CONTROL_OPTIONS_MENU_OFFSET 0x3286A0
# define SM_CONSTRUCTOR_DISPLAY_OPTIONS_MENU_OFFSET 0x338040
Expand Down Expand Up @@ -115,7 +123,9 @@

/////FUNCTIONS

#if _SM_VERSION_NUM == 071772
#if _SM_VERSION_NUM == 072775
# define SM_FUNC_VERTICAL_STACK_BOX_ADD_NEW_ITEM_OFFSET 0x527160
#elif _SM_VERSION_NUM == 071772
# define SM_FUNC_VERTICAL_STACK_BOX_ADD_NEW_ITEM_OFFSET 0x527140
#elif _SM_VERSION_NUM == 070771
# define SM_FUNC_VERTICAL_STACK_BOX_ADD_NEW_ITEM_OFFSET 0x527140
Expand All @@ -125,10 +135,13 @@

/////VARIABLES

#if _SM_VERSION_NUM == 071772
#define SM_VAR_PAINT_DRAG_LIMITER 0x3E0E1B
#define SM_VAR_PAINT_ERASE_LIMITER 0x2AD53D
#if _SM_VERSION_NUM == 072775
# define SM_VAR_PAINT_DRAG_LIMITER 0x3E0E3B
# define SM_VAR_PAINT_ERASE_LIMITER 0x2AD53D
#elif _SM_VERSION_NUM == 071772
# define SM_VAR_PAINT_DRAG_LIMITER 0x3E0E1B
# define SM_VAR_PAINT_ERASE_LIMITER 0x2AD53D
#else
#define SM_VAR_PAINT_DRAG_LIMITER 0x3F060D
#define SM_VAR_PAINT_ERASE_LIMITER 0x3F0D9B
# define SM_VAR_PAINT_DRAG_LIMITER 0x3F060D
# define SM_VAR_PAINT_ERASE_LIMITER 0x3F0D9B
#endif

0 comments on commit 23536bb

Please sign in to comment.