Merge branch 'remove-coin-counter' into 'master'

Remove coin counter at the bottom of inventories.

See merge request veloren/veloren!3998
This commit is contained in:
Samuel Keiffer 2023-07-23 17:29:23 +00:00
commit 9f2ece3199
3 changed files with 14 additions and 7 deletions

View File

@ -1124,6 +1124,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
- Remove heaptrack as it is now deprecated
- Remove coin counter at the bottom of inventories.
## [0.4.0] - 2019-10-10

View File

@ -495,15 +495,16 @@ impl<'a> InventoryScroller<'a> {
let space_max = self.inventory.slots().count();
let bag_space = format!("{}/{}", space_used, space_max);
let bag_space_percentage = space_used as f32 / space_max as f32;
let coin_itemdef = Arc::<ItemDef>::load_expect_cloned("common.items.utility.coins");
let coin_count = self.inventory.item_count(&coin_itemdef);
// TODO: Reuse this to generally count a stackable item the player selected
//let cheese_itemdef =
//let coin_itemdef =
// Arc::<ItemDef>::load_expect_cloned("common.items.utility.coins"); let
// coin_count = self.inventory.item_count(&coin_itemdef); TODO: Reuse
// this to generally count a stackable item the player selected
// let cheese_itemdef =
// Arc::<ItemDef>::load_expect_cloned("common.items.food.cheese");
// let cheese_count = self.inventory.item_count(&cheese_itemdef);
// Coin Icon and Coin Text
Image::new(self.imgs.coin_ico)
/*Image::new(self.imgs.coin_ico)
.w_h(16.0, 17.0)
.bottom_left_with_margins_on(self.bg_ids.bg_frame, 2.0, 43.0)
.set(state.ids.coin_ico, ui);
@ -512,7 +513,7 @@ impl<'a> InventoryScroller<'a> {
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(14))
.color(Color::Rgba(0.871, 0.863, 0.05, 1.0))
.set(state.ids.coin_txt, ui);
.set(state.ids.coin_txt, ui);*/
// TODO: Add a customizable counter for stackable items here
// TODO: Cheese is funny until it's real
/*Image::new(self.imgs.cheese_ico)

View File

@ -698,7 +698,12 @@ where
// Draw amount
if let Some(amount) = amount {
let amount = format!("{}", &amount);
let amount = match amount {
amount if amount > 1_000_000_000 => format!("{}G", amount / 1_000_000_000),
amount if amount > 1_000_000 => format!("{}M", amount / 1_000_000),
amount if amount > 1_000 => format!("{}K", amount / 1_000),
amount => format!("{}", amount),
};
// Text shadow
Text::new(&amount)
.font_id(amount_font)