64 if (str ==
"locked") {
70 if (str ==
"optimize") {
75 std::string lower_str = str;
76 std::ranges::transform(
77 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
80 if (lower_str ==
"locked") {
84 if (lower_str ==
"patch") {
88 if (lower_str ==
"optimize") {
115 panic(
"unhandled ArtifactEditMode value");
134 constexpr auto parse(std::format_parse_context &ctx)
std::optional< ArtifactEditMode > artifact_edit_mode_from_str(const std::string &str)
Parses a string into a ArtifactEditMode with fuzzy matching.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
ArtifactEditMode
Specifies whether artifacts (tiles or palettes) can be modified during patch compilation.
@ locked
Artifacts cannot be edited; must use existing from base tileset.
@ optimize
The Porytiles1 behavior; artifact is cleared and packed optimally.
@ patch
Artifacts can be freely edited in "open" slots during compilation.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.