mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Multiple Assets and UI fixes and additions
This commit is contained in:
parent
3902b8e364
commit
3e0ac48bd8
BIN
assets/voxygen/element/frames/frame_art/frame-b_l.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/frame_art/frame-b_l.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/frame_art/frame-b_r.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/frame_art/frame-b_r.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/frame_art/frame-t_l.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/frame_art/frame-t_l.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/frames/frame_art/frame-t_r.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/frames/frame_art/frame-t_r.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/element/icons/2haxe_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2haxe_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/2haxe_m2.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2haxe_m2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/2hhammer_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2hhammer_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/2hhammer_m2.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2hhammer_m2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/2hsword_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2hsword_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/2hsword_m2.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/2hsword_m2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/bow_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/bow_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/bow_m2.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/bow_m2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/debug_wand_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/debug_wand_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/debug_wand_m2.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/debug_wand_m2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/hammer_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/hammer_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/staff_m1.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/staff_m1.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/element/icons/staff_m2.vox
(Stored with Git LFS)
BIN
assets/voxygen/element/icons/staff_m2.vox
(Stored with Git LFS)
Binary file not shown.
@ -32,7 +32,7 @@
|
||||
(0.0, -8.0, 0.0), (-90.0, 90.0, 0.0), 2.0,
|
||||
),
|
||||
Tool(Staff): VoxTrans(
|
||||
"voxel.weapon.staff.wood-0",
|
||||
"voxel.weapon.staff.wood-fire",
|
||||
(0.0, -9.0, 0.0), (90.0, 90.0, 0.0), 2.5,
|
||||
),
|
||||
Tool(Shield): VoxTrans(
|
||||
|
BIN
assets/voxygen/voxel/armor/chest/none.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/chest/none.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/empty.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/empty.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/foot/dark_jester-elf_shoe.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/armor/foot/dark_jester-elf_shoe.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/chain_left-1.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/chain_left-1.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/chain_left.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/armor/shoulder/chain_left.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/chain_right-1.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/chain_right-1.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/chain_right.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/armor/shoulder/chain_right.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/figure/beard/orc/2.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/beard/orc/2.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/figure/body/chest.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/figure/body/chest.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/human/female-9.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/figure/hair/human/female-9.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/orc/male-1.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/hair/orc/male-1.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/orc/male-2.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/hair/orc/male-2.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/orc/male-3.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/hair/orc/male-3.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/orc/male-4.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/hair/orc/male-4.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/orc/male-5.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/hair/orc/male-5.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/figure/hair/orc/male-6.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/figure/hair/orc/male-6.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -9,11 +9,11 @@
|
||||
color: None
|
||||
),
|
||||
Sandal: (
|
||||
vox_spec: ("armor.foot.cloth_sandals", (-2.5, -3.5, -9.0)),
|
||||
vox_spec: ("armor.foot.cloth_sandals", (-2.5, -2.5, -9.0)),
|
||||
color: None
|
||||
),
|
||||
Jester: (
|
||||
vox_spec: ("armor.foot.dark_jester-elf_shoe", (-2.5, -3.5, -9.0)),
|
||||
vox_spec: ("armor.foot.dark_jester-elf_shoe", (-2.5, -3.0, -9.0)),
|
||||
color: None
|
||||
)
|
||||
})
|
@ -2,11 +2,11 @@
|
||||
//This shouldn't be the none option, but what is?
|
||||
None: (
|
||||
left: (
|
||||
vox_spec: ("armor.shoulder.brown_left", (-3.0, -3.5, 0.1)),
|
||||
vox_spec: ("armor.empty", (-3.0, -3.5, 0.1)),
|
||||
color: None
|
||||
),
|
||||
right: (
|
||||
vox_spec: ("armor.shoulder.brown_right", (-2.0, -3.5, 0.1)),
|
||||
vox_spec: ("armor.empty", (-2.0, -3.5, 0.1)),
|
||||
color: None
|
||||
)
|
||||
),
|
||||
@ -22,11 +22,11 @@
|
||||
),
|
||||
Chain: (
|
||||
left: (
|
||||
vox_spec: ("armor.shoulder.chain_left", (-3.0, -3.5, 0.1)),
|
||||
vox_spec: ("armor.shoulder.chain_left-1", (-4.0, -3.5, 0.1)),
|
||||
color: None
|
||||
),
|
||||
right: (
|
||||
vox_spec: ("armor.shoulder.chain_right", (-2.0, -3.5, 0.1)),
|
||||
vox_spec: ("armor.shoulder.chain_right-1", (-2.0, -3.5, 0.1)),
|
||||
color: None
|
||||
)
|
||||
)
|
||||
|
@ -52,11 +52,18 @@
|
||||
eyes: ("figure.eyes.orc.male-0", (5, 10, 6)),
|
||||
hair: [
|
||||
Some(("figure.hair.dwarf.bald", (0, 3, -1))),
|
||||
Some(("figure.hair.orc.male", (4, 2, 0))),
|
||||
Some(("figure.hair.orc.male-0", (4, 2, 0))),
|
||||
Some(("figure.hair.orc.male-1", (0, 0, -1))),
|
||||
Some(("figure.hair.orc.male-2", (0, 0, 0))),
|
||||
Some(("figure.hair.orc.male-3", (0, 0, 0))),
|
||||
Some(("figure.hair.orc.male-4", (0, 0, 0))),
|
||||
Some(("figure.hair.orc.male-5", (0, 0, 0))),
|
||||
Some(("figure.hair.orc.male-6", (0, 0, 0))),
|
||||
],
|
||||
beard: [
|
||||
None,
|
||||
Some(("figure.beard.orc.1", (7, 8, 1))),
|
||||
Some(("figure.beard.orc.1", (7, 11, 0))),
|
||||
Some(("figure.beard.orc.2", (3, 8, -2))),
|
||||
],
|
||||
accessory: [
|
||||
Some(("figure.accessory.orc.teeth-0", (5, 11, 3))),
|
||||
@ -67,7 +74,7 @@
|
||||
],
|
||||
),
|
||||
(Orc, Female): (
|
||||
offset: (-8.0, -4.0, -6.0),
|
||||
offset: (-8.0, -3.0, -6.0),
|
||||
head: ("figure.head.orc.female", (0, 2, 0)),
|
||||
eyes: ("figure.eyes.orc.female-0", (3, 9, 2)),
|
||||
hair: [
|
||||
|
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-2.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/leaf.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/projectile/leaf.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/nature-bolt.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/projectile/nature-bolt.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/staff/wood-nature.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/staff/wood-nature.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -339,7 +339,7 @@ impl Race {
|
||||
(Race::Human, BodyType::Female) => 19,
|
||||
(Race::Human, BodyType::Male) => 4,
|
||||
(Race::Orc, BodyType::Female) => 1,
|
||||
(Race::Orc, BodyType::Male) => 2,
|
||||
(Race::Orc, BodyType::Male) => 8,
|
||||
(Race::Undead, BodyType::Female) => 4,
|
||||
(Race::Undead, BodyType::Male) => 3,
|
||||
}
|
||||
@ -371,7 +371,7 @@ impl Race {
|
||||
(Race::Human, BodyType::Female) => 1,
|
||||
(Race::Human, BodyType::Male) => 3,
|
||||
(Race::Orc, BodyType::Female) => 1,
|
||||
(Race::Orc, BodyType::Male) => 2,
|
||||
(Race::Orc, BodyType::Male) => 3,
|
||||
(Race::Undead, BodyType::Female) => 1,
|
||||
(Race::Undead, BodyType::Male) => 1,
|
||||
}
|
||||
|
@ -49,11 +49,7 @@ impl Tool {
|
||||
}
|
||||
Tool::Hammer => "Use with caution around nails.",
|
||||
Tool::Bow => "An old but sturdy hunting bow.",
|
||||
Tool::Staff => {
|
||||
"A carved stick.\n\
|
||||
The wood smells like magic.\n\
|
||||
NOT YET AVAILABLE."
|
||||
}
|
||||
Tool::Staff => "The wood smells like magic.",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ impl<'a> System<'a> for Sys {
|
||||
}
|
||||
}
|
||||
Some(Item::Tool { .. }) => {
|
||||
// Attack
|
||||
// Melee Attack
|
||||
if controller.primary
|
||||
&& (character.movement == Stand
|
||||
|| character.movement == Run
|
||||
|
@ -189,10 +189,8 @@ impl Server {
|
||||
.with(comp::Vel(Vec3::zero()))
|
||||
.with(comp::Ori(Vec3::unit_y()))
|
||||
.with(comp::Body::Object(object))
|
||||
.with(comp::LightEmitter {
|
||||
offset: Vec3::unit_z(),
|
||||
..comp::LightEmitter::default()
|
||||
})
|
||||
.with(comp::Mass(100.0))
|
||||
.with(comp::Gravity(1.0))
|
||||
//.with(comp::LightEmitter::default())
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ use super::{
|
||||
img_ids::Imgs, Fonts, BROADCAST_COLOR, FACTION_COLOR, GAME_UPDATE_COLOR, GROUP_COLOR,
|
||||
KILL_COLOR, META_COLOR, PRIVATE_COLOR, SAY_COLOR, TELL_COLOR, TEXT_COLOR,
|
||||
};
|
||||
use crate::GlobalState;
|
||||
use client::Event as ClientEvent;
|
||||
use common::{msg::validate_chat_msg, ChatType};
|
||||
use conrod_core::{
|
||||
@ -31,6 +32,7 @@ pub struct Chat<'a> {
|
||||
force_input: Option<String>,
|
||||
force_cursor: Option<Index>,
|
||||
|
||||
global_state: &'a GlobalState,
|
||||
imgs: &'a Imgs,
|
||||
fonts: &'a Fonts,
|
||||
|
||||
@ -44,6 +46,7 @@ pub struct Chat<'a> {
|
||||
impl<'a> Chat<'a> {
|
||||
pub fn new(
|
||||
new_messages: &'a mut VecDeque<ClientEvent>,
|
||||
global_state: &'a GlobalState,
|
||||
imgs: &'a Imgs,
|
||||
fonts: &'a Fonts,
|
||||
) -> Self {
|
||||
@ -53,6 +56,7 @@ impl<'a> Chat<'a> {
|
||||
force_cursor: None,
|
||||
imgs,
|
||||
fonts,
|
||||
global_state,
|
||||
common: widget::CommonBuilder::default(),
|
||||
history_max: 32,
|
||||
}
|
||||
@ -121,7 +125,7 @@ impl<'a> Widget for Chat<'a> {
|
||||
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { id, state, ui, .. } = args;
|
||||
|
||||
let transp = self.global_state.settings.gameplay.chat_transp;
|
||||
// Maintain scrolling.
|
||||
if !self.new_messages.is_empty() {
|
||||
state.update(|s| s.messages.extend(self.new_messages.drain(..)));
|
||||
@ -197,7 +201,7 @@ impl<'a> Widget for Chat<'a> {
|
||||
_ => 0.0,
|
||||
};
|
||||
Rectangle::fill([470.0, y])
|
||||
.rgba(0.0, 0.0, 0.0, 0.8)
|
||||
.rgba(0.0, 0.0, 0.0, transp + 0.1)
|
||||
.bottom_left_with_margins_on(ui.window, 10.0, 10.0)
|
||||
.w(470.0)
|
||||
.set(state.ids.input_bg, ui);
|
||||
@ -216,7 +220,7 @@ impl<'a> Widget for Chat<'a> {
|
||||
|
||||
// Message box
|
||||
Rectangle::fill([470.0, 174.0])
|
||||
.rgba(0.0, 0.0, 0.0, 0.4)
|
||||
.rgba(0.0, 0.0, 0.0, transp)
|
||||
.and(|r| {
|
||||
if input_focused {
|
||||
r.up_from(state.ids.input_bg, 0.0)
|
||||
|
@ -157,50 +157,52 @@ impl<'a> Widget for MiniMap<'a> {
|
||||
const FADE_HOLD: f32 = 1.0;
|
||||
const FADE_OUT: f32 = 3.0;
|
||||
|
||||
match self.client.current_chunk() {
|
||||
Some(chunk) => {
|
||||
let current = chunk.meta().name();
|
||||
// Check if no other popup is displayed and a new one is needed
|
||||
if state.last_update.elapsed()
|
||||
> Duration::from_secs_f32(FADE_IN + FADE_HOLD + FADE_OUT)
|
||||
&& state
|
||||
.last_region_name
|
||||
.as_ref()
|
||||
.map(|l| l != current)
|
||||
.unwrap_or(true)
|
||||
{
|
||||
// Update last_region
|
||||
state.update(|s| s.last_region_name = Some(current.to_owned()));
|
||||
state.update(|s| s.last_update = Instant::now());
|
||||
}
|
||||
if !self.show.intro {
|
||||
match self.client.current_chunk() {
|
||||
Some(chunk) => {
|
||||
let current = chunk.meta().name();
|
||||
// Check if no other popup is displayed and a new one is needed
|
||||
if state.last_update.elapsed()
|
||||
> Duration::from_secs_f32(FADE_IN + FADE_HOLD + FADE_OUT)
|
||||
&& state
|
||||
.last_region_name
|
||||
.as_ref()
|
||||
.map(|l| l != current)
|
||||
.unwrap_or(true)
|
||||
{
|
||||
// Update last_region
|
||||
state.update(|s| s.last_region_name = Some(current.to_owned()));
|
||||
state.update(|s| s.last_update = Instant::now());
|
||||
}
|
||||
|
||||
let seconds = state.last_update.elapsed().as_secs_f32();
|
||||
let fade = if seconds < FADE_IN {
|
||||
seconds / FADE_IN
|
||||
} else if seconds < FADE_IN + FADE_HOLD {
|
||||
1.0
|
||||
} else {
|
||||
(1.0 - (seconds - FADE_IN - FADE_HOLD) / FADE_OUT).max(0.0)
|
||||
};
|
||||
// Region Name
|
||||
Text::new(state.last_region_name.as_ref().unwrap_or(&"".to_owned()))
|
||||
.mid_top_with_margin_on(ui.window, 200.0)
|
||||
.font_size(70)
|
||||
.font_id(self.fonts.alkhemi)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
|
||||
.set(state.ids.zone_display_bg, ui);
|
||||
Text::new(state.last_region_name.as_ref().unwrap_or(&"".to_owned()))
|
||||
.top_left_with_margins_on(state.ids.zone_display_bg, -2.5, -2.5)
|
||||
.font_size(70)
|
||||
.font_id(self.fonts.alkhemi)
|
||||
.color(Color::Rgba(1.0, 1.0, 1.0, fade))
|
||||
.set(state.ids.zone_display, ui);
|
||||
let seconds = state.last_update.elapsed().as_secs_f32();
|
||||
let fade = if seconds < FADE_IN {
|
||||
seconds / FADE_IN
|
||||
} else if seconds < FADE_IN + FADE_HOLD {
|
||||
1.0
|
||||
} else {
|
||||
(1.0 - (seconds - FADE_IN - FADE_HOLD) / FADE_OUT).max(0.0)
|
||||
};
|
||||
// Region Name
|
||||
Text::new(state.last_region_name.as_ref().unwrap_or(&"".to_owned()))
|
||||
.mid_top_with_margin_on(ui.window, 200.0)
|
||||
.font_size(70)
|
||||
.font_id(self.fonts.alkhemi)
|
||||
.color(Color::Rgba(0.0, 0.0, 0.0, fade))
|
||||
.set(state.ids.zone_display_bg, ui);
|
||||
Text::new(state.last_region_name.as_ref().unwrap_or(&"".to_owned()))
|
||||
.top_left_with_margins_on(state.ids.zone_display_bg, -2.5, -2.5)
|
||||
.font_size(70)
|
||||
.font_id(self.fonts.alkhemi)
|
||||
.color(Color::Rgba(1.0, 1.0, 1.0, fade))
|
||||
.set(state.ids.zone_display, ui);
|
||||
}
|
||||
None => Text::new(" ")
|
||||
.middle_of(ui.window)
|
||||
.font_size(14)
|
||||
.color(HP_COLOR)
|
||||
.set(state.ids.zone_display, ui),
|
||||
}
|
||||
None => Text::new(" ")
|
||||
.middle_of(ui.window)
|
||||
.font_size(14)
|
||||
.color(HP_COLOR)
|
||||
.set(state.ids.zone_display, ui),
|
||||
}
|
||||
|
||||
// TODO: Subregion name display
|
||||
|
@ -58,6 +58,7 @@ use crate::{discord, discord::DiscordUpdate};
|
||||
|
||||
const XP_COLOR: Color = Color::Rgba(0.59, 0.41, 0.67, 1.0);
|
||||
const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0);
|
||||
const MENU_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 0.4);
|
||||
//const TEXT_COLOR_2: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0);
|
||||
const TEXT_COLOR_3: Color = Color::Rgba(1.0, 1.0, 1.0, 0.1);
|
||||
//const BG_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 0.8);
|
||||
@ -89,6 +90,15 @@ widget_ids! {
|
||||
health_bars[],
|
||||
health_bar_backs[],
|
||||
|
||||
// Intro Text
|
||||
intro_bg,
|
||||
intro_text,
|
||||
intro_close,
|
||||
intro_close_2,
|
||||
intro_close_3,
|
||||
intro_check,
|
||||
intro_check_text,
|
||||
|
||||
// Test
|
||||
bag_space_add,
|
||||
|
||||
@ -116,8 +126,8 @@ widget_ids! {
|
||||
window_frame_4,
|
||||
window_frame_5,
|
||||
|
||||
// Contents
|
||||
button_help2,
|
||||
button_help3,
|
||||
|
||||
// External
|
||||
chat,
|
||||
@ -168,8 +178,10 @@ pub enum Event {
|
||||
ChangeFOV(u16),
|
||||
ChangeAaMode(AaMode),
|
||||
CrosshairTransp(f32),
|
||||
ChatTransp(f32),
|
||||
CrosshairType(CrosshairType),
|
||||
ToggleXpBar(XpBar),
|
||||
Intro(Intro),
|
||||
ToggleBarNumbers(BarNumbers),
|
||||
ToggleShortcutNumbers(ShortcutNumbers),
|
||||
UiScale(ScaleChange),
|
||||
@ -197,6 +209,11 @@ pub enum CrosshairType {
|
||||
Edges,
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
pub enum Intro {
|
||||
Show,
|
||||
Never,
|
||||
}
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
pub enum XpBar {
|
||||
Always,
|
||||
OnGain,
|
||||
@ -216,6 +233,7 @@ pub enum ShortcutNumbers {
|
||||
|
||||
pub struct Show {
|
||||
ui: bool,
|
||||
intro: bool,
|
||||
help: bool,
|
||||
debug: bool,
|
||||
bag: bool,
|
||||
@ -381,6 +399,9 @@ pub struct Hud {
|
||||
new_messages: VecDeque<ClientEvent>,
|
||||
inventory_space: usize,
|
||||
show: Show,
|
||||
never_show: bool,
|
||||
intro: bool,
|
||||
intro_2: bool,
|
||||
to_focus: Option<Option<widget::Id>>,
|
||||
force_ungrab: bool,
|
||||
force_chat_input: Option<String>,
|
||||
@ -417,8 +438,11 @@ impl Hud {
|
||||
ids,
|
||||
new_messages: VecDeque::new(),
|
||||
inventory_space: 8,
|
||||
intro: false,
|
||||
intro_2: false,
|
||||
show: Show {
|
||||
help: false,
|
||||
intro: true,
|
||||
debug: true,
|
||||
bag: false,
|
||||
esc_menu: false,
|
||||
@ -437,6 +461,7 @@ impl Hud {
|
||||
ingame: true,
|
||||
},
|
||||
to_focus: None,
|
||||
never_show: false,
|
||||
force_ungrab: false,
|
||||
force_chat_input: None,
|
||||
force_chat_cursor: None,
|
||||
@ -457,7 +482,6 @@ impl Hud {
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
common::util::GIT_VERSION.to_string()
|
||||
);
|
||||
|
||||
if self.show.ingame {
|
||||
// Crosshair
|
||||
if !self.show.help {
|
||||
@ -595,6 +619,131 @@ impl Hud {
|
||||
.set(bar_id, ui_widgets);
|
||||
}
|
||||
}
|
||||
// Introduction Text
|
||||
let intro_text: &'static str =
|
||||
"Welcome to the Veloren Alpha!\n\
|
||||
\n\
|
||||
\n\
|
||||
Some tips before you start:\n\
|
||||
\n\
|
||||
\n\
|
||||
MOST IMPORTANTLY: To set your respawn point type /waypoint into the chat.\n\
|
||||
\n\
|
||||
This can also be done when you are already dead!\n\
|
||||
\n\
|
||||
\n\
|
||||
Press F1 to see the available key commands.\n\
|
||||
\n\
|
||||
Type /help into the chat to see chat commands\n\
|
||||
\n\
|
||||
\n\
|
||||
There are chests and other objects randomly spawning in the World!\n\
|
||||
\n\
|
||||
Right-Click to collect them.\n\
|
||||
\n\
|
||||
To actually use whatever you loot from those chests open your inventory with 'B'.\n\
|
||||
\n\
|
||||
Double click the items in your bag to use or equip them.\n\
|
||||
\n\
|
||||
Throw them away by clicking them once and clicking outside of the bag\n\
|
||||
\n\
|
||||
\n\
|
||||
Nights can get pretty dark in Veloren.\n\
|
||||
\n\
|
||||
Light your lantern by typing /lantern into the chat\n\
|
||||
\n\
|
||||
\n\
|
||||
Want to free your cursor to close this window? Press TAB!\n\
|
||||
\n\
|
||||
\n\
|
||||
Enjoy your stay in the World of Veloren.";
|
||||
if self.show.intro && !self.show.esc_menu && !self.intro_2 {
|
||||
match global_state.settings.gameplay.intro_show {
|
||||
Intro::Show => {
|
||||
Rectangle::fill_with([800.0, 850.0], Color::Rgba(0.0, 0.0, 0.0, 0.80))
|
||||
.mid_left_with_margin_on(ui_widgets.window, 10.0)
|
||||
.set(self.ids.intro_bg, ui_widgets);
|
||||
Text::new(intro_text)
|
||||
.top_left_with_margins_on(self.ids.intro_bg, 10.0, 10.0)
|
||||
.font_size(20)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(self.ids.intro_text, ui_widgets);
|
||||
if Button::image(self.imgs.button)
|
||||
.w_h(100.0, 50.0)
|
||||
.mid_bottom_with_margin_on(self.ids.intro_bg, 10.0)
|
||||
.label("Close")
|
||||
.label_font_size(20)
|
||||
.label_color(TEXT_COLOR)
|
||||
.hover_image(self.imgs.button_hover)
|
||||
.press_image(self.imgs.button_press)
|
||||
.set(self.ids.intro_close, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
if self.never_show {
|
||||
events.push(Event::Intro(Intro::Never));
|
||||
self.never_show = !self.never_show;
|
||||
self.intro = false;
|
||||
self.intro_2 = false;
|
||||
} else {
|
||||
self.show.intro = !self.show.intro;
|
||||
self.intro = false;
|
||||
self.intro_2 = false;
|
||||
}
|
||||
}
|
||||
if Button::image(if self.never_show {
|
||||
self.imgs.checkbox_checked
|
||||
} else {
|
||||
self.imgs.checkbox
|
||||
})
|
||||
.w_h(20.0, 20.0)
|
||||
.right_from(self.ids.intro_close, 10.0)
|
||||
.hover_image(if self.never_show {
|
||||
self.imgs.checkbox_checked_mo
|
||||
} else {
|
||||
self.imgs.checkbox_mo
|
||||
})
|
||||
.press_image(self.imgs.checkbox_press)
|
||||
.set(self.ids.intro_check, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.never_show = !self.never_show
|
||||
};
|
||||
Text::new("Don't show this on Startup")
|
||||
.right_from(self.ids.intro_check, 10.0)
|
||||
.font_size(10)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(self.ids.intro_check_text, ui_widgets);
|
||||
}
|
||||
Intro::Never => {}
|
||||
}
|
||||
}
|
||||
|
||||
if self.intro_2 && !self.show.esc_menu {
|
||||
Rectangle::fill_with([800.0, 850.0], Color::Rgba(0.0, 0.0, 0.0, 0.80))
|
||||
.mid_left_with_margin_on(ui_widgets.window, 10.0)
|
||||
.set(self.ids.intro_bg, ui_widgets);
|
||||
Text::new(intro_text)
|
||||
.top_left_with_margins_on(self.ids.intro_bg, 10.0, 10.0)
|
||||
.font_size(20)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(self.ids.intro_text, ui_widgets);
|
||||
if Button::image(self.imgs.button)
|
||||
.w_h(100.0, 50.0)
|
||||
.mid_bottom_with_margin_on(self.ids.intro_bg, 10.0)
|
||||
.label("Close")
|
||||
.label_font_size(20)
|
||||
.label_color(TEXT_COLOR)
|
||||
.hover_image(self.imgs.button_hover)
|
||||
.press_image(self.imgs.button_press)
|
||||
.set(self.ids.intro_close_3, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.intro_2 = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Display debug window.
|
||||
if self.show.debug {
|
||||
@ -712,6 +861,23 @@ impl Hud {
|
||||
.middle_of(ui_widgets.window)
|
||||
.w_h(1260.0, 519.0)
|
||||
.set(self.ids.help, ui_widgets);
|
||||
// Show tips
|
||||
if Button::image(self.imgs.button)
|
||||
.w_h(120.0, 50.0)
|
||||
.hover_image(self.imgs.button_hover)
|
||||
.press_image(self.imgs.button_press)
|
||||
.label("Show Tips")
|
||||
.label_font_size(20)
|
||||
.label_color(TEXT_COLOR)
|
||||
.mid_bottom_with_margin_on(self.ids.help, 20.0)
|
||||
.set(self.ids.button_help3, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.show.help = false;
|
||||
self.show.intro = false;
|
||||
self.intro = false;
|
||||
self.intro_2 = true;
|
||||
};
|
||||
// X-button
|
||||
if Button::image(self.imgs.close_button)
|
||||
.w_h(40.0, 40.0)
|
||||
@ -788,10 +954,15 @@ impl Hud {
|
||||
}
|
||||
|
||||
// Chat box
|
||||
match Chat::new(&mut self.new_messages, &self.imgs, &self.fonts)
|
||||
.and_then(self.force_chat_input.take(), |c, input| c.input(input))
|
||||
.and_then(self.force_chat_cursor.take(), |c, pos| c.cursor_pos(pos))
|
||||
.set(self.ids.chat, ui_widgets)
|
||||
match Chat::new(
|
||||
&mut self.new_messages,
|
||||
global_state,
|
||||
&self.imgs,
|
||||
&self.fonts,
|
||||
)
|
||||
.and_then(self.force_chat_input.take(), |c, input| c.input(input))
|
||||
.and_then(self.force_chat_cursor.take(), |c, pos| c.cursor_pos(pos))
|
||||
.set(self.ids.chat, ui_widgets)
|
||||
{
|
||||
Some(chat::Event::SendMessage(message)) => {
|
||||
events.push(Event::SendMessage(message));
|
||||
@ -825,6 +996,9 @@ impl Hud {
|
||||
settings_window::Event::AdjustMouseZoom(sensitivity) => {
|
||||
events.push(Event::AdjustMouseZoom(sensitivity));
|
||||
}
|
||||
settings_window::Event::ChatTransp(chat_transp) => {
|
||||
events.push(Event::ChatTransp(chat_transp));
|
||||
}
|
||||
settings_window::Event::ToggleZoomInvert(zoom_inverted) => {
|
||||
events.push(Event::ToggleZoomInvert(zoom_inverted));
|
||||
}
|
||||
@ -834,6 +1008,9 @@ impl Hud {
|
||||
settings_window::Event::CrosshairTransp(crosshair_transp) => {
|
||||
events.push(Event::CrosshairTransp(crosshair_transp));
|
||||
}
|
||||
settings_window::Event::Intro(intro_show) => {
|
||||
events.push(Event::Intro(intro_show));
|
||||
}
|
||||
settings_window::Event::AdjustMusicVolume(music_volume) => {
|
||||
events.push(Event::AdjustMusicVolume(music_volume));
|
||||
}
|
||||
@ -1143,23 +1320,3 @@ impl Hud {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get the text to show in the help window and use the
|
||||
// length of the longest line to resize the window.
|
||||
/*fn get_help_text(cs: &ControlSettings) -> String {
|
||||
format!(
|
||||
"{free_cursor:?} = Free cursor\n\
|
||||
{escape:?} = Open/close menus\n\
|
||||
\n\
|
||||
{help:?} = Toggle this window\n\
|
||||
{toggle_interface:?} = Toggle interface\n\
|
||||
\n\
|
||||
{chat:?} = Open chat\n\
|
||||
Mouse Wheel = Scroll chat/zoom",
|
||||
free_cursor = cs.toggle_cursor,
|
||||
escape = cs.escape,
|
||||
help = cs.help,
|
||||
toggle_interface = cs.toggle_interface,
|
||||
chat = cs.enter
|
||||
)
|
||||
}*/
|
||||
|
@ -1,5 +1,6 @@
|
||||
use super::{
|
||||
img_ids::Imgs, BarNumbers, CrosshairType, Fonts, ShortcutNumbers, Show, XpBar, TEXT_COLOR,
|
||||
img_ids::Imgs, BarNumbers, CrosshairType, Fonts, Intro, ShortcutNumbers, Show, XpBar, MENU_BG,
|
||||
TEXT_COLOR,
|
||||
};
|
||||
use crate::{
|
||||
render::AaMode,
|
||||
@ -43,6 +44,8 @@ widget_ids! {
|
||||
general_txt,
|
||||
debug_button,
|
||||
debug_button_label,
|
||||
tips_button,
|
||||
tips_button_label,
|
||||
interface,
|
||||
mouse_pan_slider,
|
||||
mouse_pan_label,
|
||||
@ -102,6 +105,9 @@ widget_ids! {
|
||||
show_bars_button,
|
||||
show_bars_text,
|
||||
placeholder,
|
||||
chat_transp_title,
|
||||
chat_transp_text,
|
||||
chat_transp_slider
|
||||
}
|
||||
}
|
||||
|
||||
@ -154,6 +160,7 @@ pub enum Event {
|
||||
ToggleShortcutNumbers(ShortcutNumbers),
|
||||
ChangeTab(SettingsTab),
|
||||
Close,
|
||||
Intro(Intro),
|
||||
AdjustMousePan(u32),
|
||||
AdjustMouseZoom(u32),
|
||||
ToggleZoomInvert(bool),
|
||||
@ -167,6 +174,7 @@ pub enum Event {
|
||||
CrosshairTransp(f32),
|
||||
CrosshairType(CrosshairType),
|
||||
UiScale(ScaleChange),
|
||||
ChatTransp(f32),
|
||||
}
|
||||
|
||||
pub enum ScaleChange {
|
||||
@ -273,11 +281,12 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
let crosshair_transp = self.global_state.settings.gameplay.crosshair_transp;
|
||||
let crosshair_type = self.global_state.settings.gameplay.crosshair_type;
|
||||
let ui_scale = self.global_state.settings.gameplay.ui_scale;
|
||||
let chat_transp = self.global_state.settings.gameplay.chat_transp;
|
||||
|
||||
Text::new("General")
|
||||
.top_left_with_margins_on(state.ids.settings_content, 5.0, 5.0)
|
||||
.font_size(18)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.general_txt, ui);
|
||||
|
||||
@ -300,7 +309,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Show Help Window")
|
||||
.right_from(state.ids.button_help, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.button_help)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.show_help_label, ui);
|
||||
@ -324,16 +333,43 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Show Debug Info")
|
||||
.right_from(state.ids.debug_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.debug_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.debug_button_label, ui);
|
||||
// Tips
|
||||
if Button::image(match self.global_state.settings.gameplay.intro_show {
|
||||
Intro::Show => self.imgs.checkbox_checked,
|
||||
Intro::Never => self.imgs.checkbox,
|
||||
})
|
||||
.w_h(20.0, 20.0)
|
||||
.down_from(state.ids.debug_button, 8.0)
|
||||
.hover_image(match self.global_state.settings.gameplay.intro_show {
|
||||
Intro::Show => self.imgs.checkbox_checked_mo,
|
||||
Intro::Never => self.imgs.checkbox_mo,
|
||||
})
|
||||
.press_image(self.imgs.checkbox_press)
|
||||
.set(state.ids.tips_button, ui)
|
||||
.was_clicked()
|
||||
{
|
||||
match self.global_state.settings.gameplay.intro_show {
|
||||
Intro::Show => events.push(Event::Intro(Intro::Never)),
|
||||
Intro::Never => events.push(Event::Intro(Intro::Show)),
|
||||
}
|
||||
};
|
||||
Text::new("Show Tips on Startup")
|
||||
.right_from(state.ids.tips_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.button_help)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.tips_button_label, ui);
|
||||
|
||||
// Ui Scale
|
||||
Text::new("UI-Scale")
|
||||
.down_from(state.ids.debug_button, 20.0)
|
||||
.down_from(state.ids.tips_button, 20.0)
|
||||
.font_size(18)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.ui_scale_label, ui);
|
||||
|
||||
@ -367,7 +403,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Relative Scaling")
|
||||
.right_from(state.ids.relative_to_win_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.relative_to_win_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.relative_to_win_text, ui);
|
||||
@ -402,7 +438,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Custom Scaling")
|
||||
.right_from(state.ids.absolute_scale_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.absolute_scale_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.absolute_scale_text, ui);
|
||||
@ -429,7 +465,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new(&format!("{:.2}", scale))
|
||||
.right_from(state.ids.ui_scale_slider, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.ui_scale_value, ui);
|
||||
} else {
|
||||
@ -579,13 +615,13 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Crosshair")
|
||||
.down_from(state.ids.absolute_scale_button, 20.0)
|
||||
.font_size(18)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.ch_title, ui);
|
||||
Text::new("Transparency")
|
||||
.right_from(state.ids.ch_3_bg, 20.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.ch_transp_text, ui);
|
||||
|
||||
@ -610,7 +646,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.right_from(state.ids.ch_transp_slider, 8.0)
|
||||
.font_size(14)
|
||||
.graphics_for(state.ids.ch_transp_slider)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.ch_transp_value, ui);
|
||||
|
||||
@ -618,7 +654,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Hotbar")
|
||||
.down_from(state.ids.ch_1_bg, 20.0)
|
||||
.font_size(18)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.hotbar_title, ui);
|
||||
// Show xp bar
|
||||
@ -647,7 +683,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Always show Experience Bar")
|
||||
.right_from(state.ids.show_xpbar_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.show_xpbar_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.show_xpbar_text, ui);
|
||||
@ -681,7 +717,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Always show Shortcuts")
|
||||
.right_from(state.ids.show_shortcuts_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.show_shortcuts_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.show_shortcuts_text, ui);
|
||||
@ -691,7 +727,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Energybar Numbers")
|
||||
.down_from(state.ids.show_shortcuts_button, 20.0)
|
||||
.font_size(18)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.bar_numbers_title, ui);
|
||||
|
||||
@ -721,7 +757,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("None")
|
||||
.right_from(state.ids.show_bar_numbers_none_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.show_bar_numbers_none_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.show_bar_numbers_none_text, ui);
|
||||
@ -752,7 +788,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Values")
|
||||
.right_from(state.ids.show_bar_numbers_values_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.show_bar_numbers_values_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.show_bar_numbers_values_text, ui);
|
||||
@ -783,13 +819,43 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Percentages")
|
||||
.right_from(state.ids.show_bar_numbers_percentage_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.show_bar_numbers_percentage_button)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.show_bar_numbers_percentage_text, ui);
|
||||
|
||||
Rectangle::fill_with([20.0 * 4.0, 1.0 * 4.0], color::TRANSPARENT)
|
||||
.down_from(state.ids.show_bar_numbers_percentage_button, 8.0)
|
||||
// Chat Transp
|
||||
Text::new("Chat")
|
||||
.down_from(state.ids.show_bar_numbers_percentage_button, 20.0)
|
||||
.font_size(18)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.chat_transp_title, ui);
|
||||
Text::new("Background Transparency")
|
||||
.right_from(state.ids.chat_transp_slider, 20.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.chat_transp_text, ui);
|
||||
|
||||
if let Some(new_val) = ImageSlider::continuous(
|
||||
chat_transp,
|
||||
0.0,
|
||||
0.9,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider,
|
||||
)
|
||||
.w_h(104.0, 22.0)
|
||||
.down_from(state.ids.chat_transp_title, 8.0)
|
||||
.track_breadth(12.0)
|
||||
.slider_length(10.0)
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(state.ids.chat_transp_slider, ui)
|
||||
{
|
||||
events.push(Event::ChatTransp(new_val));
|
||||
}
|
||||
Rectangle::fill_with([40.0 * 4.0, 1.0 * 4.0], color::TRANSPARENT)
|
||||
.down_from(state.ids.chat_transp_title, 30.0)
|
||||
.set(state.ids.placeholder, ui);
|
||||
}
|
||||
|
||||
@ -829,7 +895,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Pan Sensitivity")
|
||||
.top_left_with_margins_on(state.ids.settings_content, 10.0, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.mouse_pan_label, ui);
|
||||
|
||||
@ -853,7 +919,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new(&format!("{}", display_pan))
|
||||
.right_from(state.ids.mouse_pan_slider, 8.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.mouse_pan_value, ui);
|
||||
|
||||
@ -861,7 +927,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Zoom Sensitivity")
|
||||
.down_from(state.ids.mouse_pan_slider, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.mouse_zoom_label, ui);
|
||||
|
||||
@ -885,7 +951,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new(&format!("{}", display_zoom))
|
||||
.right_from(state.ids.mouse_zoom_slider, 8.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.mouse_zoom_value, ui);
|
||||
|
||||
@ -910,7 +976,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Invert Scroll Zoom")
|
||||
.right_from(state.ids.mouse_zoom_invert_button, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.graphics_for(state.ids.button_help)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.mouse_zoom_invert_label, ui);
|
||||
@ -1020,7 +1086,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
)
|
||||
.color(TEXT_COLOR)
|
||||
.top_left_with_margins_on(state.ids.settings_content, 5.0, 5.0)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.font_size(18)
|
||||
.set(state.ids.controls_text, ui);
|
||||
// TODO: Replace with buttons that show actual keybinds and allow the user to change them.
|
||||
@ -1093,7 +1159,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
)
|
||||
.color(TEXT_COLOR)
|
||||
.right_from(state.ids.controls_text, 0.0)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.font_size(18)
|
||||
.set(state.ids.controls_controls, ui);
|
||||
}
|
||||
@ -1132,7 +1198,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("View Distance")
|
||||
.top_left_with_margins_on(state.ids.settings_content, 10.0, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.vd_text, ui);
|
||||
|
||||
@ -1159,7 +1225,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
))
|
||||
.right_from(state.ids.vd_slider, 8.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.vd_value, ui);
|
||||
|
||||
@ -1167,7 +1233,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Maximum FPS")
|
||||
.down_from(state.ids.vd_slider, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.max_fps_text, ui);
|
||||
|
||||
@ -1194,7 +1260,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new(&format!("{}", self.global_state.settings.graphics.max_fps))
|
||||
.right_from(state.ids.max_fps_slider, 8.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.max_fps_value, ui);
|
||||
|
||||
@ -1202,7 +1268,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Field of View (deg)")
|
||||
.down_from(state.ids.max_fps_slider, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.fov_text, ui);
|
||||
|
||||
@ -1226,7 +1292,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new(&format!("{}", self.global_state.settings.graphics.fov))
|
||||
.right_from(state.ids.fov_slider, 8.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.fov_value, ui);
|
||||
|
||||
@ -1234,7 +1300,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("AntiAliasing Mode")
|
||||
.down_from(state.ids.fov_slider, 8.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.aa_mode_text, ui);
|
||||
let mode_label_list = [
|
||||
@ -1298,7 +1364,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Music Volume")
|
||||
.top_left_with_margins_on(state.ids.settings_content, 10.0, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.audio_volume_text, ui);
|
||||
|
||||
@ -1323,7 +1389,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Sound Effects Volume")
|
||||
.down_from(state.ids.audio_volume_slider, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.sfx_volume_text, ui);
|
||||
|
||||
@ -1350,7 +1416,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
Text::new("Audio Device")
|
||||
.down_from(state.ids.sfx_volume_slider, 10.0)
|
||||
.font_size(14)
|
||||
.font_id(self.fonts.opensans)
|
||||
.font_id(self.fonts.cyri)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.audio_device_text, ui);
|
||||
|
||||
@ -1359,8 +1425,10 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
|
||||
if let Some(clicked) = DropDownList::new(&device_list, selected)
|
||||
.w_h(400.0, 22.0)
|
||||
.down_from(state.ids.audio_device_text, 10.0)
|
||||
.color(MENU_BG)
|
||||
.label_color(TEXT_COLOR)
|
||||
.label_font_id(self.fonts.opensans)
|
||||
.down_from(state.ids.audio_device_text, 10.0)
|
||||
.set(state.ids.audio_device_list, ui)
|
||||
{
|
||||
let new_val = device_list[clicked].clone();
|
||||
|
@ -4,6 +4,7 @@ use super::{
|
||||
};
|
||||
use crate::GlobalState;
|
||||
use common::comp::{item::Debug, item::Tool, Item, Stats};
|
||||
|
||||
use conrod_core::{
|
||||
color,
|
||||
widget::{self, Button, Image, Rectangle, Text},
|
||||
@ -163,6 +164,7 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
let shortcuts = self.global_state.settings.gameplay.shortcut_numbers;
|
||||
|
||||
const BG_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 0.8);
|
||||
const BG_COLOR_2: Color = Color::Rgba(0.0, 0.0, 0.0, 0.99);
|
||||
|
||||
// Stamina Wheel
|
||||
/*
|
||||
@ -503,8 +505,15 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
}
|
||||
// M1 Slot
|
||||
Image::new(self.imgs.skillbar_slot_big_bg)
|
||||
.w_h(37.0 * scale, 37.0 * scale)
|
||||
.color(Some(BG_COLOR))
|
||||
.w_h(36.0 * scale, 36.0 * scale)
|
||||
.color(match self.stats.equipment.main {
|
||||
Some(Item::Tool { kind, .. }) => match kind {
|
||||
Tool::Bow => Some(BG_COLOR_2),
|
||||
Tool::Staff => Some(BG_COLOR_2),
|
||||
_ => Some(BG_COLOR_2),
|
||||
},
|
||||
_ => Some(BG_COLOR_2),
|
||||
})
|
||||
.middle_of(state.ids.m1_slot)
|
||||
.set(state.ids.m1_slot_bg, ui);
|
||||
Button::image(match self.stats.equipment.main {
|
||||
@ -519,7 +528,22 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
Some(Item::Debug(Debug::Boost)) => self.imgs.flyingrod_m1,
|
||||
_ => self.imgs.twohaxe_m1,
|
||||
}) // Insert Icon here
|
||||
.w_h(38.0 * scale, 38.0 * scale)
|
||||
.w(match self.stats.equipment.main {
|
||||
Some(Item::Tool { kind, .. }) => match kind {
|
||||
Tool::Bow => 30.0 * scale,
|
||||
Tool::Staff => 30.0 * scale,
|
||||
_ => 38.0 * scale,
|
||||
},
|
||||
_ => 38.0 * scale,
|
||||
})
|
||||
.h(match self.stats.equipment.main {
|
||||
Some(Item::Tool { kind, .. }) => match kind {
|
||||
Tool::Bow => 30.0 * scale,
|
||||
Tool::Staff => 36.0 * scale,
|
||||
_ => 38.0 * scale,
|
||||
},
|
||||
_ => 38.0 * scale,
|
||||
})
|
||||
.middle_of(state.ids.m1_slot_bg)
|
||||
.set(state.ids.m1_content, ui);
|
||||
// M2 Slot
|
||||
@ -528,8 +552,15 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
.right_from(state.ids.m1_slot, 0.0)
|
||||
.set(state.ids.m2_slot, ui);
|
||||
Image::new(self.imgs.skillbar_slot_big_bg)
|
||||
.w_h(37.0 * scale, 37.0 * scale)
|
||||
.color(Some(BG_COLOR))
|
||||
.w_h(36.0 * scale, 36.0 * scale)
|
||||
.color(match self.stats.equipment.main {
|
||||
Some(Item::Tool { kind, .. }) => match kind {
|
||||
Tool::Bow => Some(BG_COLOR_2),
|
||||
Tool::Staff => Some(BG_COLOR_2),
|
||||
_ => Some(BG_COLOR_2),
|
||||
},
|
||||
_ => Some(BG_COLOR_2),
|
||||
})
|
||||
.middle_of(state.ids.m2_slot)
|
||||
.set(state.ids.m2_slot_bg, ui);
|
||||
Button::image(match self.stats.equipment.main {
|
||||
@ -544,7 +575,22 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
Some(Item::Debug(Debug::Boost)) => self.imgs.flyingrod_m2,
|
||||
_ => self.imgs.twohaxe_m2,
|
||||
}) // Insert Icon here
|
||||
.w_h(38.0 * scale, 38.0 * scale)
|
||||
.w(match self.stats.equipment.main {
|
||||
Some(Item::Tool { kind, .. }) => match kind {
|
||||
Tool::Bow => 30.0 * scale,
|
||||
Tool::Staff => 30.0 * scale,
|
||||
_ => 38.0 * scale,
|
||||
},
|
||||
_ => 38.0 * scale,
|
||||
})
|
||||
.h(match self.stats.equipment.main {
|
||||
Some(Item::Tool { kind, .. }) => match kind {
|
||||
Tool::Bow => 30.0 * scale,
|
||||
Tool::Staff => 30.0 * scale,
|
||||
_ => 38.0 * scale,
|
||||
},
|
||||
_ => 38.0 * scale,
|
||||
})
|
||||
.middle_of(state.ids.m2_slot_bg)
|
||||
.set(state.ids.m2_content, ui);
|
||||
//Slot 5
|
||||
|
@ -331,7 +331,7 @@ impl HumArmorChestSpec {
|
||||
)
|
||||
};
|
||||
|
||||
let bare_chest = graceful_load_mat_segment("armor.chest.grayscale");
|
||||
let bare_chest = graceful_load_mat_segment("armor.chest.none");
|
||||
|
||||
let mut chest_armor = graceful_load_mat_segment(&spec.vox_spec.0);
|
||||
|
||||
@ -385,13 +385,13 @@ impl HumArmorHandSpec {
|
||||
};
|
||||
|
||||
let hand_segment = color_segment(
|
||||
graceful_load_mat_segment(&spec.left.vox_spec.0),
|
||||
graceful_load_mat_segment(&spec.right.vox_spec.0),
|
||||
body.race.skin_color(body.skin),
|
||||
body.race.hair_color(body.hair_color),
|
||||
body.race.eye_color(body.eye_color),
|
||||
);
|
||||
|
||||
generate_mesh(&hand_segment, Vec3::from(spec.left.vox_spec.1))
|
||||
generate_mesh(&hand_segment, Vec3::from(spec.right.vox_spec.1))
|
||||
}
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@ pub fn mesh_main(item: Option<&Item>) -> Mesh<FigurePipeline> {
|
||||
Tool::Dagger => ("weapon.hammer.rusty_2h", Vec3::new(-2.5, -5.5, -4.0)),
|
||||
Tool::Shield => ("weapon.axe.rusty_2h", Vec3::new(-2.5, -6.5, -2.0)),
|
||||
Tool::Bow => ("weapon.bow.simple-bow", Vec3::new(-1.0, -6.0, -2.0)),
|
||||
Tool::Staff => ("weapon.staff.wood-0", Vec3::new(-1.0, -6.0, -3.0)),
|
||||
Tool::Staff => ("weapon.staff.wood-fire", Vec3::new(-1.0, -6.0, -3.0)),
|
||||
},
|
||||
Item::Debug(_) => ("weapon.debug_wand", Vec3::new(-1.5, -9.5, -4.0)),
|
||||
_ => return Mesh::new(),
|
||||
|
@ -408,10 +408,18 @@ impl PlayState for SessionState {
|
||||
global_state.settings.gameplay.crosshair_transp = crosshair_transp;
|
||||
global_state.settings.save_to_file_warn();
|
||||
}
|
||||
HudEvent::ChatTransp(chat_transp) => {
|
||||
global_state.settings.gameplay.chat_transp = chat_transp;
|
||||
global_state.settings.save_to_file_warn();
|
||||
}
|
||||
HudEvent::CrosshairType(crosshair_type) => {
|
||||
global_state.settings.gameplay.crosshair_type = crosshair_type;
|
||||
global_state.settings.save_to_file_warn();
|
||||
}
|
||||
HudEvent::Intro(intro_show) => {
|
||||
global_state.settings.gameplay.intro_show = intro_show;
|
||||
global_state.settings.save_to_file_warn();
|
||||
}
|
||||
HudEvent::ToggleXpBar(xp_bar) => {
|
||||
global_state.settings.gameplay.xp_bar = xp_bar;
|
||||
global_state.settings.save_to_file_warn();
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
hud::{BarNumbers, CrosshairType, ShortcutNumbers, XpBar},
|
||||
hud::{BarNumbers, CrosshairType, Intro, ShortcutNumbers, XpBar},
|
||||
render::AaMode,
|
||||
ui::ScaleMode,
|
||||
window::KeyMouse,
|
||||
@ -97,7 +97,9 @@ pub struct GameplaySettings {
|
||||
pub zoom_sensitivity: u32,
|
||||
pub zoom_inversion: bool,
|
||||
pub crosshair_transp: f32,
|
||||
pub chat_transp: f32,
|
||||
pub crosshair_type: CrosshairType,
|
||||
pub intro_show: Intro,
|
||||
pub xp_bar: XpBar,
|
||||
pub shortcut_numbers: ShortcutNumbers,
|
||||
pub bar_numbers: BarNumbers,
|
||||
@ -111,7 +113,9 @@ impl Default for GameplaySettings {
|
||||
zoom_sensitivity: 100,
|
||||
zoom_inversion: false,
|
||||
crosshair_transp: 0.6,
|
||||
chat_transp: 0.4,
|
||||
crosshair_type: CrosshairType::Round,
|
||||
intro_show: Intro::Show,
|
||||
xp_bar: XpBar::OnGain,
|
||||
shortcut_numbers: ShortcutNumbers::On,
|
||||
bar_numbers: BarNumbers::Off,
|
||||
|
Loading…
Reference in New Issue
Block a user