-
Notifications
You must be signed in to change notification settings - Fork 1
/
StateSingleplayer.h
79 lines (76 loc) · 3.59 KB
/
StateSingleplayer.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
#pragma once
#include "4dm.h"
namespace fdm
{
class StateSingleplayer : public State
{
public:
inline static StateSingleplayer* instanceObj = reinterpret_cast<StateSingleplayer*>((base + 0x2C0BE0));
bool updateViewFlag; // 0x8
PAD(0x7);
FontRenderer font; // 0x10
QuadRenderer qr; // 0xB0
Shader* qs; // 0xD8
gui::Interface ui; // 0xE0
gui::Button createButton; // 0x148
gui::Button cancelButton; // 0x1A0
gui::ContentBox worldListContainer; // 0x1F8
gui::Text yourWorlds; // 0x278
gui::Text noWorlds; // 0x2D0
std::vector<gui::Button> worldButtons; // 0x328
std::vector<stl::string> worldPaths; // 0x340
bool shouldLoadWorld; // 0x358
void mouseButtonInput(StateManager& s, int button, int action, int mods) override
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, StateManager& s, int button, int action, int mods)>(getFuncAddr((int)Func::StateSingleplayer::mouseButtonInput))(this, s, button, action, mods);
}
void updateProjection(const glm::ivec2& size, const glm::ivec2& translate2D)
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, const glm::ivec2& size, const glm::ivec2& translate2D)>(getFuncAddr((int)Func::StateSingleplayer::updateProjection))(this, size, translate2D);
}
StateSingleplayer()
{
reinterpret_cast<void(__thiscall*)(StateSingleplayer* self)>(getFuncAddr((int)Func::StateSingleplayer::StateSingleplayer))(this);
}
void updateWorldListContainer(int wWidth, int wHeight)
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, int wWidth, int wHeight)>(getFuncAddr((int)Func::StateSingleplayer::updateWorldListContainer))(this, wWidth, wHeight);
}
inline static void createCallback(void* user)
{
return reinterpret_cast<void (__fastcall*)(void* user)>(getFuncAddr((int)Func::StateSingleplayer::createCallback))(user);
}
inline static void viewportCallback(void* user, const glm::ivec4& pos, const glm::ivec2& scroll)
{
return reinterpret_cast<void (__fastcall*)(void* user, const glm::ivec4& pos, const glm::ivec2& scroll)>(getFuncAddr((int)Func::StateSingleplayer::viewportCallback))(user, pos, scroll);
}
inline static void worldButtonCallback(void* user)
{
return reinterpret_cast<void (__fastcall*)(void* user)>(getFuncAddr((int)Func::StateSingleplayer::worldButtonCallback))(user);
}
void init(StateManager& s) override
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, StateManager& s)>(getFuncAddr((int)Func::StateSingleplayer::init))(this, s);
}
void close(StateManager& s) override
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, StateManager& s)>(getFuncAddr((int)Func::StateSingleplayer::close))(this, s);
}
void update(StateManager& s, double dt) override
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, StateManager& s, double dt)>(getFuncAddr((int)Func::StateSingleplayer::update))(this, s, dt);
}
void resume(StateManager& s) override
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, StateManager& s)>(getFuncAddr((int)Func::StateSingleplayer::resume))(this, s);
}
void windowResize(StateManager& s, int width, int height) override
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, StateManager& s, int width, int height)>(getFuncAddr((int)Func::StateSingleplayer::windowResize))(this, s, width, height);
}
void queueWorldLoad(stl::string& path)
{
return reinterpret_cast<void (__thiscall*)(StateSingleplayer* self, stl::string& path)>(getFuncAddr((int)Func::StateSingleplayer::queueWorldLoad))(this, path);
}
};
}