Skip to content

Commit

Permalink
Don't draw coins count when in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkubax10 committed Oct 12, 2021
1 parent 46cbd58 commit cd5fa78
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/supertux/player_status_hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "supertux/resources.hpp"
#include "video/drawing_context.hpp"
#include "video/surface.hpp"
#include "editor/editor.hpp"

static const int DISPLAYED_COINS_UNSET = -1;

Expand Down Expand Up @@ -70,23 +71,24 @@ PlayerStatusHUD::draw(DrawingContext& context)

context.push_transform();
context.set_translation(Vector(0, 0));

if (coin_surface)
if (!Editor::is_active())
{
context.color().draw_surface(coin_surface,
Vector(static_cast<float>(context.get_width()) - BORDER_X - static_cast<float>(coin_surface->get_width()) - Resources::fixed_font->get_text_width(coins_text),
BORDER_Y + 1.0f + (Resources::fixed_font->get_text_height(coins_text) + 5) * static_cast<float>(player_id)),
LAYER_HUD);
}

context.color().draw_text(Resources::fixed_font,
coins_text,
Vector(static_cast<float>(context.get_width()) - BORDER_X - Resources::fixed_font->get_text_width(coins_text),
BORDER_Y + (Resources::fixed_font->get_text_height(coins_text) + 5.0f) * static_cast<float>(player_id)),
ALIGN_LEFT,
LAYER_HUD,
PlayerStatusHUD::text_color);
if (coin_surface)
{
context.color().draw_surface(coin_surface,
Vector(static_cast<float>(context.get_width()) - BORDER_X - static_cast<float>(coin_surface->get_width()) - Resources::fixed_font->get_text_width(coins_text),
BORDER_Y + 1.0f + (Resources::fixed_font->get_text_height(coins_text) + 5) * static_cast<float>(player_id)),
LAYER_HUD);
}

context.color().draw_text(Resources::fixed_font,
coins_text,
Vector(static_cast<float>(context.get_width()) - BORDER_X - Resources::fixed_font->get_text_width(coins_text),
BORDER_Y + (Resources::fixed_font->get_text_height(coins_text) + 5.0f) * static_cast<float>(player_id)),
ALIGN_LEFT,
LAYER_HUD,
PlayerStatusHUD::text_color);
}
std::string ammo_text;

if (m_player_status.bonus == FIRE_BONUS) {
Expand Down

0 comments on commit cd5fa78

Please sign in to comment.