diff --git a/data/sprites/items.sprite b/data/sprites/items.sprite index 4b88d46..d735e58 100644 --- a/data/sprites/items.sprite +++ b/data/sprites/items.sprite @@ -36,6 +36,18 @@ "originy" : 128 }, +"tree_pine_icon" : { + "texture" : "treetop", + "topx" : 128, + "topy" : 128, + "height" : 32, + "width" : 32, + "number_of_frames" : 1, + "frame_time" : 100, + "originx" : 16, + "originy" : 16 +}, + "tree_palm" : { "texture" : "plant_repack", "topx" : 320, @@ -48,6 +60,18 @@ "originy" : 112 }, +"tree_palm_icon" : { + "texture" : "plant_repack", + "topx" : 352, + "topy" : 320, + "height" : 32, + "width" : 32, + "number_of_frames" : 1, + "frame_time" : 100, + "originx" : 16, + "originy" : 16 +}, + "cactus_one" : { "texture" : "plant_repack", "topx" : 32, diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp index d7002f9..76a2e3d 100644 --- a/src/saland/Game.cpp +++ b/src/saland/Game.cpp @@ -278,7 +278,7 @@ Game::Game() { data->spell_holder->slot_spell.at(6) = data->spell_holder->get_spell_by_name("spell_spawn_item:barrel"); data->spell_holder->slot_spell.at(7) = data->spell_holder->get_spell_by_name("spell_spawn_item:tree_palm"); data->spell_holder->slot_spell.at(8) = data->spell_holder->get_spell_by_name("spell_spawn_item:cactus_full"); - data->spell_holder->slot_spell.at(9) = data->spell_holder->get_spell_by_name("spell_clear_block"); + data->spell_holder->slot_spell.at(9) = data->spell_holder->get_spell_clear_tile(); } Game::~Game() { diff --git a/src/saland/model/spells.cpp b/src/saland/model/spells.cpp index 8370b1d..a250b93 100644 --- a/src/saland/model/spells.cpp +++ b/src/saland/model/spells.cpp @@ -70,7 +70,7 @@ void SpellHolder::init() slot6.name = "spell_spawn_item"; slot6.item_name = "barrel"; Spell slot7; - slot7.icon = "tree_palm"; // Quite big. As this has no icon + slot7.icon = "tree_palm_icon"; slot7.name = "spell_spawn_item"; slot7.item_name = "tree_palm"; Spell slot8; @@ -78,9 +78,12 @@ void SpellHolder::init() slot8.name = "spell_spawn_item"; slot8.item_name = "cactus_full"; Spell slot9; - slot9.icon = "icon_trash_can"; - slot9.name = "spell_clear_block"; - slot9.type = SpellCursorType::tile; + slot9.icon = "tree_pine_icon"; + slot9.name = "spell_spawn_item"; + slot9.item_name = "tree_pine"; + clearTileSpell.icon = "icon_trash_can"; + clearTileSpell.name = "spell_clear_block"; + clearTileSpell.type = SpellCursorType::tile; add_spell(slot0); add_spell(slot1); add_spell(slot2); @@ -115,4 +118,9 @@ const Spell &SpellHolder::get_spell_by_name(const std::string &spell_name) const return blankSpell; } return get_spell(it->second); +} + +const Spell &SpellHolder::get_spell_clear_tile() const +{ + return clearTileSpell; } \ No newline at end of file diff --git a/src/saland/model/spells.hpp b/src/saland/model/spells.hpp index f22a118..9291232 100644 --- a/src/saland/model/spells.hpp +++ b/src/saland/model/spells.hpp @@ -43,6 +43,7 @@ class SpellHolder { std::vector spells; std::map spellIndex; Spell blankSpell; + Spell clearTileSpell; bool initialized = false; public: size_t slot_selected = 0; @@ -53,6 +54,7 @@ public: size_t get_spell_count() const; const Spell& get_spell(size_t index) const; const Spell& get_spell_by_name(const std::string&) const; + const Spell& get_spell_clear_tile() const; }; #endif //MODEL_SPELLS_HPP \ No newline at end of file