52 if (str ==
"locked") {
58 if (str ==
"optimize") {
63 std::string lower_str = str;
64 std::ranges::transform(
65 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
68 if (lower_str ==
"locked") {
72 if (lower_str ==
"patch") {
76 if (lower_str ==
"optimize") {
101 panic(
"unhandled ArtifactEditMode value");
118 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.