Minimap draw order fix

Minimap location marker and player indicator are no longer drawn on top of the main map if they overlap.
Minimap location marker is no longer a button.
This commit is contained in:
Karl Werf 2022-02-27 15:41:12 +01:00
parent 4aa89fd6cc
commit 4dae579aca

View File

@ -796,16 +796,15 @@ impl<'a> Widget for MiniMap<'a> {
{ {
let factor = 1.2; let factor = 1.2;
Button::image(self.imgs.location_marker) Image::new(self.imgs.location_marker)
.x_y_position_relative_to( .x_y_position_relative_to(
state.ids.map_layers[0], state.ids.map_layers[0],
position::Relative::Scalar(rpos.x as f64), position::Relative::Scalar(rpos.x as f64),
position::Relative::Scalar(rpos.y as f64 + 8.0 * factor), position::Relative::Scalar(rpos.y as f64 + 8.0 * factor),
) )
.w_h(16.0 * factor, 16.0 * factor) .w_h(16.0 * factor, 16.0 * factor)
//.image_color(Color::Rgba(1.0, 1.0, 1.0, 1.0)) .parent(ui.window)
.floating(true) .set(state.ids.location_marker, ui)
.set(state.ids.location_marker, ui);
} }
// Indicator // Indicator
let ind_scale = 0.4; let ind_scale = 0.4;
@ -818,7 +817,7 @@ impl<'a> Widget for MiniMap<'a> {
.middle_of(state.ids.map_layers[0]) .middle_of(state.ids.map_layers[0])
.w_h(32.0 * ind_scale, 37.0 * ind_scale) .w_h(32.0 * ind_scale, 37.0 * ind_scale)
.color(Some(UI_HIGHLIGHT_0)) .color(Some(UI_HIGHLIGHT_0))
.floating(true) .parent(ui.window)
.set(state.ids.indicator, ui); .set(state.ids.indicator, ui);
// Compass directions // Compass directions