about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2025-03-08 16:13:23 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2025-03-08 16:13:23 -0500
commit5436dc4f12671d2605944bed03e1f8ab7853056c (patch)
tree3fdd1348a988435e323fe3abfe134e1fab610e6a /src
parent49c45e69febb321d6d5787f9056771bebfb01eec (diff)
downloadlingo-ap-tracker-5436dc4f12671d2605944bed03e1f8ab7853056c.tar.gz
lingo-ap-tracker-5436dc4f12671d2605944bed03e1f8ab7853056c.tar.bz2
lingo-ap-tracker-5436dc4f12671d2605944bed03e1f8ab7853056c.zip
Added options pane
Diffstat (limited to 'src')
-rw-r--r--src/ap_state.cpp15
-rw-r--r--src/ap_state.h6
-rw-r--r--src/options_pane.cpp71
-rw-r--r--src/options_pane.h19
-rw-r--r--src/tracker_frame.cpp5
-rw-r--r--src/tracker_frame.h2
6 files changed, 118 insertions, 0 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 01ee065..c3e7f5b 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp
@@ -71,6 +71,7 @@ struct APState {
71 DoorShuffleMode door_shuffle_mode = kNO_DOORS; 71 DoorShuffleMode door_shuffle_mode = kNO_DOORS;
72 bool group_doors = false; 72 bool group_doors = false;
73 bool color_shuffle = false; 73 bool color_shuffle = false;
74 PanelShuffleMode panel_shuffle_mode = kNO_PANELS;
74 bool painting_shuffle = false; 75 bool painting_shuffle = false;
75 int mastery_requirement = 21; 76 int mastery_requirement = 21;
76 int level_2_requirement = 223; 77 int level_2_requirement = 223;
@@ -133,6 +134,7 @@ struct APState {
133 door_shuffle_mode = kNO_DOORS; 134 door_shuffle_mode = kNO_DOORS;
134 group_doors = false; 135 group_doors = false;
135 color_shuffle = false; 136 color_shuffle = false;
137 panel_shuffle_mode = kNO_PANELS;
136 painting_shuffle = false; 138 painting_shuffle = false;
137 painting_mapping.clear(); 139 painting_mapping.clear();
138 painting_codomain.clear(); 140 painting_codomain.clear();
@@ -469,6 +471,7 @@ struct APState {
469 } 471 }
470 } 472 }
471 color_shuffle = slot_data["shuffle_colors"].get<int>() == 1; 473 color_shuffle = slot_data["shuffle_colors"].get<int>() == 1;
474 panel_shuffle_mode = slot_data["shuffle_panels"].get<PanelShuffleMode>();
472 painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1; 475 painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1;
473 mastery_requirement = slot_data["mastery_achievements"].get<int>(); 476 mastery_requirement = slot_data["mastery_achievements"].get<int>();
474 level_2_requirement = slot_data["level_2_requirement"].get<int>(); 477 level_2_requirement = slot_data["level_2_requirement"].get<int>();
@@ -762,6 +765,12 @@ int AP_GetLevel2Requirement() {
762 return GetState().level_2_requirement; 765 return GetState().level_2_requirement;
763} 766}
764 767
768LocationChecks AP_GetLocationsChecks() {
769 std::lock_guard state_guard(GetState().state_mutex);
770
771 return GetState().location_checks;
772}
773
765bool AP_IsLocationVisible(int classification) { 774bool AP_IsLocationVisible(int classification) {
766 std::lock_guard state_guard(GetState().state_mutex); 775 std::lock_guard state_guard(GetState().state_mutex);
767 776
@@ -789,6 +798,12 @@ bool AP_IsLocationVisible(int classification) {
789 return (world_state & classification); 798 return (world_state & classification);
790} 799}
791 800
801PanelShuffleMode AP_GetPanelShuffleMode() {
802 std::lock_guard state_guard(GetState().state_mutex);
803
804 return GetState().panel_shuffle_mode;
805}
806
792VictoryCondition AP_GetVictoryCondition() { 807VictoryCondition AP_GetVictoryCondition() {
793 std::lock_guard state_guard(GetState().state_mutex); 808 std::lock_guard state_guard(GetState().state_mutex);
794 809
diff --git a/src/ap_state.h b/src/ap_state.h index 8b8db03..298df8c 100644 --- a/src/ap_state.h +++ b/src/ap_state.h
@@ -26,6 +26,8 @@ enum LocationChecks {
26 kPANELSANITY = 2 26 kPANELSANITY = 2
27}; 27};
28 28
29enum PanelShuffleMode { kNO_PANELS = 0, kREARRANGE_PANELS = 1 };
30
29enum SunwarpAccess { 31enum SunwarpAccess {
30 kSUNWARP_ACCESS_NORMAL = 0, 32 kSUNWARP_ACCESS_NORMAL = 0,
31 kSUNWARP_ACCESS_DISABLED = 1, 33 kSUNWARP_ACCESS_DISABLED = 1,
@@ -88,8 +90,12 @@ int AP_GetMasteryRequirement();
88 90
89int AP_GetLevel2Requirement(); 91int AP_GetLevel2Requirement();
90 92
93LocationChecks AP_GetLocationsChecks();
94
91bool AP_IsLocationVisible(int classification); 95bool AP_IsLocationVisible(int classification);
92 96
97PanelShuffleMode AP_GetPanelShuffleMode();
98
93VictoryCondition AP_GetVictoryCondition(); 99VictoryCondition AP_GetVictoryCondition();
94 100
95bool AP_HasAchievement(const std::string& achievement_name); 101bool AP_HasAchievement(const std::string& achievement_name);
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
5namespace {
6
7const char* kDoorShuffleLabels[] = {"None", "Panels", "Doors"};
8const char* kLocationChecksLabels[] = {"Normal", "Reduced", "Insanity"};
9const char* kPanelShuffleLabels[] = {"None", "Rearrange"};
10const char* kVictoryConditionLabels[] = {"The End", "The Master", "Level 2",
11 "Pilgrimage"};
12const char* kSunwarpAccessLabels[] = {"Normal", "Disabled", "Unlock",
13 "Individual", "Progressive"};
14
15void 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
24OptionsPane::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
47void 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}
diff --git a/src/options_pane.h b/src/options_pane.h new file mode 100644 index 0000000..e9df9f0 --- /dev/null +++ b/src/options_pane.h
@@ -0,0 +1,19 @@
1#ifndef OPTIONS_PANE_H_026A0EC0
2#define OPTIONS_PANE_H_026A0EC0
3
4#include <wx/wxprec.h>
5
6#ifndef WX_PRECOMP
7#include <wx/wx.h>
8#endif
9
10#include <wx/dataview.h>
11
12class OptionsPane : public wxDataViewListCtrl {
13 public:
14 explicit OptionsPane(wxWindow* parent);
15
16 void OnConnect();
17};
18
19#endif /* end of include guard: OPTIONS_PANE_H_026A0EC0 */
diff --git a/src/tracker_frame.cpp b/src/tracker_frame.cpp index 0ab043d..2e7a7d7 100644 --- a/src/tracker_frame.cpp +++ b/src/tracker_frame.cpp
@@ -18,6 +18,7 @@
18#include "ipc_dialog.h" 18#include "ipc_dialog.h"
19#include "ipc_state.h" 19#include "ipc_state.h"
20#include "items_pane.h" 20#include "items_pane.h"
21#include "options_pane.h"
21#include "paintings_pane.h" 22#include "paintings_pane.h"
22#include "settings_dialog.h" 23#include "settings_dialog.h"
23#include "subway_map.h" 24#include "subway_map.h"
@@ -127,6 +128,9 @@ TrackerFrame::TrackerFrame()
127 items_pane_ = new ItemsPane(choicebook); 128 items_pane_ = new ItemsPane(choicebook);
128 choicebook->AddPage(items_pane_, "Items"); 129 choicebook->AddPage(items_pane_, "Items");
129 130
131 options_pane_ = new OptionsPane(choicebook);
132 choicebook->AddPage(options_pane_, "Options");
133
130 paintings_pane_ = new PaintingsPane(choicebook); 134 paintings_pane_ = new PaintingsPane(choicebook);
131 choicebook->AddPage(paintings_pane_, "Paintings"); 135 choicebook->AddPage(paintings_pane_, "Paintings");
132 136
@@ -301,6 +305,7 @@ void TrackerFrame::OnStateReset(wxCommandEvent &event) {
301 tracker_panel_->UpdateIndicators(); 305 tracker_panel_->UpdateIndicators();
302 achievements_pane_->UpdateIndicators(); 306 achievements_pane_->UpdateIndicators();
303 items_pane_->ResetIndicators(); 307 items_pane_->ResetIndicators();
308 options_pane_->OnConnect();
304 paintings_pane_->ResetIndicators(); 309 paintings_pane_->ResetIndicators();
305 subway_map_->OnConnect(); 310 subway_map_->OnConnect();
306 if (panels_panel_ != nullptr) { 311 if (panels_panel_ != nullptr) {
diff --git a/src/tracker_frame.h b/src/tracker_frame.h index e7a3958..3bf0753 100644 --- a/src/tracker_frame.h +++ b/src/tracker_frame.h
@@ -15,6 +15,7 @@
15 15
16class AchievementsPane; 16class AchievementsPane;
17class ItemsPane; 17class ItemsPane;
18class OptionsPane;
18class PaintingsPane; 19class PaintingsPane;
19class SubwayMap; 20class SubwayMap;
20class TrackerPanel; 21class TrackerPanel;
@@ -108,6 +109,7 @@ class TrackerFrame : public wxFrame {
108 TrackerPanel *tracker_panel_; 109 TrackerPanel *tracker_panel_;
109 AchievementsPane *achievements_pane_; 110 AchievementsPane *achievements_pane_;
110 ItemsPane *items_pane_; 111 ItemsPane *items_pane_;
112 OptionsPane *options_pane_;
111 PaintingsPane *paintings_pane_; 113 PaintingsPane *paintings_pane_;
112 SubwayMap *subway_map_; 114 SubwayMap *subway_map_;
113 TrackerPanel *panels_panel_ = nullptr; 115 TrackerPanel *panels_panel_ = nullptr;