mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
stat icons, frame colours
This commit is contained in:
parent
44ec09a8e7
commit
4153df66ea
BIN
assets/voxygen/element/frames/server_frame.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/frames/server_frame.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/frames/window.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/frames/window.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/frames/window_3.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/frames/window_3.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/frames/window_4.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/frames/window_4.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/endurance.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/endurance.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/fitness.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/fitness.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/willpower.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/icons/willpower.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -14,6 +14,7 @@ use conrod_core::{
|
||||
widget::{self, Button, Image, Rectangle, Text},
|
||||
widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon,
|
||||
};
|
||||
//use const_tweaker::tweak;
|
||||
|
||||
widget_ids! {
|
||||
pub struct Ids {
|
||||
@ -84,6 +85,9 @@ widget_ids! {
|
||||
tabard_ico,
|
||||
mainhand_ico,
|
||||
offhand_ico,
|
||||
end_ico,
|
||||
fit_ico,
|
||||
wp_ico,
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,10 +148,10 @@ pub enum Event {
|
||||
Stats,
|
||||
Close,
|
||||
}
|
||||
|
||||
//#[const_tweaker::tweak(min = -10.0, max = 10.0, step = 1.0)]
|
||||
//const X: f64 = 10.0;
|
||||
|
||||
/*
|
||||
#[tweak(min = -100.0, max = 20.0, step = 1.0)]
|
||||
const END_X: f64 = 10.0;
|
||||
*/
|
||||
impl<'a> Widget for Bag<'a> {
|
||||
type Event = Option<Event>;
|
||||
type State = State;
|
||||
@ -559,6 +563,21 @@ impl<'a> Widget for Bag<'a> {
|
||||
.font_size(self.fonts.cyri.scale(16))
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.statnames, ui);
|
||||
Image::new(self.imgs.endurance_ico)
|
||||
.w_h(30.0, 30.0)
|
||||
.top_left_with_margins_on(state.ids.statnames, -10.0, -40.0)
|
||||
.color(Some(UI_HIGHLIGHT_0))
|
||||
.set(state.ids.end_ico, ui);
|
||||
Image::new(self.imgs.fitness_ico)
|
||||
.w_h(30.0, 30.0)
|
||||
.down_from(state.ids.end_ico, 10.0)
|
||||
.color(Some(UI_HIGHLIGHT_0))
|
||||
.set(state.ids.fit_ico, ui);
|
||||
Image::new(self.imgs.willpower_ico)
|
||||
.w_h(30.0, 30.0)
|
||||
.down_from(state.ids.fit_ico, 10.0)
|
||||
.color(Some(UI_HIGHLIGHT_0))
|
||||
.set(state.ids.wp_ico, ui);
|
||||
|
||||
Text::new(&format!(
|
||||
"{}\n\n{}\n\n{}",
|
||||
|
@ -187,9 +187,6 @@ image_ids! {
|
||||
divider: "voxygen.element.frames.divider_charwindow",
|
||||
|
||||
// Close button
|
||||
close_button: "voxygen.element.buttons.x",
|
||||
close_button_hover: "voxygen.element.buttons.x_hover",
|
||||
close_button_press: "voxygen.element.buttons.x_press",
|
||||
|
||||
|
||||
// Items
|
||||
@ -227,6 +224,9 @@ image_ids! {
|
||||
close_btn: "voxygen.element.buttons.close_btn",
|
||||
close_btn_hover: "voxygen.element.buttons.close_btn_hover",
|
||||
close_btn_press: "voxygen.element.buttons.close_btn_press",
|
||||
close_button: "voxygen.element.buttons.close_btn",
|
||||
close_button_hover: "voxygen.element.buttons.close_btn_hover",
|
||||
close_button_press: "voxygen.element.buttons.close_btn_press",
|
||||
|
||||
// Inventory
|
||||
coin_ico: "voxygen.element.icons.coin",
|
||||
@ -258,8 +258,9 @@ image_ids! {
|
||||
necklace_bg: "voxygen.element.icons.necklace",
|
||||
mainhand_bg: "voxygen.element.icons.mainhand",
|
||||
offhand_bg: "voxygen.element.icons.offhand",
|
||||
|
||||
|
||||
willpower_ico: "voxygen.element.icons.willpower",
|
||||
endurance_ico: "voxygen.element.icons.endurance",
|
||||
fitness_ico: "voxygen.element.icons.fitness",
|
||||
|
||||
not_found:"voxygen.element.not_found",
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use super::{img_ids::Imgs, Show, TEXT_COLOR, TEXT_COLOR_3};
|
||||
use super::{img_ids::Imgs, Show, TEXT_COLOR, TEXT_COLOR_3, UI_MAIN};
|
||||
|
||||
use crate::{i18n::VoxygenLocalization, ui::fonts::ConrodVoxygenFonts};
|
||||
use client::{self, Client};
|
||||
@ -90,6 +90,7 @@ impl<'a> Widget for Social<'a> {
|
||||
|
||||
Image::new(self.imgs.window_3)
|
||||
.top_left_with_margins_on(ui.window, 200.0, 25.0)
|
||||
.color(Some(UI_MAIN))
|
||||
.w_h(103.0 * 4.0, 122.0 * 4.0)
|
||||
.set(ids.social_frame, ui);
|
||||
|
||||
@ -131,6 +132,7 @@ impl<'a> Widget for Social<'a> {
|
||||
Image::new(self.imgs.social_frame)
|
||||
.w_h(99.0 * 4.0, 100.0 * 4.0)
|
||||
.mid_bottom_of(ids.align)
|
||||
.color(Some(UI_MAIN))
|
||||
.set(ids.frame, ui);
|
||||
|
||||
// Online Tab
|
||||
@ -156,6 +158,7 @@ impl<'a> Widget for Social<'a> {
|
||||
.label_font_size(self.fonts.cyri.scale(14))
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.parent(ids.frame)
|
||||
.color(UI_MAIN)
|
||||
.label_color(TEXT_COLOR)
|
||||
.set(ids.online_tab, ui)
|
||||
.was_clicked()
|
||||
@ -222,6 +225,7 @@ impl<'a> Widget for Social<'a> {
|
||||
.label_font_size(self.fonts.cyri.scale(14))
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.parent(ids.frame)
|
||||
.color(UI_MAIN)
|
||||
.label_color(TEXT_COLOR_3)
|
||||
.set(ids.friends_tab, ui)
|
||||
.was_clicked()
|
||||
@ -253,6 +257,7 @@ impl<'a> Widget for Social<'a> {
|
||||
.parent(ids.frame)
|
||||
.label_font_size(self.fonts.cyri.scale(14))
|
||||
.label_font_id(self.fonts.cyri.conrod_id)
|
||||
.color(UI_MAIN)
|
||||
.label_color(TEXT_COLOR_3)
|
||||
.set(ids.faction_tab, ui)
|
||||
.was_clicked()
|
||||
|
@ -1,4 +1,4 @@
|
||||
use super::{img_ids::Imgs, Show, TEXT_COLOR};
|
||||
use super::{img_ids::Imgs, Show, TEXT_COLOR, UI_MAIN};
|
||||
use crate::ui::fonts::ConrodVoxygenFonts;
|
||||
use conrod_core::{
|
||||
color,
|
||||
@ -77,6 +77,7 @@ impl<'a> Widget for Spell<'a> {
|
||||
Image::new(self.imgs.window_3)
|
||||
.top_left_with_margins_on(ui.window, 200.0, 25.0)
|
||||
.w_h(103.0 * 4.0, 122.0 * 4.0)
|
||||
.color(Some(UI_MAIN))
|
||||
.set(state.spell_frame, ui);
|
||||
|
||||
// X-Button
|
||||
|
@ -12,7 +12,7 @@ use crate::{
|
||||
};
|
||||
use client::Client;
|
||||
use common::{
|
||||
assets::{load_expect, load_glob},
|
||||
assets::load_expect,
|
||||
comp::{self, humanoid},
|
||||
};
|
||||
use conrod_core::{
|
||||
@ -22,7 +22,7 @@ use conrod_core::{
|
||||
widget::{text_box::Event as TextBoxEvent, Button, Image, Rectangle, Scrollbar, Text, TextBox},
|
||||
widget_ids, Borderable, Color, Colorable, Labelable, Positionable, Sizeable, UiCell, Widget,
|
||||
};
|
||||
use std::{borrow::Borrow, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
const STARTER_HAMMER: &str = "common.items.weapons.starter_hammer";
|
||||
const STARTER_BOW: &str = "common.items.weapons.starter_bow";
|
||||
@ -31,6 +31,10 @@ const STARTER_STAFF: &str = "common.items.weapons.starter_staff";
|
||||
const STARTER_SWORD: &str = "common.items.weapons.starter_sword";
|
||||
const STARTER_DAGGER: &str = "common.items.weapons.starter_dagger";
|
||||
|
||||
// UI Color-Theme
|
||||
const UI_MAIN: Color = Color::Rgba(0.61, 0.70, 0.70, 1.0); // Greenish Blue
|
||||
//const UI_HIGHLIGHT_0: Color = Color::Rgba(0.79, 1.09, 1.09, 1.0);
|
||||
|
||||
widget_ids! {
|
||||
struct Ids {
|
||||
// Background and logo
|
||||
@ -383,6 +387,7 @@ impl CharSelectionUi {
|
||||
Image::new(self.imgs.info_frame)
|
||||
.w_h(550.0, 150.0)
|
||||
.middle_of(self.ids.info_bg)
|
||||
.color(Some(UI_MAIN))
|
||||
.set(self.ids.info_frame, ui_widgets);
|
||||
Rectangle::fill_with([275.0, 150.0], color::TRANSPARENT)
|
||||
.bottom_left_with_margins_on(self.ids.info_frame, 0.0, 0.0)
|
||||
@ -450,6 +455,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.server_frame_bg, ui_widgets);
|
||||
Image::new(self.imgs.server_frame)
|
||||
.w_h(400.0, 100.0)
|
||||
.color(Some(UI_MAIN))
|
||||
.middle_of(self.ids.server_frame_bg)
|
||||
.set(self.ids.server_frame, ui_widgets);
|
||||
|
||||
@ -460,6 +466,7 @@ impl CharSelectionUi {
|
||||
Image::new(self.imgs.charlist_frame)
|
||||
.w_h(400.0, 800.0)
|
||||
.middle_of(self.ids.charlist_bg)
|
||||
.color(Some(UI_MAIN))
|
||||
.set(self.ids.charlist_frame, ui_widgets);
|
||||
Rectangle::fill_with([386.0, 783.0], color::TRANSPARENT)
|
||||
.middle_of(self.ids.charlist_bg)
|
||||
@ -469,7 +476,7 @@ impl CharSelectionUi {
|
||||
Scrollbar::y_axis(self.ids.charlist_alignment)
|
||||
.thickness(5.0)
|
||||
.auto_hide(true)
|
||||
.rgba(0.0, 0.0, 0., 0.0)
|
||||
.color(UI_MAIN)
|
||||
.set(self.ids.selection_scrollbar, ui_widgets);
|
||||
// Server Name
|
||||
Text::new(&client.server_info.name)
|
||||
@ -757,6 +764,7 @@ impl CharSelectionUi {
|
||||
Image::new(self.imgs.charlist_frame)
|
||||
.w_h(400.0, ui_widgets.win_h - ui_widgets.win_h * 0.19)
|
||||
.middle_of(self.ids.creation_bg)
|
||||
.color(Some(UI_MAIN))
|
||||
.set(self.ids.charlist_frame, ui_widgets);
|
||||
Rectangle::fill_with(
|
||||
[386.0, ui_widgets.win_h - ui_widgets.win_h * 0.19],
|
||||
@ -864,13 +872,6 @@ impl CharSelectionUi {
|
||||
"",
|
||||
&tooltip_human,
|
||||
)
|
||||
/*.tooltip_image(
|
||||
if let humanoid::BodyType::Male = body.body_type {
|
||||
self.imgs.human_m
|
||||
} else {
|
||||
self.imgs.human_f
|
||||
},
|
||||
)*/
|
||||
.set(self.ids.race_1, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
@ -1029,10 +1030,6 @@ impl CharSelectionUi {
|
||||
{
|
||||
*tool = Some(STARTER_HAMMER);
|
||||
}
|
||||
// REMOVE THIS AFTER IMPLEMENTATION
|
||||
/*Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8))
|
||||
.middle_of(self.ids.hammer)
|
||||
.set(self.ids.hammer_grey, ui_widgets);*/
|
||||
|
||||
// Bow
|
||||
Image::new(self.imgs.bow)
|
||||
@ -1292,7 +1289,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.beard_slider, ui_widgets);
|
||||
}
|
||||
// Chest
|
||||
let armor = load_glob::<comp::Item>("common.items.armor.chest.*")
|
||||
/*let armor = load_glob::<comp::Item>("common.items.armor.chest.*")
|
||||
.expect("Unable to load armor!");
|
||||
if let Some(new_val) = char_slider(
|
||||
self.ids.beard_slider,
|
||||
@ -1313,7 +1310,7 @@ impl CharSelectionUi {
|
||||
ui_widgets,
|
||||
) {
|
||||
loadout.chest = Some((*armor[new_val]).clone());
|
||||
}
|
||||
}*/
|
||||
// Pants
|
||||
/*let current_pants = body.pants;
|
||||
if let Some(new_val) = char_slider(
|
||||
@ -1331,7 +1328,7 @@ impl CharSelectionUi {
|
||||
body.pants = humanoid::ALL_PANTS[new_val];
|
||||
}*/
|
||||
Rectangle::fill_with([20.0, 20.0], color::TRANSPARENT)
|
||||
.down_from(self.ids.chest_slider, 15.0)
|
||||
.down_from(self.ids.beard_slider, 15.0)
|
||||
.set(self.ids.space, ui_widgets);
|
||||
|
||||
if to_select {
|
||||
|
@ -20,6 +20,10 @@ use conrod_core::{
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
use std::time::Duration;
|
||||
|
||||
// UI Color-Theme
|
||||
/*const UI_MAIN: Color = Color::Rgba(0.61, 0.70, 0.70, 1.0); // Greenish Blue
|
||||
const UI_HIGHLIGHT_0: Color = Color::Rgba(0.79, 1.09, 1.09, 1.0);*/
|
||||
|
||||
widget_ids! {
|
||||
struct Ids {
|
||||
// Background and logo
|
||||
|
Loading…
Reference in New Issue
Block a user