mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Bag Position
Former-commit-id: af8435d0c078ea1caa388ff0926ef6dae22ab70b
This commit is contained in:
parent
b7b3c5f3cd
commit
6894e55a24
@ -15,7 +15,8 @@ widget_ids! {
|
||||
bag_close,
|
||||
bag_contents,
|
||||
inv_alignment,
|
||||
inv_grid,
|
||||
inv_grid_1,
|
||||
inv_grid_2,
|
||||
inv_scrollbar,
|
||||
inv_slot_0,
|
||||
map_title,
|
||||
@ -80,32 +81,36 @@ impl<'a> Widget for Bag<'a> {
|
||||
|
||||
// Contents
|
||||
Image::new(self.imgs.bag_contents)
|
||||
.w_h(307.0, 545.0)
|
||||
.bottom_right_with_margins_on(ui.window, 90.0, 5.0)
|
||||
.w_h(68.0 * 4.0, 123.0 * 4.0)
|
||||
.bottom_right_with_margins_on(ui.window, 60.0, 5.0)
|
||||
.set(state.ids.bag_contents, ui);
|
||||
|
||||
// Alignment for Grid
|
||||
Rectangle::fill_with([246.0, 465.0], color::TRANSPARENT)
|
||||
.top_left_with_margins_on(state.ids.bag_contents, 27.0, 23.0)
|
||||
.scroll_kids()
|
||||
.scroll_kids_vertically()
|
||||
.set(state.ids.inv_alignment, ui);
|
||||
Rectangle::fill_with([58.0 * 4.0 - 5.0, 100.0 * 4.0], color::TRANSPARENT)
|
||||
.top_left_with_margins_on(state.ids.bag_contents, 11.0 * 4.0, 5.0 * 4.0)
|
||||
.scroll_kids()
|
||||
.scroll_kids_vertically()
|
||||
.set(state.ids.inv_alignment, ui);
|
||||
// Grid
|
||||
Image::new(self.imgs.inv_grid)
|
||||
.w_h(232.0, 1104.0)
|
||||
.mid_top_with_margin_on(state.ids.inv_alignment, 0.0)
|
||||
.set(state.ids.inv_grid, ui);
|
||||
Scrollbar::y_axis(state.ids.inv_alignment)
|
||||
.thickness(5.0)
|
||||
.rgba(0.86, 0.86, 0.86, 0.1)
|
||||
.set(state.ids.inv_scrollbar, ui);
|
||||
.w_h(58.0 * 4.0, 111.0 * 4.0)
|
||||
.mid_top_with_margin_on(state.ids.inv_alignment, 0.0)
|
||||
.set(state.ids.inv_grid_1, ui);
|
||||
Image::new(self.imgs.inv_grid)
|
||||
.w_h(58.0 * 4.0, 111.0 * 4.0)
|
||||
.mid_top_with_margin_on(state.ids.inv_alignment, 110.0 * 4.0)
|
||||
.set(state.ids.inv_grid_2, ui);
|
||||
Scrollbar::y_axis(state.ids.inv_alignment)
|
||||
.thickness(5.0)
|
||||
.rgba(0.33, 0.33, 0.33, 1.0)
|
||||
.set(state.ids.inv_scrollbar, ui);
|
||||
|
||||
// X-button
|
||||
if Button::image(self.imgs.close_button)
|
||||
.w_h(244.0 * 0.22 / 3.0, 244.0 * 0.22 / 3.0)
|
||||
.w_h(28.0, 28.0)
|
||||
.hover_image(self.imgs.close_button_hover)
|
||||
.press_image(self.imgs.close_button_press)
|
||||
.top_right_with_margins_on(state.ids.bag_contents, 5.0, 17.0)
|
||||
.top_right_with_margins_on(state.ids.bag_contents, 0.0, 0.0)
|
||||
.set(state.ids.bag_close, ui)
|
||||
.was_clicked()
|
||||
{
|
||||
@ -115,8 +120,8 @@ impl<'a> Widget for Bag<'a> {
|
||||
if self.inventory_space > 0 {
|
||||
// First Slot
|
||||
Button::image(self.imgs.inv_slot)
|
||||
.top_left_with_margins_on(state.ids.inv_grid, 5.0, 5.0)
|
||||
.w_h(40.0, 40.0)
|
||||
.top_left_with_margins_on(state.ids.inv_grid_1, 4.0, 4.0)
|
||||
.w_h(10.0 * 4.0, 10.0 * 4.0)
|
||||
.set(state.ids.inv_slot_0, ui);
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,9 @@ impl<'a> Widget for CharacterWindow<'a> {
|
||||
|
||||
// Title
|
||||
Text::new("Character Name") // Add in actual Character Name
|
||||
.mid_top_with_margin_on(state.charwindow_frame, 7.0)
|
||||
.mid_top_with_margin_on(state.charwindow_frame, 17.0)
|
||||
.font_id(self.fonts.metamorph)
|
||||
.font_size(14)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.charwindow_title, ui);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user