From 4d2aa957a4f7bcf3bbe789c78d2b244d20a774c8 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 27 Apr 2018 18:03:09 +0200 Subject: A different icon for restocking grenades. --- assets/ui/crystals_0.png | Bin 1416 -> 0 bytes assets/ui/icon_crystals_0.png | Bin 0 -> 1416 bytes assets/ui/icon_grenade_0.png | Bin 0 -> 886 bytes assets/ui/icon_grenades_0.png | Bin 886 -> 1746 bytes src/game/assets.cpp | 4 ++-- src/game/game.cpp | 4 ++-- src/game/game.hpp | 5 +++-- src/game/interface.cpp | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 assets/ui/crystals_0.png create mode 100644 assets/ui/icon_crystals_0.png create mode 100644 assets/ui/icon_grenade_0.png diff --git a/assets/ui/crystals_0.png b/assets/ui/crystals_0.png deleted file mode 100644 index 92795fc..0000000 Binary files a/assets/ui/crystals_0.png and /dev/null differ diff --git a/assets/ui/icon_crystals_0.png b/assets/ui/icon_crystals_0.png new file mode 100644 index 0000000..92795fc Binary files /dev/null and b/assets/ui/icon_crystals_0.png differ diff --git a/assets/ui/icon_grenade_0.png b/assets/ui/icon_grenade_0.png new file mode 100644 index 0000000..f7f7e12 Binary files /dev/null and b/assets/ui/icon_grenade_0.png differ diff --git a/assets/ui/icon_grenades_0.png b/assets/ui/icon_grenades_0.png index f7f7e12..157097a 100644 Binary files a/assets/ui/icon_grenades_0.png and b/assets/ui/icon_grenades_0.png differ diff --git a/src/game/assets.cpp b/src/game/assets.cpp index f2deedf..6d4aff6 100644 --- a/src/game/assets.cpp +++ b/src/game/assets.cpp @@ -159,10 +159,10 @@ void load(void) ambients[AMBIENT_WATER].load("assets/ambience/water.ogg"); ambients[AMBIENT_WATER].volume = 0.1f; - ui.crystals.load("assets/ui/crystals_", 1); - ui.icon_builder.load("assets/ui/icon_builder_", 1); + ui.icon_crystals.load("assets/ui/icon_crystals_", 1); ui.icon_fire.load("assets/ui/icon_fire_", 1); + ui.icon_grenade.load("assets/ui/icon_grenade_", 1); ui.icon_grenades.load("assets/ui/icon_grenades_", 1); ui.icon_health.load("assets/ui/icon_health_", 1); ui.icon_move.load("assets/ui/icon_move_", 1); diff --git a/src/game/game.cpp b/src/game/game.cpp index 162a274..c585314 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -257,7 +257,7 @@ bool state_t::populate_pie_menu(std::vector &items) if (soldiers) { items.push_back((interface::pie_item_t){&assets::ui.icon_fire, "Fire", COMMAND_FIRE}); if (grenades) - items.push_back((interface::pie_item_t){&assets::ui.icon_grenades, "Throw a grenade", COMMAND_THROW_GRENADE}); + items.push_back((interface::pie_item_t){&assets::ui.icon_grenade, "Throw a grenade", COMMAND_THROW_GRENADE}); if (restock_shells) items.push_back((interface::pie_item_t){&assets::ui.icon_shells, "Restock shells", COMMAND_RESTOCK_SHELLS}); if (restock_grenades) @@ -265,7 +265,7 @@ bool state_t::populate_pie_menu(std::vector &items) } if (scientists) - items.push_back((interface::pie_item_t){&assets::ui.crystals, "Gather", COMMAND_GATHER}); + items.push_back((interface::pie_item_t){&assets::ui.icon_crystals, "Gather", COMMAND_GATHER}); if (builders) { items.push_back((interface::pie_item_t){&assets::ui.icon_repair, "Repair", COMMAND_REPAIR}); diff --git a/src/game/game.hpp b/src/game/game.hpp index 1fd986f..4c361df 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -267,10 +267,10 @@ namespace game { } deco_assets_t; typedef struct { - render::animated_texture_t crystals; - audio::sound_t crystal_tick; render::animated_texture_t icon_builder, + icon_crystals, icon_fire, + icon_grenade, icon_grenades, icon_health, icon_move, @@ -281,6 +281,7 @@ namespace game { icon_soldier, icon_stop, icon_teleporter; + audio::sound_t crystal_tick; } ui_assets_t; extern soldier_assets_t soldier; diff --git a/src/game/interface.cpp b/src/game/interface.cpp index ab11f85..5fc52f3 100644 --- a/src/game/interface.cpp +++ b/src/game/interface.cpp @@ -513,7 +513,7 @@ void state_t::render_to(render::state_t *render) render->render_rect(rect, sf::Color(0, 0, 0, 140)); rect = rectf_t(v2f_t(0.0f, 0.0f), 1.1f * v2f_t(em, em)); - render->render(0.0, &assets::ui.crystals, rect, sf::Color::White); + render->render(0.0, &assets::ui.icon_crystals, rect, sf::Color::White); x = v2f_t(1.1f * em, 0.0f); render->render_text(x, em, std::to_string(game->crystals), render::ALIGN_LEFT_TOP, sf::Color::White); -- cgit