generated from ScrappySM/CarbonTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use CarbonLib for contraption support
CarbonLib, my SM modding lib, has support for getting Contraption, logging using fmt and also a full Lua and Lauxlib wrapper allowing for more stable usage
- Loading branch information
Showing
11 changed files
with
1,958 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"dependencies": [ | ||
"polyhook2" | ||
"polyhook2", | ||
"fmt" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#pragma once | ||
|
||
#define WIN32_LEAN_AND_MEAN | ||
#include <Windows.h> | ||
#include <string> | ||
|
||
#include <fmt/format.h> | ||
|
||
#include "utils.h" | ||
#include "contraption.h" | ||
|
||
namespace Carbon::SM::UTILS { | ||
/// <summary> | ||
/// What colour to log in | ||
/// </summary> | ||
enum Colour : WORD { | ||
DARKGREEN = 2, | ||
BLUE = 3, | ||
PURPLE = 5, | ||
GOLD = 6, | ||
WHITE = 7, | ||
DARKGRAY = 8, | ||
DARKBLUE = 9, | ||
GREEN = 10, | ||
CYAN = 11, | ||
RED = 12, | ||
PINK = 13, | ||
YELLOW = 14, | ||
}; | ||
|
||
/// <summary> | ||
/// What type of log to make | ||
/// </summary> | ||
enum LogType { | ||
Default = 1 << 0, | ||
Profile = 1 << 1, | ||
Resource = 1 << 2, | ||
Shader = 1 << 3, | ||
Buffer = 1 << 4, | ||
Render = 1 << 5, | ||
Network = 1 << 6, | ||
System = 1 << 7, | ||
Terrain = 1 << 8, | ||
World = 1 << 9, | ||
Lua = 1 << 11, | ||
Print = 1 << 12, | ||
Audio = 1 << 10, | ||
UGC = 1 << 13, | ||
Steam = 1 << 14, | ||
Error = -1, | ||
Warning = 1 << 30, | ||
None = 0 | ||
}; | ||
|
||
class Console { | ||
public: | ||
virtual ~Console() { /* Implemented by game */ } | ||
virtual void Log(const std::string& message, Colour colour = Colour::WHITE, LogType type = LogType::Default) { /* Implemented by game */ } | ||
virtual void LogNoReturn(const std::string& message, Colour colour = Colour::WHITE, LogType type = LogType::Default) { /* Implemented by game */ } | ||
}; | ||
} // namespace Carbon::SM::UTILS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "utils.h" | ||
#include "offsets.h" | ||
|
||
#include "console.h" | ||
|
||
namespace Carbon::SM { | ||
enum GameStateType; | ||
|
||
class Contraption { | ||
SINGLETON(Contraption); | ||
|
||
/* 0x0000 */ PAD(0x58); | ||
/* 0x0058 */ PUB UTILS::Console* console; | ||
/* 0x0060 */ PAD(0x11C); | ||
/* 0x017C */ PUB GameStateType gameState; | ||
}; | ||
|
||
enum GameStateType : uint32_t { | ||
Null, | ||
Load, | ||
Play, | ||
Menu, | ||
TileEditor, | ||
WorldBuilder, | ||
}; | ||
} // namespace Carbon::SM |
Oops, something went wrong.