diff options
Diffstat (limited to 'src/options_pane.cpp')
| -rw-r--r-- | src/options_pane.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
| diff --git a/src/options_pane.cpp b/src/options_pane.cpp new file mode 100644 index 0000000..844e145 --- /dev/null +++ b/src/options_pane.cpp | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | #include "options_pane.h" | ||
| 2 | |||
| 3 | #include "ap_state.h" | ||
| 4 | |||
| 5 | namespace { | ||
| 6 | |||
| 7 | const char* kDoorShuffleLabels[] = {"None", "Panels", "Doors"}; | ||
| 8 | const char* kLocationChecksLabels[] = {"Normal", "Reduced", "Insanity"}; | ||
| 9 | const char* kPanelShuffleLabels[] = {"None", "Rearrange"}; | ||
| 10 | const char* kVictoryConditionLabels[] = {"The End", "The Master", "Level 2", | ||
| 11 | "Pilgrimage"}; | ||
| 12 | const char* kSunwarpAccessLabels[] = {"Normal", "Disabled", "Unlock", | ||
| 13 | "Individual", "Progressive"}; | ||
| 14 | |||
| 15 | void AddRow(wxDataViewListCtrl* list, const std::string& text) { | ||
| 16 | wxVector<wxVariant> data; | ||
| 17 | data.push_back(wxVariant{text + ": "}); | ||
| 18 | data.push_back(wxVariant{""}); | ||
| 19 | list->AppendItem(data); | ||
| 20 | } | ||
| 21 | |||
| 22 | } // namespace | ||
| 23 | |||
| 24 | OptionsPane::OptionsPane(wxWindow* parent) | ||
| 25 | : wxDataViewListCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, | ||
| 26 | wxDV_ROW_LINES) { | ||
| 27 | AppendTextColumn("Name", wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE); | ||
| 28 | AppendTextColumn("Value"); | ||
| 29 | AddRow(this, "Shuffle Doors"); | ||
| 30 | AddRow(this, "Group Doors"); | ||
| 31 | AddRow(this, "Location Checks"); | ||
| 32 | AddRow(this, "Shuffle Colors"); | ||
| 33 | AddRow(this, "Shuffle Panels"); | ||
| 34 | AddRow(this, "Shuffle Paintings"); | ||
| 35 | AddRow(this, "Victory Condition"); | ||
| 36 | AddRow(this, "Early Color Hallways"); | ||
| 37 | AddRow(this, "Shuffle Postgame"); | ||
| 38 | AddRow(this, "Enable Pilgrimage"); | ||
| 39 | AddRow(this, "Pilgrimage Roof Access"); | ||
| 40 | AddRow(this, "Pilgrimage Paintings"); | ||
| 41 | AddRow(this, "Sunwarp Access"); | ||
| 42 | AddRow(this, "Shuffle Sunwarps"); | ||
| 43 | AddRow(this, "Mastery Achievements"); | ||
| 44 | AddRow(this, "Level 2 Requirement"); | ||
| 45 | } | ||
| 46 | |||
| 47 | void OptionsPane::OnConnect() { | ||
| 48 | SetTextValue(kDoorShuffleLabels[static_cast<size_t>(AP_GetDoorShuffleMode())], | ||
| 49 | 0, 1); | ||
| 50 | SetTextValue(AP_AreDoorsGrouped() ? "Yes" : "No", 1, 1); | ||
| 51 | SetTextValue( | ||
| 52 | kLocationChecksLabels[static_cast<size_t>(AP_GetLocationsChecks())], 2, | ||
| 53 | 1); | ||
| 54 | SetTextValue(AP_IsColorShuffle() ? "Yes" : "No", 3, 1); | ||
| 55 | SetTextValue( | ||
| 56 | kPanelShuffleLabels[static_cast<size_t>(AP_GetPanelShuffleMode())], 4, 1); | ||
| 57 | SetTextValue(AP_IsPaintingShuffle() ? "Yes" : "No", 5, 1); | ||
| 58 | SetTextValue( | ||
| 59 | kVictoryConditionLabels[static_cast<size_t>(AP_GetVictoryCondition())], 6, | ||
| 60 | 1); | ||
| 61 | SetTextValue(AP_HasEarlyColorHallways() ? "Yes" : "No", 7, 1); | ||
| 62 | SetTextValue(AP_IsPostgameShuffle() ? "Yes" : "No", 8, 1); | ||
| 63 | SetTextValue(AP_IsPilgrimageEnabled() ? "Yes" : "No", 9, 1); | ||
| 64 | SetTextValue(AP_DoesPilgrimageAllowRoofAccess() ? "Yes" : "No", 10, 1); | ||
| 65 | SetTextValue(AP_DoesPilgrimageAllowPaintings() ? "Yes" : "No", 11, 1); | ||
| 66 | SetTextValue(kSunwarpAccessLabels[static_cast<size_t>(AP_GetSunwarpAccess())], | ||
| 67 | 12, 1); | ||
| 68 | SetTextValue(AP_IsSunwarpShuffle() ? "Yes" : "No", 13, 1); | ||
| 69 | SetTextValue(std::to_string(AP_GetMasteryRequirement()), 14, 1); | ||
| 70 | SetTextValue(std::to_string(AP_GetLevel2Requirement()), 15, 1); | ||
| 71 | } | ||
