#pragma once #include "lab/dialogs/lab_dialog.h" template struct lab_flag { Checkbox* cb; T flag; }; class Options : public LabDialog { // Called when this dialog is opened via the top toolbar void open(Button* /*caller*/) override; // Called when the dialog is closed void close() override { if (dialogWindow != nullptr) { dialogWindow->DeleteChildren(); dialogWindow = nullptr; } } // Called when the global state changes (e.g. other ship/weapon being selected) void update(LabMode newLabMode, int classIndex) override; // Returns the string to use for the top nav bar SCP_string getTitle() override { return "Class Options"; } // Returns true if it is safe to open this dialog bool safeToOpen(LabMode labMode) override { return labMode == LabMode::Ship || labMode == LabMode::Weapon; } private: DialogWindow* dialogWindow; SCP_vector> Ship_Class_Flags; SCP_vector> Weapon_Class_Flags; template void addFlags(int* const X, int* const Y, const char* flag_name, T flag, SCP_vector>& flag_list); };