summaryrefslogtreecommitdiffstats
path: root/pokemodr/MapWarpUI.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-05-16 16:55:28 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-05-16 16:55:28 +0000
commit9c1388c7964bd3b4ae147e39c146c96dc20947e9 (patch)
tree09628e1b12604d3194b7056c31df0573af4239bd /pokemodr/MapWarpUI.cpp
parenta2a81fa0eee00670a1e18918458f6ac12860d59c (diff)
downloadsigen-9c1388c7964bd3b4ae147e39c146c96dc20947e9.tar.gz
sigen-9c1388c7964bd3b4ae147e39c146c96dc20947e9.tar.xz
sigen-9c1388c7964bd3b4ae147e39c146c96dc20947e9.zip
[FIX] TypeModel done for data() in models
[FIX] Another Qt bug found :( [FIX] Better connections for the editor widget git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@141 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/MapWarpUI.cpp')
-rw-r--r--pokemodr/MapWarpUI.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/pokemodr/MapWarpUI.cpp b/pokemodr/MapWarpUI.cpp
index 72ecdd0c..d3403672 100644
--- a/pokemodr/MapWarpUI.cpp
+++ b/pokemodr/MapWarpUI.cpp
@@ -65,33 +65,30 @@ void MapWarpUI::refreshGui()
void MapWarpUI::setGui()
{
- const bool resetWarps = (static_cast<MapWarp*>(modified())->toMap() == m_lastMap);
+ const bool resetWarps = (static_cast<MapWarp*>(modified())->toMap() != m_lastMap);
varName->setText(static_cast<MapWarp*>(modified())->name());
varCoordinate->setValue(static_cast<MapWarp*>(modified())->coordinate());
for (int i = 0; i < varActivation->count(); ++i)
varActivation->item(i)->setSelected(static_cast<MapWarp*>(modified())->from(i));
varDirectionOut->setCurrentIndex(static_cast<MapWarp*>(modified())->directionOut());
varType->setCurrentIndex(static_cast<MapWarp*>(modified())->type());
- varBiking->setCheckState((static_cast<MapWarp*>(modified())->isBiking() == Flag::On) ? Qt::Checked : ((static_cast<MapWarp*>(modified())->isBiking() == Flag::Off) ? Qt::Unchecked : Qt::PartiallyChecked));
- varFlash->setCheckState((static_cast<MapWarp*>(modified())->isFlash() == Flag::On) ? Qt::Checked : ((static_cast<MapWarp*>(modified())->isFlash() == Flag::Off) ? Qt::Unchecked : Qt::PartiallyChecked));
- varFog->setCheckState((static_cast<MapWarp*>(modified())->isFoggy() == Flag::On) ? Qt::Checked : ((static_cast<MapWarp*>(modified())->isFoggy() == Flag::Off) ? Qt::Unchecked : Qt::PartiallyChecked));
+ // FIXME: Qt bug
+// varBiking->setCheckState((static_cast<MapWarp*>(modified())->isBiking() == Flag::On) ? Qt::Checked : ((static_cast<MapWarp*>(modified())->isBiking() == Flag::Off) ? Qt::Unchecked : Qt::PartiallyChecked));
+// varFlash->setCheckState((static_cast<MapWarp*>(modified())->isFlash() == Flag::On) ? Qt::Checked : ((static_cast<MapWarp*>(modified())->isFlash() == Flag::Off) ? Qt::Unchecked : Qt::PartiallyChecked));
+// varFog->setCheckState((static_cast<MapWarp*>(modified())->isFoggy() == Flag::On) ? Qt::Checked : ((static_cast<MapWarp*>(modified())->isFoggy() == Flag::Off) ? Qt::Unchecked : Qt::PartiallyChecked));
varToMap->setCurrentIndex(varToMap->findData(static_cast<MapWarp*>(modified())->toMap()));
m_lastMap = static_cast<MapWarp*>(modified())->toMap();
if (resetWarps)
{
varToWarp->clear();
- int index = static_cast<const Pokemod*>(original()->pokemod())->mapIndex(static_cast<MapWarp*>(modified())->toMap());
- if (index != INT_MAX)
+ const Map* map = static_cast<const Pokemod*>(original()->pokemod())->mapById(static_cast<MapWarp*>(modified())->toMap());
+ if (map)
{
- const Map* map = static_cast<const Pokemod*>(original()->pokemod())->map(index);
- if (map)
+ for (int i = 0; i < map->warpCount(); ++i)
{
- for (int i = 0; i < map->warpCount(); ++i)
- {
- const MapWarp* warp = map->warp(i);
- varToWarp->addItem(warp->name());
- varToWarp->setItemData(i, warp->id());
- }
+ const MapWarp* warp = map->warp(i);
+ varToWarp->addItem(warp->name());
+ varToWarp->setItemData(i, warp->id());
}
}
}
@@ -139,17 +136,17 @@ void MapWarpUI::on_varType_currentIndexChanged(const int type)
static_cast<MapWarp*>(modified())->setType(type);
}
-void MapWarpUI::on_varBiking_stateChanged(const int biking)
+void MapWarpUI::on_varBiking_toggled(const int biking)
{
static_cast<MapWarp*>(modified())->setIsBiking(biking);
}
-void MapWarpUI::on_varFlash_stateChanged(const int flash)
+void MapWarpUI::on_varFlash_toggled(const int flash)
{
static_cast<MapWarp*>(modified())->setIsFlash(flash);
}
-void MapWarpUI::on_varFog_stateChanged(const int fog)
+void MapWarpUI::on_varFog_toggled(const int fog)
{
static_cast<MapWarp*>(modified())->setIsFoggy(fog);
}