Rework the special node button dictionary (#607)

This commit is contained in:
2025-02-19 20:22:06 -05:00
committed by Celtic Minstrel
parent 56bbdbc6f8
commit 4174ccd470
15 changed files with 999 additions and 297 deletions

View File

@@ -661,15 +661,8 @@ static bool edit_spec_enc_type(cDialog& me, std::string item_hit, node_stack_t&
else if(item_hit == "town") category = eSpecCat::TOWN;
else if(item_hit == "out") category = eSpecCat::OUTDOOR;
else if(item_hit == "rect") category = eSpecCat::RECT;
int start = -1, finish = -1, current = int(edit_stack.top().node.type);
for(int i = 0; i < std::numeric_limits<unsigned short>::max(); i++) {
eSpecCat check = (*eSpecType(i)).cat;
if(start >= 0 && check == eSpecCat::INVALID) {
finish = i - 1;
break;
} else if(check == category && start < 0)
start = i;
}
auto bounds = *category;
int start = int(bounds.first), finish = int(bounds.last), current = int(edit_stack.top().node.type);
if(start < 0 || finish < 0) return true;
std::vector<std::string> choices;
for(int i = start; i <= finish; i++) {