Merge branch 'pfau/small-UI-fixes' into 'master'

Pfau/small ui fixes

See merge request veloren/veloren!1511
This commit is contained in:
Monty Marz 2020-11-13 14:47:38 +00:00
commit 73077be5ba
2 changed files with 33 additions and 33 deletions

View File

@ -142,8 +142,8 @@ impl<'a> Widget for BuffsBar<'a> {
},
);
// Limit displayed buffs
let buff_count = buff_count.min(22);
let debuff_count = debuff_count.min(22);
let buff_count = buff_count.min(12);
let debuff_count = debuff_count.min(12);
let gen = &mut ui.widget_id_generator();
if state.ids.buffs.len() < buff_count {
@ -186,14 +186,14 @@ impl<'a> Widget for BuffsBar<'a> {
BuffKind::Potion { .. } => self.imgs.buff_potion_0,
_ => self.imgs.missing_icon,
};
let buff_widget = Image::new(buff_img).w_h(20.0, 20.0);
let buff_widget = Image::new(buff_img).w_h(40.0, 40.0);
// Sort buffs into rows of 11 slots
let x = i % 11;
let y = i / 11;
let x = i % 6;
let y = i / 6;
let buff_widget = buff_widget.bottom_left_with_margins_on(
state.ids.buffs_align,
0.0 + y as f64 * (21.0),
0.0 + x as f64 * (21.0),
0.0 + y as f64 * (41.0),
0.0 + x as f64 * (41.0),
);
buff_widget
.color(
@ -240,7 +240,7 @@ impl<'a> Widget for BuffsBar<'a> {
0..=124 => self.imgs.buff_6, // 1/8
_ => self.imgs.nothing,
})
.w_h(20.0, 20.0)
.w_h(40.0, 40.0)
.middle_of(id)
.with_tooltip(
self.tooltip_manager,
@ -281,14 +281,14 @@ impl<'a> Widget for BuffsBar<'a> {
BuffKind::Cursed { .. } => self.imgs.debuff_skull_0,
_ => self.imgs.missing_icon,
};
let debuff_widget = Image::new(debuff_img).w_h(20.0, 20.0);
let debuff_widget = Image::new(debuff_img).w_h(40.0, 40.0);
// Sort buffs into rows of 11 slots
let x = i % 11;
let y = i / 11;
let x = i % 6;
let y = i / 6;
let debuff_widget = debuff_widget.bottom_right_with_margins_on(
state.ids.debuffs_align,
0.0 + y as f64 * (21.0),
0.0 + x as f64 * (21.0),
0.0 + y as f64 * (41.0),
0.0 + x as f64 * (41.0),
);
debuff_widget
@ -326,7 +326,7 @@ impl<'a> Widget for BuffsBar<'a> {
0..=124 => self.imgs.buff_6, // 1/8
_ => self.imgs.nothing,
})
.w_h(20.0, 20.0)
.w_h(40.0, 40.0)
.middle_of(id)
.with_tooltip(
self.tooltip_manager,

View File

@ -532,7 +532,7 @@ impl<'a> Widget for SettingsWindow<'a> {
),
};
if Button::image(check_img)
.w_h(288.0 / 24.0, 288.0 / 24.0)
.w_h(12.0, 12.0)
.down_from(state.ids.ui_scale_label, 20.0)
.hover_image(check_mo_img)
.press_image(check_press_img)
@ -567,7 +567,7 @@ impl<'a> Widget for SettingsWindow<'a> {
),
};
if Button::image(check_img)
.w_h(288.0 / 24.0, 288.0 / 24.0)
.w_h(12.0, 12.0)
.down_from(state.ids.relative_to_win_button, 8.0)
.hover_image(check_mo_img)
.press_image(check_press_img)
@ -837,17 +837,17 @@ impl<'a> Widget for SettingsWindow<'a> {
// Buff Position
// Buffs above skills
if Button::image(match self.global_state.settings.gameplay.buff_position {
BuffPosition::Bar => self.imgs.checkbox_checked,
BuffPosition::Map => self.imgs.checkbox,
BuffPosition::Bar => self.imgs.check_checked,
BuffPosition::Map => self.imgs.check,
})
.w_h(18.0, 18.0)
.w_h(12.0, 12.0)
.hover_image(match self.global_state.settings.gameplay.buff_position {
BuffPosition::Bar => self.imgs.checkbox_checked_mo,
BuffPosition::Map => self.imgs.checkbox_mo,
BuffPosition::Bar => self.imgs.check_checked_mo,
BuffPosition::Map => self.imgs.check_mo,
})
.press_image(match self.global_state.settings.gameplay.buff_position {
BuffPosition::Bar => self.imgs.checkbox_checked,
BuffPosition::Map => self.imgs.checkbox_press,
BuffPosition::Bar => self.imgs.check_checked,
BuffPosition::Map => self.imgs.check_press,
})
.down_from(state.ids.show_shortcuts_button, 8.0)
.set(state.ids.buff_pos_bar_button, ui)
@ -864,17 +864,17 @@ impl<'a> Widget for SettingsWindow<'a> {
.set(state.ids.buff_pos_bar_text, ui);
// Buffs left from minimap
if Button::image(match self.global_state.settings.gameplay.buff_position {
BuffPosition::Map => self.imgs.checkbox_checked,
BuffPosition::Bar => self.imgs.checkbox,
BuffPosition::Map => self.imgs.check_checked,
BuffPosition::Bar => self.imgs.check,
})
.w_h(18.0, 18.0)
.w_h(12.0, 12.0)
.hover_image(match self.global_state.settings.gameplay.buff_position {
BuffPosition::Map => self.imgs.checkbox_checked_mo,
BuffPosition::Bar => self.imgs.checkbox_mo,
BuffPosition::Map => self.imgs.check_checked_mo,
BuffPosition::Bar => self.imgs.check_mo,
})
.press_image(match self.global_state.settings.gameplay.buff_position {
BuffPosition::Map => self.imgs.checkbox_checked,
BuffPosition::Bar => self.imgs.checkbox_press,
BuffPosition::Map => self.imgs.check_checked,
BuffPosition::Bar => self.imgs.check_press,
})
.down_from(state.ids.buff_pos_bar_button, 8.0)
.set(state.ids.buff_pos_map_button, ui)
@ -1116,7 +1116,7 @@ impl<'a> Widget for SettingsWindow<'a> {
} else {
self.imgs.check
})
.w_h(288.0 / 24.0, 288.0 / 24.0)
.w_h(12.0, 12.0)
.hover_image(if let BarNumbers::Off = bar_values {
self.imgs.check_checked_mo
} else {
@ -1147,7 +1147,7 @@ impl<'a> Widget for SettingsWindow<'a> {
} else {
self.imgs.check
})
.w_h(288.0 / 24.0, 288.0 / 24.0)
.w_h(12.0, 12.0)
.hover_image(if let BarNumbers::Values = bar_values {
self.imgs.check_checked_mo
} else {
@ -1178,7 +1178,7 @@ impl<'a> Widget for SettingsWindow<'a> {
} else {
self.imgs.check
})
.w_h(288.0 / 24.0, 288.0 / 24.0)
.w_h(12.0, 12.0)
.hover_image(if let BarNumbers::Percent = bar_values {
self.imgs.check_checked_mo
} else {