formtaed code with cargo fmt

This commit is contained in:
parzivale 2022-08-23 19:18:18 +02:00
parent e7f472059d
commit 0ca2e64772
14 changed files with 304 additions and 158 deletions

View File

@ -230,7 +230,8 @@ impl<'a> Widget for BuffsBar<'a> {
let title = hud::get_buff_title(buff.kind, localized_strings);
let desc_txt = hud::get_buff_desc(buff.kind, buff.data, localized_strings);
let remaining_time = hud::get_buff_time(*buff);
let click_to_remove = format!("<{}>", &localized_strings.get_msg("buff-remove"));
let click_to_remove =
format!("<{}>", &localized_strings.get_msg("buff-remove"));
let desc = format!("{}\n\n{}\n\n{}", desc_txt, remaining_time, click_to_remove);
// Timer overlay
if Button::image(self.get_duration_image(duration_percentage))
@ -388,7 +389,8 @@ impl<'a> Widget for BuffsBar<'a> {
let title = hud::get_buff_title(buff.kind, localized_strings);
let desc_txt = hud::get_buff_desc(buff.kind, buff.data, localized_strings);
let remaining_time = hud::get_buff_time(*buff);
let click_to_remove = format!("<{}>", &localized_strings.get_msg("buff-remove"));
let click_to_remove =
format!("<{}>", &localized_strings.get_msg("buff-remove"));
let desc = if buff.is_buff {
format!("{}\n\n{}", desc_txt, click_to_remove)
} else {

View File

@ -1804,13 +1804,17 @@ impl<'a> Widget for Crafting<'a> {
}
} else if *sel_crafting_tab == CraftingTab::Dismantle {
// Title
Text::new(&self.localized_strings.get_msg("hud-crafting-dismantle_title"))
.mid_top_with_margin_on(state.ids.align_ing, 0.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(24))
.color(TEXT_COLOR)
.parent(state.ids.window)
.set(state.ids.dismantle_title, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-crafting-dismantle_title"),
)
.mid_top_with_margin_on(state.ids.align_ing, 0.0)
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(24))
.color(TEXT_COLOR)
.parent(state.ids.window)
.set(state.ids.dismantle_title, ui);
// Bench Icon
let size = 140.0;

View File

@ -4588,7 +4588,9 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow<s
BuffKind::Saturation { .. } => localized_strings.get_msg("buff-title-saturation"),
BuffKind::Potion { .. } => localized_strings.get_msg("buff-title-potion"),
BuffKind::CampfireHeal { .. } => localized_strings.get_msg("buff-title-campfire_heal"),
BuffKind::IncreaseMaxHealth { .. } => localized_strings.get_msg("buff-title-IncreaseMaxHealth"),
BuffKind::IncreaseMaxHealth { .. } => {
localized_strings.get_msg("buff-title-IncreaseMaxHealth")
},
BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get_msg("buff-title-energyup"),
BuffKind::Invulnerability => localized_strings.get_msg("buff-title-invulnerability"),
BuffKind::ProtectingWard => localized_strings.get_msg("buff-title-protectingward"),
@ -4617,8 +4619,12 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz
"rate" => data.strength * 100.0
})
},
BuffKind::IncreaseMaxHealth { .. } => localized_strings.get_msg("buff-desc-IncreaseMaxHealth"),
BuffKind::IncreaseMaxEnergy { .. } => localized_strings.get_msg("buff-desc-IncreaseMaxEnergy"),
BuffKind::IncreaseMaxHealth { .. } => {
localized_strings.get_msg("buff-desc-IncreaseMaxHealth")
},
BuffKind::IncreaseMaxEnergy { .. } => {
localized_strings.get_msg("buff-desc-IncreaseMaxEnergy")
},
BuffKind::Invulnerability => localized_strings.get_msg("buff-desc-invulnerability"),
BuffKind::ProtectingWard => localized_strings.get_msg("buff-desc-protectingward"),
BuffKind::Frenzied => localized_strings.get_msg("buff-desc-frenzied"),

View File

@ -196,7 +196,11 @@ impl<'a> Widget for Controls<'a> {
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.down_from(prev_id, 20.0)
.label(&self.localized_strings.get_msg("hud-settings-reset_keybinds"))
.label(
&self
.localized_strings
.get_msg("hud-settings-reset_keybinds"),
)
.label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)

View File

@ -122,12 +122,16 @@ impl<'a> Widget for Gameplay<'a> {
let display_clamp = self.global_state.settings.gameplay.camera_clamp_angle;
// Mouse Pan Sensitivity
Text::new(&self.localized_strings.get_msg("hud-setting-pan_sensitivity"))
.top_left_with_margins_on(state.ids.window, 10.0, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.mouse_pan_label, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-setting-pan_sensitivity"),
)
.top_left_with_margins_on(state.ids.window, 10.0, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.mouse_pan_label, ui);
if let Some(new_val) = ImageSlider::discrete(
display_pan,
@ -154,12 +158,16 @@ impl<'a> Widget for Gameplay<'a> {
.set(state.ids.mouse_pan_value, ui);
// Mouse Zoom Sensitivity
Text::new(&self.localized_strings.get_msg("hud-settings-zoom_sensitivity"))
.down_from(state.ids.mouse_pan_slider, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.mouse_zoom_label, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-zoom_sensitivity"),
)
.down_from(state.ids.mouse_pan_slider, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.mouse_zoom_label, ui);
if let Some(new_val) = ImageSlider::discrete(
display_zoom,
@ -526,7 +534,11 @@ impl<'a> Widget for Gameplay<'a> {
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.down_from(state.ids.camera_clamp_behavior_list, 12.0)
.label(&self.localized_strings.get_msg("hud-settings-reset_gameplay"))
.label(
&self
.localized_strings
.get_msg("hud-settings-reset_gameplay"),
)
.label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)

View File

@ -319,13 +319,17 @@ impl<'a> Widget for Interface<'a> {
events.push(ToggleHotkeyHints(show_hotkey_hints));
}
Text::new(&self.localized_strings.get_msg("hud-settings-show_hotkey_hints"))
.right_from(state.ids.hotkey_hints_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.hotkey_hints_button)
.color(TEXT_COLOR)
.set(state.ids.hotkey_hints_button_label, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-show_hotkey_hints"),
)
.right_from(state.ids.hotkey_hints_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.hotkey_hints_button)
.color(TEXT_COLOR)
.set(state.ids.hotkey_hints_button_label, ui);
// Ui Scale
Text::new(&self.localized_strings.get_msg("hud-settings-ui_scale"))
@ -362,13 +366,17 @@ impl<'a> Widget for Interface<'a> {
events.push(UiScale(ScaleChange::ToRelative));
}
Text::new(&self.localized_strings.get_msg("hud-settings-relative_scaling"))
.right_from(state.ids.relative_to_win_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.relative_to_win_button)
.color(TEXT_COLOR)
.set(state.ids.relative_to_win_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-relative_scaling"),
)
.right_from(state.ids.relative_to_win_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.relative_to_win_button)
.color(TEXT_COLOR)
.set(state.ids.relative_to_win_text, ui);
// Absolute Scaling Button
let (check_img, check_mo_img, check_press_img, absolute_selected) = match ui_scale {
@ -397,13 +405,17 @@ impl<'a> Widget for Interface<'a> {
events.push(UiScale(ScaleChange::ToAbsolute));
}
Text::new(&self.localized_strings.get_msg("hud-settings-custom_scaling"))
.right_from(state.ids.absolute_scale_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.absolute_scale_button)
.color(TEXT_COLOR)
.set(state.ids.absolute_scale_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-custom_scaling"),
)
.right_from(state.ids.absolute_scale_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.absolute_scale_button)
.color(TEXT_COLOR)
.set(state.ids.absolute_scale_text, ui);
// Slider -> Inactive when "Relative to window" is selected
if let ScaleMode::Absolute(scale) = ui_scale {
@ -648,13 +660,17 @@ impl<'a> Widget for Interface<'a> {
ShortcutNumbers::Off => events.push(ToggleShortcutNumbers(ShortcutNumbers::On)),
}
}
Text::new(&self.localized_strings.get_msg("hud-settings-toggle_shortcuts"))
.right_from(state.ids.show_shortcuts_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.show_shortcuts_button)
.color(TEXT_COLOR)
.set(state.ids.show_shortcuts_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-toggle_shortcuts"),
)
.right_from(state.ids.show_shortcuts_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.show_shortcuts_button)
.color(TEXT_COLOR)
.set(state.ids.show_shortcuts_text, ui);
// Buff Position
// Buffs above skills
if Button::image(match self.global_state.settings.interface.buff_position {
@ -676,13 +692,17 @@ impl<'a> Widget for Interface<'a> {
{
events.push(BuffPosition(BuffPosition::Bar))
}
Text::new(&self.localized_strings.get_msg("hud-settings-buffs_skillbar"))
.right_from(state.ids.buff_pos_bar_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.show_shortcuts_button)
.color(TEXT_COLOR)
.set(state.ids.buff_pos_bar_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-buffs_skillbar"),
)
.right_from(state.ids.buff_pos_bar_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.show_shortcuts_button)
.color(TEXT_COLOR)
.set(state.ids.buff_pos_bar_text, ui);
// Buffs left from minimap
if Button::image(match self.global_state.settings.interface.buff_position {
BuffPosition::Map => self.imgs.check_checked,
@ -823,13 +843,17 @@ impl<'a> Widget for Interface<'a> {
!self.global_state.settings.interface.sct_inc_dmg,
))
}
Text::new(&self.localized_strings.get_msg("hud-settings-incoming_damage"))
.right_from(state.ids.sct_show_inc_dmg_radio, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.sct_show_inc_dmg_radio)
.color(TEXT_COLOR)
.set(state.ids.sct_show_inc_dmg_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-incoming_damage"),
)
.right_from(state.ids.sct_show_inc_dmg_radio, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.sct_show_inc_dmg_radio)
.color(TEXT_COLOR)
.set(state.ids.sct_show_inc_dmg_text, ui);
if self.global_state.settings.interface.sct_inc_dmg {
Text::new(
&self
@ -997,12 +1021,16 @@ impl<'a> Widget for Interface<'a> {
// Energybars Numbers
// Hotbar text
Text::new(&self.localized_strings.get_msg("hud-settings-energybar_numbers"))
.down_from(state.ids.speech_bubble_icon_button, 20.0)
.font_size(self.fonts.cyri.scale(18))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.bar_numbers_title, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-energybar_numbers"),
)
.down_from(state.ids.speech_bubble_icon_button, 20.0)
.font_size(self.fonts.cyri.scale(18))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.bar_numbers_title, ui);
// None
if Button::image(if let BarNumbers::Off = bar_values {
@ -1113,13 +1141,17 @@ impl<'a> Widget for Interface<'a> {
events.push(ToggleAlwaysShowBars(always_show_bars));
}
Text::new(&self.localized_strings.get_msg("hud-settings-always_show_bars"))
.right_from(state.ids.always_show_bars_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.always_show_bars_button)
.color(TEXT_COLOR)
.set(state.ids.always_show_bars_label, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-always_show_bars"),
)
.right_from(state.ids.always_show_bars_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.always_show_bars_button)
.color(TEXT_COLOR)
.set(state.ids.always_show_bars_label, ui);
// Experience Numbers
Text::new(
@ -1169,7 +1201,11 @@ impl<'a> Widget for Interface<'a> {
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.down_from(state.ids.buff_pos_map_button, 12.0)
.label(&self.localized_strings.get_msg("hud-settings-reset_interface"))
.label(
&self
.localized_strings
.get_msg("hud-settings-reset_interface"),
)
.label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)

View File

@ -149,13 +149,17 @@ impl<'a> Widget for Language<'a> {
events.push(ToggleEnglishFallback(show_english_fallback));
}
Text::new(&self.localized_strings.get_msg("hud-settings-english_fallback"))
.right_from(state.ids.english_fallback_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.english_fallback_button)
.color(TEXT_COLOR)
.set(state.ids.english_fallback_button_label, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-english_fallback"),
)
.right_from(state.ids.english_fallback_button, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.graphics_for(state.ids.english_fallback_button)
.color(TEXT_COLOR)
.set(state.ids.english_fallback_button_label, ui);
events
}

View File

@ -255,12 +255,16 @@ impl<'a> Widget for Sound<'a> {
.color(TEXT_COLOR)
.set(state.ids.sfx_volume_number, ui);
// Ambience Volume
Text::new(&self.localized_strings.get_msg("hud-settings-ambience_volume"))
.down_from(state.ids.sfx_volume_slider, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.ambience_volume_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-ambience_volume"),
)
.down_from(state.ids.sfx_volume_slider, 10.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.ambience_volume_text, ui);
// Ambience Volume Slider
if let Some(new_val) = ImageSlider::continuous(
self.global_state.settings.audio.ambience_volume,

View File

@ -382,13 +382,17 @@ impl<'a> Widget for Video<'a> {
.set(state.ids.max_fps_value, ui);
// Max Background FPS
Text::new(&self.localized_strings.get_msg("hud-settings-background_fps"))
.down_from(state.ids.ld_slider, 10.0)
.right_from(state.ids.max_fps_value, 30.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.max_background_fps_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-background_fps"),
)
.down_from(state.ids.ld_slider, 10.0)
.right_from(state.ids.max_fps_value, 30.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.max_background_fps_text, ui);
if let Some(which) = ImageSlider::discrete(
BG_FPS_CHOICES
@ -444,7 +448,9 @@ impl<'a> Widget for Video<'a> {
PresentMode::Immediate,
];
let mode_label_list = [
&self.localized_strings.get_msg("hud-settings-present_mode-fifo"),
&self
.localized_strings
.get_msg("hud-settings-present_mode-fifo"),
&self
.localized_strings
.get_msg("hud-settings-present_mode-mailbox"),
@ -727,12 +733,16 @@ impl<'a> Widget for Video<'a> {
.set(state.ids.figure_dist_value, ui);
// AaMode
Text::new(&self.localized_strings.get_msg("hud-settings-antialiasing_mode"))
.down_from(state.ids.gamma_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.aa_mode_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-antialiasing_mode"),
)
.down_from(state.ids.gamma_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.aa_mode_text, ui);
// NOTE: MSAA modes are currently disabled from the UI due to poor
// interaction with greedy meshing, and may eventually be removed.
@ -866,12 +876,16 @@ impl<'a> Widget for Video<'a> {
.set(state.ids.point_glow_value, ui);
// Upscaling factor
Text::new(&self.localized_strings.get_msg("hud-settings-upscale_factor"))
.down_from(state.ids.bloom_intensity_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.upscale_factor_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-upscale_factor"),
)
.down_from(state.ids.bloom_intensity_slider, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.upscale_factor_text, ui);
let upscale_factors = [
// Upscaling
@ -1243,12 +1257,16 @@ impl<'a> Widget for Video<'a> {
}
// Disable flashing lights
Text::new(&self.localized_strings.get_msg("hud-settings-flashing_lights"))
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.down_from(state.ids.particles_label, 25.0)
.color(TEXT_COLOR)
.set(state.ids.flashing_lights_label, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-flashing_lights"),
)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.down_from(state.ids.particles_label, 25.0)
.color(TEXT_COLOR)
.set(state.ids.flashing_lights_label, ui);
let flashing_lights_enabled = ToggleButton::new(
self.global_state
@ -1368,10 +1386,12 @@ impl<'a> Widget for Video<'a> {
.set(state.ids.bit_depth_label, ui);
if let Some(clicked) = DropDownList::new(
once(String::from(self.localized_strings.get_msg("common-automatic")))
.chain(bit_depths.iter().map(|depth| format!("{}", depth)))
.collect::<Vec<String>>()
.as_slice(),
once(String::from(
self.localized_strings.get_msg("common-automatic"),
))
.chain(bit_depths.iter().map(|depth| format!("{}", depth)))
.collect::<Vec<String>>()
.as_slice(),
match self.global_state.settings.graphics.fullscreen.bit_depth {
Some(bit_depth) => bit_depths
.iter()
@ -1422,10 +1442,12 @@ impl<'a> Widget for Video<'a> {
.set(state.ids.refresh_rate_label, ui);
if let Some(clicked) = DropDownList::new(
once(String::from(self.localized_strings.get_msg("common-automatic")))
.chain(refresh_rates.iter().map(|rate| format!("{}", rate)))
.collect::<Vec<String>>()
.as_slice(),
once(String::from(
self.localized_strings.get_msg("common-automatic"),
))
.chain(refresh_rates.iter().map(|rate| format!("{}", rate)))
.collect::<Vec<String>>()
.as_slice(),
match self.global_state.settings.graphics.fullscreen.refresh_rate {
Some(refresh_rate) => refresh_rates
.iter()
@ -1479,12 +1501,16 @@ impl<'a> Widget for Video<'a> {
}
// Fullscreen Mode
Text::new(&self.localized_strings.get_msg("hud-settings-fullscreen_mode"))
.down_from(state.ids.fullscreen_label, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.fullscreen_mode_text, ui);
Text::new(
&self
.localized_strings
.get_msg("hud-settings-fullscreen_mode"),
)
.down_from(state.ids.fullscreen_label, 8.0)
.font_size(self.fonts.cyri.scale(14))
.font_id(self.fonts.cyri.conrod_id)
.color(TEXT_COLOR)
.set(state.ids.fullscreen_mode_text, ui);
let mode_list = [FullscreenMode::Exclusive, FullscreenMode::Borderless];
let mode_label_list = [
@ -1521,7 +1547,11 @@ impl<'a> Widget for Video<'a> {
.hover_image(self.imgs.button_hover)
.press_image(self.imgs.button_press)
.down_from(state.ids.fullscreen_mode_list, 12.0)
.label(&self.localized_strings.get_msg("hud-settings-save_window_size"))
.label(
&self
.localized_strings
.get_msg("hud-settings-save_window_size"),
)
.label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)
@ -1545,7 +1575,11 @@ impl<'a> Widget for Video<'a> {
.press_image(self.imgs.button_press)
.down_from(state.ids.fullscreen_mode_list, 12.0)
.right_from(state.ids.save_window_size_button, 12.0)
.label(&self.localized_strings.get_msg("hud-settings-reset_graphics"))
.label(
&self
.localized_strings
.get_msg("hud-settings-reset_graphics"),
)
.label_font_size(self.fonts.cyri.scale(14))
.label_color(TEXT_COLOR)
.label_font_id(self.fonts.cyri.conrod_id)

View File

@ -455,8 +455,12 @@ impl<'a> Skillbar<'a> {
// Bar Text
let bar_text = if self.health.is_dead {
Some((
self.localized_strings.get_msg("hud-group-dead").into_owned(),
self.localized_strings.get_msg("hud-group-dead").into_owned(),
self.localized_strings
.get_msg("hud-group-dead")
.into_owned(),
self.localized_strings
.get_msg("hud-group-dead")
.into_owned(),
))
} else if let BarNumbers::Values = bar_values {
Some((

View File

@ -161,9 +161,15 @@ impl<'a> Trade<'a> {
trade: &'a PendingTrade,
) {
let phase_text = match trade.phase() {
TradePhase::Mutate => self.localized_strings.get_msg("hud-trade-phase1_description"),
TradePhase::Review => self.localized_strings.get_msg("hud-trade-phase2_description"),
TradePhase::Complete => self.localized_strings.get_msg("hud-trade-phase3_description"),
TradePhase::Mutate => self
.localized_strings
.get_msg("hud-trade-phase1_description"),
TradePhase::Review => self
.localized_strings
.get_msg("hud-trade-phase2_description"),
TradePhase::Complete => self
.localized_strings
.get_msg("hud-trade-phase3_description"),
};
Text::new(&phase_text)

View File

@ -240,8 +240,11 @@ impl PlayState for CharSelectionState {
}
},
Err(err) => {
global_state.info_message =
Some(localized_strings.get_msg("common-connection_lost").into_owned());
global_state.info_message = Some(
localized_strings
.get_msg("common-connection_lost")
.into_owned(),
);
error!(?err, "[char_selection] Failed to tick the client");
return PlayStateResult::Pop;
},

View File

@ -250,8 +250,11 @@ impl PlayState for MainMenuState {
}
},
Err(err) => {
global_state.info_message =
Some(localized_strings.get_msg("common-connection_lost").into_owned());
global_state.info_message = Some(
localized_strings
.get_msg("common-connection_lost")
.into_owned(),
);
error!(?err, "[main menu] Failed to tick the client");
self.init = InitState::None;
},
@ -444,7 +447,11 @@ fn get_client_msg_error(
mismatched_server_info,
} => match error {
Error::SpecsErr(e) => {
format!("{}: {}", localization.get_msg("main-login-internal_error"), e)
format!(
"{}: {}",
localization.get_msg("main-login-internal_error"),
e
)
},
Error::AuthErr(e) => format!(
"{}: {}",
@ -453,9 +460,9 @@ fn get_client_msg_error(
),
Error::Kicked(e) => e,
Error::TooManyPlayers => localization.get_msg("main-login-server_full").into(),
Error::AuthServerNotTrusted => {
localization.get_msg("main-login-untrusted_auth_server").into()
},
Error::AuthServerNotTrusted => localization
.get_msg("main-login-untrusted_auth_server")
.into(),
Error::ServerTimeout => localization.get_msg("main-login-timeout").into(),
Error::ServerShutdown => localization.get_msg("main-login-server_shut_down").into(),
Error::NotOnWhitelist => localization.get_msg("main-login-not_on_whitelist").into(),
@ -475,7 +482,11 @@ fn get_client_msg_error(
Error::ParticipantErr(e) => net_error(e.to_string(), mismatched_server_info),
Error::StreamErr(e) => net_error(e.to_string(), mismatched_server_info),
Error::HostnameLookupFailed(e) => {
format!("{}: {}", localization.get_msg("main-login-server_not_found"), e)
format!(
"{}: {}",
localization.get_msg("main-login-server_not_found"),
e
)
},
Error::Other(e) => {
format!("{}: {}", localization.get_msg("common-error"), e)
@ -492,9 +503,9 @@ fn get_client_msg_error(
localization.get_msg("main-login-failed_sending_request"),
e
),
client::AuthClientError::InsecureSchema => {
localization.get_msg("main-login-insecure_auth_scheme").into()
},
client::AuthClientError::InsecureSchema => localization
.get_msg("main-login-insecure_auth_scheme")
.into(),
client::AuthClientError::ServerError(_, e) => String::from_utf8_lossy(&e).into(),
},
Error::AuthServerUrlInvalid(e) => {

View File

@ -868,7 +868,11 @@ impl<'a> Widget for ItemTooltip<'a> {
// Slots
if item.num_slots() > 0 {
stat_text(
format!("{} : {}", i18n.get_msg("common-stats-slots"), item.num_slots()),
format!(
"{} : {}",
i18n.get_msg("common-stats-slots"),
item.num_slots()
),
index,
);
}
@ -1006,7 +1010,11 @@ impl<'a> Widget for ItemTooltip<'a> {
stats.power * 10.0
)
} else {
format!("{} : x{:.2}", i18n.get_msg("common-stats-power"), stats.power)
format!(
"{} : x{:.2}",
i18n.get_msg("common-stats-power"),
stats.power
)
};
widget::Text::new(&power_text)
.x_align_to(state.ids.item_frame, conrod_core::position::Align::Start)
@ -1025,7 +1033,11 @@ impl<'a> Widget for ItemTooltip<'a> {
(stats.speed - 1.0) * 100.0
)
} else {
format!("{} : x{:.2}", i18n.get_msg("common-stats-speed"), stats.speed)
format!(
"{} : x{:.2}",
i18n.get_msg("common-stats-speed"),
stats.speed
)
};
widget::Text::new(&speed_text)
.graphics_for(id)
@ -1089,7 +1101,11 @@ impl<'a> Widget for ItemTooltip<'a> {
(stats.range - 1.0) * 100.0
)
} else {
format!("{} : x{:.2}", i18n.get_msg("common-stats-range"), stats.range)
format!(
"{} : x{:.2}",
i18n.get_msg("common-stats-range"),
stats.range
)
};
widget::Text::new(&range_text)
.graphics_for(id)