Finish edit terrain type dialog in the editor and tweak some terrain properties

- Introduce enum for step sounds
- Remove union for treating terrain flags as either signed or unsigned
Editor:
- Add Choose button to select the "transform to" terrain.
- Implement Choose buttons as appropriate for the terrain flags, including editing the special that a terrain calls.
- Range-check the terrain flags.
- Add Custom button to choose a town as the combat arena.
- Fix/tweak/improve several of the terrain flag prompts.
- Fix placing shortcut key in field as its ASCII code instead of the letter
- Fix some of the range checks that were already in place but were incorrect or improperly static
Game:
- The wilderness terrain types now allow specifying how many d6's of food you get when hunting there.
- Crumbling terrain uses flag 2 instead of 3 to determine method (flag 2 was supposed to be strength but was never used)
- Merge two functions that did almost exactly the same thing (namely altering a terrain space and potentially updating conveyor/lights info)
- Merge switch_level into handle_lever since it was the only place it was called
- Remove global store_special_loc; the location is stored in the stuff_done array now
- Change when use/step on terrains will now update lighting if they changed to a terrain with a different light level
- Terrains that call a special no longer support mixed global/local modes - they either always call a local special or always call a global special
- Use previously unused swap_ter function (which did the exact same thing as the swap terrain special node)
Dialog Engine:
- Don't "erase" invisible icons or buttons; it's not necessary, since the entire window is filled with background before the draw() method is called, and it causes problems in case of overlapping elements.
This commit is contained in:
2015-01-28 15:43:58 -05:00
parent 92a20b1c67
commit a23682306c
29 changed files with 431 additions and 317 deletions

View File

@@ -583,19 +583,17 @@ void swap_ter(short i,short j,ter_num_t ter1,ter_num_t ter2) {
}
void alter_space(short i,short j,ter_num_t ter) {
location l;
l.x = i;
l.y = j;
if(is_out()) {
location l(i,j);
l = local_to_global(l);
univ.out[l.x][l.y] = ter;
univ.out->terrain[i][j] = ter;
}
else {
} else {
ter_num_t former = univ.town->terrain(i,j);
univ.town->terrain(i,j) = ter;
if(univ.scenario.ter_types[univ.town->terrain(i,j)].special == eTerSpec::CONVEYOR)
if(univ.scenario.ter_types[ter].special == eTerSpec::CONVEYOR)
univ.town.belt_present = true;
if(univ.scenario.ter_types[former].light_radius != univ.scenario.ter_types[ter].light_radius)
univ.town->set_up_lights();
}
}