Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/DAILY_FACTION_BULK_CLAIM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Daily faction bulk-claim configuration

`ui.daily_bulk_claim_factions` defaults explicitly to `"federation,klingon,romulan"`.

| Config value | Main-faction dailies eligible for bulk claim |
| --- | --- |
| Missing, empty or whitespace-only | The default: all three factions |
| `"federation,romulan"` | Federation and Romulan |
| `"none"` | None of the three |

Other dailies remain eligible. Use `none` by itself. Restart after editing TOML.

On upgrade, existing blank configurations keep their all-factions behavior.
The loader now resolves blank to the explicit default before populating the
runtime faction list and generated configuration values. `none` is a new explicit
opt-out; it does not share the blank/default representation.
4 changes: 2 additions & 2 deletions example_community_patch_settings_en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,8 @@ extend_chest_purchase_max = 160
# Subgroup: Daily Goals
# ---------------------

# Comma-separated factions (federation, klingon, romulan) for which the Daily Goals bulk-claim toggle applies; leave blank to preserve the game's default behaviour
daily_bulk_claim_factions = ""
# Comma-separated factions for Daily Goals bulk claim. Missing or blank uses the default below; "none" skips all three main-faction dailies. Other dailies remain eligible.
daily_bulk_claim_factions = "federation,klingon,romulan"

# Force the Daily Goals Claim All toggle back on the first time the screen is shown each session
daily_bulk_claim_toggle_default_on = false
Expand Down
24 changes: 19 additions & 5 deletions mods/src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,21 @@ void parse_faction_filter(std::string_view value, std::vector<std::string>& fact
static constexpr std::array kKnownFactions{"federation", "klingon", "romulan"};

factions.clear();
bool none = false;
for (const auto& token : StrSplit(std::string(value), ',')) {
const auto stripped = StripAsciiWhitespace(token);
if (stripped.empty()) continue;
if (stripped.empty())
continue;

auto lowered = AsciiStrToLower(stripped);
auto lowered = AsciiStrToLower(std::string(stripped));

if (lowered == "none") {
none = true;
continue;
}
if (std::ranges::find(kKnownFactions, lowered) == kKnownFactions.end()) {
spdlog::warn("Unrecognised faction '{}' in daily_bulk_claim_factions; expected one of: federation, klingon, "
"romulan. Ignoring.",
"romulan, or none by itself. Ignoring.",
stripped);
continue;
}
Expand All @@ -612,13 +618,21 @@ void parse_faction_filter(std::string_view value, std::vector<std::string>& fact
factions.emplace_back(std::move(lowered));
}
}
if (none) {
if (!factions.empty())
spdlog::warn("daily_bulk_claim_factions: none overrides named factions; use none by itself.");
factions = {"none"};
}
}

void read_daily_bulk_claim_factions(toml::table& config, toml::table& new_config, std::vector<std::string>& factions,
std::string_view default_value, bool write_log)
{
const auto value =
config["ui"]["daily_bulk_claim_factions"].value<std::string>().value_or(std::string(default_value));
auto value = config["ui"]["daily_bulk_claim_factions"].value<std::string>().value_or(std::string(default_value));
// Blank has the same meaning as an omitted setting. Materialize the default
// for both gameplay and generated config values; none is the explicit opt-out.
if (StripAsciiWhitespace(value).empty())
value = std::string(default_value);
parse_faction_filter(value, factions);

new_config.emplace<toml::table>("ui", toml::table());
Expand Down
2 changes: 1 addition & 1 deletion mods/src/defaultconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ namespace UI
constexpr bool auto_confirm_ft_upgrade = false;
constexpr bool auto_confirm_reveal_ability = false;
constexpr bool auto_open_bulk_claim_flyout = false;
constexpr const char* daily_bulk_claim_factions = "";
constexpr const char* daily_bulk_claim_factions = "federation,klingon,romulan";
constexpr bool daily_bulk_claim_toggle_default_on = false;
constexpr bool only_show_first_popup = false;
constexpr bool disable_escape_exit = true;
Expand Down
Loading