Skip to content

Commit

Permalink
Map catalogue: "Playable" tick
Browse files Browse the repository at this point in the history
  • Loading branch information
geneotech committed Jul 30, 2024
1 parent 24df487 commit 033e891
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/application/gui/headless_map_catalogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct map_catalogue_entry {
std::string author;
std::string short_description;
version_timestamp_string version_timestamp;
bool playable = true;
// END GEN INTROSPECTOR

mutable std::optional<std::string> version_on_disk;
Expand Down
8 changes: 8 additions & 0 deletions src/application/gui/map_catalogue_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ void map_catalogue_gui_state::perform_list(const map_catalogue_input in) {
const auto arena_name = entry.name;
const auto arena_folder_path = downloads_directory / arena_name;

if (only_playable && !entry.playable) {
entry.passed_filter = false;
return;
}

if (filter.IsActive() && !filter.PassFilter(arena_name.c_str()) && !filter.PassFilter(entry.author.c_str())) {
entry.passed_filter = false;
return;
Expand Down Expand Up @@ -558,6 +563,9 @@ bool map_catalogue_gui_state::perform(const map_catalogue_input in) {
if (ImGui::Button("Refresh")) {
refresh(in.external_arena_files_provider);
}

ImGui::SameLine();
ImGui::Checkbox("Only playable", &only_playable);
}

if (headless.list_refresh_in_progress()) {
Expand Down
1 change: 1 addition & 0 deletions src/application/gui/map_catalogue_gui.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class map_catalogue_gui_state : public standard_window_mixin<map_catalogue_gui_s
bool refresh_in_progress() const;

bool launch_download_on_last_selected = false;
bool only_playable = true;


public:
Expand Down
2 changes: 1 addition & 1 deletion src/application/gui/settings_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@ void settings_gui_state::perform(
revertable_checkbox("Show performance", config.session.show_performance);
revertable_checkbox("Show logs", config.session.show_logs);
revertable_checkbox("Log keystrokes", config.window.log_keystrokes);
#if PLATFORM_WEB
#if PLATFORM_WEB || !IS_PRODUCTION_BUILD
revertable_checkbox("Suppress client webhooks", config.client.suppress_webhooks);
#endif
revertable_slider("Camera query aabb mult", config.session.camera_query_aabb_mult, 0.10f, 5.f);
Expand Down

0 comments on commit 033e891

Please sign in to comment.