Scenario editor initialize new town bounds/entrances
This commit is contained in:
@@ -94,6 +94,7 @@ public:
|
||||
std::vector<cTown*> towns;
|
||||
void addTown(size_t dim) {
|
||||
towns.push_back(new cTown(*this, dim));
|
||||
towns.back()->init_start();
|
||||
}
|
||||
|
||||
void import_legacy(legacy::scenario_data_type& old);
|
||||
|
@@ -81,10 +81,12 @@ cTown::cTown(cScenario& scenario, size_t dim) : cArea(dim), scenario(&scenario),
|
||||
town_chop_key = -1;
|
||||
for(short i = 0; i < wandering.size(); i++) {
|
||||
wandering[i] = d_wan;
|
||||
// x of 100 indicates an unset wandering monster location
|
||||
wandering_locs[i].x = 100;
|
||||
}
|
||||
lighting_type = LIGHT_NORMAL;
|
||||
for(short i = 0; i < 4; i++) {
|
||||
// x of 100 indicates an unset starting location
|
||||
start_locs[i].x = 100;
|
||||
exits[i].spec = -1;
|
||||
exits[i].x = -1;
|
||||
|
@@ -1324,9 +1324,9 @@ bool new_town() {
|
||||
std::string size = dynamic_cast<cLedGroup&>(new_dlg->getControl("size")).getSelected();
|
||||
std::string preset = dynamic_cast<cLedGroup&>(new_dlg->getControl("preset")).getSelected();
|
||||
|
||||
if(size == "lg") scenario.towns.push_back(new cTown(scenario, AREA_LARGE));
|
||||
else if(size == "med") scenario.towns.push_back(new cTown(scenario, AREA_MEDIUM));
|
||||
else if(size == "sm") scenario.towns.push_back(new cTown(scenario, AREA_SMALL));
|
||||
if(size == "lg") scenario.addTown(AREA_LARGE);
|
||||
else if(size == "med") scenario.addTown(AREA_MEDIUM);
|
||||
else if(size == "sm") scenario.addTown(AREA_SMALL);
|
||||
|
||||
set_current_town(scenario.towns.size() - 1);
|
||||
town->name = new_dlg->getControl("name").getText().substr(0,30);
|
||||
|
Reference in New Issue
Block a user