mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
New Settings Window and Map Window
Former-commit-id: ca6d1c937193cb29afb2dd484c596b79c947f36e
This commit is contained in:
parent
3c45d3c996
commit
c7b61d5626
@ -95,10 +95,13 @@ widget_ids! {
|
|||||||
window_frame_5,
|
window_frame_5,
|
||||||
//0 Settings-Window
|
//0 Settings-Window
|
||||||
settings_bg,
|
settings_bg,
|
||||||
|
settings_content,
|
||||||
settings_icon,
|
settings_icon,
|
||||||
settings_button_mo,
|
settings_button_mo,
|
||||||
settings_close,
|
settings_close,
|
||||||
settings_title,
|
settings_title,
|
||||||
|
settings_r,
|
||||||
|
settings_l,
|
||||||
//Contents
|
//Contents
|
||||||
button_help,
|
button_help,
|
||||||
button_help2,
|
button_help2,
|
||||||
@ -123,6 +126,8 @@ widget_ids! {
|
|||||||
map_title,
|
map_title,
|
||||||
map_frame_l,
|
map_frame_l,
|
||||||
map_frame_r,
|
map_frame_r,
|
||||||
|
map_frame_bl,
|
||||||
|
map_frame_br,
|
||||||
//3 Spellbook
|
//3 Spellbook
|
||||||
spellbook_frame,
|
spellbook_frame,
|
||||||
spellbook_bg,
|
spellbook_bg,
|
||||||
@ -238,6 +243,12 @@ pub(self) struct Imgs {
|
|||||||
window_frame: ImgId,
|
window_frame: ImgId,
|
||||||
window_frame_2: ImgId,
|
window_frame_2: ImgId,
|
||||||
//Settings-Window
|
//Settings-Window
|
||||||
|
settings_frame_r: ImgId,
|
||||||
|
settings_frame_l: ImgId,
|
||||||
|
settings_button: ImgId,
|
||||||
|
settings_button_pressed: ImgId,
|
||||||
|
settings_button_hover: ImgId,
|
||||||
|
settings_button_press: ImgId,
|
||||||
settings_bg: ImgId,
|
settings_bg: ImgId,
|
||||||
settings_icon: ImgId,
|
settings_icon: ImgId,
|
||||||
settings_button_mo: ImgId,
|
settings_button_mo: ImgId,
|
||||||
@ -260,6 +271,8 @@ pub(self) struct Imgs {
|
|||||||
map_icon: ImgId,
|
map_icon: ImgId,
|
||||||
map_frame_l: ImgId,
|
map_frame_l: ImgId,
|
||||||
map_frame_r: ImgId,
|
map_frame_r: ImgId,
|
||||||
|
map_frame_bl: ImgId,
|
||||||
|
map_frame_br: ImgId,
|
||||||
// Spell Book Window
|
// Spell Book Window
|
||||||
spellbook_bg: ImgId,
|
spellbook_bg: ImgId,
|
||||||
spellbook_icon: ImgId,
|
spellbook_icon: ImgId,
|
||||||
@ -388,6 +401,12 @@ impl Imgs {
|
|||||||
window_frame_2: load_img("element/frames/window_2.png", ui),
|
window_frame_2: load_img("element/frames/window_2.png", ui),
|
||||||
|
|
||||||
// Settings Window
|
// Settings Window
|
||||||
|
settings_frame_r: load_vox("element/frames/settings_r.vox", ui),
|
||||||
|
settings_frame_l: load_vox("element/frames/settings_l.vox", ui),
|
||||||
|
settings_button: load_vox("element/buttons/settings_button.vox", ui),
|
||||||
|
settings_button_pressed: load_vox("element/buttons/settings_button_pressed.vox", ui),
|
||||||
|
settings_button_hover: load_vox("element/buttons/settings_button_hover.vox", ui),
|
||||||
|
settings_button_press: load_vox("element/buttons/settings_button_press.vox", ui),
|
||||||
settings_bg: load_img("element/frames/settings.png", ui),
|
settings_bg: load_img("element/frames/settings.png", ui),
|
||||||
settings_icon: load_img("element/icons/settings.png", ui),
|
settings_icon: load_img("element/icons/settings.png", ui),
|
||||||
settings_button_mo: load_img("element/buttons/blue_mo.png", ui),
|
settings_button_mo: load_img("element/buttons/blue_mo.png", ui),
|
||||||
@ -414,6 +433,8 @@ impl Imgs {
|
|||||||
map_icon: load_img("element/icons/map.png", ui),
|
map_icon: load_img("element/icons/map.png", ui),
|
||||||
map_frame_l: load_vox("element/frames/map_l.vox", ui),
|
map_frame_l: load_vox("element/frames/map_l.vox", ui),
|
||||||
map_frame_r: load_vox("element/frames/map_r.vox", ui),
|
map_frame_r: load_vox("element/frames/map_r.vox", ui),
|
||||||
|
map_frame_bl: load_vox("element/frames/map_bl.vox", ui),
|
||||||
|
map_frame_br: load_vox("element/frames/map_br.vox", ui),
|
||||||
|
|
||||||
// Spell Book Window
|
// Spell Book Window
|
||||||
spellbook_bg: load_img("element/misc_bg/small_bg.png", ui),
|
spellbook_bg: load_img("element/misc_bg/small_bg.png", ui),
|
||||||
@ -658,7 +679,7 @@ impl Hud {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if Button::image(if self.mmap_open {self.imgs.mmap_open} else {self.imgs.mmap_closed})
|
if Button::image(if self.mmap_open {self.imgs.mmap_open} else {self.imgs.mmap_closed})
|
||||||
.w_h(10.0 * 2.0, 10.0 * 2.0)
|
.w_h(100.0 * 0.2, 100.0 * 0.2)
|
||||||
.hover_image(if self.mmap_open {self.imgs.mmap_open_hover} else {self.imgs.mmap_closed_hover})
|
.hover_image(if self.mmap_open {self.imgs.mmap_open_hover} else {self.imgs.mmap_closed_hover})
|
||||||
.press_image(if self.mmap_open {self.imgs.mmap_open_press} else {self.imgs.mmap_closed_press})
|
.press_image(if self.mmap_open {self.imgs.mmap_open_press} else {self.imgs.mmap_closed_press})
|
||||||
.top_right_with_margins_on(self.ids.mmap_frame, 0.0, 0.0)
|
.top_right_with_margins_on(self.ids.mmap_frame, 0.0, 0.0)
|
||||||
@ -950,11 +971,11 @@ impl Hud {
|
|||||||
// Contents
|
// Contents
|
||||||
Image::new(self.imgs.bag_contents)
|
Image::new(self.imgs.bag_contents)
|
||||||
.w_h(68.0 * 4.0, 123.0 * 4.0)
|
.w_h(68.0 * 4.0, 123.0 * 4.0)
|
||||||
.bottom_right_with_margins_on(ui_widgets.window, 90.0, 5.0)
|
.bottom_right_with_margins_on(ui_widgets.window, 60.0, 5.0)
|
||||||
.set(self.ids.bag_contents, ui_widgets);
|
.set(self.ids.bag_contents, ui_widgets);
|
||||||
|
|
||||||
// Alignment for Grid
|
// Alignment for Grid
|
||||||
Rectangle::fill_with([(58.0 * 4.0) - 5.0, 100.0 * 4.0], color::TRANSPARENT)
|
Rectangle::fill_with([58.0 * 4.0 - 5.0, 100.0 * 4.0], color::TRANSPARENT)
|
||||||
.top_left_with_margins_on(self.ids.bag_contents, 11.0 * 4.0, 5.0 * 4.0)
|
.top_left_with_margins_on(self.ids.bag_contents, 11.0 * 4.0, 5.0 * 4.0)
|
||||||
.scroll_kids()
|
.scroll_kids()
|
||||||
.scroll_kids_vertically()
|
.scroll_kids_vertically()
|
||||||
@ -1028,17 +1049,32 @@ impl Hud {
|
|||||||
// 0 Settings
|
// 0 Settings
|
||||||
|
|
||||||
if let Windows::Settings = self.open_windows {
|
if let Windows::Settings = self.open_windows {
|
||||||
// BG
|
// Frame Alignment
|
||||||
Image::new(self.imgs.window_frame)
|
Rectangle::fill_with([824.0, 488.0], color::TRANSPARENT)
|
||||||
.middle_of(ui_widgets.window)
|
.middle_of(ui_widgets.window)
|
||||||
.w_h(1648.0 / 2.5, 1952.0 / 2.5)
|
|
||||||
.set(self.ids.settings_bg, ui_widgets);
|
.set(self.ids.settings_bg, ui_widgets);
|
||||||
|
// Frame
|
||||||
|
Image::new(self.imgs.settings_frame_l)
|
||||||
|
.top_left_with_margins_on(self.ids.settings_bg, 0.0, 0.0)
|
||||||
|
.w_h(412.0, 488.0)
|
||||||
|
.set(self.ids.settings_l, ui_widgets);
|
||||||
|
Image::new(self.imgs.settings_frame_r)
|
||||||
|
.right_from(self.ids.settings_l, 0.0)
|
||||||
|
.parent(self.ids.settings_bg)
|
||||||
|
.w_h(412.0, 488.0)
|
||||||
|
.set(self.ids.settings_r, ui_widgets);
|
||||||
|
// Content Alignment
|
||||||
|
Rectangle::fill_with([198.0*4.0, 97.0*4.0], color::TRANSPARENT)
|
||||||
|
.top_right_with_margins_on(self.ids.settings_r, 21.0*4.0, 4.0*4.0)
|
||||||
|
.scroll_kids()
|
||||||
|
.scroll_kids_vertically()
|
||||||
|
.set(self.ids.settings_content, ui_widgets);
|
||||||
// X-Button
|
// X-Button
|
||||||
if Button::image(self.imgs.close_button)
|
if Button::image(self.imgs.close_button)
|
||||||
.w_h(244.0 * 0.22 / 2.5, 244.0 * 0.22 / 2.5)
|
.w_h(28.0, 28.0)
|
||||||
.hover_image(self.imgs.close_button_hover)
|
.hover_image(self.imgs.close_button_hover)
|
||||||
.press_image(self.imgs.close_button_press)
|
.press_image(self.imgs.close_button_press)
|
||||||
.top_right_with_margins_on(self.ids.settings_bg, 4.0, 4.0)
|
.top_right_with_margins_on(self.ids.settings_r, 0.0, 0.0)
|
||||||
.set(self.ids.settings_close, ui_widgets)
|
.set(self.ids.settings_close, ui_widgets)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
@ -1048,31 +1084,35 @@ impl Hud {
|
|||||||
|
|
||||||
// Title
|
// Title
|
||||||
Text::new("Settings")
|
Text::new("Settings")
|
||||||
.mid_top_with_margin_on(self.ids.settings_bg, 10.0)
|
.mid_top_with_margin_on(self.ids.settings_bg, 5.0)
|
||||||
.font_size(30)
|
.font_size(14)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.set(self.ids.settings_title, ui_widgets);
|
.set(self.ids.settings_title, ui_widgets);
|
||||||
// Icon
|
// Icon
|
||||||
Image::new(self.imgs.settings_icon)
|
//Image::new(self.imgs.settings_icon)
|
||||||
.w_h(224.0 / 3.0, 224.0 / 3.0)
|
//.w_h(224.0 / 3.0, 224.0 / 3.0)
|
||||||
.top_left_with_margins_on(self.ids.settings_bg, -10.0, -10.0)
|
//.top_left_with_margins_on(self.ids.settings_bg, -10.0, -10.0)
|
||||||
.set(self.ids.settings_icon, ui_widgets);
|
//.set(self.ids.settings_icon, ui_widgets);
|
||||||
// TODO: Find out if we can remove this
|
// TODO: Find out if we can remove this
|
||||||
// Alignment Rectangle
|
|
||||||
Rectangle::fill_with([1008.0 / 2.5, 1616.0 / 2.5], color::TRANSPARENT)
|
|
||||||
.top_left_with_margins_on(self.ids.settings_bg, 77.0, 205.0)
|
|
||||||
.set(self.ids.rectangle, ui_widgets);
|
|
||||||
|
|
||||||
// 1 Interface////////////////////////////
|
// 1 Interface////////////////////////////
|
||||||
if Button::image(if let SettingsTab::Interface = self.settings_tab {
|
if Button::image(if let SettingsTab::Interface = self.settings_tab {
|
||||||
self.imgs.button_blue_mo
|
self.imgs.settings_button_pressed
|
||||||
} else {
|
} else {
|
||||||
self.imgs.button_blank
|
self.imgs.settings_button
|
||||||
})
|
})
|
||||||
.w_h(304.0 / 2.5, 80.0 / 2.5)
|
.w_h(31.0*4.0, 12.0*4.0)
|
||||||
.hover_image(self.imgs.button_blue_mo)
|
.hover_image(if let SettingsTab::Interface = self.settings_tab {
|
||||||
.press_image(self.imgs.button_blue_press)
|
self.imgs.settings_button_pressed
|
||||||
.top_left_with_margins_on(self.ids.settings_bg, 78.0, 50.0)
|
} else {
|
||||||
|
self.imgs.settings_button_hover
|
||||||
|
})
|
||||||
|
.press_image(if let SettingsTab::Interface = self.settings_tab {
|
||||||
|
self.imgs.settings_button_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.settings_button_press
|
||||||
|
})
|
||||||
|
.top_left_with_margins_on(self.ids.settings_l, 8.0*4.0, 2.0*4.0)
|
||||||
.label("Interface")
|
.label("Interface")
|
||||||
.label_font_size(14)
|
.label_font_size(14)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
@ -1086,13 +1126,13 @@ impl Hud {
|
|||||||
self.show_help =
|
self.show_help =
|
||||||
ToggleButton::new(self.show_help, self.imgs.check, self.imgs.check_checked)
|
ToggleButton::new(self.show_help, self.imgs.check, self.imgs.check_checked)
|
||||||
.w_h(288.0 / 24.0, 288.0 / 24.0)
|
.w_h(288.0 / 24.0, 288.0 / 24.0)
|
||||||
.top_left_with_margins_on(self.ids.rectangle, 15.0, 15.0)
|
.top_left_with_margins_on(self.ids.settings_content, 5.0, 5.0)
|
||||||
.hover_images(self.imgs.check_checked_mo, self.imgs.check_mo)
|
.hover_images(self.imgs.check_checked_mo, self.imgs.check_mo)
|
||||||
.press_images(self.imgs.check_press, self.imgs.check_press)
|
.press_images(self.imgs.check_press, self.imgs.check_press)
|
||||||
.set(self.ids.button_help, ui_widgets);
|
.set(self.ids.button_help, ui_widgets);
|
||||||
Text::new("Show Help")
|
Text::new("Show Help")
|
||||||
.right_from(self.ids.button_help, 10.0)
|
.right_from(self.ids.button_help, 10.0)
|
||||||
.font_size(12)
|
.font_size(14)
|
||||||
.font_id(self.font_opensans)
|
.font_id(self.font_opensans)
|
||||||
.graphics_for(self.ids.button_help)
|
.graphics_for(self.ids.button_help)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
@ -1104,14 +1144,14 @@ impl Hud {
|
|||||||
self.imgs.check_checked,
|
self.imgs.check_checked,
|
||||||
)
|
)
|
||||||
.w_h(288.0 / 24.0, 288.0 / 24.0)
|
.w_h(288.0 / 24.0, 288.0 / 24.0)
|
||||||
.top_left_with_margins_on(self.ids.rectangle, 40.0, 15.0)
|
.down_from(self.ids.button_help, 7.0)
|
||||||
.hover_images(self.imgs.check_checked_mo, self.imgs.check_mo)
|
.hover_images(self.imgs.check_checked_mo, self.imgs.check_mo)
|
||||||
.press_images(self.imgs.check_press, self.imgs.check_press)
|
.press_images(self.imgs.check_press, self.imgs.check_press)
|
||||||
.set(self.ids.inventorytest_button, ui_widgets);
|
.set(self.ids.inventorytest_button, ui_widgets);
|
||||||
|
|
||||||
Text::new("Show Inventory Test Button")
|
Text::new("Show Inventory Test Button")
|
||||||
.right_from(self.ids.inventorytest_button, 10.0)
|
.right_from(self.ids.inventorytest_button, 10.0)
|
||||||
.font_size(12)
|
.font_size(14)
|
||||||
.font_id(self.font_opensans)
|
.font_id(self.font_opensans)
|
||||||
.graphics_for(self.ids.inventorytest_button)
|
.graphics_for(self.ids.inventorytest_button)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
@ -1120,14 +1160,14 @@ impl Hud {
|
|||||||
self.show_debug =
|
self.show_debug =
|
||||||
ToggleButton::new(self.show_debug, self.imgs.check, self.imgs.check_checked)
|
ToggleButton::new(self.show_debug, self.imgs.check, self.imgs.check_checked)
|
||||||
.w_h(288.0 / 24.0, 288.0 / 24.0)
|
.w_h(288.0 / 24.0, 288.0 / 24.0)
|
||||||
.top_left_with_margins_on(self.ids.rectangle, 65.0, 15.0)
|
.down_from(self.ids.inventorytest_button, 7.0)
|
||||||
.hover_images(self.imgs.check_checked_mo, self.imgs.check_mo)
|
.hover_images(self.imgs.check_checked_mo, self.imgs.check_mo)
|
||||||
.press_images(self.imgs.check_press, self.imgs.check_press)
|
.press_images(self.imgs.check_press, self.imgs.check_press)
|
||||||
.set(self.ids.debug_button, ui_widgets);
|
.set(self.ids.debug_button, ui_widgets);
|
||||||
|
|
||||||
Text::new("Show Debug Window")
|
Text::new("Show Debug Window")
|
||||||
.right_from(self.ids.debug_button, 10.0)
|
.right_from(self.ids.debug_button, 10.0)
|
||||||
.font_size(12)
|
.font_size(14)
|
||||||
.font_id(self.font_opensans)
|
.font_id(self.font_opensans)
|
||||||
.graphics_for(self.ids.debug_button)
|
.graphics_for(self.ids.debug_button)
|
||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
@ -1135,15 +1175,23 @@ impl Hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2 Gameplay////////////////
|
// 2 Gameplay////////////////
|
||||||
if Button::image(if let SettingsTab::Gameplay = self.settings_tab {
|
if Button::image(if let SettingsTab::Gameplay = self.settings_tab {
|
||||||
self.imgs.button_blue_mo
|
self.imgs.settings_button_pressed
|
||||||
} else {
|
} else {
|
||||||
self.imgs.button_blank
|
self.imgs.settings_button
|
||||||
})
|
})
|
||||||
.w_h(304.0 / 2.5, 80.0 / 2.5)
|
.w_h(31.0*4.0, 12.0*4.0)
|
||||||
.hover_image(self.imgs.button_blue_mo)
|
.hover_image(if let SettingsTab::Gameplay = self.settings_tab {
|
||||||
.press_image(self.imgs.button_blue_press)
|
self.imgs.settings_button_pressed
|
||||||
.down_from(self.ids.interface, 1.0)
|
} else {
|
||||||
|
self.imgs.settings_button_hover
|
||||||
|
})
|
||||||
|
.press_image(if let SettingsTab::Gameplay = self.settings_tab {
|
||||||
|
self.imgs.settings_button_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.settings_button_press
|
||||||
|
})
|
||||||
|
.right_from(self.ids.interface, 0.0)
|
||||||
.label("Gameplay")
|
.label("Gameplay")
|
||||||
.label_font_size(14)
|
.label_font_size(14)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
@ -1155,14 +1203,22 @@ impl Hud {
|
|||||||
|
|
||||||
// 3 Controls/////////////////////
|
// 3 Controls/////////////////////
|
||||||
if Button::image(if let SettingsTab::Controls = self.settings_tab {
|
if Button::image(if let SettingsTab::Controls = self.settings_tab {
|
||||||
self.imgs.button_blue_mo
|
self.imgs.settings_button_pressed
|
||||||
} else {
|
} else {
|
||||||
self.imgs.button_blank
|
self.imgs.settings_button
|
||||||
})
|
})
|
||||||
.w_h(304.0 / 2.5, 80.0 / 2.5)
|
.w_h(31.0*4.0, 12.0*4.0)
|
||||||
.hover_image(self.imgs.button_blue_mo)
|
.hover_image(if let SettingsTab::Controls = self.settings_tab {
|
||||||
.press_image(self.imgs.button_blue_press)
|
self.imgs.settings_button_pressed
|
||||||
.down_from(self.ids.gameplay, 1.0)
|
} else {
|
||||||
|
self.imgs.settings_button_hover
|
||||||
|
})
|
||||||
|
.press_image(if let SettingsTab::Controls = self.settings_tab {
|
||||||
|
self.imgs.settings_button_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.settings_button_press
|
||||||
|
})
|
||||||
|
.right_from(self.ids.gameplay, 0.0)
|
||||||
.label("Controls")
|
.label("Controls")
|
||||||
.label_font_size(14)
|
.label_font_size(14)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
@ -1173,16 +1229,25 @@ impl Hud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4 Video////////////////////////////////
|
// 4 Video////////////////////////////////
|
||||||
if Button::image(if let SettingsTab::Video = self.settings_tab {
|
if Button::image(if let SettingsTab::Video = self.settings_tab {
|
||||||
self.imgs.button_blue_mo
|
self.imgs.settings_button_pressed
|
||||||
} else {
|
} else {
|
||||||
self.imgs.button_blank
|
self.imgs.settings_button
|
||||||
})
|
})
|
||||||
.w_h(304.0 / 2.5, 80.0 / 2.5)
|
.w_h(31.0*4.0, 12.0*4.0)
|
||||||
.hover_image(self.imgs.button_blue_mo)
|
.hover_image(if let SettingsTab::Video = self.settings_tab {
|
||||||
.press_image(self.imgs.button_blue_press)
|
self.imgs.settings_button_pressed
|
||||||
.down_from(self.ids.controls, 1.0)
|
} else {
|
||||||
|
self.imgs.settings_button_hover
|
||||||
|
})
|
||||||
|
.press_image(if let SettingsTab::Video = self.settings_tab {
|
||||||
|
self.imgs.settings_button_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.settings_button_press
|
||||||
|
})
|
||||||
|
.right_from(self.ids.controls, 0.0)
|
||||||
.label("Video")
|
.label("Video")
|
||||||
|
.parent(self.ids.settings_r)
|
||||||
.label_font_size(14)
|
.label_font_size(14)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
.set(self.ids.video, ui_widgets)
|
.set(self.ids.video, ui_widgets)
|
||||||
@ -1193,14 +1258,23 @@ impl Hud {
|
|||||||
|
|
||||||
// 5 Sound///////////////////////////////
|
// 5 Sound///////////////////////////////
|
||||||
if Button::image(if let SettingsTab::Sound = self.settings_tab {
|
if Button::image(if let SettingsTab::Sound = self.settings_tab {
|
||||||
self.imgs.button_blue_mo
|
self.imgs.settings_button_pressed
|
||||||
} else {
|
} else {
|
||||||
self.imgs.button_blank
|
self.imgs.settings_button
|
||||||
})
|
})
|
||||||
.w_h(304.0 / 2.5, 80.0 / 2.5)
|
.w_h(31.0*4.0, 12.0*4.0)
|
||||||
.hover_image(self.imgs.button_blue_mo)
|
.hover_image(if let SettingsTab::Sound = self.settings_tab {
|
||||||
.press_image(self.imgs.button_blue_press)
|
self.imgs.settings_button_pressed
|
||||||
.down_from(self.ids.video, 1.0)
|
} else {
|
||||||
|
self.imgs.settings_button_hover
|
||||||
|
})
|
||||||
|
.press_image(if let SettingsTab::Sound = self.settings_tab {
|
||||||
|
self.imgs.settings_button_pressed
|
||||||
|
} else {
|
||||||
|
self.imgs.settings_button_press
|
||||||
|
})
|
||||||
|
.right_from(self.ids.video, 0.0)
|
||||||
|
.parent(self.ids.settings_r)
|
||||||
.label("Sound")
|
.label("Sound")
|
||||||
.label_font_size(14)
|
.label_font_size(14)
|
||||||
.label_color(TEXT_COLOR)
|
.label_color(TEXT_COLOR)
|
||||||
@ -1247,10 +1321,10 @@ impl Hud {
|
|||||||
|
|
||||||
// X-Button
|
// X-Button
|
||||||
if Button::image(self.imgs.close_button)
|
if Button::image(self.imgs.close_button)
|
||||||
.w_h(20.0, 20.0)
|
.w_h(28.0, 28.0)
|
||||||
.hover_image(self.imgs.close_button_hover)
|
.hover_image(self.imgs.close_button_hover)
|
||||||
.press_image(self.imgs.close_button_press)
|
.press_image(self.imgs.close_button_press)
|
||||||
.top_right_with_margins_on(self.ids.social_frame, 17.0, 5.0)
|
.top_right_with_margins_on(self.ids.social_frame, 12.0, 0.0)
|
||||||
.set(self.ids.social_close, ui_widgets)
|
.set(self.ids.social_close, ui_widgets)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
@ -1297,10 +1371,10 @@ impl Hud {
|
|||||||
|
|
||||||
// X-Button
|
// X-Button
|
||||||
if Button::image(self.imgs.close_button)
|
if Button::image(self.imgs.close_button)
|
||||||
.w_h(20.0, 20.0)
|
.w_h(14.0, 14.0)
|
||||||
.hover_image(self.imgs.close_button_hover)
|
.hover_image(self.imgs.close_button_hover)
|
||||||
.press_image(self.imgs.close_button_press)
|
.press_image(self.imgs.close_button_press)
|
||||||
.top_right_with_margins_on(self.ids.spellbook_frame, 17.0, 5.0)
|
.top_right_with_margins_on(self.ids.spellbook_frame, 12.0, 0.0)
|
||||||
.set(self.ids.spellbook_close, ui_widgets)
|
.set(self.ids.spellbook_close, ui_widgets)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
@ -1492,10 +1566,11 @@ impl Hud {
|
|||||||
|
|
||||||
// 2 Map
|
// 2 Map
|
||||||
if self.map_open {
|
if self.map_open {
|
||||||
// BG
|
// BG
|
||||||
Image::new(self.imgs.map_bg)
|
Rectangle::fill_with([824.0, 976.0], color::TRANSPARENT)
|
||||||
.w_h(824.0, 488.0)
|
.mid_top_with_margin_on(ui_widgets.window, 15.0)
|
||||||
.mid_top_with_margin_on(ui_widgets.window, 200.0)
|
.scroll_kids()
|
||||||
|
.scroll_kids_vertically()
|
||||||
.set(self.ids.map_bg, ui_widgets);
|
.set(self.ids.map_bg, ui_widgets);
|
||||||
// Frame
|
// Frame
|
||||||
Image::new(self.imgs.map_frame_l)
|
Image::new(self.imgs.map_frame_l)
|
||||||
@ -1503,9 +1578,18 @@ impl Hud {
|
|||||||
.w_h(412.0, 488.0)
|
.w_h(412.0, 488.0)
|
||||||
.set(self.ids.map_frame_l, ui_widgets);
|
.set(self.ids.map_frame_l, ui_widgets);
|
||||||
Image::new(self.imgs.map_frame_r)
|
Image::new(self.imgs.map_frame_r)
|
||||||
.top_right_with_margins_on(self.ids.map_bg, 0.0, 0.0)
|
.right_from(self.ids.map_frame_l, 0.0)
|
||||||
.w_h(1648.0 / 4.0, 1952.0 / 4.0)
|
.w_h(412.0, 488.0)
|
||||||
.set(self.ids.map_frame_r, ui_widgets);
|
.set(self.ids.map_frame_r, ui_widgets);
|
||||||
|
Image::new(self.imgs.map_frame_br)
|
||||||
|
.down_from(self.ids.map_frame_r, 0.0)
|
||||||
|
.w_h(412.0, 488.0)
|
||||||
|
.set(self.ids.map_frame_br, ui_widgets);
|
||||||
|
Image::new(self.imgs.map_frame_bl)
|
||||||
|
.down_from(self.ids.map_frame_l, 0.0)
|
||||||
|
.w_h(412.0, 488.0)
|
||||||
|
.set(self.ids.map_frame_bl, ui_widgets);
|
||||||
|
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
Image::new(self.imgs.map_icon)
|
Image::new(self.imgs.map_icon)
|
||||||
@ -1515,21 +1599,21 @@ impl Hud {
|
|||||||
|
|
||||||
// X-Button
|
// X-Button
|
||||||
if Button::image(self.imgs.close_button)
|
if Button::image(self.imgs.close_button)
|
||||||
.w_h(20.0, 20.0)
|
.w_h(28.0, 28.0)
|
||||||
.hover_image(self.imgs.close_button_hover)
|
.hover_image(self.imgs.close_button_hover)
|
||||||
.press_image(self.imgs.close_button_press)
|
.press_image(self.imgs.close_button_press)
|
||||||
.top_right_with_margins_on(self.ids.map_frame_r, 17.0, 5.0)
|
.top_right_with_margins_on(self.ids.map_frame_r, 0.0, 0.0)
|
||||||
.set(self.ids.map_close, ui_widgets)
|
.set(self.ids.map_close, ui_widgets)
|
||||||
.was_clicked()
|
.was_clicked()
|
||||||
{
|
{
|
||||||
self.map_open = false;
|
self.map_open = false;
|
||||||
}
|
}
|
||||||
// Title
|
// Title
|
||||||
Text::new("Map")
|
//Text::new("Map")
|
||||||
.mid_top_with_margin_on(self.ids.map_bg, -7.0)
|
//.mid_top_with_margin_on(self.ids.map_bg, -7.0)
|
||||||
.font_size(14)
|
//.font_size(14)
|
||||||
.color(TEXT_COLOR)
|
//.color(TEXT_COLOR)
|
||||||
.set(self.ids.map_title, ui_widgets);
|
//.set(self.ids.map_title, ui_widgets);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ESC-MENU
|
// ESC-MENU
|
||||||
|
Loading…
x
Reference in New Issue
Block a user