-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathConsole.h
112 lines (89 loc) · 1.88 KB
/
Console.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#pragma once
#include "skse64/ObScript.h"
namespace Tralala
{
void ConsoleGetAddresses();
class ConsoleManager
{
public:
static ConsoleManager* GetSingleton();
void VPrint(const char* fmt, va_list args);
};
void Console_Print(const char* fmt, ...);
// 0C
struct ObScriptParam
{
const char* typeStr; // 00
UInt32 typeID; // 04
UInt32 isOptional; // 08
};
typedef bool (*ObScript_Execute)(void* paramInfo, void* scriptData, TESObjectREFR* thisObj, void* containingObj, void* scriptObj, void* locals, double* result, void* opcodeOffsetPtr);
// 50
struct ObScriptCommand
{
struct Chunk
{
};
struct StringChunk : public Chunk
{
UInt16 length; // 00
char str[1]; // 02
std::string GetString() const
{
return std::string(str, length);
}
Chunk* GetNext()
{
UInt16 len = *(UInt16*)this;
return (Chunk*)(str + length);
}
};
struct IntegerChunk : public Chunk
{
char unk00; // 00
int value; // 01
int GetInteger() const
{
return *(int*)((char*)this + 1);
}
Chunk* GetNext()
{
UInt16 len = *(UInt16*)this;
return (Chunk*)(this + 1);
}
};
struct ScriptData
{
UInt16 opcode; // 00
UInt16 chunkSize; // 02
UInt16 numParams; // 04
Chunk* GetChunk()
{
return (Chunk*)((uintptr_t)this + 6);
}
UInt16 strLen; // 06
char str[1]; // 08
};
const char* longName; // 00
const char* shortName; // 08
UInt32 opcode; // 10
UInt32 pad14; // 14
const char* helpText; // 18
UInt8 needsParent; // 20
UInt8 pad21; // 21
UInt16 numParams; // 22
UInt32 pad24; // 24
ObScriptParam* params; // 28
// handlers
ObScript_Execute execute; // 30
void* parse; // 38
void* eval; // 40
UInt32 flags; // 48
UInt32 pad4C; // 4C
};
}
namespace ConsoleCommand
{
void GetAddress();
void Register();
}