From 6679f5cffa9d35a23b76605ddfbf3257f882b6ee Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 17 Apr 2008 23:34:36 +0000 Subject: [FIX] Frac -> Fraction [FIX] ImageCache and Ini removed [FIX] Fraction/Point widgets moved to pokemodr [FIX] Copy ctors made for pokemod classes [FIX] Ctors in pokemod fixed [FIX] Copyright headers fixed in pokemodr [FIX] PokeModr updated to new API and fixed in some places git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@99 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/TileDelegate.cpp | 56 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 29 deletions(-) (limited to 'pokemodr/TileDelegate.cpp') diff --git a/pokemodr/TileDelegate.cpp b/pokemodr/TileDelegate.cpp index d86bcfb4..756edc66 100644 --- a/pokemodr/TileDelegate.cpp +++ b/pokemodr/TileDelegate.cpp @@ -1,37 +1,35 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: pokegen/TileDelegate.cpp -// Purpose: Provides an editor for tiles in the tilemap editor -// Author: Ben Boeckel -// Modified by: Ben Boeckel -// Created: Sat Feb 2 01:31:30 2008 -// Copyright: ©2007-2008 Ben Boeckel and Nerdy Productions -// Licence: -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License along -// with this program. If not, see . -///////////////////////////////////////////////////////////////////////////// - +/* + * Copyright 2008 Ben Boeckel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +// KDE includes #include -#include "../general/ImageCache.h" - +// Pokemod includes #include #include +// PokeModr includes #include "ObjectUI.h" #include "MapUI.h" -#include "TileDelegate.h" #include "TilemapModel.h" +// Header include +#include "TileDelegate.h" + QWidget* TileDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem&, const QModelIndex&) const { KComboBox* editor = new KComboBox(parent); @@ -40,11 +38,11 @@ QWidget* TileDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& void TileDelegate::setEditorData(QWidget* editor, const QModelIndex& index) const { - for (int i = 0; i < static_cast(editor->parent())->getOriginal()->getPokemod()->getTileCount(); ++i) + for (int i = 0; i < static_cast(editor->parent())->original()->pokemod()->tileCount(); ++i) { - const Tile* t = static_cast(editor->parent())->getOriginal()->getPokemod()->getTile(i); - static_cast(editor)->addItem(ImageCache::open(t->getPic()), t->getName()); - static_cast(editor)->setItemData(i, t->getId()); + const Tile* tile = static_cast(editor->parent())->original()->pokemod()->tile(i); + static_cast(editor)->addItem(tile->sprite(), tile->name()); + static_cast(editor)->setItemData(i, tile->id()); } static_cast(editor)->setCurrentIndex(index.data(Qt::EditRole).toInt()); } -- cgit