diff --git a/CHANGELOG.md b/CHANGELOG.md index dfa0221af1..30384b5e59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Mountain peak and lake markers on the map - There's now a checkbox in the graphics tab to opt-in to receiving lossily-compressed terrain colors. - /buff command which allows you to cast a buff on player +- Warn the user with an animated red text in the second phase of a trade in which a party is offering nothing. ### Changed diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 6ac6c7a17b..b5c2fad8f1 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -951,6 +951,7 @@ impl Hud { let bodies = ecs.read_storage::(); let items = ecs.read_storage::(); let inventories = ecs.read_storage::(); + let players = ecs.read_storage::(); let msm = ecs.read_resource::(); let entities = ecs.entities(); let me = client.entity(); @@ -1527,6 +1528,7 @@ impl Hud { &hp_floater_lists, &uids, &inventories, + players.maybe(), ) .join() .filter(|t| { @@ -1549,10 +1551,15 @@ impl Hud { hpfl, uid, inventory, + player, )| { // Use interpolated position if available let pos = interpolated.map_or(pos.0, |i| i.pos); let in_group = client.group_members().contains_key(uid); + // TODO: once the site2 rework lands and merchants have dedicated stalls or + // buildings, they no longer need to be emphasized via the higher overhead + // text radius relative to other NPCs + let is_merchant = stats.name == "Merchant" && player.is_none(); let dist_sqr = pos.distance_squared(player_pos); // Determine whether to display nametag and healthbar based on whether the // entity has been damaged, is targeted/selected, or is in your group @@ -1562,9 +1569,10 @@ impl Hud { (info.target_entity.map_or(false, |e| e == entity) || info.selected_entity.map_or(false, |s| s.0 == entity) || health.map_or(true, overhead::should_show_healthbar) - || in_group) + || in_group + || is_merchant) && dist_sqr - < (if in_group { + < (if in_group || is_merchant { NAMETAG_GROUP_RANGE } else if hpfl .time_since_last_dmg_by_me diff --git a/voxygen/src/hud/trade.rs b/voxygen/src/hud/trade.rs index adf6392dee..7dbdc061a7 100644 --- a/voxygen/src/hud/trade.rs +++ b/voxygen/src/hud/trade.rs @@ -400,6 +400,7 @@ impl<'a> Trade<'a> { .resize(2 * MAX_TRADE_SLOTS, &mut ui.widget_id_generator()); }); } + let mut total_quantity = 0; for i in 0..MAX_TRADE_SLOTS { let slot = tradeslots.get(i).cloned().unwrap_or(TradeSlot { index: i, @@ -408,6 +409,7 @@ impl<'a> Trade<'a> { ours, entity, }); + total_quantity += slot.quantity; let itemname = slot .invslot .and_then(|i| inventory.get(i)) @@ -426,6 +428,19 @@ impl<'a> Trade<'a> { )) .set(state.ids.inv_textslots[i + who * MAX_TRADE_SLOTS], ui); } + if total_quantity == 0 { + Text::new("Nothing!") + .top_left_with_margins_on(state.ids.inv_alignment[who], 10.0, 0.0) + .font_id(self.fonts.cyri.conrod_id) + .font_size(self.fonts.cyri.scale(20)) + .color(Color::Rgba( + 1.0, + 0.25 + 0.25 * (4.0 * self.pulse).sin(), + 0.0, + 1.0, + )) + .set(state.ids.inv_textslots[who * MAX_TRADE_SLOTS], ui); + } } fn accept_decline_buttons(