summaryrefslogtreecommitdiffstats
path: root/pokemodr/TilemapModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-02-25 16:26:07 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-02-25 16:26:07 +0000
commit86b07a87ceb0154a254f104b3135a51787c57f30 (patch)
tree1c6b5e3460029e97c69df0a99868400cbe11e482 /pokemodr/TilemapModel.cpp
parent1e02a507f0b481465f5b47441479b98a81aee079 (diff)
downloadsigen-86b07a87ceb0154a254f104b3135a51787c57f30.tar.gz
sigen-86b07a87ceb0154a254f104b3135a51787c57f30.tar.xz
sigen-86b07a87ceb0154a254f104b3135a51787c57f30.zip
[ADD] Pokemod tree will reflect PokéMod heirarchy and load panels
[FIX] PokemodUI panel now loads [FIX] Includes fixed [FIX] newAuthor had + instead of - (QList assertions) [FIX] Pokemod copying works now [FIX] Debug rather than release used git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@83 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/TilemapModel.cpp')
-rw-r--r--pokemodr/TilemapModel.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/pokemodr/TilemapModel.cpp b/pokemodr/TilemapModel.cpp
index d90fcbe9..683420cd 100644
--- a/pokemodr/TilemapModel.cpp
+++ b/pokemodr/TilemapModel.cpp
@@ -52,11 +52,19 @@ QVariant TilemapModel::data(const QModelIndex& index, int role) const
if (!index.isValid())
return QVariant();
if (role == Qt::DisplayRole)
- return ImageCache::open(pokemod->getTileByID(map->at(index.row(), index.column()))->getPic());
+ {
+ int idx = pokemod->getTileIndex(map->at(index.row(), index.column()));
+ if (idx != -1)
+ return ImageCache::open(pokemod->getTile(idx)->getPic());
+ }
if (role == Qt::EditRole)
map->at(index.row(), index.column());
if (role == Qt::ToolTipRole)
- return pokemod->getTileByID(map->at(index.row(), index.column()))->getName();
+ {
+ int idx = pokemod->getTileIndex(map->at(index.row(), index.column()));
+ if (idx != -1)
+ return pokemod->getTile(idx)->getName();
+ }
return QVariant();
}