mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Addressed feedback
This commit is contained in:
parent
807a8bcea0
commit
e4ebd17363
@ -30,16 +30,12 @@ hud-crafting-tabs-utility = Utility
|
|||||||
hud-crafting-tabs-weapon = Weapons
|
hud-crafting-tabs-weapon = Weapons
|
||||||
hud-crafting-tabs-bag = Bags
|
hud-crafting-tabs-bag = Bags
|
||||||
hud-crafting-tabs-processed_material = Materials
|
hud-crafting-tabs-processed_material = Materials
|
||||||
hud-crafting-tabs-repair = Repair
|
|
||||||
hud-crafting-dismantle_title = Dismantling
|
hud-crafting-dismantle_title = Dismantling
|
||||||
hud-crafting-dismantle_explanation =
|
hud-crafting-dismantle_explanation =
|
||||||
Hover items in your bag to see what
|
Hover items in your bag to see what
|
||||||
you can salvage.
|
you can salvage.
|
||||||
|
|
||||||
Double-Click them to start dismantling.
|
Double-Click them to start dismantling.
|
||||||
hud-crafting-repair_title = Repair Items
|
|
||||||
hud-crafting-repair_slot_title = Damaged Item
|
|
||||||
hud-crafting-repair_slot_desc = Place a damaged item here to repair it.
|
|
||||||
hud-crafting-modular_desc = Drag Item-Parts here to craft a weapon
|
hud-crafting-modular_desc = Drag Item-Parts here to craft a weapon
|
||||||
hud-crafting-mod_weap_prim_slot_title = Primary Weapon Component
|
hud-crafting-mod_weap_prim_slot_title = Primary Weapon Component
|
||||||
hud-crafting-mod_weap_prim_slot_desc = Place a primary weapon component here (e.g. a sword blade, axe head, or bow limbs).
|
hud-crafting-mod_weap_prim_slot_desc = Place a primary weapon component here (e.g. a sword blade, axe head, or bow limbs).
|
||||||
|
@ -38,7 +38,7 @@ impl ArmorKind {
|
|||||||
Back => true,
|
Back => true,
|
||||||
Ring => false,
|
Ring => false,
|
||||||
Neck => false,
|
Neck => false,
|
||||||
Head => false,
|
Head => true,
|
||||||
Tabard => false,
|
Tabard => false,
|
||||||
Bag => false,
|
Bag => false,
|
||||||
}
|
}
|
||||||
|
@ -218,11 +218,12 @@ impl Mul<DurabilityMultiplier> for Stats {
|
|||||||
|
|
||||||
fn mul(self, value: DurabilityMultiplier) -> Self {
|
fn mul(self, value: DurabilityMultiplier) -> Self {
|
||||||
let DurabilityMultiplier(value) = value;
|
let DurabilityMultiplier(value) = value;
|
||||||
|
let less_scaled = value * 0.5 + 0.5;
|
||||||
Self {
|
Self {
|
||||||
equip_time_secs: self.equip_time_secs / value.max(0.01),
|
equip_time_secs: self.equip_time_secs / less_scaled.max(0.01),
|
||||||
power: self.power * value,
|
power: self.power * value,
|
||||||
effect_power: self.effect_power * value,
|
effect_power: self.effect_power * value,
|
||||||
speed: self.speed * value,
|
speed: self.speed * less_scaled,
|
||||||
crit_chance: self.crit_chance * value,
|
crit_chance: self.crit_chance * value,
|
||||||
range: self.range * value,
|
range: self.range * value,
|
||||||
energy_efficiency: self.energy_efficiency * value,
|
energy_efficiency: self.energy_efficiency * value,
|
||||||
|
@ -5,7 +5,8 @@ use common::{
|
|||||||
item::{
|
item::{
|
||||||
armor::{Armor, ArmorKind, Protection},
|
armor::{Armor, ArmorKind, Protection},
|
||||||
tool::{Hands, Tool, ToolKind},
|
tool::{Hands, Tool, ToolKind},
|
||||||
Effects, ItemDefinitionId, ItemDesc, ItemKind, MaterialKind, MaterialStatManifest,
|
Effects, Item, ItemDefinitionId, ItemDesc, ItemKind, MaterialKind,
|
||||||
|
MaterialStatManifest,
|
||||||
},
|
},
|
||||||
BuffKind,
|
BuffKind,
|
||||||
},
|
},
|
||||||
@ -355,6 +356,14 @@ pub fn protec2string(stat: Protection) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets the durability of an item in a format more intuitive for UI
|
||||||
|
pub fn item_durability(item: &dyn ItemDesc) -> Option<u32> {
|
||||||
|
let durability = item
|
||||||
|
.durability()
|
||||||
|
.or_else(|| item.has_durability().then_some(0));
|
||||||
|
durability.map(|d| Item::MAX_DURABILITY - d)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id {
|
pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id {
|
||||||
match ability_id {
|
match ability_id {
|
||||||
// Debug stick
|
// Debug stick
|
||||||
|
@ -711,6 +711,13 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
equipped_tool_stats.buff_strength,
|
equipped_tool_stats.buff_strength,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let tool_durability =
|
||||||
|
util::item_durability(item).unwrap_or(Item::MAX_DURABILITY);
|
||||||
|
let equipped_durability =
|
||||||
|
util::item_durability(equipped_item).unwrap_or(Item::MAX_DURABILITY);
|
||||||
|
let durability_diff =
|
||||||
|
util::comparison(tool_durability, equipped_durability);
|
||||||
|
|
||||||
let mut diff_text = |text: String, color, id_index| {
|
let mut diff_text = |text: String, color, id_index| {
|
||||||
widget::Text::new(&text)
|
widget::Text::new(&text)
|
||||||
.align_middle_y_of(state.ids.stats[id_index])
|
.align_middle_y_of(state.ids.stats[id_index])
|
||||||
@ -766,6 +773,14 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
);
|
);
|
||||||
diff_text(text, buff_strength_diff.1, 6)
|
diff_text(text, buff_strength_diff.1, 6)
|
||||||
}
|
}
|
||||||
|
if tool_durability != equipped_durability {
|
||||||
|
let text = format!(
|
||||||
|
"{} {}",
|
||||||
|
&durability_diff.0,
|
||||||
|
tool_durability as i32 - equipped_durability as i32
|
||||||
|
);
|
||||||
|
diff_text(text, durability_diff.1, 7)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -890,8 +905,7 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
index += 1;
|
index += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if item.has_durability() {
|
if let Some(durability) = util::item_durability(item) {
|
||||||
let durability = Item::MAX_DURABILITY - item.durability().unwrap_or(0);
|
|
||||||
stat_text(
|
stat_text(
|
||||||
format!(
|
format!(
|
||||||
"{} : {}/{}",
|
"{} : {}/{}",
|
||||||
@ -931,6 +945,11 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
let stealth_diff =
|
let stealth_diff =
|
||||||
util::option_comparison(&armor_stats.stealth, &equipped_stats.stealth);
|
util::option_comparison(&armor_stats.stealth, &equipped_stats.stealth);
|
||||||
|
|
||||||
|
let armor_durability = util::item_durability(item);
|
||||||
|
let equipped_durability = util::item_durability(equipped_item);
|
||||||
|
let durability_diff =
|
||||||
|
util::option_comparison(&armor_durability, &equipped_durability);
|
||||||
|
|
||||||
let mut diff_text = |text: String, color, id_index| {
|
let mut diff_text = |text: String, color, id_index| {
|
||||||
widget::Text::new(&text)
|
widget::Text::new(&text)
|
||||||
.align_middle_y_of(state.ids.stats[id_index])
|
.align_middle_y_of(state.ids.stats[id_index])
|
||||||
@ -999,6 +1018,14 @@ impl<'a> Widget for ItemTooltip<'a> {
|
|||||||
diff_text(text, stealth_diff.1, index);
|
diff_text(text, stealth_diff.1, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
index += armor_stats.stealth.is_some() as usize;
|
||||||
|
|
||||||
|
if armor_durability != equipped_durability {
|
||||||
|
let diff = armor_durability.unwrap_or(Item::MAX_DURABILITY) as i32
|
||||||
|
- equipped_durability.unwrap_or(Item::MAX_DURABILITY) as i32;
|
||||||
|
let text = format!("{} {}", &durability_diff.0, diff);
|
||||||
|
diff_text(text, durability_diff.1, index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user