Change to social window selection visuals

This commit is contained in:
Monty Marz 2020-08-07 15:04:43 +02:00
parent 2608217e83
commit 74ace74d5a

View File

@ -287,7 +287,7 @@ impl<'a> Widget for Social<'a> {
.set(state.ids.zones_align, ui); .set(state.ids.zones_align, ui);
Scrollbar::y_axis(state.ids.online_align) Scrollbar::y_axis(state.ids.online_align)
.thickness(4.0) .thickness(4.0)
.color(UI_HIGHLIGHT_0) .color(Color::Rgba(0.79, 1.09, 1.09, 0.0))
.set(state.ids.scrollbar, ui); .set(state.ids.scrollbar, ui);
// //
// Headlines // Headlines
@ -413,7 +413,7 @@ impl<'a> Widget for Social<'a> {
} else { } else {
button.down_from(state.ids.player_names[i - 1], 1.0) button.down_from(state.ids.player_names[i - 1], 1.0)
}; };
if button button
.w_h(133.0, 20.0) .w_h(133.0, 20.0)
.hover_image(if selected { .hover_image(if selected {
self.imgs.selection self.imgs.selection
@ -427,33 +427,40 @@ impl<'a> Widget for Social<'a> {
}) })
.label(&name_text) .label(&name_text)
.label_font_size(self.fonts.cyri.scale(14)) .label_font_size(self.fonts.cyri.scale(14))
.label_y(conrod_core::position::Relative::Scalar(0.0)) .label_y(conrod_core::position::Relative::Scalar(1.0))
.label_font_id(self.fonts.cyri.conrod_id) .label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR) .label_color(TEXT_COLOR)
.set(state.ids.player_names[i], ui) .set(state.ids.player_names[i], ui);
.was_clicked() // Player Levels
{}; Button::image(if !selected {
let level_txt = if i == 0 { self.imgs.nothing
Text::new(&level).mid_top_with_margin_on(state.ids.levels_align, 4.0)
} else { } else {
Text::new(&level).down_from(state.ids.player_levels[i - 1], 4.0) self.imgs.selection
}; })
level_txt .w_h(39.0, 20.0)
.font_size(self.fonts.cyri.scale(14)) .right_from(state.ids.player_names[i], 2.0)
.font_id(self.fonts.cyri.conrod_id) .label(&level)
.color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(14))
.set(state.ids.player_levels[i], ui); .label_font_id(self.fonts.cyri.conrod_id)
let zone_txt = if i == 0 { .label_color(TEXT_COLOR)
Text::new(&zone_name).mid_top_with_margin_on(state.ids.zones_align, 4.0) .label_y(conrod_core::position::Relative::Scalar(1.0))
.parent(state.ids.levels_align)
.set(state.ids.player_levels[i], ui);
// Player Zones
Button::image(if !selected {
self.imgs.nothing
} else { } else {
Text::new(&zone_name).down_from(state.ids.player_zones[i - 1], 4.0) self.imgs.selection
}; })
zone_txt .w_h(94.0, 20.0)
.font_size(self.fonts.cyri.scale(14)) .right_from(state.ids.player_levels[i], 2.0)
.font_id(self.fonts.cyri.conrod_id) .label(&zone_name)
.color(TEXT_COLOR) .label_font_size(self.fonts.cyri.scale(14))
.set(state.ids.player_zones[i], ui); .label_font_id(self.fonts.cyri.conrod_id)
.label_color(TEXT_COLOR)
.label_y(conrod_core::position::Relative::Scalar(1.0))
.parent(state.ids.zones_align)
.set(state.ids.player_zones[i], ui);
// Check for click // Check for click
if ui if ui
.widget_input(state.ids.player_names[i]) .widget_input(state.ids.player_names[i])