mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
translations, fixes
This commit is contained in:
parent
b30dfd1539
commit
099dfc959f
BIN
assets/voxygen/element/map/castle_bg.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/map/castle_bg.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/map/dungeon_bg.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/map/dungeon_bg.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/map/dungeon_bg2.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/map/dungeon_bg2.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/map/town_bg.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/map/town_bg.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -400,8 +400,17 @@ magischen Gegenstände ergattern?"#,
|
|||||||
|
|
||||||
"hud.free_look_indicator": "Freie Sicht aktiv",
|
"hud.free_look_indicator": "Freie Sicht aktiv",
|
||||||
"hud.auto_walk_indicator": "Automatisches Laufen aktiv",
|
"hud.auto_walk_indicator": "Automatisches Laufen aktiv",
|
||||||
|
"hud.map.difficulty": "Schwierigkeit",
|
||||||
|
"hud.map.towns": "Dörfer",
|
||||||
|
"hud.map.castles": "Festungen",
|
||||||
|
"hud.map.dungeons": "Dungeons",
|
||||||
|
"hud.map.town": "Dorf",
|
||||||
|
"hud.map.castle": "Festung",
|
||||||
|
"hud.map.dungeon": "Dungeon",
|
||||||
|
"hud.map.difficulty_dungeon": "Dungeon\n\nSchwierigkeit: {difficulty}",
|
||||||
|
"hud.map.drag": "Ziehen",
|
||||||
|
"hud.map.zoom": "Zoomen",
|
||||||
|
"hud.map.recenter": "Zurücksetzen",
|
||||||
/// End HUD section
|
/// End HUD section
|
||||||
/// Start GameInput section
|
/// Start GameInput section
|
||||||
|
|
||||||
|
@ -414,6 +414,18 @@ magically infused items?"#,
|
|||||||
"hud.free_look_indicator": "Free look active. Press {key} to disable.",
|
"hud.free_look_indicator": "Free look active. Press {key} to disable.",
|
||||||
"hud.auto_walk_indicator": "Auto walk active",
|
"hud.auto_walk_indicator": "Auto walk active",
|
||||||
|
|
||||||
|
"hud.map.difficulty": "Difficulty",
|
||||||
|
"hud.map.towns": "Towns",
|
||||||
|
"hud.map.castles": "Castles",
|
||||||
|
"hud.map.dungeons": "Dungeons",
|
||||||
|
"hud.map.town": "Town",
|
||||||
|
"hud.map.castle": "Castle",
|
||||||
|
"hud.map.dungeon": "Dungeon",
|
||||||
|
"hud.map.difficulty_dungeon": "Dungeon\n\nDifficulty: {difficulty}",
|
||||||
|
"hud.map.drag": "Drag",
|
||||||
|
"hud.map.zoom": "Zoom",
|
||||||
|
"hud.map.recenter": "Recenter",
|
||||||
|
|
||||||
/// End HUD section
|
/// End HUD section
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,10 +203,13 @@ image_ids! {
|
|||||||
map_dif_5: "voxygen.element.map.dif_5",
|
map_dif_5: "voxygen.element.map.dif_5",
|
||||||
mmap_site_town: "voxygen.element.map.town",
|
mmap_site_town: "voxygen.element.map.town",
|
||||||
mmap_site_town_hover: "voxygen.element.map.town_hover",
|
mmap_site_town_hover: "voxygen.element.map.town_hover",
|
||||||
|
mmap_site_town_bg: "voxygen.element.map.town_bg",
|
||||||
mmap_site_dungeon: "voxygen.element.map.dungeon",
|
mmap_site_dungeon: "voxygen.element.map.dungeon",
|
||||||
mmap_site_dungeon_hover: "voxygen.element.map.dungeon_hover",
|
mmap_site_dungeon_hover: "voxygen.element.map.dungeon_hover",
|
||||||
|
mmap_site_dungeon_bg: "voxygen.element.map.dungeon_bg",
|
||||||
mmap_site_castle: "voxygen.element.map.castle",
|
mmap_site_castle: "voxygen.element.map.castle",
|
||||||
mmap_site_castle_hover: "voxygen.element.map.castle_hover",
|
mmap_site_castle_hover: "voxygen.element.map.castle_hover",
|
||||||
|
mmap_site_castle_bg: "voxygen.element.map.castle_bg",
|
||||||
|
|
||||||
// Window Parts
|
// Window Parts
|
||||||
window_3: "voxygen.element.frames.window_3",
|
window_3: "voxygen.element.frames.window_3",
|
||||||
|
@ -143,6 +143,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
let show_dungeons = self.global_state.settings.gameplay.map_show_dungeons;
|
let show_dungeons = self.global_state.settings.gameplay.map_show_dungeons;
|
||||||
let show_castles = self.global_state.settings.gameplay.map_show_castles;
|
let show_castles = self.global_state.settings.gameplay.map_show_castles;
|
||||||
let mut events = Vec::new();
|
let mut events = Vec::new();
|
||||||
|
let i18n = &self.localized_strings;
|
||||||
// Tooltips
|
// Tooltips
|
||||||
let site_tooltip = Tooltip::new({
|
let site_tooltip = Tooltip::new({
|
||||||
// Edge images [t, b, r, l]
|
// Edge images [t, b, r, l]
|
||||||
@ -191,7 +192,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
.set(state.ids.icon, ui);
|
.set(state.ids.icon, ui);
|
||||||
|
|
||||||
// Map Title
|
// Map Title
|
||||||
Text::new(self.localized_strings.get("hud.map.map_title"))
|
Text::new(i18n.get("hud.map.map_title"))
|
||||||
.mid_top_with_margin_on(state.ids.frame, 3.0)
|
.mid_top_with_margin_on(state.ids.frame, 3.0)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.font_size(self.fonts.cyri.scale(29))
|
.font_size(self.fonts.cyri.scale(29))
|
||||||
@ -199,7 +200,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
.set(state.ids.map_title, ui);
|
.set(state.ids.map_title, ui);
|
||||||
|
|
||||||
// Questlog Title
|
// Questlog Title
|
||||||
Text::new(self.localized_strings.get("hud.map.qlog_title"))
|
Text::new(i18n.get("hud.map.qlog_title"))
|
||||||
.mid_top_with_margin_on(state.ids.qlog_align, 6.0)
|
.mid_top_with_margin_on(state.ids.qlog_align, 6.0)
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.font_size(self.fonts.cyri.scale(21))
|
.font_size(self.fonts.cyri.scale(21))
|
||||||
@ -343,7 +344,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
{
|
{
|
||||||
events.push(Event::ShowDifficulties(!show_difficulty));
|
events.push(Event::ShowDifficulties(!show_difficulty));
|
||||||
}
|
}
|
||||||
Text::new("Difficulty")
|
Text::new(i18n.get("hud.map.difficulty"))
|
||||||
.right_from(state.ids.show_difficulty_box, 10.0)
|
.right_from(state.ids.show_difficulty_box, 10.0)
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
@ -377,7 +378,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
{
|
{
|
||||||
events.push(Event::ShowTowns(!show_towns));
|
events.push(Event::ShowTowns(!show_towns));
|
||||||
}
|
}
|
||||||
Text::new("Towns")
|
Text::new(i18n.get("hud.map.towns"))
|
||||||
.right_from(state.ids.show_towns_box, 10.0)
|
.right_from(state.ids.show_towns_box, 10.0)
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
@ -411,7 +412,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
{
|
{
|
||||||
events.push(Event::ShowCastles(!show_castles));
|
events.push(Event::ShowCastles(!show_castles));
|
||||||
}
|
}
|
||||||
Text::new("Castles")
|
Text::new(i18n.get("hud.map.castles"))
|
||||||
.right_from(state.ids.show_castles_box, 10.0)
|
.right_from(state.ids.show_castles_box, 10.0)
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
@ -445,7 +446,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
{
|
{
|
||||||
events.push(Event::ShowDungeons(!show_dungeons));
|
events.push(Event::ShowDungeons(!show_dungeons));
|
||||||
}
|
}
|
||||||
Text::new("Dungeons")
|
Text::new(i18n.get("hud.map.dungeons"))
|
||||||
.right_from(state.ids.show_dungeons_box, 10.0)
|
.right_from(state.ids.show_dungeons_box, 10.0)
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
@ -484,18 +485,23 @@ impl<'a> Widget for Map<'a> {
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let title = site.name
|
let title =
|
||||||
|
site.name
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|s| s.as_str())
|
.map(|s| s.as_str())
|
||||||
.unwrap_or_else(|| match &site.kind {
|
.unwrap_or_else(|| match &site.kind {
|
||||||
SiteKind::Town => "Town",
|
SiteKind::Town => i18n.get("hud.map.town"),
|
||||||
SiteKind::Dungeon { .. } => "Dungeon",
|
SiteKind::Dungeon { .. } => i18n.get("hud.map.dungeon"),
|
||||||
SiteKind::Castle => "Castle",
|
SiteKind::Castle => i18n.get("hud.map.castle"),
|
||||||
});
|
});
|
||||||
let (difficulty, desc) = match &site.kind {
|
let (difficulty, desc) = match &site.kind {
|
||||||
SiteKind::Town => (0, "Town".to_string()),
|
SiteKind::Town => (0, i18n.get("hud.map.town").to_string()),
|
||||||
SiteKind::Dungeon { difficulty } => (*difficulty, format!("Dungeon, difficulty {}", difficulty)),
|
SiteKind::Dungeon { difficulty } => (
|
||||||
SiteKind::Castle => (0, "Castle".to_string()),
|
*difficulty,
|
||||||
|
i18n.get("hud.map.difficulty_dungeon")
|
||||||
|
.replace("{difficulty}", difficulty.to_string().as_str()),
|
||||||
|
),
|
||||||
|
SiteKind::Castle => (0, i18n.get("hud.map.castle").to_string()),
|
||||||
};
|
};
|
||||||
let site_btn = Button::image(match &site.kind {
|
let site_btn = Button::image(match &site.kind {
|
||||||
SiteKind::Town => {
|
SiteKind::Town => {
|
||||||
@ -538,15 +544,19 @@ impl<'a> Widget for Map<'a> {
|
|||||||
title,
|
title,
|
||||||
&desc,
|
&desc,
|
||||||
&site_tooltip,
|
&site_tooltip,
|
||||||
match difficulty {
|
match &site.kind {
|
||||||
1 => QUALITY_LOW,
|
SiteKind::Town => TEXT_COLOR,
|
||||||
2 => QUALITY_COMMON,
|
SiteKind::Castle => TEXT_COLOR,
|
||||||
3 => QUALITY_MODERATE,
|
SiteKind::Dungeon { .. } => match difficulty {
|
||||||
4 => QUALITY_HIGH,
|
0 => QUALITY_LOW,
|
||||||
5 => QUALITY_EPIC,
|
1 => QUALITY_COMMON,
|
||||||
6 => QUALITY_DEBUG,
|
2 => QUALITY_MODERATE,
|
||||||
|
3 => QUALITY_HIGH,
|
||||||
|
4 => QUALITY_EPIC,
|
||||||
|
5 => QUALITY_DEBUG,
|
||||||
_ => TEXT_COLOR,
|
_ => TEXT_COLOR,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
// Only display sites that are toggled on
|
// Only display sites that are toggled on
|
||||||
match &site.kind {
|
match &site.kind {
|
||||||
@ -572,33 +582,33 @@ impl<'a> Widget for Map<'a> {
|
|||||||
if show_difficulty {
|
if show_difficulty {
|
||||||
let size = 1.8; // Size factor for difficulty indicators
|
let size = 1.8; // Size factor for difficulty indicators
|
||||||
let dif_img = Image::new(match difficulty {
|
let dif_img = Image::new(match difficulty {
|
||||||
1 => self.imgs.map_dif_0,
|
0 => self.imgs.map_dif_0,
|
||||||
2 => self.imgs.map_dif_1,
|
1 => self.imgs.map_dif_1,
|
||||||
3 => self.imgs.map_dif_2,
|
2 => self.imgs.map_dif_2,
|
||||||
4 => self.imgs.map_dif_3,
|
3 => self.imgs.map_dif_3,
|
||||||
5 => self.imgs.map_dif_4,
|
4 => self.imgs.map_dif_4,
|
||||||
6 => self.imgs.map_dif_5,
|
5 => self.imgs.map_dif_5,
|
||||||
_ => self.imgs.nothing,
|
_ => self.imgs.nothing,
|
||||||
})
|
})
|
||||||
.mid_top_with_margin_on(state.ids.mmap_site_icons[i], match difficulty {
|
.mid_top_with_margin_on(state.ids.mmap_site_icons[i], match difficulty {
|
||||||
6 => -12.0 * size,
|
5 => -12.0 * size,
|
||||||
_ => -4.0 * size,
|
_ => -4.0 * size,
|
||||||
})
|
})
|
||||||
.w(match difficulty {
|
.w(match difficulty {
|
||||||
6 => 12.0 * size,
|
5 => 12.0 * size,
|
||||||
_ => 4.0 * size * difficulty as f64,
|
_ => 4.0 * size * difficulty as f64,
|
||||||
})
|
})
|
||||||
.h(match difficulty {
|
.h(match difficulty {
|
||||||
6 => 12.0 * size,
|
5 => 12.0 * size,
|
||||||
_ => 4.0 * size,
|
_ => 4.0 * size,
|
||||||
})
|
})
|
||||||
.color(Some(match difficulty {
|
.color(Some(match difficulty {
|
||||||
1 => QUALITY_LOW,
|
0 => QUALITY_LOW,
|
||||||
2 => QUALITY_COMMON,
|
1 => QUALITY_COMMON,
|
||||||
3 => QUALITY_MODERATE,
|
2 => QUALITY_MODERATE,
|
||||||
4 => QUALITY_HIGH,
|
3 => QUALITY_HIGH,
|
||||||
5 => QUALITY_EPIC,
|
4 => QUALITY_EPIC,
|
||||||
6 => TEXT_COLOR,
|
5 => QUALITY_DEBUG,
|
||||||
_ => TEXT_COLOR,
|
_ => TEXT_COLOR,
|
||||||
}));
|
}));
|
||||||
match &site.kind {
|
match &site.kind {
|
||||||
@ -672,7 +682,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
} else {
|
} else {
|
||||||
self.imgs.button
|
self.imgs.button
|
||||||
})
|
})
|
||||||
.label("Recenter")
|
.label(i18n.get("hud.map.recenter"))
|
||||||
.label_y(conrod_core::position::Relative::Scalar(1.0))
|
.label_y(conrod_core::position::Relative::Scalar(1.0))
|
||||||
.label_color(if recenter {
|
.label_color(if recenter {
|
||||||
TEXT_COLOR
|
TEXT_COLOR
|
||||||
@ -697,7 +707,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
.w_h(icon_size.x, icon_size.y)
|
.w_h(icon_size.x, icon_size.y)
|
||||||
.color(Some(UI_HIGHLIGHT_0))
|
.color(Some(UI_HIGHLIGHT_0))
|
||||||
.set(state.ids.drag_ico, ui);
|
.set(state.ids.drag_ico, ui);
|
||||||
Text::new("Drag")
|
Text::new(i18n.get("hud.map.drag"))
|
||||||
.right_from(state.ids.drag_ico, tweak!(5.0))
|
.right_from(state.ids.drag_ico, tweak!(5.0))
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
@ -709,7 +719,7 @@ impl<'a> Widget for Map<'a> {
|
|||||||
.w_h(icon_size.x, icon_size.y)
|
.w_h(icon_size.x, icon_size.y)
|
||||||
.color(Some(UI_HIGHLIGHT_0))
|
.color(Some(UI_HIGHLIGHT_0))
|
||||||
.set(state.ids.zoom_ico, ui);
|
.set(state.ids.zoom_ico, ui);
|
||||||
Text::new("Zoom")
|
Text::new(i18n.get("hud.map.zoom"))
|
||||||
.right_from(state.ids.zoom_ico, tweak!(5.0))
|
.right_from(state.ids.zoom_ico, tweak!(5.0))
|
||||||
.font_size(self.fonts.cyri.scale(14))
|
.font_size(self.fonts.cyri.scale(14))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use super::{
|
use super::{
|
||||||
img_ids::{Imgs, ImgsRot},
|
img_ids::{Imgs, ImgsRot},
|
||||||
Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN,
|
Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN, QUALITY_COMMON, QUALITY_DEBUG, QUALITY_EPIC, QUALITY_HIGH, QUALITY_LOW, QUALITY_MODERATE,
|
||||||
};
|
};
|
||||||
use crate::ui::{fonts::Fonts, img_ids};
|
use crate::ui::{fonts::Fonts, img_ids};
|
||||||
use client::{self, Client};
|
use client::{self, Client};
|
||||||
use common::{comp, msg::world_msg::SiteKind, terrain::TerrainChunkSize, vol::RectVolSize};
|
use common::{comp, msg::world_msg::SiteKind, terrain::TerrainChunkSize, vol::RectVolSize};
|
||||||
@ -10,7 +10,7 @@ use conrod_core::{
|
|||||||
widget::{self, Button, Image, Rectangle, Text},
|
widget::{self, Button, Image, Rectangle, Text},
|
||||||
widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon,
|
widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon,
|
||||||
};
|
};
|
||||||
use inline_tweak::*;
|
|
||||||
use specs::WorldExt;
|
use specs::WorldExt;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
@ -29,6 +29,7 @@ widget_ids! {
|
|||||||
mmap_east,
|
mmap_east,
|
||||||
mmap_south,
|
mmap_south,
|
||||||
mmap_west,
|
mmap_west,
|
||||||
|
mmap_site_icons_bgs[],
|
||||||
mmap_site_icons[],
|
mmap_site_icons[],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -233,6 +234,14 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
.resize(self.client.sites().len(), &mut ui.widget_id_generator())
|
.resize(self.client.sites().len(), &mut ui.widget_id_generator())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if state.ids.mmap_site_icons_bgs.len() < self.client.sites().len() {
|
||||||
|
state.update(|state| {
|
||||||
|
state
|
||||||
|
.ids
|
||||||
|
.mmap_site_icons_bgs
|
||||||
|
.resize(self.client.sites().len(), &mut ui.widget_id_generator())
|
||||||
|
});
|
||||||
|
}
|
||||||
for (i, site) in self.client.sites().iter().enumerate() {
|
for (i, site) in self.client.sites().iter().enumerate() {
|
||||||
let rwpos = site.wpos.map(|e| e as f32) - player_pos;
|
let rwpos = site.wpos.map(|e| e as f32) - player_pos;
|
||||||
let rcpos = rwpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz| e / sz as f32)
|
let rcpos = rwpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz| e / sz as f32)
|
||||||
@ -251,19 +260,42 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Image::new(match &site.kind {
|
Image::new(match &site.kind {
|
||||||
SiteKind::Town => self.imgs.mmap_site_town,
|
SiteKind::Town => self.imgs.mmap_site_town_bg,
|
||||||
SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon,
|
SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon_bg,
|
||||||
SiteKind::Castle => self.imgs.mmap_site_castle,
|
SiteKind::Castle => self.imgs.mmap_site_castle_bg,
|
||||||
})
|
})
|
||||||
.x_y_position_relative_to(
|
.x_y_position_relative_to(
|
||||||
state.ids.grid,
|
state.ids.grid,
|
||||||
position::Relative::Scalar(rpos.x as f64),
|
position::Relative::Scalar(rpos.x as f64),
|
||||||
position::Relative::Scalar(rpos.y as f64),
|
position::Relative::Scalar(rpos.y as f64),
|
||||||
)
|
)
|
||||||
.w_h(20.0 * tweak!(1.0), 20.0 * tweak!(1.0))
|
.w_h(20.0, 20.0)
|
||||||
.color(Some(UI_HIGHLIGHT_0))
|
.color(Some(
|
||||||
|
match &site.kind {
|
||||||
|
SiteKind::Town => Color::Rgba(1.0, 1.0, 1.0, 0.0),
|
||||||
|
SiteKind::Castle => Color::Rgba(1.0, 1.0, 1.0, 0.0),
|
||||||
|
SiteKind::Dungeon { difficulty } => match difficulty {
|
||||||
|
0 => QUALITY_LOW,
|
||||||
|
1 => QUALITY_COMMON,
|
||||||
|
2 => QUALITY_MODERATE,
|
||||||
|
3 => QUALITY_HIGH,
|
||||||
|
4 => QUALITY_EPIC,
|
||||||
|
5 => QUALITY_DEBUG,
|
||||||
|
_ => Color::Rgba(1.0, 1.0, 1.0, 0.0),
|
||||||
|
},
|
||||||
|
},))
|
||||||
.floating(true)
|
.floating(true)
|
||||||
.parent(ui.window)
|
.parent(ui.window)
|
||||||
|
.set(state.ids.mmap_site_icons_bgs[i], ui);
|
||||||
|
Image::new(match &site.kind {
|
||||||
|
SiteKind::Town => self.imgs.mmap_site_town,
|
||||||
|
SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon,
|
||||||
|
SiteKind::Castle => self.imgs.mmap_site_castle,
|
||||||
|
})
|
||||||
|
.middle_of(state.ids.mmap_site_icons_bgs[i])
|
||||||
|
.w_h(20.0, 20.0)
|
||||||
|
.color(Some(UI_HIGHLIGHT_0))
|
||||||
|
.floating(true)
|
||||||
.set(state.ids.mmap_site_icons[i], ui);
|
.set(state.ids.mmap_site_icons[i], ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,8 +365,7 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
// Title
|
// Title
|
||||||
|
|
||||||
match self.client.current_chunk() {
|
match self.client.current_chunk() {
|
||||||
Some(chunk) =>
|
Some(chunk) => {
|
||||||
{
|
|
||||||
// Count characters in the name to avoid clipping with the name display
|
// Count characters in the name to avoid clipping with the name display
|
||||||
let name_len = chunk.meta().name().chars().count();
|
let name_len = chunk.meta().name().chars().count();
|
||||||
Text::new(chunk.meta().name())
|
Text::new(chunk.meta().name())
|
||||||
@ -342,15 +373,15 @@ impl<'a> Widget for MiniMap<'a> {
|
|||||||
16..=30 => 4.0,
|
16..=30 => 4.0,
|
||||||
_ => 2.0,
|
_ => 2.0,
|
||||||
})
|
})
|
||||||
.font_size(self.fonts.cyri.scale(
|
.font_size(self.fonts.cyri.scale(match name_len {
|
||||||
match name_len {
|
|
||||||
0..=16 => 18,
|
0..=16 => 18,
|
||||||
16..=30 => 14,
|
16..=30 => 14,
|
||||||
_ => 14,
|
_ => 14,
|
||||||
}))
|
}))
|
||||||
.font_id(self.fonts.cyri.conrod_id)
|
.font_id(self.fonts.cyri.conrod_id)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.set(state.ids.mmap_location, ui)},
|
.set(state.ids.mmap_location, ui)
|
||||||
|
},
|
||||||
None => Text::new(" ")
|
None => Text::new(" ")
|
||||||
.mid_top_with_margin_on(state.ids.mmap_frame, 0.0)
|
.mid_top_with_margin_on(state.ids.mmap_frame, 0.0)
|
||||||
.font_size(self.fonts.cyri.scale(18))
|
.font_size(self.fonts.cyri.scale(18))
|
||||||
|
@ -49,8 +49,6 @@ use crate::{
|
|||||||
i18n::{i18n_asset_key, LanguageMetadata, Localization},
|
i18n::{i18n_asset_key, LanguageMetadata, Localization},
|
||||||
render::{Consts, Globals, RenderMode, Renderer},
|
render::{Consts, Globals, RenderMode, Renderer},
|
||||||
scene::camera::{self, Camera},
|
scene::camera::{self, Camera},
|
||||||
|
|
||||||
|
|
||||||
ui::{fonts::Fonts, img_ids::Rotations, slot, Graphic, Ingameable, ScaleMode, Ui},
|
ui::{fonts::Fonts, img_ids::Rotations, slot, Graphic, Ingameable, ScaleMode, Ui},
|
||||||
window::{Event as WinEvent, FullScreenSettings, GameInput},
|
window::{Event as WinEvent, FullScreenSettings, GameInput},
|
||||||
GlobalState,
|
GlobalState,
|
||||||
@ -67,9 +65,9 @@ use common::{
|
|||||||
span,
|
span,
|
||||||
sync::Uid,
|
sync::Uid,
|
||||||
terrain::TerrainChunk,
|
terrain::TerrainChunk,
|
||||||
|
util::srgba_to_linear,
|
||||||
vol::RectRasterableVol,
|
vol::RectRasterableVol,
|
||||||
};
|
};
|
||||||
use common::util::srgba_to_linear;
|
|
||||||
use conrod_core::{
|
use conrod_core::{
|
||||||
text::cursor::Index,
|
text::cursor::Index,
|
||||||
widget::{self, Button, Image, Text},
|
widget::{self, Button, Image, Text},
|
||||||
@ -2289,8 +2287,7 @@ impl Hud {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Reset the map position when it's not showing
|
// Reset the map position when it's not showing
|
||||||
let drag = &global_state.settings.gameplay.map_drag;
|
let drag = &global_state.settings.gameplay.map_drag;
|
||||||
if drag.x != 0.0 || drag.y != 0.0 {
|
if drag.x != 0.0 || drag.y != 0.0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user