Former-commit-id: b3eef84c3a76629e399827e12327556b4c8c7ffa
This commit is contained in:
Pfauenauge 2019-04-30 13:49:29 +02:00
parent 85bdff364d
commit 532a570923

View File

@ -176,6 +176,7 @@ pub(self) struct Imgs {
inv_slot: ImgId, inv_slot: ImgId,
// Buttons // Buttons
mmap_closed: ImgId, mmap_closed: ImgId,
mmap_closed_hover: ImgId, mmap_closed_hover: ImgId,
mmap_closed_press: ImgId, mmap_closed_press: ImgId,
@ -669,29 +670,18 @@ impl Hud {
Rectangle::fill_with([92.0 * 2.0, 82.0 * 2.0], color::TRANSPARENT) Rectangle::fill_with([92.0 * 2.0, 82.0 * 2.0], color::TRANSPARENT)
.mid_top_with_margin_on(self.ids.mmap_frame, 13.0 * 2.0 + 2.0) .mid_top_with_margin_on(self.ids.mmap_frame, 13.0 * 2.0 + 2.0)
.set(self.ids.mmap_frame_bg, ui_widgets); .set(self.ids.mmap_frame_bg, ui_widgets);
} else { }
else {
Image::new(self.imgs.mmap_frame_closed) Image::new(self.imgs.mmap_frame_closed)
.w_h(100.0 * 2.0, 11.0 * 2.0) .w_h(100.0 * 2.0, 11.0 * 2.0)
.top_right_with_margins_on(ui_widgets.window, 5.0, 5.0) .top_right_with_margins_on(ui_widgets.window, 5.0, 5.0)
.set(self.ids.mmap_frame, ui_widgets); .set(self.ids.mmap_frame, ui_widgets);
}; };
if Button::image(if self.mmap_open { if Button::image(if self.mmap_open {self.imgs.mmap_open} else {self.imgs.mmap_closed})
self.imgs.mmap_open
} else {
self.imgs.mmap_closed
})
.w_h(100.0 * 0.2, 100.0 * 0.2) .w_h(100.0 * 0.2, 100.0 * 0.2)
.hover_image(if self.mmap_open { .hover_image(if self.mmap_open {self.imgs.mmap_open_hover} else {self.imgs.mmap_closed_hover})
self.imgs.mmap_open_hover .press_image(if self.mmap_open {self.imgs.mmap_open_press} else {self.imgs.mmap_closed_press})
} else {
self.imgs.mmap_closed_hover
})
.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)
.set(self.ids.mmap_button, ui_widgets) .set(self.ids.mmap_button, ui_widgets)
.was_clicked() .was_clicked()
@ -1068,12 +1058,7 @@ impl Hud {
.top_left_with_margins_on(self.ids.settings_bg, 0.0, 0.0) .top_left_with_margins_on(self.ids.settings_bg, 0.0, 0.0)
.w_h(412.0, 488.0) .w_h(412.0, 488.0)
.set(self.ids.settings_l, ui_widgets); .set(self.ids.settings_l, ui_widgets);
<<<<<<< HEAD
<<<<<<< HEAD
Image::new(self.imgs.settings_frame_r) Image::new(self.imgs.settings_frame_r)
=======
Image::new(self.imgs.settings_frame_r)
>>>>>>> settings window
.right_from(self.ids.settings_l, 0.0) .right_from(self.ids.settings_l, 0.0)
.parent(self.ids.settings_bg) .parent(self.ids.settings_bg)
.w_h(412.0, 488.0) .w_h(412.0, 488.0)
@ -1084,22 +1069,6 @@ impl Hud {
.scroll_kids() .scroll_kids()
.scroll_kids_vertically() .scroll_kids_vertically()
.set(self.ids.settings_content, ui_widgets); .set(self.ids.settings_content, 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);
<<<<<<< HEAD
>>>>>>> Map Window, Settings Window
=======
// 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);
>>>>>>> settings window
// X-Button // X-Button
if Button::image(self.imgs.close_button) if Button::image(self.imgs.close_button)
.w_h(28.0, 28.0) .w_h(28.0, 28.0)
@ -1121,25 +1090,14 @@ impl Hud {
.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)
<<<<<<< HEAD
//.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);
=======
//.w_h(224.0 / 3.0, 224.0 / 3.0)
//.top_left_with_margins_on(self.ids.settings_bg, -10.0, -10.0)
//.set(self.ids.settings_icon, ui_widgets);
<<<<<<< HEAD
>>>>>>> Map Window, Settings Window
// TODO: Find out if we can remove this // TODO: Find out if we can remove this
=======
// TODO: Find out if we can remove this
>>>>>>> settings window
// 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.settings_button_pressed self.imgs.settings_button_pressed
<<<<<<< HEAD
} else { } else {
self.imgs.settings_button self.imgs.settings_button
}) })
@ -1155,23 +1113,6 @@ impl Hud {
self.imgs.settings_button_press self.imgs.settings_button_press
}) })
.top_left_with_margins_on(self.ids.settings_l, 8.0*4.0, 2.0*4.0) .top_left_with_margins_on(self.ids.settings_l, 8.0*4.0, 2.0*4.0)
=======
} else {
self.imgs.settings_button
})
.w_h(31.0*4.0, 12.0*4.0)
.hover_image(if let SettingsTab::Interface = self.settings_tab {
self.imgs.settings_button_pressed
} 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)
>>>>>>> settings window
.label("Interface") .label("Interface")
.label_font_size(14) .label_font_size(14)
.label_color(TEXT_COLOR) .label_color(TEXT_COLOR)
@ -1234,16 +1175,11 @@ impl Hud {
} }
// 2 Gameplay//////////////// // 2 Gameplay////////////////
<<<<<<< HEAD
if Button::image(if let SettingsTab::Gameplay = self.settings_tab { if Button::image(if let SettingsTab::Gameplay = self.settings_tab {
=======
if Button::image(if let SettingsTab::Gameplay = self.settings_tab {
>>>>>>> settings window
self.imgs.settings_button_pressed self.imgs.settings_button_pressed
} else { } else {
self.imgs.settings_button self.imgs.settings_button
}) })
<<<<<<< HEAD
.w_h(31.0*4.0, 12.0*4.0) .w_h(31.0*4.0, 12.0*4.0)
.hover_image(if let SettingsTab::Gameplay = self.settings_tab { .hover_image(if let SettingsTab::Gameplay = self.settings_tab {
self.imgs.settings_button_pressed self.imgs.settings_button_pressed
@ -1255,19 +1191,6 @@ impl Hud {
} else { } else {
self.imgs.settings_button_press self.imgs.settings_button_press
}) })
=======
.w_h(31.0*4.0, 12.0*4.0)
.hover_image(if let SettingsTab::Gameplay = self.settings_tab {
self.imgs.settings_button_pressed
} 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
})
>>>>>>> settings window
.right_from(self.ids.interface, 0.0) .right_from(self.ids.interface, 0.0)
.label("Gameplay") .label("Gameplay")
.label_font_size(14) .label_font_size(14)
@ -1284,11 +1207,7 @@ impl Hud {
} else { } else {
self.imgs.settings_button self.imgs.settings_button
}) })
<<<<<<< HEAD
.w_h(31.0*4.0, 12.0*4.0) .w_h(31.0*4.0, 12.0*4.0)
=======
.w_h(31.0*4.0, 12.0*4.0)
>>>>>>> settings window
.hover_image(if let SettingsTab::Controls = self.settings_tab { .hover_image(if let SettingsTab::Controls = self.settings_tab {
self.imgs.settings_button_pressed self.imgs.settings_button_pressed
} else { } else {
@ -1310,16 +1229,11 @@ impl Hud {
} }
// 4 Video//////////////////////////////// // 4 Video////////////////////////////////
<<<<<<< HEAD
if Button::image(if let SettingsTab::Video = self.settings_tab { if Button::image(if let SettingsTab::Video = self.settings_tab {
=======
if Button::image(if let SettingsTab::Video = self.settings_tab {
>>>>>>> settings window
self.imgs.settings_button_pressed self.imgs.settings_button_pressed
} else { } else {
self.imgs.settings_button self.imgs.settings_button
}) })
<<<<<<< HEAD
.w_h(31.0*4.0, 12.0*4.0) .w_h(31.0*4.0, 12.0*4.0)
.hover_image(if let SettingsTab::Video = self.settings_tab { .hover_image(if let SettingsTab::Video = self.settings_tab {
self.imgs.settings_button_pressed self.imgs.settings_button_pressed
@ -1331,19 +1245,6 @@ impl Hud {
} else { } else {
self.imgs.settings_button_press self.imgs.settings_button_press
}) })
=======
.w_h(31.0*4.0, 12.0*4.0)
.hover_image(if let SettingsTab::Video = self.settings_tab {
self.imgs.settings_button_pressed
} 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
})
>>>>>>> settings window
.right_from(self.ids.controls, 0.0) .right_from(self.ids.controls, 0.0)
.label("Video") .label("Video")
.parent(self.ids.settings_r) .parent(self.ids.settings_r)
@ -1358,7 +1259,6 @@ 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.settings_button_pressed self.imgs.settings_button_pressed
<<<<<<< HEAD
} else { } else {
self.imgs.settings_button self.imgs.settings_button
}) })
@ -1373,22 +1273,6 @@ impl Hud {
} else { } else {
self.imgs.settings_button_press self.imgs.settings_button_press
}) })
=======
} else {
self.imgs.settings_button
})
.w_h(31.0*4.0, 12.0*4.0)
.hover_image(if let SettingsTab::Sound = self.settings_tab {
self.imgs.settings_button_pressed
} 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
})
>>>>>>> settings window
.right_from(self.ids.video, 0.0) .right_from(self.ids.video, 0.0)
.parent(self.ids.settings_r) .parent(self.ids.settings_r)
.label("Sound") .label("Sound")
@ -1682,11 +1566,7 @@ impl Hud {
// 2 Map // 2 Map
if self.map_open { if self.map_open {
<<<<<<< HEAD
// BG // BG
=======
// BG
>>>>>>> Map Window, Settings Window
Rectangle::fill_with([824.0, 976.0], color::TRANSPARENT) Rectangle::fill_with([824.0, 976.0], color::TRANSPARENT)
.mid_top_with_margin_on(ui_widgets.window, 15.0) .mid_top_with_margin_on(ui_widgets.window, 15.0)
.scroll_kids() .scroll_kids()
@ -1698,8 +1578,6 @@ 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)
<<<<<<< HEAD
<<<<<<< HEAD
.right_from(self.ids.map_frame_l, 0.0) .right_from(self.ids.map_frame_l, 0.0)
.w_h(412.0, 488.0) .w_h(412.0, 488.0)
.set(self.ids.map_frame_r, ui_widgets); .set(self.ids.map_frame_r, ui_widgets);
@ -1711,23 +1589,7 @@ impl Hud {
.down_from(self.ids.map_frame_l, 0.0) .down_from(self.ids.map_frame_l, 0.0)
.w_h(412.0, 488.0) .w_h(412.0, 488.0)
.set(self.ids.map_frame_bl, ui_widgets); .set(self.ids.map_frame_bl, ui_widgets);
=======
.top_right_with_margins_on(self.ids.map_bg, 0.0, 0.0)
=======
.right_from(self.ids.map_frame_l, 0.0)
>>>>>>> settings window
.w_h(412.0, 488.0)
.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);
>>>>>>> Map Window, Settings Window
// Icon // Icon
Image::new(self.imgs.map_icon) Image::new(self.imgs.map_icon)
@ -1748,17 +1610,10 @@ impl Hud {
} }
// Title // Title
//Text::new("Map") //Text::new("Map")
<<<<<<< HEAD
//.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);
=======
//.mid_top_with_margin_on(self.ids.map_bg, -7.0)
//.font_size(14)
//.color(TEXT_COLOR)
//.set(self.ids.map_title, ui_widgets);
>>>>>>> Map Window, Settings Window
} }
// ESC-MENU // ESC-MENU