diff --git a/forms/eventpropertiesframe.ui b/forms/eventpropertiesframe.ui
index 1e951a75..78d55a9e 100644
--- a/forms/eventpropertiesframe.ui
+++ b/forms/eventpropertiesframe.ui
@@ -107,16 +107,29 @@
-
-
+
0
0
- Object 1
+ Id
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
-
diff --git a/forms/mainwindow.ui b/forms/mainwindow.ui
index 20918c31..58b1f24f 100644
--- a/forms/mainwindow.ui
+++ b/forms/mainwindow.ui
@@ -158,7 +158,7 @@
- 2
+ 0
false
diff --git a/include/core/event.h b/include/core/event.h
index 06cfed97..25b15882 100644
--- a/include/core/event.h
+++ b/include/core/event.h
@@ -10,8 +10,8 @@ class EventType
public:
static QString Object;
static QString Warp;
- static QString CoordScript;
- static QString CoordWeather;
+ static QString Trigger;
+ static QString WeatherTrigger;
static QString Sign;
static QString HiddenItem;
static QString SecretBase;
@@ -58,16 +58,16 @@ public:
static Event* createNewObjectEvent();
static Event* createNewWarpEvent(QString);
static Event* createNewHealLocationEvent(QString);
- static Event* createNewCoordScriptEvent();
- static Event* createNewCoordWeatherEvent();
+ static Event* createNewTriggerEvent();
+ static Event* createNewWeatherTriggerEvent();
static Event* createNewSignEvent();
static Event* createNewHiddenItemEvent();
static Event* createNewSecretBaseEvent();
QString buildObjectEventMacro(int);
QString buildWarpEventMacro(QMap*);
- QString buildCoordScriptEventMacro();
- QString buildCoordWeatherEventMacro();
+ QString buildTriggerEventMacro();
+ QString buildWeatherTriggerEventMacro();
QString buildSignEventMacro();
QString buildHiddenItemEventMacro();
QString buildSecretBaseEventMacro();
diff --git a/include/editor.h b/include/editor.h
index 56c0f616..622588ba 100644
--- a/include/editor.h
+++ b/include/editor.h
@@ -137,8 +137,8 @@ private:
Event* createNewObjectEvent();
Event* createNewWarpEvent();
Event* createNewHealLocationEvent();
- Event* createNewCoordScriptEvent();
- Event* createNewCoordWeatherEvent();
+ Event* createNewTriggerEvent();
+ Event* createNewWeatherTriggerEvent();
Event* createNewSignEvent();
Event* createNewHiddenItemEvent();
Event* createNewSecretBaseEvent();
diff --git a/include/ui/neweventtoolbutton.h b/include/ui/neweventtoolbutton.h
index 7ff446fd..007dcd51 100644
--- a/include/ui/neweventtoolbutton.h
+++ b/include/ui/neweventtoolbutton.h
@@ -14,8 +14,8 @@ public slots:
void newObject();
void newWarp();
void newHealLocation();
- void newCoordScript();
- void newCoordWeather();
+ void newTrigger();
+ void newWeatherTrigger();
void newSign();
void newHiddenItem();
void newSecretBase();
@@ -26,8 +26,8 @@ private:
QAction *newObjectAction;
QAction *newWarpAction;
QAction *newHealLocationAction;
- QAction *newCoordScriptAction;
- QAction *newCoordWeatherAction;
+ QAction *newTriggerAction;
+ QAction *newWeatherTriggerAction;
QAction *newSignAction;
QAction *newHiddenItemAction;
QAction *newSecretBaseAction;
diff --git a/src/core/event.cpp b/src/core/event.cpp
index 47c42166..eed7d56d 100644
--- a/src/core/event.cpp
+++ b/src/core/event.cpp
@@ -3,8 +3,8 @@
QString EventType::Object = "event_object";
QString EventType::Warp = "event_warp";
-QString EventType::CoordScript = "event_trap";
-QString EventType::CoordWeather = "event_trap_weather";
+QString EventType::Trigger = "event_trigger";
+QString EventType::WeatherTrigger = "event_weather_trigger";
QString EventType::Sign = "event_sign";
QString EventType::HiddenItem = "event_hidden_item";
QString EventType::SecretBase = "event_secret_base";
@@ -25,10 +25,10 @@ Event* Event::createNewEvent(QString event_type, QString map_name)
event = createNewWarpEvent(map_name);
} else if (event_type == EventType::HealLocation) {
event = createNewHealLocationEvent(map_name);
- } else if (event_type == EventType::CoordScript) {
- event = createNewCoordScriptEvent();
- } else if (event_type == EventType::CoordWeather) {
- event = createNewCoordWeatherEvent();
+ } else if (event_type == EventType::Trigger) {
+ event = createNewTriggerEvent();
+ } else if (event_type == EventType::WeatherTrigger) {
+ event = createNewWeatherTriggerEvent();
} else if (event_type == EventType::Sign) {
event = createNewSignEvent();
} else if (event_type == EventType::HiddenItem) {
@@ -79,22 +79,22 @@ Event* Event::createNewHealLocationEvent(QString map_name)
return event;
}
-Event* Event::createNewCoordScriptEvent()
+Event* Event::createNewTriggerEvent()
{
Event *event = new Event;
event->put("event_group_type", "coord_event_group");
- event->put("event_type", EventType::CoordScript);
+ event->put("event_type", EventType::Trigger);
event->put("script_label", "NULL");
event->put("script_var", "VAR_TEMP_0");
event->put("script_var_value", "0");
return event;
}
-Event* Event::createNewCoordWeatherEvent()
+Event* Event::createNewWeatherTriggerEvent()
{
Event *event = new Event;
event->put("event_group_type", "coord_event_group");
- event->put("event_type", EventType::CoordWeather);
+ event->put("event_type", EventType::WeatherTrigger);
event->put("weather", "COORD_EVENT_WEATHER_SUNNY");
return event;
}
@@ -175,7 +175,7 @@ QString Event::buildWarpEventMacro(QMap *mapNamesToMapConstant
return text;
}
-QString Event::buildCoordScriptEventMacro()
+QString Event::buildTriggerEventMacro()
{
QString text = "";
text += QString("\tcoord_event %1").arg(this->get("x"));
@@ -188,7 +188,7 @@ QString Event::buildCoordScriptEventMacro()
return text;
}
-QString Event::buildCoordWeatherEventMacro()
+QString Event::buildWeatherTriggerEventMacro()
{
QString text = "";
text += QString("\tcoord_weather_event %1").arg(this->get("x"));
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index bc2cac93..5c2e7fab 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -973,7 +973,7 @@ void MainWindow::updateObjects() {
else if (event_type == EventType::Warp) {
hasWarps = true;
}
- else if (event_type == EventType::CoordScript || event_type == EventType::CoordWeather) {
+ else if (event_type == EventType::Trigger || event_type == EventType::WeatherTrigger) {
hasTriggers = true;
}
else if (event_type == EventType::Sign || event_type == EventType::HiddenItem || event_type == EventType::SecretBase) {
@@ -1053,20 +1053,13 @@ void MainWindow::updateSelectedObjects() {
connect(z, SIGNAL(valueChanged(QString)), item, SLOT(set_elevation(QString)));
connect(item, SIGNAL(elevationChanged(int)), z, SLOT(setValue(int)));
- QFont font;
- font.setCapitalization(QFont::Capitalize);
- frame->ui->label_name->setFont(font);
QString event_type = item->event->get("event_type");
QString event_group_type = item->event->get("event_group_type");
QString map_name = item->event->get("map_name");
int event_offs;
if (event_type == "event_warp") { event_offs = 0; }
else { event_offs = 1; }
- frame->ui->label_name->setText(
- QString("%1 %2")
- .arg(map_name)
- .arg(event_type)
- );
+ frame->ui->label_name->setText(QString("%1 Id").arg(event_type));
if (events->count() == 1)
{
@@ -1136,12 +1129,12 @@ void MainWindow::updateSelectedObjects() {
fields << "destination_map_name";
fields << "destination_warp";
}
- else if (event_type == EventType::CoordScript) {
+ else if (event_type == EventType::Trigger) {
fields << "script_label";
fields << "script_var";
fields << "script_var_value";
}
- else if (event_type == EventType::CoordWeather) {
+ else if (event_type == EventType::WeatherTrigger) {
fields << "weather";
}
else if (event_type == EventType::Sign) {
@@ -1161,6 +1154,7 @@ void MainWindow::updateSelectedObjects() {
QWidget *widget = new QWidget(frame);
QFormLayout *fl = new QFormLayout(widget);
fl->setContentsMargins(9, 0, 9, 0);
+ fl->setRowWrapPolicy(QFormLayout::WrapLongRows);
// is_trainer is the only non-combobox item.
if (key == "is_trainer") {
diff --git a/src/project.cpp b/src/project.cpp
index 01a39aa7..88c97c19 100644
--- a/src/project.cpp
+++ b/src/project.cpp
@@ -267,7 +267,15 @@ void Project::setNewMapHeader(Map* map, int mapIndex) {
map->weather = "WEATHER_SUNNY";
map->type = "MAP_TYPE_TOWN";
map->unknown = "0";
- map->show_location = "TRUE";
+ if (projectConfig.getBaseGameVersion() == BaseGameVersion::pokeruby) {
+ map->show_location = "TRUE";
+ } else if (projectConfig.getBaseGameVersion() == BaseGameVersion::pokeemerald) {
+ map->allowBiking = "1";
+ map->allowEscapeRope = "0";
+ map->allowRunning = "1";
+ map->show_location = "1";
+ }
+
map->battle_scene = "MAP_BATTLE_SCENE_NORMAL";
}
@@ -1555,7 +1563,7 @@ void Project::loadEventPixmaps(QList objects) {
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
} else if (event_type == EventType::Warp) {
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(16, 0, 16, 16);
- } else if (event_type == EventType::CoordScript || event_type == EventType::CoordWeather) {
+ } else if (event_type == EventType::Trigger || event_type == EventType::WeatherTrigger) {
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(32, 0, 16, 16);
} else if (event_type == EventType::Sign || event_type == EventType::HiddenItem || event_type == EventType::SecretBase) {
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(48, 0, 16, 16);
@@ -1630,10 +1638,10 @@ void Project::saveMapEvents(Map *map) {
text += QString("%1::\n").arg(coordEventsLabel);
for (Event *event : map->events["coord_event_group"]) {
QString event_type = event->get("event_type");
- if (event_type == EventType::CoordScript) {
- text += event->buildCoordScriptEventMacro();
- } else if (event_type == EventType::CoordWeather) {
- text += event->buildCoordWeatherEventMacro();
+ if (event_type == EventType::Trigger) {
+ text += event->buildTriggerEventMacro();
+ } else if (event_type == EventType::WeatherTrigger) {
+ text += event->buildWeatherTriggerEventMacro();
}
}
text += "\n";
@@ -1785,7 +1793,7 @@ void Project::readMapEvents(Map *map) {
coord->put("script_var_value", command.value(i++));
coord->put("script_label", command.value(i++));
coord->put("event_group_type", "coord_event_group");
- coord->put("event_type", EventType::CoordScript);
+ coord->put("event_type", EventType::Trigger);
map->events["coord_event_group"].append(coord);
} else if (command.value(0) == "coord_weather_event") {
Event *coord = new Event;
@@ -1796,7 +1804,7 @@ void Project::readMapEvents(Map *map) {
coord->put("elevation", command.value(i++));
coord->put("weather", command.value(i++));
coord->put("event_group_type", "coord_event_group");
- coord->put("event_type", EventType::CoordWeather);
+ coord->put("event_type", EventType::WeatherTrigger);
map->events["coord_event_group"].append(coord);
}
}
diff --git a/src/ui/neweventtoolbutton.cpp b/src/ui/neweventtoolbutton.cpp
index 233b5c3f..6c3a59a0 100644
--- a/src/ui/neweventtoolbutton.cpp
+++ b/src/ui/neweventtoolbutton.cpp
@@ -29,13 +29,13 @@ void NewEventToolButton::init()
connect(this->newHealLocationAction, SIGNAL(triggered(bool)), this, SLOT(newHealLocation()));
*/
- this->newCoordScriptAction = new QAction("New Coord Script", this);
- this->newCoordScriptAction->setIcon(QIcon(":/icons/add.ico"));
- connect(this->newCoordScriptAction, SIGNAL(triggered(bool)), this, SLOT(newCoordScript()));
+ this->newTriggerAction = new QAction("New Trigger", this);
+ this->newTriggerAction->setIcon(QIcon(":/icons/add.ico"));
+ connect(this->newTriggerAction, SIGNAL(triggered(bool)), this, SLOT(newTrigger()));
- this->newCoordWeatherAction = new QAction("New Coord Weather", this);
- this->newCoordWeatherAction->setIcon(QIcon(":/icons/add.ico"));
- connect(this->newCoordWeatherAction, SIGNAL(triggered(bool)), this, SLOT(newCoordWeather()));
+ this->newWeatherTriggerAction = new QAction("New Weather Trigger", this);
+ this->newWeatherTriggerAction->setIcon(QIcon(":/icons/add.ico"));
+ connect(this->newWeatherTriggerAction, SIGNAL(triggered(bool)), this, SLOT(newWeatherTrigger()));
this->newSignAction = new QAction("New Sign", this);
this->newSignAction->setIcon(QIcon(":/icons/add.ico"));
@@ -53,8 +53,8 @@ void NewEventToolButton::init()
alignMenu->addAction(this->newObjectAction);
alignMenu->addAction(this->newWarpAction);
//alignMenu->addAction(this->newHealLocationAction);
- alignMenu->addAction(this->newCoordScriptAction);
- alignMenu->addAction(this->newCoordWeatherAction);
+ alignMenu->addAction(this->newTriggerAction);
+ alignMenu->addAction(this->newWeatherTriggerAction);
alignMenu->addAction(this->newSignAction);
alignMenu->addAction(this->newHiddenItemAction);
alignMenu->addAction(this->newSecretBaseAction);
@@ -85,15 +85,15 @@ void NewEventToolButton::newHealLocation()
emit newEventAdded(this->selectedEventType);
}
-void NewEventToolButton::newCoordScript()
+void NewEventToolButton::newTrigger()
{
- this->selectedEventType = EventType::CoordScript;
+ this->selectedEventType = EventType::Trigger;
emit newEventAdded(this->selectedEventType);
}
-void NewEventToolButton::newCoordWeather()
+void NewEventToolButton::newWeatherTrigger()
{
- this->selectedEventType = EventType::CoordWeather;
+ this->selectedEventType = EventType::WeatherTrigger;
emit newEventAdded(this->selectedEventType);
}