Combine timer data into a single structure

This commit is contained in:
2015-02-06 16:54:05 -05:00
parent c50e24b8e4
commit f609711e27
12 changed files with 52 additions and 60 deletions

View File

@@ -741,8 +741,8 @@ static bool save_town_events(cDialog& me, std::string, eKeyMod) {
if(!me.toast(true)) return true;
for(int i = 0; i < 8; i++) {
std::string id = std::to_string(i + 1);
town->timer_spec_times[i] = me["time" + id].getTextAsNum();
town->timer_specs[i] = me["spec" + id].getTextAsNum();
town->timers[i].time = me["time" + id].getTextAsNum();
town->timers[i].node = me["spec" + id].getTextAsNum();
}
return true;
}
@@ -751,8 +751,8 @@ static void put_town_events_in_dlog(cDialog& me) {
short i;
for(i = 0; i < 8; i++) {
std::string id = std::to_string(i + 1);
me["time" + id].setTextToNum(town->timer_spec_times[i]);
me["spec" + id].setTextToNum(town->timer_specs[i]);
me["time" + id].setTextToNum(town->timers[i].time);
me["spec" + id].setTextToNum(town->timers[i].node);
}
}