2015-04-21 11:51:57 +00:00
|
|
|
struct CheatDatabase : Window {
|
|
|
|
CheatDatabase();
|
|
|
|
auto findCodes() -> void;
|
|
|
|
auto addCodes() -> void;
|
|
|
|
|
|
|
|
vector<string> codes;
|
|
|
|
|
|
|
|
VerticalLayout layout{this};
|
|
|
|
ListView cheatList{&layout, Size{~0, ~0}};
|
|
|
|
HorizontalLayout controlLayout{&layout, Size{~0, 0}};
|
|
|
|
Button selectAllButton{&controlLayout, Size{100, 0}};
|
|
|
|
Button unselectAllButton{&controlLayout, Size{100, 0}};
|
|
|
|
Widget spacer{&controlLayout, Size{~0, 0}};
|
|
|
|
Button addCodesButton{&controlLayout, Size{80, 0}};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CheatEditor : TabFrameItem {
|
|
|
|
enum : unsigned { Slots = 128 };
|
|
|
|
|
|
|
|
CheatEditor(TabFrame*);
|
2015-04-21 11:58:59 +00:00
|
|
|
auto doChangeSelected() -> void;
|
2015-04-21 11:51:57 +00:00
|
|
|
auto doModify() -> void;
|
|
|
|
auto doRefresh() -> void;
|
2015-04-21 11:58:59 +00:00
|
|
|
auto doReset(bool force = false) -> void;
|
2015-04-21 11:51:57 +00:00
|
|
|
auto doErase() -> void;
|
|
|
|
auto synchronizeCodes() -> void;
|
2015-04-21 11:58:59 +00:00
|
|
|
auto addCode(const string& code, const string& description, bool enabled = false) -> bool;
|
|
|
|
auto loadCheats() -> void;
|
|
|
|
auto saveCheats() -> void;
|
2015-04-21 11:51:57 +00:00
|
|
|
|
|
|
|
struct Cheat {
|
2015-04-21 11:58:59 +00:00
|
|
|
bool enabled = false;
|
2015-04-21 11:51:57 +00:00
|
|
|
string code;
|
|
|
|
string description;
|
|
|
|
};
|
|
|
|
Cheat cheats[Slots];
|
|
|
|
|
|
|
|
VerticalLayout layout{this};
|
|
|
|
ListView cheatList{&layout, Size{~0, ~0}};
|
|
|
|
HorizontalLayout codeLayout{&layout, Size{~0, 0}};
|
|
|
|
Label codeLabel{&codeLayout, Size{70, 0}};
|
|
|
|
LineEdit codeValue{&codeLayout, Size{~0, 0}};
|
|
|
|
HorizontalLayout descriptionLayout{&layout, Size{~0, 0}};
|
|
|
|
Label descriptionLabel{&descriptionLayout, Size{70, 0}};
|
|
|
|
LineEdit descriptionValue{&descriptionLayout, Size{~0, 0}};
|
|
|
|
HorizontalLayout controlLayout{&layout, Size{~0, 0}};
|
|
|
|
Button findCodesButton{&controlLayout, Size{120, 0}};
|
|
|
|
Widget spacer{&controlLayout, Size{~0, 0}};
|
|
|
|
Button resetButton{&controlLayout, Size{80, 0}};
|
|
|
|
Button eraseButton{&controlLayout, Size{80, 0}};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct StateManager : TabFrameItem {
|
|
|
|
enum : unsigned { Slots = 32 };
|
|
|
|
|
|
|
|
StateManager(TabFrame*);
|
|
|
|
auto doChange() -> void;
|
|
|
|
auto doRefresh() -> void;
|
|
|
|
auto doLabel() -> void;
|
|
|
|
auto doLoad() -> void;
|
|
|
|
auto doSave() -> void;
|
|
|
|
auto doReset() -> void;
|
|
|
|
auto doErase() -> void;
|
|
|
|
|
|
|
|
VerticalLayout layout{this};
|
|
|
|
ListView stateList{&layout, Size{~0, ~0}};
|
|
|
|
HorizontalLayout descriptionLayout{&layout, Size{~0, 0}};
|
|
|
|
Label descriptionLabel{&descriptionLayout, Size{70, 0}};
|
|
|
|
LineEdit descriptionValue{&descriptionLayout, Size{~0, 0}};
|
|
|
|
HorizontalLayout controlLayout{&layout, Size{~0, 0}};
|
|
|
|
Button saveButton{&controlLayout, Size{80, 0}};
|
|
|
|
Button loadButton{&controlLayout, Size{80, 0}};
|
|
|
|
Widget spacer{&controlLayout, Size{~0, 0}};
|
|
|
|
Button resetButton{&controlLayout, Size{80, 0}};
|
|
|
|
Button eraseButton{&controlLayout, Size{80, 0}};
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ToolsManager : Window {
|
|
|
|
ToolsManager();
|
|
|
|
auto show(unsigned tool) -> void;
|
|
|
|
|
|
|
|
VerticalLayout layout{this};
|
|
|
|
TabFrame panel{&layout, Size{~0, ~0}};
|
|
|
|
CheatEditor cheatEditor{&panel};
|
|
|
|
StateManager stateManager{&panel};
|
|
|
|
};
|
|
|
|
|
|
|
|
extern CheatDatabase* cheatDatabase;
|
|
|
|
extern ToolsManager* toolsManager;
|