mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Show ctrl-click and shift-click usage in item tooltips during trades.
This commit is contained in:
parent
dc4c02baad
commit
8a25ebb59a
@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Merchants now have stacks of stackable items instead of just one per slot
|
||||
- Bag tooltips only show slots now
|
||||
- Removed infinite armour values from most admin items
|
||||
- Item tooltips during trades will now inform the user of what ctrl-click and shift-click do
|
||||
|
||||
### Removed
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
"hud.trade.buy_price": "Buy price",
|
||||
"hud.trade.sell_price": "Sell Price",
|
||||
"hud.trade.coin": "coin(s)",
|
||||
"hud.trade.tooltip_hint_1": "<Shift-Click to Add/Remove from trade.>",
|
||||
"hud.trade.tooltip_hint_2": "<Ctrl-Click to Auto-Balance with this.>",
|
||||
},
|
||||
|
||||
|
||||
|
@ -293,6 +293,7 @@ widget_ids! {
|
||||
desc,
|
||||
prices_buy,
|
||||
prices_sell,
|
||||
tooltip_hints,
|
||||
main_stat,
|
||||
main_stat_text,
|
||||
stats[],
|
||||
@ -951,6 +952,21 @@ impl<'a> Widget for ItemTooltip<'a> {
|
||||
.down_from(state.ids.prices_buy, V_PAD_STATS)
|
||||
.w(text_w)
|
||||
.set(state.ids.prices_sell, ui);
|
||||
|
||||
//Tooltips for trade mini-tutorial
|
||||
widget::Text::new(&format!(
|
||||
"{}\n{}",
|
||||
i18n.get("hud.trade.tooltip_hint_1"),
|
||||
i18n.get("hud.trade.tooltip_hint_2")
|
||||
))
|
||||
.x_align_to(state.ids.item_frame, conrod_core::position::Align::Start)
|
||||
.graphics_for(id)
|
||||
.parent(id)
|
||||
.with_style(self.style.desc)
|
||||
.color(Color::Rgba(255.0, 255.0, 255.0, 1.0))
|
||||
.down_from(state.ids.prices_sell, V_PAD_STATS)
|
||||
.w(text_w)
|
||||
.set(state.ids.tooltip_hints, ui);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1032,7 +1048,12 @@ impl<'a> Widget for ItemTooltip<'a> {
|
||||
item.item_definition_id(),
|
||||
&self.localized_strings,
|
||||
) {
|
||||
widget::Text::new(&format!("{}\n{}", buy, sell))
|
||||
//Get localized tooltip strings (gotten here because these should only show if
|
||||
// in a trade- aka if buy/sell prices are present)
|
||||
let tt_hint_1 = self.localized_strings.get("hud.trade.tooltip_hint_1");
|
||||
let tt_hint_2 = self.localized_strings.get("hud.trade.tooltip_hint_2");
|
||||
|
||||
widget::Text::new(&format!("{}\n{}\n{}\n{}", buy, sell, tt_hint_1, tt_hint_2))
|
||||
.with_style(self.style.desc)
|
||||
.w(text_w)
|
||||
.get_h(ui)
|
||||
|
Loading…
Reference in New Issue
Block a user