From e02f97d2e05f5dc4b012cb946af45c9594617202 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 18 Jul 2016 15:57:55 +0300 Subject: Move skilldata into resources/skill directory. --- src/CMakeLists.txt | 4 +-- src/Makefile.am | 4 +-- src/being/being.cpp | 3 +- src/dragdrop.h | 3 +- src/gui/models/skillmodel.cpp | 2 +- src/gui/popups/skillpopup.cpp | 3 +- src/gui/widgets/skilldata.cpp | 71 --------------------------------------- src/gui/widgets/skilldata.h | 56 ------------------------------ src/gui/widgets/skillinfo.cpp | 4 +-- src/resources/skill/skilldata.cpp | 71 +++++++++++++++++++++++++++++++++++++++ src/resources/skill/skilldata.h | 56 ++++++++++++++++++++++++++++++ 11 files changed, 140 insertions(+), 137 deletions(-) delete mode 100644 src/gui/widgets/skilldata.cpp delete mode 100644 src/gui/widgets/skilldata.h create mode 100644 src/resources/skill/skilldata.cpp create mode 100644 src/resources/skill/skilldata.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8b1ce79a0..d555931ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -264,8 +264,8 @@ SET(SRCS gui/widgets/shoplistbox.h gui/widgets/shortcutcontainer.cpp gui/widgets/shortcutcontainer.h - gui/widgets/skilldata.cpp - gui/widgets/skilldata.h + resources/skill/skilldata.cpp + resources/skill/skilldata.h gui/widgets/skillinfo.cpp gui/widgets/skillinfo.h gui/widgets/skilllistbox.h diff --git a/src/Makefile.am b/src/Makefile.am index fd9db6e8e..02966844a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1029,8 +1029,8 @@ manaplus_SOURCES += main.cpp \ gui/widgets/shoplistbox.h \ gui/widgets/shortcutcontainer.cpp \ gui/widgets/shortcutcontainer.h \ - gui/widgets/skilldata.cpp \ - gui/widgets/skilldata.h \ + resources/skill/skilldata.cpp \ + resources/skill/skilldata.h \ gui/widgets/skillinfo.cpp \ gui/widgets/skillinfo.h \ gui/widgets/skilllistbox.h \ diff --git a/src/being/being.cpp b/src/being/being.cpp index 0b52592d4..fd4b37e2c 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -90,10 +90,11 @@ #include "resources/map/map.h" +#include "resources/skill/skilldata.h" + #include "resources/sprite/animatedsprite.h" #include "gui/widgets/createwidget.h" -#include "gui/widgets/skilldata.h" #include "gui/widgets/skillinfo.h" #include "gui/widgets/tabs/chat/langtab.h" diff --git a/src/dragdrop.h b/src/dragdrop.h index 3d04f111d..9c5a6399f 100644 --- a/src/dragdrop.h +++ b/src/dragdrop.h @@ -28,11 +28,12 @@ #include "enums/dragdropsource.h" -#include "gui/widgets/skilldata.h" #include "gui/widgets/skillinfo.h" #include "resources/image/image.h" +#include "resources/skill/skilldata.h" + #include "localconsts.h" class DragDrop final diff --git a/src/gui/models/skillmodel.cpp b/src/gui/models/skillmodel.cpp index 7e49de9a3..7f130addd 100644 --- a/src/gui/models/skillmodel.cpp +++ b/src/gui/models/skillmodel.cpp @@ -22,7 +22,7 @@ #include "gui/models/skillmodel.h" -#include "gui/widgets/skilldata.h" +#include "resources/skill/skilldata.h" #include "debug.h" diff --git a/src/gui/popups/skillpopup.cpp b/src/gui/popups/skillpopup.cpp index 879e48a80..b88fa83ca 100644 --- a/src/gui/popups/skillpopup.cpp +++ b/src/gui/popups/skillpopup.cpp @@ -28,13 +28,14 @@ #include "gui/fonts/font.h" #include "gui/widgets/label.h" -#include "gui/widgets/skilldata.h" #include "gui/widgets/skillinfo.h" #include "gui/widgets/textbox.h" #include "utils/gettext.h" #include "utils/stringutils.h" +#include "resources/skill/skilldata.h" + #include "debug.h" SkillPopup *skillPopup = nullptr; diff --git a/src/gui/widgets/skilldata.cpp b/src/gui/widgets/skilldata.cpp deleted file mode 100644 index 3b8328474..000000000 --- a/src/gui/widgets/skilldata.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2016 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 2 of the License, or - * 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 . - */ - -#include "gui/widgets/skilldata.h" - -#include "configuration.h" - -#include "gui/theme.h" - -#include "resources/image/image.h" - -#include "resources/loaders/imageloader.h" - -#include "debug.h" - -SkillData::SkillData() : - name(), - shortName(), - dispName(), - description(), - icon(nullptr), - particle(), - invokeCmd(), - soundHit(std::string(), 0), - soundMiss(std::string(), 0), - updateEffectId(-1), - removeEffectId(-1), - hitEffectId(-1), - missEffectId(-1) -{ -} - -SkillData::~SkillData() -{ - if (icon) - { - icon->decRef(); - icon = nullptr; - } -} - -void SkillData::setIcon(const std::string &iconPath) -{ - if (!iconPath.empty()) - icon = Loader::getImage(iconPath); - - if (!icon) - { - icon = Theme::getImageFromTheme( - paths.getStringValue("unknownItemFile")); - } -} diff --git a/src/gui/widgets/skilldata.h b/src/gui/widgets/skilldata.h deleted file mode 100644 index 20365593f..000000000 --- a/src/gui/widgets/skilldata.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2004-2009 The Mana World Development Team - * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2016 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * 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 2 of the License, or - * 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 . - */ - -#ifndef GUI_WIDGETS_SKILLDATA_H -#define GUI_WIDGETS_SKILLDATA_H - -#include "resources/soundinfo.h" - -class Image; - -struct SkillData final -{ - std::string name; - std::string shortName; - std::string dispName; - std::string description; - Image *icon; - - std::string particle; - std::string invokeCmd; - - SoundInfo soundHit; - SoundInfo soundMiss; - - int updateEffectId; - int removeEffectId; - int hitEffectId; - int missEffectId; - - SkillData(); - A_DELETE_COPY(SkillData) - ~SkillData(); - - void setIcon(const std::string &iconPath); -}; - -#endif // GUI_WIDGETS_SKILLDATA_H diff --git a/src/gui/widgets/skillinfo.cpp b/src/gui/widgets/skillinfo.cpp index 906aff101..8c7fbefea 100644 --- a/src/gui/widgets/skillinfo.cpp +++ b/src/gui/widgets/skillinfo.cpp @@ -24,14 +24,14 @@ #include "being/playerinfo.h" -#include "gui/widgets/skilldata.h" - #include "gui/models/skillmodel.h" #include "utils/stringutils.h" #include "resources/skilltypelist.h" +#include "resources/skill/skilldata.h" + #include "debug.h" SkillInfo::SkillInfo() : diff --git a/src/resources/skill/skilldata.cpp b/src/resources/skill/skilldata.cpp new file mode 100644 index 000000000..65d454260 --- /dev/null +++ b/src/resources/skill/skilldata.cpp @@ -0,0 +1,71 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 2 of the License, or + * 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 . + */ + +#include "resources/skill/skilldata.h" + +#include "configuration.h" + +#include "gui/theme.h" + +#include "resources/image/image.h" + +#include "resources/loaders/imageloader.h" + +#include "debug.h" + +SkillData::SkillData() : + name(), + shortName(), + dispName(), + description(), + icon(nullptr), + particle(), + invokeCmd(), + soundHit(std::string(), 0), + soundMiss(std::string(), 0), + updateEffectId(-1), + removeEffectId(-1), + hitEffectId(-1), + missEffectId(-1) +{ +} + +SkillData::~SkillData() +{ + if (icon) + { + icon->decRef(); + icon = nullptr; + } +} + +void SkillData::setIcon(const std::string &iconPath) +{ + if (!iconPath.empty()) + icon = Loader::getImage(iconPath); + + if (!icon) + { + icon = Theme::getImageFromTheme( + paths.getStringValue("unknownItemFile")); + } +} diff --git a/src/resources/skill/skilldata.h b/src/resources/skill/skilldata.h new file mode 100644 index 000000000..20365593f --- /dev/null +++ b/src/resources/skill/skilldata.h @@ -0,0 +1,56 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2016 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 2 of the License, or + * 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 . + */ + +#ifndef GUI_WIDGETS_SKILLDATA_H +#define GUI_WIDGETS_SKILLDATA_H + +#include "resources/soundinfo.h" + +class Image; + +struct SkillData final +{ + std::string name; + std::string shortName; + std::string dispName; + std::string description; + Image *icon; + + std::string particle; + std::string invokeCmd; + + SoundInfo soundHit; + SoundInfo soundMiss; + + int updateEffectId; + int removeEffectId; + int hitEffectId; + int missEffectId; + + SkillData(); + A_DELETE_COPY(SkillData) + ~SkillData(); + + void setIcon(const std::string &iconPath); +}; + +#endif // GUI_WIDGETS_SKILLDATA_H -- cgit v1.2.3-60-g2f50