From 5436dc4f12671d2605944bed03e1f8ab7853056c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 8 Mar 2025 16:13:23 -0500 Subject: Added options pane --- src/options_pane.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/options_pane.cpp (limited to 'src/options_pane.cpp') 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 @@ +#include "options_pane.h" + +#include "ap_state.h" + +namespace { + +const char* kDoorShuffleLabels[] = {"None", "Panels", "Doors"}; +const char* kLocationChecksLabels[] = {"Normal", "Reduced", "Insanity"}; +const char* kPanelShuffleLabels[] = {"None", "Rearrange"}; +const char* kVictoryConditionLabels[] = {"The End", "The Master", "Level 2", + "Pilgrimage"}; +const char* kSunwarpAccessLabels[] = {"Normal", "Disabled", "Unlock", + "Individual", "Progressive"}; + +void AddRow(wxDataViewListCtrl* list, const std::string& text) { + wxVector data; + data.push_back(wxVariant{text + ": "}); + data.push_back(wxVariant{""}); + list->AppendItem(data); +} + +} // namespace + +OptionsPane::OptionsPane(wxWindow* parent) + : wxDataViewListCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, + wxDV_ROW_LINES) { + AppendTextColumn("Name", wxDATAVIEW_CELL_INERT, wxCOL_WIDTH_AUTOSIZE); + AppendTextColumn("Value"); + AddRow(this, "Shuffle Doors"); + AddRow(this, "Group Doors"); + AddRow(this, "Location Checks"); + AddRow(this, "Shuffle Colors"); + AddRow(this, "Shuffle Panels"); + AddRow(this, "Shuffle Paintings"); + AddRow(this, "Victory Condition"); + AddRow(this, "Early Color Hallways"); + AddRow(this, "Shuffle Postgame"); + AddRow(this, "Enable Pilgrimage"); + AddRow(this, "Pilgrimage Roof Access"); + AddRow(this, "Pilgrimage Paintings"); + AddRow(this, "Sunwarp Access"); + AddRow(this, "Shuffle Sunwarps"); + AddRow(this, "Mastery Achievements"); + AddRow(this, "Level 2 Requirement"); +} + +void OptionsPane::OnConnect() { + SetTextValue(kDoorShuffleLabels[static_cast(AP_GetDoorShuffleMode())], + 0, 1); + SetTextValue(AP_AreDoorsGrouped() ? "Yes" : "No", 1, 1); + SetTextValue( + kLocationChecksLabels[static_cast(AP_GetLocationsChecks())], 2, + 1); + SetTextValue(AP_IsColorShuffle() ? "Yes" : "No", 3, 1); + SetTextValue( + kPanelShuffleLabels[static_cast(AP_GetPanelShuffleMode())], 4, 1); + SetTextValue(AP_IsPaintingShuffle() ? "Yes" : "No", 5, 1); + SetTextValue( + kVictoryConditionLabels[static_cast(AP_GetVictoryCondition())], 6, + 1); + SetTextValue(AP_HasEarlyColorHallways() ? "Yes" : "No", 7, 1); + SetTextValue(AP_IsPostgameShuffle() ? "Yes" : "No", 8, 1); + SetTextValue(AP_IsPilgrimageEnabled() ? "Yes" : "No", 9, 1); + SetTextValue(AP_DoesPilgrimageAllowRoofAccess() ? "Yes" : "No", 10, 1); + SetTextValue(AP_DoesPilgrimageAllowPaintings() ? "Yes" : "No", 11, 1); + SetTextValue(kSunwarpAccessLabels[static_cast(AP_GetSunwarpAccess())], + 12, 1); + SetTextValue(AP_IsSunwarpShuffle() ? "Yes" : "No", 13, 1); + SetTextValue(std::to_string(AP_GetMasteryRequirement()), 14, 1); + SetTextValue(std::to_string(AP_GetLevel2Requirement()), 15, 1); +} -- cgit 1.4.1