-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMainScript.h
159 lines (149 loc) · 4.65 KB
/
MainScript.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
//---------------------------------------------------------------------------
#ifndef MainScriptH
#define MainScriptH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ExtCtrls.hpp>
#include <pngimage.hpp>
#include <CheckLst.hpp>
#include "cspin.h"
#include <vector>
//---------------------------------------------------------------------------
enum PATCH_TYPE
{
PT_FPS = 1,
PT_STAMINA,
PT_ALWAYS_LIGHT,
PT_PAPERDOLL_SLOTS,
PT_SPLASH_SCREEN,
PT_RESOLUTION,
PT_OPTIONS_NOTIFICATION,
PT_MULTI_UO,
PT_NO_CRYPT,
PT_GLOBAL_SOUND,
PT_VIEW_RANGE,
PT_GM_STEP,
PT_COUNT
};
//---------------------------------------------------------------------------
enum PATCH_STATE
{
PS_DISABLE = 0,
PS_ENABLE,
PS_NOT_FOUND
};
//---------------------------------------------------------------------------
enum PATCH_MESSAGES
{
PM_INSTALL = WM_USER + 666,
PM_INFO,
PM_ENABLE,
PM_DISABLE,
PM_VIEW_RANGE_VALUE
};
//---------------------------------------------------------------------------
typedef DWORD __cdecl GET_FILE_PATCHES_FUN(const char*);
typedef DWORD __cdecl SET_FILE_PATCHES_FUN(const char*, DWORD, int);
//---------------------------------------------------------------------------
class TPatcher : public TForm
{
__published: // IDE-managed Components
TListBox *lb_ClientList;
TLabel *Label1;
TPageControl *pc_Main;
TTabSheet *ts_PatchMemory;
TTabSheet *ts_PatchFile;
TButton *bt_SetClientPatch;
TOpenDialog *od_ClientPath;
TEdit *eb_ClientPath;
TGroupBox *GroupBox1;
TCheckBox *cb_FPS;
TCheckBox *cb_Stamina;
TCheckBox *cb_AlwaysLight;
TCheckBox *cb_PaperdollSlots;
TGroupBox *gb_OrionInfo;
TLabel *lb_OrionGitHub;
TLabel *lb_OrionDiscord;
TLabel *lb_OrionForum;
TImage *img_Refresh;
TLabel *lb_TextFPS;
TLabel *lb_TextStamina;
TLabel *lb_TextAlwaysLight;
TLabel *lb_TextPaperdollSlots;
TTimer *tm_Creation;
TGroupBox *GroupBox2;
TLabel *lb_FileTextStamina;
TLabel *lb_FileTextAlwaysLight;
TLabel *lb_FileTextPaperdollSlots;
TCheckBox *cb_FileStamina;
TCheckBox *cb_FileAlwaysLight;
TCheckBox *cb_FilePaperdollSlots;
TButton *bt_ClientPatch;
TImage *img_RefreshFilePatches;
TCheckBox *cb_FileSplashScreen;
TLabel *lb_FileTextSplashScreen;
TLabel *Label2;
TLabel *lb_FileTextResolution;
TCheckBox *cb_FileResolution;
TLabel *lb_FileTextOptionsNotification;
TCheckBox *cb_FileOptionsNotification;
TLabel *lb_TextOptionsNotification;
TCheckBox *cb_OptionsNotification;
TLabel *lb_FileTextMultiUO;
TCheckBox *cb_FileMultiUO;
TCheckBox *cb_FileNoCrypt;
TLabel *lb_FileTextNoCrypt;
TLabel *lb_FileTextGlobalSound;
TCheckBox *cb_FileGlobalSound;
TCheckBox *cb_ViewRange;
TLabel *lb_TextViewRange;
TCheckBox *cb_FileViewRange;
TLabel *lb_FileTextViewRange;
TCSpinEdit *se_ViewRange;
TCSpinEdit *se_FileViewRange;
TCheckBox *cb_GMStep;
TLabel *lb_TextGMStep;
TCheckBox *cb_FileGMStep;
TLabel *lb_FileTextGMStep;
void __fastcall eb_ClientPathKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall bt_SetClientPatchClick(TObject *Sender);
void __fastcall lb_OrionGitHubClick(TObject *Sender);
void __fastcall lb_ClientListClick(TObject *Sender);
void __fastcall img_RefreshClick(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall RuntimePatchClickProc(TObject *Sender);
void __fastcall TextLabelRuntimePatckClickProc(TObject *Sender);
void __fastcall FileTextLabelRuntimePatckClickProc(TObject *Sender);
void __fastcall tm_CreationTimer(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
void __fastcall img_RefreshFilePatchesClick(TObject *Sender);
void __fastcall bt_ClientPatchClick(TObject *Sender);
private: // User declarations
std::vector<HWND> m_ClientList;
TCheckBox *m_CheckboxList[PT_COUNT - 1];
TLabel *m_LabelsList[PT_COUNT - 1];
HMODULE m_Dll;
TCheckBox *m_FileCheckboxList[PT_COUNT - 1];
TLabel *m_FileLabelsList[PT_COUNT - 1];
void DisableRuntimePatches();
void DisableFilePatches();
void SetCheckStateNoProcess(TCheckBox *object, const bool &state);
public: // User declarations
__fastcall TPatcher(TComponent* Owner);
void __fastcall OnMessagePathInfo(TMessage &Message);
void __fastcall OnMessagePathViewRange(TMessage &Message);
#pragma warn -inl
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(PM_INFO, TMessage, OnMessagePathInfo)
MESSAGE_HANDLER(PM_VIEW_RANGE_VALUE, TMessage, OnMessagePathViewRange)
END_MESSAGE_MAP(TForm)
};
//---------------------------------------------------------------------------
extern PACKAGE TPatcher *Patcher;
//---------------------------------------------------------------------------
#endif