-
Notifications
You must be signed in to change notification settings - Fork 3
/
mods.h
58 lines (44 loc) · 1.36 KB
/
mods.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
#pragma once
#include <map>
#include <string>
#include <functional>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Button.H>
#include "patches.h"
#include "patch_group.h"
#include "derandom.h"
#include "shop_contents_patch.h"
#include "custom_hud.h"
#include "seeder.h"
#include "game_hooks.h"
#define BUTTON_CLASS(NAME) \
class NAME : public Fl_Button { \
public: \
NAME(int x, int y, int w, int h, char* L) : Fl_Button(x,y,w,h,L) {} \
virtual int handle(int evt) override; \
}
namespace Mods {
typedef std::function<void(bool)> visibility_callback;
BUTTON_CLASS(DoneButton);
class ModCheckbox : public Fl_Check_Button {
public:
std::string target;
public:
ModCheckbox(const std::string& target, int x, int y, int w, int h, const char* label);
};
class ShopItemCheckbox : public Fl_Check_Button {
public:
ItemID id;
public:
ShopItemCheckbox(ItemID id, int x, int y, int w, int h, const char* label);
};
BUTTON_CLASS(RemoveAIButton);
BUTTON_CLASS(AddAIButton);
std::shared_ptr<PatchGroup> ModsGroup();
void ShowModsGUI();
void HideModsGUI();
void SetVisibilityChangeCallback(visibility_callback cb);
void Initialize(std::shared_ptr<Seeder> seeder, std::shared_ptr<DerandomizePatch> dp, std::shared_ptr<GameHooks> gh, std::shared_ptr<CustomHudPatch> chp);
}
#undef BUTTON_CLASS
#undef CHECK_CLASS