Skip to content

Commit

Permalink
Version 0.7.3.776 support
Browse files Browse the repository at this point in the history
  • Loading branch information
QuestionableM committed Dec 10, 2024
1 parent c646b2b commit 1f265f5
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 9 deletions.
12 changes: 9 additions & 3 deletions Code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ static void h_perframeUpdate(void* a1, float dt, void* a3, void* a4, void* pFram
o_perframeUpdate(a1, dt, a3, a4, pFrameSettings);
}

#if _SM_VERSION_NUM == 072775
#if _SM_VERSION_NUM == 073776
# define PVC_CLIENT_PACKET_HANDLER 0x406A60
# define PVC_SERVER_PACKET_HANDLER 0x8CE7E0
# define PVC_CUSTOM_OPTIONS_MENU_CONSTRUCTOR 0x3BCBC0
# define PVC_CUSTOM_OPTIONS_MENU_INITIALIZE 0x3BD7F0
# define PVC_PERFRAME_UPDATE 0x6D2B20
#elif _SM_VERSION_NUM == 072775
# define PVC_CLIENT_PACKET_HANDLER 0x406AE0
# define PVC_SERVER_PACKET_HANDLER 0x8CE790
# define PVC_CUSTOM_OPTIONS_MENU_CONSTRUCTOR 0x3BCC40
Expand Down Expand Up @@ -68,11 +74,11 @@ static void h_perframeUpdate(void* a1, float dt, void* a3, void* a4, void* pFram

static void process_attach(HMODULE hMod)
{
if (!SmSdk::CheckTimestamp(_SM_TIMESTAMP_072_775))
if (!SmSdk::CheckTimestamp(_SM_TIMESTAMP_073_776))
{
MessageBoxA(
NULL,
"Your game version is not supported by Proximity Voice Chat. 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.",
"Your game version is not supported by Proximity Voice Chat. The current version of the mod has been built for Scrap Mechanic 0.7.3.776\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 @@ -5,6 +5,7 @@
#define _SM_TIMESTAMP_070_771 1733399248
#define _SM_TIMESTAMP_071_772 1733491522
#define _SM_TIMESTAMP_072_775 1733754961
#define _SM_TIMESTAMP_073_776 1733837301

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

#define _SM_VERSION_NUM 072775
#define _SM_VERSION_NUM 073776

///////STATIC VALUE OFFSETS

#if _SM_VERSION_NUM == 071772 || _SM_VERSION_NUM == 072775
#if _SM_VERSION_NUM == 073776
# define SM_CURRENT_GAME_STATE_OFFSET 0x1267598
# define SM_IN_GAME_GUI_MANAGER_OFFSET 0x1267570
# define SM_GUI_SYSTEM_MANAGER_OFFSET 0x12676E8
# define SM_CHARACTER_MANAGER_OFFSET 0x1267738
# define SM_PLAYER_MANAGER_OFFSET 0x12677D8
# define SM_AUDIO_MANAGER_OFFSET 0x1267648
# define SM_INPUT_MANAGER_OFFSET 0x1267800
# define SM_MY_PLAYER_OFFSET 0x12675A8
# define SM_GAME_SETTINGS_OFFSET 0x1267760
# define SM_CONTAINER_MANAGER_OFFSET 0x1267798
# define SM_PORTAL_MANAGER_OFFSET 0x1267690
# define SM_PATHFINDER_MANAGER_OFFSET 0x12676B0
# define SM_AREA_TRIGGER_MANAGER_OFFSET 0x1267668
# define SM_HARVESTABLE_MANAGER_OFFSET 0x1267718
# define SM_DIRECTORY_MANAGER_OFFSET 0x1267810
# define SM_CREATION_MANAGER_OFFSET 0x1267740
# define SM_NET_OBJ_MANAGER_OFFSET 0x12677D0
# define SM_PHYSICS_OFFSET 0x1267590
#elif _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 +84,13 @@

//////VFTABLE OFFSETS

#if _SM_VERSION_NUM == 071772 || _SM_VERSION_NUM == 072775
#if _SM_VERSION_NUM == 073776
# define SM_VTBL_GAME_STATE_OFFSET 0xF88A70
# define SM_VTBL_OPTIONS_MENU_OFFSET 0xF82558
# define SM_VTBL_GAMEPLAY_OPTIONS_MENU_OFFSET 0xF824F8
# define SM_VTBL_AUDIO_OPTIONS_MENU_OFFSET 0xF31370
# define SM_VTBL_OPTIONS_SUB_MENU_BASE_OFFSET 0xF6A698
#elif _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 +112,15 @@

//////CONSTRUCTOR OFFSETS

#if _SM_VERSION_NUM == 072775
#if _SM_VERSION_NUM == 073776
# define SM_CONSTRUCTOR_OPTIONS_SUB_MENU_BASE_OFFSET 0x3BF890
# define SM_CONSTRUCTOR_CONTROL_OPTIONS_MENU_OFFSET 0x328620
# define SM_CONSTRUCTOR_DISPLAY_OPTIONS_MENU_OFFSET 0x337FC0
# define SM_CONSTRUCTOR_GRAPHICS_OPTIONS_MENU_OFFSET 0x351D20
# define SM_CONSTRUCTOR_COMPOUND_BUTTON_OFFSET 0x644A70
# define SM_CONSTRUCTOR_RADIO_BUTTON_SET_OFFSET 0x28C6B0
# define SM_CONSTRUCTOR_OPTIONS_ITEM_SLIDER_OFFSET 0x3BBE20
#elif _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
Expand Down Expand Up @@ -123,7 +156,9 @@

/////FUNCTIONS

#if _SM_VERSION_NUM == 072775
#if _SM_VERSION_NUM == 073776
# define SM_FUNC_VERTICAL_STACK_BOX_ADD_NEW_ITEM_OFFSET 0x5270E0
#elif _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
Expand All @@ -135,7 +170,10 @@

/////VARIABLES

#if _SM_VERSION_NUM == 072775
#if _SM_VERSION_NUM == 073776
# define SM_VAR_PAINT_DRAG_LIMITER 0x3E0DBB
# define SM_VAR_PAINT_ERASE_LIMITER 0x2AD4BD
#elif _SM_VERSION_NUM == 072775
# define SM_VAR_PAINT_DRAG_LIMITER 0x3E0E3B
# define SM_VAR_PAINT_ERASE_LIMITER 0x2AD53D
#elif _SM_VERSION_NUM == 071772
Expand Down

0 comments on commit 1f265f5

Please sign in to comment.