Merge branch 'pfau/assets' into 'master'

Fix map being inverted and indicator positioning

See merge request veloren/veloren!669
This commit is contained in:
Monty Marz 2019-11-26 22:39:07 +00:00
commit d374e8e673
12 changed files with 39 additions and 24 deletions

BIN
assets/voxygen/background/map.png (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/element/buttons/indicator_mmap.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/figure/accessory/elf/headband-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/voxel/figure/hair/dwarf/female-2.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/figure/hair/dwarf/female-3.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -151,7 +151,7 @@
beard: [None],
accessory: [
None,
Some(("figure.accessory.elf.warpaint-0", (6, 9, 5))),]
Some(("figure.accessory.elf.headband-0", (6, 9, 4))),]
),
(Dwarf, Male): (
offset: (-6.0, -4.5, -6.0),
@ -195,7 +195,9 @@
eyes: ("figure.eyes.dwarf.female-0", (1, 10, 2)),
hair: [
Some(("figure.hair.dwarf.female-0", (-9, -9, -7))),
Some(("figure.hair.dwarf.female-1", (-9, -9, -7))),
Some(("figure.hair.dwarf.female-1", (-9, -9, -7))),
Some(("figure.hair.dwarf.female-2", (-9, -9, -7))),
Some(("figure.hair.dwarf.female-3", (-9, -9, -7))),
],
beard: [None],
accessory: [

View File

@ -332,7 +332,7 @@ impl Race {
match (self, body_type) {
(Race::Danari, BodyType::Female) => 2,
(Race::Danari, BodyType::Male) => 2,
(Race::Dwarf, BodyType::Female) => 2,
(Race::Dwarf, BodyType::Female) => 4,
(Race::Dwarf, BodyType::Male) => 3,
(Race::Elf, BodyType::Female) => 21,
(Race::Elf, BodyType::Male) => 4,

View File

@ -59,7 +59,7 @@ image_ids! {
// MiniMap
mmap_frame: "voxygen.element.frames.mmap",
mmap_frame_closed: "voxygen.element.frames.mmap_closed",
indicator_mmap: "voxygen.voxel.figure.accessory.human.earring",
indicator_mmap: "voxygen.element.buttons.indicator_mmap",
// Missing: Buff Frame Animation .gif ?! we could do animation in ui.maintain, or in shader?
window_frame: "voxygen.element.frames.window2",

View File

@ -157,7 +157,7 @@ impl<'a> Widget for Map<'a> {
let worldsize = 32768.0; // TODO This has to get the actual world size and not be hardcoded
let x = player_pos.x as f64 / worldsize * 700.0;
let y = (1.0 - player_pos.y as f64 / worldsize) * 700.0;
let y = (/*1.0 -*/player_pos.y as f64 / worldsize) * 700.0;
// Indicator
Image::new(self.imgs.map_indicator)
.bottom_left_with_margins_on(state.ids.grid, y, x - (12.0 * 1.4) / 2.0)

View File

@ -89,17 +89,17 @@ impl<'a> Widget for MiniMap<'a> {
if self.show.mini_map {
Image::new(self.imgs.mmap_frame)
.w_h(100.0 * 2.0, 100.0 * 2.0)
.w_h(100.0 * 4.0, 100.0 * 4.0)
.top_right_with_margins_on(ui.window, 5.0, 5.0)
.set(state.ids.mmap_frame, ui);
Rectangle::fill_with([92.0 * 2.0, 82.0 * 2.0], color::TRANSPARENT)
.mid_top_with_margin_on(state.ids.mmap_frame, 13.0 * 2.0 + 2.0)
Rectangle::fill_with([92.0 * 4.0, 82.0 * 4.0], color::TRANSPARENT)
.mid_top_with_margin_on(state.ids.mmap_frame, 13.0 * 4.0 + 4.0)
.set(state.ids.mmap_frame_bg, ui);
// Map Image
Image::new(/*self.world_map*/ self.imgs.map_placeholder)
.middle_of(state.ids.mmap_frame_bg)
.w_h(92.0 * 2.0, 82.0 * 2.0)
.w_h(92.0 * 4.0, 82.0 * 4.0)
.parent(state.ids.mmap_frame_bg)
.set(state.ids.grid, ui);
// Coordinates
@ -112,12 +112,12 @@ impl<'a> Widget for MiniMap<'a> {
.map_or(Vec3::zero(), |pos| pos.0);
let worldsize = 32768.0; // TODO This has to get the actual world size and not be hardcoded
let x = player_pos.x as f64 / worldsize * 92.0 * 2.0;
let y = (1.0 - player_pos.y as f64 / worldsize) * 82.0 * 2.0;
let x = player_pos.x as f64 / worldsize * 92.0 * 4.0;
let y = (/*1.0X-*/player_pos.y as f64 / worldsize) * 82.0 * 4.0;
// Indicator
Image::new(self.imgs.indicator_mmap)
.bottom_left_with_margins_on(state.ids.grid, y, x - 2.5)
.w_h(5.0, 5.0)
.bottom_left_with_margins_on(state.ids.grid, y, x - 5.0)
.w_h(10.0, 10.0)
.floating(true)
.parent(ui.window)
.set(state.ids.indicator, ui);
@ -133,7 +133,11 @@ impl<'a> Widget for MiniMap<'a> {
} else {
self.imgs.mmap_closed
})
.w_h(100.0 * 0.2, 100.0 * 0.2)
.wh(if self.show.mini_map {
[100.0 * 0.4; 2]
} else {
[100.0 * 0.2; 2]
})
.hover_image(if self.show.mini_map {
self.imgs.mmap_open_hover
} else {
@ -207,8 +211,11 @@ impl<'a> Widget for MiniMap<'a> {
// Title
match self.client.current_chunk() {
Some(chunk) => Text::new(chunk.meta().name())
.mid_top_with_margin_on(state.ids.mmap_frame, 0.0)
.font_size(18)
.mid_top_with_margin_on(
state.ids.mmap_frame,
if self.show.mini_map { 6.0 } else { 0.0 },
)
.font_size(if self.show.mini_map { 30 } else { 18 })
.font_id(self.fonts.cyri)
.color(TEXT_COLOR)
.set(state.ids.mmap_location, ui),