mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'pfau/fix-fonts' into 'master'
Fix Fonts See merge request veloren/veloren!806
This commit is contained in:
commit
4b3d61f41d
@ -35,7 +35,7 @@ VoxygenLocalization(
|
||||
scale_ratio: 1.0,
|
||||
),
|
||||
"cyri": Font (
|
||||
asset_key: "voxygen.font.haxrcorp_4089_cyrillic_altgr",
|
||||
asset_key: "voxygen.font.haxrcorp_4089_cyrillic_altgr_extended",
|
||||
scale_ratio: 1.0,
|
||||
),
|
||||
},
|
||||
|
@ -31,7 +31,7 @@ pub struct Buttons<'a> {
|
||||
show_bag: bool,
|
||||
|
||||
imgs: &'a Imgs,
|
||||
_fonts: &'a ConrodVoxygenFonts,
|
||||
fonts: &'a ConrodVoxygenFonts,
|
||||
#[conrod(common_builder)]
|
||||
common: widget::CommonBuilder,
|
||||
}
|
||||
@ -49,7 +49,7 @@ impl<'a> Buttons<'a> {
|
||||
show_map,
|
||||
show_bag,
|
||||
imgs,
|
||||
_fonts: fonts,
|
||||
fonts,
|
||||
common: widget::CommonBuilder::default(),
|
||||
}
|
||||
}
|
||||
@ -101,6 +101,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
Text::new("B")
|
||||
.bottom_right_with_margins_on(state.ids.bag, 0.0, 0.0)
|
||||
.font_size(10)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.bag_text, ui);
|
||||
} else {
|
||||
@ -111,6 +112,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
Text::new("B")
|
||||
.bottom_right_with_margins_on(state.ids.bag, 0.0, 0.0)
|
||||
.font_size(10)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.bag_text, ui);
|
||||
}
|
||||
@ -122,6 +124,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
.hover_image(self.imgs.settings_hover)
|
||||
.press_image(self.imgs.settings_press)
|
||||
.label("N")
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.label_font_size(10)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_y(conrod_core::position::Relative::Scalar(-7.0))
|
||||
@ -144,6 +147,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
.hover_image(self.imgs.map_hover)
|
||||
.press_image(self.imgs.map_press)
|
||||
.label("M")
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.label_font_size(10)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_y(conrod_core::position::Relative::Scalar(-7.0))
|
||||
@ -185,6 +189,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
.hover_image(self.imgs.social_hover)
|
||||
.press_image(self.imgs.social_press)
|
||||
.label("O")
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.label_font_size(10)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_y(conrod_core::position::Relative::Scalar(-7.0))
|
||||
@ -202,6 +207,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
.hover_image(self.imgs.spellbook_hover)
|
||||
.press_image(self.imgs.spellbook_press)
|
||||
.label("P")
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.label_font_size(10)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_y(conrod_core::position::Relative::Scalar(-7.0))
|
||||
@ -219,6 +225,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
.hover_image(self.imgs.character_hover)
|
||||
.press_image(self.imgs.character_press)
|
||||
.label("C")
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.label_font_size(10)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_y(conrod_core::position::Relative::Scalar(-7.0))
|
||||
@ -236,6 +243,7 @@ impl<'a> Widget for Buttons<'a> {
|
||||
.hover_image(self.imgs.qlog_hover)
|
||||
.press_image(self.imgs.qlog_press)
|
||||
.label("L")
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.label_font_size(10)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_y(conrod_core::position::Relative::Scalar(-7.0))
|
||||
|
@ -306,7 +306,7 @@ impl<'a> Widget for MiniMap<'a> {
|
||||
.font_size(
|
||||
self.fonts
|
||||
.cyri
|
||||
.scale(if self.show.mini_map { 30 } else { 18 }),
|
||||
.scale(if self.show.mini_map { 20 } else { 18 }),
|
||||
)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(TEXT_COLOR)
|
||||
|
@ -806,12 +806,14 @@ impl Hud {
|
||||
|
||||
Text::new(&format!("{}", (hp_damage).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
|
||||
.x_y(0.0, y - 3.0)
|
||||
.position_ingame(ingame_pos)
|
||||
.set(sct_bg_id, ui_widgets);
|
||||
Text::new(&format!("{}", hp_damage.abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.x_y(0.0, y)
|
||||
.color(if hp_damage < 0 {
|
||||
Color::Rgba(font_col.r, font_col.g, font_col.b, fade)
|
||||
@ -852,6 +854,7 @@ impl Hud {
|
||||
|
||||
Text::new(&format!("{}", (floater.hp_change).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(if floater.hp_change < 0 {
|
||||
Color::Rgba(0.0, 0.0, 0.0, fade)
|
||||
} else {
|
||||
@ -862,6 +865,7 @@ impl Hud {
|
||||
.set(sct_bg_id, ui_widgets);
|
||||
Text::new(&format!("{}", (floater.hp_change).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.x_y(0.0, y)
|
||||
.color(if floater.hp_change < 0 {
|
||||
Color::Rgba(font_col.r, font_col.g, font_col.b, fade)
|
||||
@ -919,6 +923,7 @@ impl Hud {
|
||||
((crate::ecs::sys::floater::MY_HP_SHOWTIME - timer) * 0.25) + 0.2;
|
||||
Text::new(&format!("{}", (hp_damage).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(if hp_damage < 0 {
|
||||
Color::Rgba(0.0, 0.0, 0.0, hp_fade)
|
||||
} else {
|
||||
@ -928,6 +933,7 @@ impl Hud {
|
||||
.set(player_sct_bg_id, ui_widgets);
|
||||
Text::new(&format!("{}", (hp_damage).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(if hp_damage < 0 {
|
||||
Color::Rgba(1.0, 0.1, 0.0, hp_fade)
|
||||
} else {
|
||||
@ -991,11 +997,13 @@ impl Hud {
|
||||
+ 0.2;
|
||||
Text::new(&format!("{}", (floater.hp_change).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, hp_fade))
|
||||
.x_y(x, y - 3.0)
|
||||
.set(player_sct_bg_id, ui_widgets);
|
||||
Text::new(&format!("{}", (floater.hp_change).abs()))
|
||||
.font_size(font_size)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(if floater.hp_change < 0 {
|
||||
Color::Rgba(1.0, 0.1, 0.0, hp_fade)
|
||||
} else {
|
||||
@ -1046,6 +1054,7 @@ impl Hud {
|
||||
|
||||
Text::new(&format!("{} Exp", exp_change))
|
||||
.font_size(font_size_xp)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
|
||||
.x_y(
|
||||
ui_widgets.win_w * (0.5 * rand.0 as f64 - 0.25),
|
||||
@ -1054,6 +1063,7 @@ impl Hud {
|
||||
.set(player_sct_bg_id, ui_widgets);
|
||||
Text::new(&format!("{} Exp", exp_change))
|
||||
.font_size(font_size_xp)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(Color::Rgba(0.59, 0.41, 0.67, fade))
|
||||
.x_y(
|
||||
ui_widgets.win_w * (0.5 * rand.0 as f64 - 0.25),
|
||||
@ -1087,6 +1097,7 @@ impl Hud {
|
||||
|
||||
Text::new(&format!("{} Exp", floater.exp_change))
|
||||
.font_size(font_size_xp)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
|
||||
.x_y(
|
||||
ui_widgets.win_w * (0.5 * floater.rand.0 as f64 - 0.25),
|
||||
@ -1095,6 +1106,7 @@ impl Hud {
|
||||
.set(player_sct_bg_id, ui_widgets);
|
||||
Text::new(&format!("{} Exp", floater.exp_change))
|
||||
.font_size(font_size_xp)
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.color(Color::Rgba(0.59, 0.41, 0.67, fade))
|
||||
.x_y(
|
||||
ui_widgets.win_w * (0.5 * floater.rand.0 as f64 - 0.25),
|
||||
@ -1167,13 +1179,15 @@ impl Hud {
|
||||
|
||||
// Name
|
||||
Text::new(&name)
|
||||
.font_size(self.fonts.cyri.scale(30))
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.font_size(30)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, 1.0))
|
||||
.x_y(-1.0, MANA_BAR_Y + 48.0)
|
||||
.position_ingame(ingame_pos)
|
||||
.set(name_bg_id, ui_widgets);
|
||||
Text::new(&name)
|
||||
.font_size(self.fonts.cyri.scale(30))
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.font_size(30)
|
||||
.color(Color::Rgba(0.61, 0.61, 0.89, 1.0))
|
||||
.x_y(0.0, MANA_BAR_Y + 50.0)
|
||||
.position_ingame(ingame_pos)
|
||||
@ -1193,6 +1207,7 @@ impl Hud {
|
||||
// -5 - +5 levels around player level -> equal
|
||||
// - 5 levels below player -> low
|
||||
Text::new(if level_comp < 10 { &level_str } else { "?" })
|
||||
.font_id(self.fonts.cyri.conrod_id)
|
||||
.font_size(if op_level > 9 && level_comp < 10 {
|
||||
14
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user