Skip to content

Commit

Permalink
Gold ui label update for 0 gold
Browse files Browse the repository at this point in the history
  • Loading branch information
richard1 committed Jun 9, 2017
1 parent 75e8a9e commit c840d5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ui/gold_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void GoldUI::set_gold(int gold) {
total_gold.set_text(std::to_string(cur_gold));

// Update delta text
std::string prefix = cur_delta < 0 ? "-" : "+";

This comment has been minimized.

Copy link
@jytang

jytang Jun 10, 2017

Collaborator

you would want to see "-0" over "+0"? Anyways, nice last commit.

This comment has been minimized.

Copy link
@richard1

richard1 Jun 11, 2017

Author Collaborator

(this commit was made by Ethan)

But the only reason the delta would be 0 is if the player had 0 gold and got damaged, so I think it makes sense.

This comment has been minimized.

Copy link
@jytang

jytang Jun 11, 2017

Collaborator

Also when you have 10000 gold and gain gold, the delta is 0

This comment has been minimized.

Copy link
@metakirby5

metakirby5 Jun 11, 2017

Member

The more common case is losing gold at 0, exceeding the cap usually only happens in case of a glitch

std::string prefix = cur_delta <= 0 ? "-" : "+";
Color color = cur_delta < 0 ? Color::INDIAN_RED : Color::WINDWAKER_GREEN;
gold_delta.set_text(prefix + std::to_string(std::abs(cur_delta)));
gold_delta.set_color(color);
Expand Down

0 comments on commit c840d5a

Please sign in to comment.