Show ctrl-click and shift-click usage in item tooltips during trades.

This commit is contained in:
Rickey Chamblee 2021-04-11 22:56:02 +00:00 committed by Marcel
parent dc4c02baad
commit 8a25ebb59a
3 changed files with 25 additions and 1 deletions

View File

@ -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 - Merchants now have stacks of stackable items instead of just one per slot
- Bag tooltips only show slots now - Bag tooltips only show slots now
- Removed infinite armour values from most admin items - 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 ### Removed

View File

@ -19,6 +19,8 @@
"hud.trade.buy_price": "Buy price", "hud.trade.buy_price": "Buy price",
"hud.trade.sell_price": "Sell Price", "hud.trade.sell_price": "Sell Price",
"hud.trade.coin": "coin(s)", "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.>",
}, },

View File

@ -293,6 +293,7 @@ widget_ids! {
desc, desc,
prices_buy, prices_buy,
prices_sell, prices_sell,
tooltip_hints,
main_stat, main_stat,
main_stat_text, main_stat_text,
stats[], stats[],
@ -951,6 +952,21 @@ impl<'a> Widget for ItemTooltip<'a> {
.down_from(state.ids.prices_buy, V_PAD_STATS) .down_from(state.ids.prices_buy, V_PAD_STATS)
.w(text_w) .w(text_w)
.set(state.ids.prices_sell, ui); .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(), item.item_definition_id(),
&self.localized_strings, &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) .with_style(self.style.desc)
.w(text_w) .w(text_w)
.get_h(ui) .get_h(ui)