Merge branch 'char_win_ui_rebase' into 'master'

Char Window Visuals and assets

See merge request veloren/veloren!125

Former-commit-id: 5c8a80e5e01c13ac184a580e5feb49e64f5e4e1a
This commit is contained in:
Joshua Barretto 2019-05-12 13:01:46 +00:00
commit 5d8a03896a
34 changed files with 402 additions and 85 deletions

BIN
assets/voxygen/element/buttons/grid.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/buttons/x.vox (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/element/frames/divider_charwindow.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/frames/tab_bg.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/frames/tab_small_closed.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/frames/tab_small_open.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/frames/window2.vox (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/element/frames/window_3.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/frames/xp_charwindow.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/back.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/belt.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/chest.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/feet.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/gem.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/hands.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/head.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/legs.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/mainhand.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/necklace.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/offhand.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/ring.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/shoulders.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/element/icons/tabard.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/element/misc_bg/crosshair.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/Wood Training 2h.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/hand.vox (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/voxel/head.vox (Stored with Git LFS)

Binary file not shown.

BIN
assets/voxygen/voxel/sword.vox (Stored with Git LFS)

Binary file not shown.

View File

@ -2,18 +2,18 @@ use super::{img_ids::Imgs, Fonts, TEXT_COLOR, XP_COLOR};
use conrod_core::{
color,
widget::{self, Button, Image, Rectangle, Text},
widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon,
widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon,
};
widget_ids! {
pub struct Ids {
charwindow,
charwindow_bg,
charwindow_gradient,
charwindow_close,
charwindow_exp_progress_rectangle,
charwindow_exp_rectangle,
charwindow_frame,
charwindow_icon,
content_align,
charwindow_rectangle,
charwindow_tab1,
charwindow_tab1_exp,
@ -23,6 +23,45 @@ widget_ids! {
charwindow_tab1_stats,
charwindow_tab_bg,
charwindow_title,
window_3,
tab_bg,
tab_small_open,
tab_small_closed,
xp_charwindow,
divider,
head_bg,
shoulders_bg,
hands_bg,
belt_bg,
legs_bg,
feet_bg,
ring_r_bg,
ring_l_bg,
tabard_bg,
chest_bg,
back_bg,
gem_bg,
necklace_bg,
mainhand_bg,
offhand_bg,
charwindow_bg,
head_grid,
shoulders_grid,
hands_grid,
belt_grid,
legs_grid,
feet_grid,
ring_r_grid,
ring_l_grid,
tabard_grid,
chest_grid,
back_grid,
gem_grid,
necklace_grid,
mainhand_grid,
offhand_grid,
}
}
@ -69,24 +108,24 @@ impl<'a> Widget for CharacterWindow<'a> {
let xp_percentage = 0.4;
// Frame
Image::new(self.imgs.window_frame)
Image::new(self.imgs.window_3)
.middle_of(id)
.top_left_with_margins_on(ui.window, 200.0, 215.0)
.w_h(107.0 * 4.0, 125.0 * 4.0)
.top_left_with_margins_on(ui.window, 212.0, 215.0)
.w_h(103.0 * 4.0, 122.0 * 4.0)
.set(state.charwindow_frame, ui);
// Icon
Image::new(self.imgs.charwindow_icon)
.w_h(40.0, 40.0)
.top_left_with_margins_on(state.charwindow_frame, 4.0, 4.0)
.set(state.charwindow_icon, ui);
//Image::new(self.imgs.charwindow_icon)
//.w_h(40.0, 40.0)
//.top_left_with_margins_on(state.charwindow_frame, 4.0, 4.0)
//.set(state.charwindow_icon, ui);
// X-Button
if Button::image(self.imgs.close_button)
.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.charwindow_frame, 12.0, 0.0)
.top_right_with_margins_on(state.charwindow_frame, 0.0, 0.0)
.set(state.charwindow_close, ui)
.was_clicked()
{
@ -95,31 +134,199 @@ impl<'a> Widget for CharacterWindow<'a> {
// Title
Text::new("Character Name") // Add in actual Character Name
.mid_top_with_margin_on(state.charwindow_frame, 17.0)
.mid_top_with_margin_on(state.charwindow_frame, 6.0)
.font_id(self.fonts.metamorph)
.font_size(14)
.color(TEXT_COLOR)
.set(state.charwindow_title, ui);
// Content Alignment
Rectangle::fill_with([95.0 * 4.0, 108.0 * 4.0], color::TRANSPARENT)
.mid_top_with_margin_on(state.charwindow_frame, 40.0)
.set(state.content_align, ui);
// Gradient BG
Image::new(self.imgs.charwindow_gradient)
.w_h(95.0 * 4.0, 108.0 * 4.0)
.middle_of(state.content_align)
.set(state.charwindow_gradient, ui);
// Contents
//Head
Image::new(self.imgs.head_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.mid_top_with_margin_on(state.content_align, 5.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.head_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.head_bg)
.set(state.head_grid, ui);
// Ring R
Image::new(self.imgs.ring_r_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.bottom_right_with_margins_on(state.content_align, 20.0, 20.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.ring_r_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.ring_r_bg)
.set(state.ring_r_grid, ui);
// Feet
Image::new(self.imgs.feet_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.ring_r_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.feet_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.feet_bg)
.set(state.feet_grid, ui);
// Legs
Image::new(self.imgs.legs_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.feet_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.legs_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.legs_bg)
.set(state.legs_grid, ui);
// Belt
Image::new(self.imgs.belt_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.legs_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.belt_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.belt_bg)
.set(state.belt_grid, ui);
// Hands
Image::new(self.imgs.hands_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.belt_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.hands_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.hands_bg)
.set(state.hands_grid, ui);
// Shoulders
Image::new(self.imgs.shoulders_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.hands_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.shoulders_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.shoulders_bg)
.set(state.shoulders_grid, ui);
// Ring L
Image::new(self.imgs.ring_l_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.bottom_left_with_margins_on(state.content_align, 20.0, 20.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.ring_l_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.ring_l_bg)
.set(state.ring_l_grid, ui);
// Tabard
Image::new(self.imgs.tabard_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.ring_l_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.tabard_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.tabard_bg)
.set(state.tabard_grid, ui);
// Chest
Image::new(self.imgs.chest_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.tabard_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.chest_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.chest_bg)
.set(state.chest_grid, ui);
// Back
Image::new(self.imgs.back_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.chest_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.back_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.back_bg)
.set(state.back_grid, ui);
// Gem
Image::new(self.imgs.gem_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.back_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.gem_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.gem_bg)
.set(state.gem_grid, ui);
// Necklace
Image::new(self.imgs.necklace_bg)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.up_from(state.gem_bg, 10.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.necklace_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 1.8, 28.0 * 1.8)
.middle_of(state.necklace_bg)
.set(state.necklace_grid, ui);
// Weapon Main Hand
Image::new(self.imgs.mainhand_bg)
.w_h(28.0 * 2.2, 28.0 * 2.2)
.bottom_right_with_margins_on(state.ring_l_bg, 0.0, -115.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.mainhand_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 2.2, 28.0 * 2.2)
.middle_of(state.mainhand_bg)
.set(state.mainhand_grid, ui);
// Weapon Off-Hand
Image::new(self.imgs.offhand_bg)
.w_h(28.0 * 2.2, 28.0 * 2.2)
.bottom_left_with_margins_on(state.ring_r_bg, 0.0, -115.0)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 0.1)))
.set(state.offhand_bg, ui);
Button::image(self.imgs.grid)
.w_h(28.0 * 2.2, 28.0 * 2.2)
.middle_of(state.offhand_bg)
.set(state.offhand_grid, ui);
// Stats Tab
// Tab BG
Image::new(self.imgs.charwindow_tab_bg)
.w_h(205.0, 412.0)
.mid_left_with_margin_on(state.charwindow_frame, -205.0)
Image::new(self.imgs.tab_bg)
.w_h(51.0 * 4.0, 115.0 * 4.0)
.top_left_with_margins_on(state.charwindow_frame, 28.0, -200.0)
.set(state.charwindow_tab_bg, ui);
// Tab Rectangle
Rectangle::fill_with([192.0, 371.0], color::rgba(0.0, 0.0, 0.0, 0.8))
.top_right_with_margins_on(state.charwindow_tab_bg, 20.0, 0.0)
Rectangle::fill_with([45.0 * 4.0, 104.0 * 4.0], color::TRANSPARENT)
.top_left_with_margins_on(state.charwindow_tab_bg, 7.0 * 4.0, 4.0 * 4.0)
.set(state.charwindow_rectangle, ui);
// Tab Button
Button::image(self.imgs.charwindow_tab)
.w_h(65.0, 23.0)
.top_left_with_margins_on(state.charwindow_tab_bg, -18.0, 2.0)
.label("Stats")
.label_color(TEXT_COLOR)
.label_font_size(14)
.set(state.charwindow_tab1, ui);
// Tab Button -> Add that back in when we have multiple tabs
// Button::image(self.imgs.charwindow_tab)
//.w_h(65.0, 23.0)
//.top_left_with_margins_on(state.charwindow_tab_bg, -18.0, 1.8)
//.label("Stats")
//.label_color(TEXT_COLOR)
//.label_font_size(14)
//.set(state.charwindow_tab1, ui);
Text::new("1") //Add in actual Character Level
.mid_top_with_margin_on(state.charwindow_rectangle, 10.0)
@ -152,6 +359,13 @@ impl<'a> Widget for CharacterWindow<'a> {
.color(TEXT_COLOR)
.set(state.charwindow_tab1_exp, ui);
// Divider
Image::new(self.imgs.divider)
.w_h(38.0 * 4.0, 5.0 * 4.0)
.mid_top_with_margin_on(state.charwindow_tab1_exp, 30.0)
.set(state.divider, ui);
// Stats
Text::new(
"Stamina\n\
@ -162,7 +376,7 @@ impl<'a> Widget for CharacterWindow<'a> {
\n\
Intelligence",
)
.top_left_with_margins_on(state.charwindow_rectangle, 100.0, 20.0)
.top_left_with_margins_on(state.charwindow_rectangle, 140.0, 5.0)
.font_id(self.fonts.opensans)
.font_size(16)
.color(TEXT_COLOR)
@ -177,7 +391,7 @@ impl<'a> Widget for CharacterWindow<'a> {
\n\
124124",
)
.right_from(state.charwindow_tab1_statnames, 10.0)
.top_right_with_margins_on(state.charwindow_rectangle, 140.0, 5.0)
.font_id(self.fonts.opensans)
.font_size(16)
.color(TEXT_COLOR)

View File

@ -3,11 +3,55 @@ use crate::ui::img_ids::{BlankGraphic, ImageGraphic, VoxelGraphic, VoxelMs9Graph
image_ids! {
pub struct Imgs {
<VoxelGraphic>
// Bag
bag_contents: "/voxygen/element/frames/bag.vox",
inv_grid: "/voxygen/element/frames/inv_grid.vox",
inv_slot: "/voxygen/element/buttons/inv_slot.vox",
// Window Parts
window_3: "/voxygen/element/frames/window_3.vox",
tab_bg: "/voxygen/element/frames/tab_bg.vox",
tab_small_open: "/voxygen/element/frames/tab_small_open.vox",
tab_small_closed: "/voxygen/element/frames/tab_small_closed.vox",
// MiniMap
mmap_frame: "/voxygen/element/frames/mmap.vox",
mmap_frame_closed: "/voxygen/element/frames/mmap_closed.vox",
// Missing: Buff Frame Animation .gif ?! we could do animation in ui.maintain, or in shader?
window_frame: "/voxygen/element/frames/window2.vox",
// Settings Window
settings_frame_r: "/voxygen/element/frames/settings_r.vox",
settings_frame_l: "/voxygen/element/frames/settings_l.vox",
settings_button: "/voxygen/element/buttons/settings_button.vox",
settings_button_pressed: "/voxygen/element/buttons/settings_button_pressed.vox",
settings_button_hover: "/voxygen/element/buttons/settings_button_hover.vox",
settings_button_press: "/voxygen/element/buttons/settings_button_press.vox",
check: "/voxygen/element/buttons/check/no.vox",
check_mo: "/voxygen/element/buttons/check/no_mo.vox",
check_press: "/voxygen/element/buttons/check/press.vox",
check_checked: "/voxygen/element/buttons/check/yes.vox",
check_checked_mo: "/voxygen/element/buttons/check/yes_mo.vox",
slider: "/voxygen/element/slider/track.vox",
slider_indicator: "/voxygen/element/slider/indicator.vox",
// Map Window
map_frame_l: "/voxygen/element/frames/map_l.vox",
map_frame_r: "/voxygen/element/frames/map_r.vox",
map_frame_bl: "/voxygen/element/frames/map_bl.vox",
map_frame_br: "/voxygen/element/frames/map_br.vox",
// Chat-Arrows
chat_arrow: "/voxygen/element/buttons/arrow_down.vox",
chat_arrow_mo: "/voxygen/element/buttons/arrow_down_hover.vox",
chat_arrow_press: "/voxygen/element/buttons/arrow_down_press.vox",
// Crosshair
crosshair: "/voxygen/element/misc_bg/crosshair.vox",
<VoxelMs9Graphic>
// Buttons
@ -18,6 +62,11 @@ image_ids! {
mmap_open_hover: "/voxygen/element/buttons/button_mmap_open_hover.vox",
mmap_open_press: "/voxygen/element/buttons/button_mmap_open_press.vox",
// Grid
grid: "/voxygen/element/buttons/grid.vox",
grid_hover: "/voxygen/element/buttons/grid.vox",
grid_press: "/voxygen/element/buttons/grid.vox",
settings: "/voxygen/element/buttons/settings.vox",
settings_hover: "/voxygen/element/buttons/settings_hover.vox",
settings_press: "/voxygen/element/buttons/settings_press.vox",
@ -42,6 +91,24 @@ image_ids! {
qlog_hover: "/voxygen/element/buttons/qlog_hover.vox",
qlog_press: "/voxygen/element/buttons/qlog_press.vox",
// Charwindow
xp_charwindow: "/voxygen/element/frames/xp_charwindow.vox",
divider: "/voxygen/element/frames/divider_charwindow.vox",
head_bg: "/voxygen/element/icons/head.vox",
shoulders_bg: "/voxygen/element/icons/shoulders.vox",
hands_bg: "/voxygen/element/icons/hands.vox",
belt_bg: "/voxygen/element/icons/belt.vox",
legs_bg: "/voxygen/element/icons/legs.vox",
feet_bg: "/voxygen/element/icons/feet.vox",
ring_r_bg: "/voxygen/element/icons/ring.vox",
ring_l_bg: "/voxygen/element/icons/ring.vox",
tabard_bg: "/voxygen/element/icons/tabard.vox",
chest_bg: "/voxygen/element/icons/chest.vox",
back_bg: "/voxygen/element/icons/back.vox",
gem_bg: "/voxygen/element/icons/gem.vox",
necklace_bg: "/voxygen/element/icons/necklace.vox",
mainhand_bg: "/voxygen/element/icons/mainhand.vox",
offhand_bg: "/voxygen/element/icons/offhand.vox",
// Close button
close_button: "/voxygen/element/buttons/x.vox",
@ -54,47 +121,12 @@ image_ids! {
button_hover: "/voxygen/element/buttons/button_hover.vox",
button_press: "/voxygen/element/buttons/button_press.vox",
<VoxelGraphic>
// MiniMap
mmap_frame: "/voxygen/element/frames/mmap.vox",
mmap_frame_closed: "/voxygen/element/frames/mmap_closed.vox",
// Missing: Buff Frame Animation .gif ?! we could do animation in ui.maintain, or in shader?
window_frame: "/voxygen/element/frames/window2.vox",
// Settings Window
settings_frame_r: "/voxygen/element/frames/settings_r.vox",
settings_frame_l: "/voxygen/element/frames/settings_l.vox",
settings_button: "/voxygen/element/buttons/settings_button.vox",
settings_button_pressed: "/voxygen/element/buttons/settings_button_pressed.vox",
settings_button_hover: "/voxygen/element/buttons/settings_button_hover.vox",
settings_button_press: "/voxygen/element/buttons/settings_button_press.vox",
check: "/voxygen/element/buttons/check/no.vox",
check_mo: "/voxygen/element/buttons/check/no_mo.vox",
check_press: "/voxygen/element/buttons/check/press.vox",
check_checked: "/voxygen/element/buttons/check/yes.vox",
check_checked_mo: "/voxygen/element/buttons/check/yes_mo.vox",
slider: "/voxygen/element/slider/track.vox",
slider_indicator: "/voxygen/element/slider/indicator.vox",
// Map Window
map_frame_l: "/voxygen/element/frames/map_l.vox",
map_frame_r: "/voxygen/element/frames/map_r.vox",
map_frame_bl: "/voxygen/element/frames/map_bl.vox",
map_frame_br: "/voxygen/element/frames/map_br.vox",
// Chat-Arrows
chat_arrow: "/voxygen/element/buttons/arrow_down.vox",
chat_arrow_mo: "/voxygen/element/buttons/arrow_down_hover.vox",
chat_arrow_press: "/voxygen/element/buttons/arrow_down_press.vox",
<ImageGraphic>
// Spell Book Window
charwindow_gradient:"/voxygen/element/misc_bg/charwindow.png",
// Spell Book Window
spellbook_bg: "/voxygen/element/misc_bg/small_bg.png",
spellbook_icon: "/voxygen/element/icons/spellbook.png",

View File

@ -71,6 +71,7 @@ impl<'a> Widget for Map<'a> {
.scroll_kids()
.scroll_kids_vertically()
.set(state.ids.map_bg, ui);
// Frame
Image::new(self.imgs.map_frame_l)
.top_left_with_margins_on(state.ids.map_bg, 0.0, 0.0)
@ -95,12 +96,6 @@ impl<'a> Widget for Map<'a> {
.top_left_with_margins_on(state.ids.map_frame, -10.0, -10.0)
.set(state.ids.map_icon, ui);
// Icon
Image::new(self.imgs.map_icon)
.w_h(224.0 / 3.0, 224.0 / 3.0)
.top_left_with_margins_on(state.ids.map_frame, -10.0, -10.0)
.set(state.ids.map_icon, ui);
// X-Button
if Button::image(self.imgs.close_button)
.w_h(28.0, 28.0)

View File

@ -306,7 +306,7 @@ impl Hud {
.w_h(100.0 * 0.2, 100.0 * 0.2)
.hover_image(self.imgs.close_button_hover)
.press_image(self.imgs.close_button_press)
.top_right_with_margins_on(self.ids.help_bg, 8.0, 3.0)
.top_right_with_margins_on(self.ids.help_bg, 4.0, 4.0)
.set(self.ids.button_help2, ui_widgets)
.was_clicked()
{

View File

@ -21,6 +21,7 @@ widget_ids! {
test,
xp_bar,
xp_bar_progress,
crosshair,
}
}
@ -69,8 +70,14 @@ impl<'a> Widget for Skillbar<'a> {
// TODO: Read from parameter / character struct
let xp_percentage = 0.4;
let hp_percentage = 0.4;
let mana_percentage = 0.4;
let hp_percentage = 1.0;
let mana_percentage = 1.0;
// Crosshair TODO: Only show while aiming with a bow or when casting a spell
// Image::new(self.imgs.crosshair)
// .w_h(101.0 * 0.5, 101.0 * 0.5)
// .mid_top_with_margin_on(ui.window, 500.0)
// .set(state.ids.crosshair, ui);
// Experience-Bar
Image::new(self.imgs.xp_bar)