From 9096d4c95bbe40912ad2d8e5d365f21c35c7907b Mon Sep 17 00:00:00 2001 From: Capucho Date: Tue, 24 Mar 2020 21:41:59 +0000 Subject: [PATCH 01/14] Fix the cursor lagging behind on password field --- Cargo.lock | 6 +++--- voxygen/Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22b3939864..18e18ac0b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "conrod_core" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" +source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#e8a5b312ba0e3ab64efe54985d203137a34cd17d" dependencies = [ "conrod_derive", "copypasta", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "conrod_derive" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" +source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#e8a5b312ba0e3ab64efe54985d203137a34cd17d" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", @@ -582,7 +582,7 @@ dependencies = [ [[package]] name = "conrod_winit" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git?branch=hide_text#92925b122dfed139169c7d7687b3ca15c0cb5a2e" +source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#e8a5b312ba0e3ab64efe54985d203137a34cd17d" [[package]] name = "const-random" diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 21049a4c4c..49cf4c60bf 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -24,8 +24,8 @@ gfx_device_gl = { version = "0.16.2", optional = true } gfx_window_glutin = "0.31.0" glutin = "0.21.1" winit = { version = "0.19.4", features = ["serde"] } -conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "hide_text" } -conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "hide_text" } +conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "capucho/hide_text_cursor_fix" } +conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "capucho/hide_text_cursor_fix" } euc = "0.3.0" # ECS From b1409ee7172c93361581cae6b983aa5b520eb8d9 Mon Sep 17 00:00:00 2001 From: Capucho Date: Wed, 25 Mar 2020 12:51:43 +0000 Subject: [PATCH 02/14] Fixed Some minor bugs on the password field --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18e18ac0b9..72c53ca4d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "conrod_core" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#e8a5b312ba0e3ab64efe54985d203137a34cd17d" +source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#df3a5d8098687fb0addf6fdf7c9ad2ac8794997f" dependencies = [ "conrod_derive", "copypasta", @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "conrod_derive" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#e8a5b312ba0e3ab64efe54985d203137a34cd17d" +source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#df3a5d8098687fb0addf6fdf7c9ad2ac8794997f" dependencies = [ "proc-macro2 0.4.30", "quote 0.6.13", @@ -582,7 +582,7 @@ dependencies = [ [[package]] name = "conrod_winit" version = "0.63.0" -source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#e8a5b312ba0e3ab64efe54985d203137a34cd17d" +source = "git+https://gitlab.com/veloren/conrod.git?branch=capucho/hide_text_cursor_fix#df3a5d8098687fb0addf6fdf7c9ad2ac8794997f" [[package]] name = "const-random" From 1c4e507973d0947c5952fa26171b994dda24436a Mon Sep 17 00:00:00 2001 From: Marli Frost Date: Fri, 27 Mar 2020 10:09:21 +0000 Subject: [PATCH 03/14] fix: connect to LOCALHOST address in tests Windows doesn't allow us to connect to the Any (0.0.0.0) address, instead returning the WSAEADDRNOTAVAIL error code. https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2 --- common/src/net/post2.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/src/net/post2.rs b/common/src/net/post2.rs index ee9e7303e5..95307ac4bd 100644 --- a/common/src/net/post2.rs +++ b/common/src/net/post2.rs @@ -332,7 +332,8 @@ mod tests { #[test] fn connect() { - let (mut postoffice, sock) = create_postoffice::<(), ()>(0).unwrap(); + let (mut postoffice, bound) = create_postoffice::<(), ()>(0).unwrap(); + let sock = (std::net::Ipv4Addr::LOCALHOST, bound.port()); let _client0 = PostBox::<(), ()>::to(sock).unwrap(); let _client1 = PostBox::<(), ()>::to(sock).unwrap(); @@ -364,7 +365,8 @@ mod tests { #[test] fn send_recv() { - let (mut postoffice, sock) = create_postoffice::<(), i32>(2).unwrap(); + let (mut postoffice, bound) = create_postoffice::<(), i32>(2).unwrap(); + let sock = (std::net::Ipv4Addr::LOCALHOST, bound.port()); let test_msgs = vec![1, 1337, 42, -48]; let mut client = PostBox::::to(sock).unwrap(); @@ -386,7 +388,8 @@ mod tests { #[test] #[ignore] fn send_recv_huge() { - let (mut postoffice, sock) = create_postoffice::<(), Vec>(3).unwrap(); + let (mut postoffice, bound) = create_postoffice::<(), Vec>(3).unwrap(); + let sock = (std::net::Ipv4Addr::LOCALHOST, bound.port()); let test_msgs: Vec> = (0..5) .map(|i| (0..100000).map(|j| i * 2 + j).collect()) .collect(); @@ -410,7 +413,8 @@ mod tests { #[test] fn send_recv_both() { - let (mut postoffice, sock) = create_postoffice::(4).unwrap(); + let (mut postoffice, bound) = create_postoffice::(4).unwrap(); + let sock = (std::net::Ipv4Addr::LOCALHOST, bound.port()); let mut client = PostBox::::to(sock).unwrap(); loop_for(Duration::from_millis(250), || ()); let mut server = postoffice.new_postboxes().next().unwrap(); From bb67638df577fcef76c5ccab99acd2689b1929f9 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 27 Mar 2020 15:13:36 +0000 Subject: [PATCH 04/14] Better water shaders --- assets/voxygen/shaders/fluid-frag/cheap.glsl | 12 +----------- assets/voxygen/shaders/fluid-frag/shiny.glsl | 14 ++------------ assets/voxygen/shaders/fluid-vert.glsl | 3 +++ assets/voxygen/shaders/include/sky.glsl | 4 +++- assets/voxygen/shaders/skybox-frag.glsl | 10 +++++++++- 5 files changed, 18 insertions(+), 25 deletions(-) diff --git a/assets/voxygen/shaders/fluid-frag/cheap.glsl b/assets/voxygen/shaders/fluid-frag/cheap.glsl index b2e3d4b6ac..f3c92ab429 100644 --- a/assets/voxygen/shaders/fluid-frag/cheap.glsl +++ b/assets/voxygen/shaders/fluid-frag/cheap.glsl @@ -34,16 +34,6 @@ void main() { vec3 cam_to_frag = normalize(f_pos - cam_pos.xyz); - /* - // Round the position to the nearest triangular grid cell - vec3 hex_pos = f_pos * 2.0; - hex_pos = hex_pos + vec3(hex_pos.y * 1.4 / 3.0, hex_pos.y * 0.1, 0); - if (fract(hex_pos.x) > fract(hex_pos.y)) { - hex_pos += vec3(1.0, 1.0, 0); - } - hex_pos = floor(hex_pos); - */ - vec3 light, diffuse_light, ambient_light; get_sun_diffuse(f_norm, time_of_day.x, light, diffuse_light, ambient_light, 0.0); float point_shadow = shadow_at(f_pos,f_norm); @@ -52,7 +42,7 @@ void main() { vec3 point_light = light_at(f_pos, f_norm); light += point_light; diffuse_light += point_light; - vec3 surf_color = illuminate(srgb_to_linear(vec3(0.2, 0.2, 1.0)), light, diffuse_light, ambient_light); + vec3 surf_color = srgb_to_linear(vec3(0.4, 0.7, 2.0)) * light * diffuse_light * ambient_light; float fog_level = fog(f_pos.xyz, focus_pos.xyz, medium.x); vec4 clouds; diff --git a/assets/voxygen/shaders/fluid-frag/shiny.glsl b/assets/voxygen/shaders/fluid-frag/shiny.glsl index cb7a37544d..8d06ee468c 100644 --- a/assets/voxygen/shaders/fluid-frag/shiny.glsl +++ b/assets/voxygen/shaders/fluid-frag/shiny.glsl @@ -68,16 +68,6 @@ void main() { vec3 cam_to_frag = normalize(f_pos - cam_pos.xyz); float frag_dist = length(f_pos - cam_pos.xyz); - /* - // Round the position to the nearest triangular grid cell - vec3 hex_pos = f_pos * 2.0; - hex_pos = hex_pos + vec3(hex_pos.y * 1.4 / 3.0, hex_pos.y * 0.1, 0); - if (fract(hex_pos.x) > fract(hex_pos.y)) { - hex_pos += vec3(1.0, 1.0, 0); - } - hex_pos = floor(hex_pos); - */ - vec3 b_norm; if (f_norm.z > 0.0) { b_norm = vec3(1, 0, 0); @@ -111,7 +101,7 @@ void main() { vec3 point_light = light_at(f_pos, norm); light += point_light; diffuse_light += point_light; - vec3 surf_color = illuminate(srgb_to_linear(f_col), light, diffuse_light, ambient_light); + vec3 surf_color = srgb_to_linear(vec3(0.2, 0.5, 1.0)) * light * diffuse_light * ambient_light; float fog_level = fog(f_pos.xyz, focus_pos.xyz, medium.x); vec4 clouds; @@ -119,7 +109,7 @@ void main() { vec3 reflect_ray_dir = reflect(cam_to_frag, norm); // Hack to prevent the reflection ray dipping below the horizon and creating weird blue spots in the water - reflect_ray_dir.z = max(reflect_ray_dir.z, 0.05); + reflect_ray_dir.z = max(reflect_ray_dir.z, 0.01); vec4 _clouds; vec3 reflect_color = get_sky_color(reflect_ray_dir, time_of_day.x, f_pos, vec3(-100000), 0.25, false, _clouds) * f_light; diff --git a/assets/voxygen/shaders/fluid-vert.glsl b/assets/voxygen/shaders/fluid-vert.glsl index 2692e463a2..412b46bd80 100644 --- a/assets/voxygen/shaders/fluid-vert.glsl +++ b/assets/voxygen/shaders/fluid-vert.glsl @@ -27,6 +27,9 @@ void main() { f_pos.z *= min(1.0001 - 0.02 / pow(tick.x - load_time, 10.0), 1.0); f_pos.z -= 25.0 * pow(distance(focus_pos.xy, f_pos.xy) / view_distance.x, 20.0); + // Small waves + f_pos.z -= 0.05 + 0.05 * (sin(tick.x * 2.0 + f_pos.x * 2.0 + f_pos.y * 2.0) + 1.0) * 0.5; + f_col = vec3( float((v_col_light >> 8) & 0xFFu), float((v_col_light >> 16) & 0xFFu), diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 5b3869c8ac..7ac0dbc6c9 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -21,6 +21,8 @@ const vec3 SKY_NIGHT_MID = vec3(0.001, 0.005, 0.02); const vec3 SKY_NIGHT_BOT = vec3(0.002, 0.004, 0.004); const vec3 NIGHT_LIGHT = vec3(0.002, 0.01, 0.03); +const float UNDERWATER_MIST_DIST = 100.0; + vec3 get_sun_dir(float time_of_day) { const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0); @@ -202,7 +204,7 @@ float fog(vec3 f_pos, vec3 focus_pos, uint medium) { float max_fog = 1.0; if (medium == 1u) { - mist_radius = 96.0; + mist_radius = UNDERWATER_MIST_DIST; min_fog = 0.0; } diff --git a/assets/voxygen/shaders/skybox-frag.glsl b/assets/voxygen/shaders/skybox-frag.glsl index ab39a37c3c..d537a1f9eb 100644 --- a/assets/voxygen/shaders/skybox-frag.glsl +++ b/assets/voxygen/shaders/skybox-frag.glsl @@ -14,5 +14,13 @@ out vec4 tgt_color; void main() { vec4 _clouds; - tgt_color = vec4(get_sky_color(normalize(f_pos), time_of_day.x, cam_pos.xyz, vec3(-100000), 1.0, true, _clouds), 1.0); + float fog_level = fog(f_pos.xyz, focus_pos.xyz, medium.x); + + float dist = 100000.0; + if (medium.x == 1u) { + dist = UNDERWATER_MIST_DIST; + } + vec3 wpos = cam_pos.xyz + normalize(f_pos) * dist; + + tgt_color = vec4(get_sky_color(normalize(f_pos), time_of_day.x, cam_pos.xyz, wpos, 1.0, true, _clouds), 1.0); } From bba43dc9c8467ad48c03e74e3526cbe151f194c1 Mon Sep 17 00:00:00 2001 From: Capucho Date: Fri, 27 Mar 2020 18:35:52 +0000 Subject: [PATCH 05/14] Added an option for hold and added everything to the settings --- assets/voxygen/i18n/en.ron | 6 ++++ voxygen/src/hud/mod.rs | 9 ++++++ voxygen/src/hud/settings_window.rs | 51 ++++++++++++++++++++++++++++-- voxygen/src/session.rs | 20 +++++++++--- voxygen/src/settings.rs | 6 ++-- 5 files changed, 83 insertions(+), 9 deletions(-) diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 57ef0300db..cdcad13db1 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -192,6 +192,8 @@ Enjoy your stay in the World of Veloren."#, "hud.settings.general": "General", "hud.settings.none": "None", + "hud.settings.press_behavior.toggle": "Toggle", + "hud.settings.press_behavior.hold": "Hold", "hud.settings.help_window": "Help Window", "hud.settings.debug_info": "Debug Info", "hud.settings.tips_on_startup": "Tips-On-Startup", @@ -219,6 +221,7 @@ Enjoy your stay in the World of Veloren."#, "hud.settings.zoom_sensitivity": "Zoom Sensitivity", "hud.settings.invert_scroll_zoom": "Invert Scroll Zoom", "hud.settings.invert_mouse_y_axis": "Invert Mouse Y Axis", + "hud.settings.free_look_behavior": "Free look behavior", "hud.settings.view_distance": "View Distance", "hud.settings.maximum_fps": "Maximum FPS", @@ -308,6 +311,9 @@ Send Chat Message Scroll Chat +Free look + + Chat commands: /alias [Name] - Change your Chat Name diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 9a45e82156..af37606609 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -231,6 +231,7 @@ pub enum Event { Logout, Quit, ChangeLanguage(LanguageMetadata), + ChangeFreeLookBehavior(PressBehavior), } // TODO: Are these the possible layouts we want? @@ -271,6 +272,11 @@ pub enum ShortcutNumbers { On, Off, } +#[derive(Clone, Copy, Debug, Serialize, Deserialize)] +pub enum PressBehavior { + Toggle = 0, + Hold = 1, +} pub struct Show { ui: bool, @@ -1825,6 +1831,9 @@ impl Hud { settings_window::Event::AdjustWindowSize(new_size) => { events.push(Event::AdjustWindowSize(new_size)); }, + settings_window::Event::ChangeFreeLookBehavior(behavior) => { + events.push(Event::ChangeFreeLookBehavior(behavior)); + }, } } } diff --git a/voxygen/src/hud/settings_window.rs b/voxygen/src/hud/settings_window.rs index 1c63978804..d0aba49fff 100644 --- a/voxygen/src/hud/settings_window.rs +++ b/voxygen/src/hud/settings_window.rs @@ -1,6 +1,6 @@ use super::{ - img_ids::Imgs, BarNumbers, CrosshairType, Intro, ShortcutNumbers, Show, XpBar, MENU_BG, - TEXT_COLOR, + img_ids::Imgs, BarNumbers, CrosshairType, Intro, PressBehavior, ShortcutNumbers, Show, XpBar, + MENU_BG, TEXT_COLOR, }; use crate::{ i18n::{list_localizations, LanguageMetadata, VoxygenLocalization}, @@ -141,7 +141,8 @@ widget_ids! { sct_num_dur_text, sct_num_dur_slider, sct_num_dur_value, - + free_look_behavior_text, + free_look_behavior_list } } @@ -220,6 +221,7 @@ pub enum Event { SctPlayerBatch(bool), SctDamageBatch(bool), ChangeLanguage(LanguageMetadata), + ChangeFreeLookBehavior(PressBehavior), } pub enum ScaleChange { @@ -1254,6 +1256,45 @@ impl<'a> Widget for SettingsWindow<'a> { .graphics_for(state.ids.mouse_y_invert_button) .color(TEXT_COLOR) .set(state.ids.mouse_y_invert_label, ui); + + // Free look behaviour + Text::new( + &self + .localized_strings + .get("hud.settings.free_look_behavior"), + ) + .down_from(state.ids.mouse_zoom_invert_button, 10.0) + .font_size(self.fonts.cyri.scale(14)) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.free_look_behavior_text, ui); + + let mode_label_list = [ + &self + .localized_strings + .get("hud.settings.press_behavior.toggle"), + &self + .localized_strings + .get("hud.settings.press_behavior.hold"), + ]; + + // Get which free look behavior is currently active + let selected = self.global_state.settings.gameplay.free_look_behavior as usize; + + if let Some(clicked) = DropDownList::new(&mode_label_list, Some(selected)) + .w_h(200.0, 30.0) + .color(MENU_BG) + .label_color(TEXT_COLOR) + .label_font_id(self.fonts.cyri.conrod_id) + .down_from(state.ids.free_look_behavior_text, 8.0) + .set(state.ids.free_look_behavior_list, ui) + { + match clicked { + 0 => events.push(Event::ChangeFreeLookBehavior(PressBehavior::Toggle)), + 1 => events.push(Event::ChangeFreeLookBehavior(PressBehavior::Hold)), + _ => unreachable!(), + } + } } // 3) Controls Tab -------------------------------- @@ -1367,6 +1408,9 @@ impl<'a> Widget for SettingsWindow<'a> { {}\n\ \n\ \n\ + {}\n\ + \n\ + \n\ \n\ \n\ \n\ @@ -1417,6 +1461,7 @@ impl<'a> Widget for SettingsWindow<'a> { controls.bag, controls.enter, "Mouse Wheel", // Scroll chat + controls.free_look )) .color(TEXT_COLOR) .right_from(state.ids.controls_text, 0.0) diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 5e9d46b6fb..335b06b21d 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -1,6 +1,6 @@ use crate::{ ecs::MyEntity, - hud::{DebugInfo, Event as HudEvent, Hud}, + hud::{DebugInfo, Event as HudEvent, Hud, PressBehavior}, i18n::{i18n_asset_key, VoxygenLocalization}, key_state::KeyState, menu::char_selection::CharSelectionState, @@ -402,9 +402,18 @@ impl PlayState for SessionState { Event::InputUpdate(GameInput::Charge, state) => { self.inputs.charge.set_state(state); }, - Event::InputUpdate(GameInput::FreeLook, true) => { - free_look = !free_look; - self.hud.free_look(free_look); + Event::InputUpdate(GameInput::FreeLook, state) => { + match (global_state.settings.gameplay.free_look_behavior, state) { + (PressBehavior::Toggle, true) => { + free_look = !free_look; + self.hud.free_look(free_look); + }, + (PressBehavior::Hold, state) => { + free_look = state; + self.hud.free_look(free_look); + }, + _ => {}, + }; }, Event::AnalogGameInput(input) => match input { AnalogGameInput::MovementX(v) => { @@ -681,6 +690,9 @@ impl PlayState for SessionState { global_state.settings.graphics.window_size = new_size; global_state.settings.save_to_file_warn(); }, + HudEvent::ChangeFreeLookBehavior(behavior) => { + global_state.settings.gameplay.free_look_behavior = behavior; + }, } } diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 5f47300544..6a7590f093 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -1,5 +1,5 @@ use crate::{ - hud::{BarNumbers, CrosshairType, Intro, ShortcutNumbers, XpBar}, + hud::{BarNumbers, CrosshairType, Intro, PressBehavior, ShortcutNumbers, XpBar}, i18n, render::{AaMode, CloudMode, FluidMode}, ui::ScaleMode, @@ -69,7 +69,7 @@ impl Default for ControlSettings { Self { primary: KeyMouse::Mouse(MouseButton::Left), secondary: KeyMouse::Mouse(MouseButton::Right), - toggle_cursor: KeyMouse::Key(VirtualKeyCode::Tab), + toggle_cursor: KeyMouse::Key(VirtualKeyCode::L), escape: KeyMouse::Key(VirtualKeyCode::Escape), enter: KeyMouse::Key(VirtualKeyCode::Return), command: KeyMouse::Key(VirtualKeyCode::Slash), @@ -346,6 +346,7 @@ pub struct GameplaySettings { pub shortcut_numbers: ShortcutNumbers, pub bar_numbers: BarNumbers, pub ui_scale: ScaleMode, + pub free_look_behavior: PressBehavior, } impl Default for GameplaySettings { @@ -367,6 +368,7 @@ impl Default for GameplaySettings { shortcut_numbers: ShortcutNumbers::On, bar_numbers: BarNumbers::Off, ui_scale: ScaleMode::RelativeToWindow([1920.0, 1080.0].into()), + free_look_behavior: PressBehavior::Toggle, } } } From 41b640480679a521b1a238be4db4a6f90138794d Mon Sep 17 00:00:00 2001 From: Capucho Date: Fri, 27 Mar 2020 19:36:20 +0000 Subject: [PATCH 06/14] Fix the wrong default keybind change --- voxygen/src/settings.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 6a7590f093..a8ce79e0b4 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -69,7 +69,7 @@ impl Default for ControlSettings { Self { primary: KeyMouse::Mouse(MouseButton::Left), secondary: KeyMouse::Mouse(MouseButton::Right), - toggle_cursor: KeyMouse::Key(VirtualKeyCode::L), + toggle_cursor: KeyMouse::Key(VirtualKeyCode::Tab), escape: KeyMouse::Key(VirtualKeyCode::Escape), enter: KeyMouse::Key(VirtualKeyCode::Return), command: KeyMouse::Key(VirtualKeyCode::Slash), @@ -102,7 +102,7 @@ impl Default for ControlSettings { interact: KeyMouse::Mouse(MouseButton::Right), toggle_wield: KeyMouse::Key(VirtualKeyCode::T), charge: KeyMouse::Key(VirtualKeyCode::Key1), - free_look: KeyMouse::Key(VirtualKeyCode::LAlt), + free_look: KeyMouse::Key(VirtualKeyCode::L), } } } From a82c055fa69ce5e3459ab57dbfa62c3355c6976d Mon Sep 17 00:00:00 2001 From: S Handley Date: Sun, 29 Mar 2020 01:47:18 +0000 Subject: [PATCH 07/14] Add Italian translation --- assets/voxygen/i18n/it.ron | 559 +++++++++++++++++++++++++++++++++++++ 1 file changed, 559 insertions(+) create mode 100644 assets/voxygen/i18n/it.ron diff --git a/assets/voxygen/i18n/it.ron b/assets/voxygen/i18n/it.ron new file mode 100644 index 0000000000..7099e32f5c --- /dev/null +++ b/assets/voxygen/i18n/it.ron @@ -0,0 +1,559 @@ +/// Translation document instructions +/// +/// In order to keep localization documents readible please follow the following +/// rules: +/// - separate the string map sections using a commentary describing the purpose +/// of the next section +/// - prepend multi-line strings with a commentary +/// - append one blank lines after a multi-line strings and two after sections +/// +/// To add a new language in Veloren, just write an additional `.ron` file in +/// `assets/voxygen/i18n` and that's it! + + + + +/// Localization for "global" Italian +VoxygenLocalization( + metadata: ( + language_name: "Italiano", + language_identifier: "it", + ), + convert_utf8_to_ascii: false, + fonts: { + "opensans": Font ( + asset_key: "voxygen.font.OpenSans-Regular", + scale_ratio: 1.0, + ), + "metamorph": Font ( + asset_key: "voxygen.font.Metamorphous-Regular", + scale_ratio: 1.0, + ), + "alkhemi": Font ( + asset_key: "voxygen.font.Alkhemikal", + scale_ratio: 1.0, + ), + "wizard": Font ( + asset_key: "voxygen.font.wizard", + scale_ratio: 1.0, + ), + "cyri": Font ( + asset_key: "voxygen.font.haxrcorp_4089_cyrillic_altgr_extended", + scale_ratio: 1.0, + ), + }, + string_map: { + /// Start Common section + // Texts used in multiple locations with the same formatting + "common.username": "Nome Utente", + "common.singleplayer": "Giocatore Singolo", + "common.multiplayer": "Multigiocatore", + "common.servers": "Server", + "common.quit": "Esci", + "common.settings": "Impostazioni", + "common.languages": "Lingue", + "common.interface": "Interfaccia", + "common.gameplay": "Gameplay", + "common.controls": "Controlli", + "common.video": "Video", + "common.sound": "Audio", + "common.resume": "Riprendi", + "common.characters": "Personaggi", + "common.close": "Chiudi", + "common.yes": "Si", + "common.no": "No", + "common.back": "Indietro", + "common.create": "Crea", + "common.okay": "Ok", + "common.disclaimer": "Disclaimer", + "common.cancel": "Cancella", + "common.none": "Nessuno", + "common.error": "Errore", + "common.fatal_error": "Errore Fatale", + + + + + + // Message when connection to the server is lost + "common.connection_lost": r#"Connessione persa! +Si è riavviato il server? +Il client è aggiornato?"#, + + + + + + + + + "common.races.orc": "Orco", + "common.races.human": "Umano", + "common.races.dwarf": "Nano", + "common.races.elf": "Elfo", + "common.races.undead": "Non-Morto", + "common.races.danari": "Danari", + + + + + "common.weapons.axe": "Ascia", + "common.weapons.sword": "Spada", + "common.weapons.staff": "Bastone", + "common.weapons.bow": "Arco", + "common.weapons.hammer": "Martello", + /// End Common section + + + + + + + + + /// Start Main screen section + "main.connecting": "Connessione in corso", + "main.creating_world": "Creazione del mondo", + + + + + // Welcome notice that appears the first time Veloren is started + "main.notice": r#"Benvenuto nella versione Alpha di Veloren! + + + + +Prima di tuffarti nel divertimento, ti preghiamo di tenere a mente che: + + + + +- Questa è un’Alpha molto prematura. Aspettati errori, gameplay non completo, meccaniche non rifinite, e funzioni mancanti. +- Se hai critiche costruttive o errori da segnalare, ci puoi contattare tramite Reddit, GitLab, o il server Discord della nostra community. +- Veloren è concesso in licenza con la licenza open-source GPL 3. Il che vuol dire che sei libero di giocare, modificare, e ridistribuire il gioco come tu desideri (purché il lavoro che ne derivi sia sempre sotto licenza GPL 3). +- Veloren è un progetto comunitario no-profit, e chiunque ci lavori sopra è un volontario. +Se ti piace ciò che vedi, sei il benvenuto ad unirti ai team di sviluppo e artistico! +- 'Voxel RPG' è un genere a sé stante. Gli sparatutto-in-prima-persona venivano considerati cloni di Doom. + + + + +Come loro, stiamo cercando di costruire una nicchia. Il gioco non è un clone, e il suo sviluppo divergerà dai giochi esistenti in futuro. + + + + +Grazie per aver dedicato del tempo a leggere questo avviso, speriamo che ti divertirai col gioco! + + + + +~ Il team di sviluppo di Veloren"#, + + + + + // Login process description + "main.login_process": r#"Informazioni sul processo del Login: + + +Se stai avendo problemi nell'accedere: + +Notare che hai bisogno di un account +per giocare su server con autenticazione abilitata. + +Puoi creare un account su + +https://account.veloren.net."#, + "main.login.server_not_found": "Server non trovato", + "main.login.authentication_error": "Errore di autenticazione server", + "main.login.server_full": "Il server è pieno", + "main.login.untrusted_auth_server": "Server di autenticazione non affidabile", + "main.login.outdated_client_or_server": "Il server è impazzito: Probabilmente le versioni sono incompatibili, controlla per degli aggiornamenti", + "main.login.timeout": "Tempo scaduto: Il server non ha risposto in tempo. (In sovraccarico o problemi di rete)", + "main.login.server_shut_down": "Il server è stato chiuso", + "main.login.already_logged_in": "Hai già effettuato l'accesso al server", + "main.login.network_error": "Errore di rete", + "main.login.failed_sending_request": "Richiesta ai server di autenticazione fallita", + "main.login.client_crashed": "Il client si è arrestato", + + + + + + + + + + /// End Main screen section + + + + + + + + + /// Start HUD Section + "hud.do_not_show_on_startup": "Non mostrare all’avvio", + "hud.show_tips": "Mostra consigli", + "hud.quests": "Missioni", + "hud.you_died": "Sei Morto", + + "hud.press_key_to_show_keybindings_fmt": "Premi {key} per mostrare le scorciatoie da tastiera", + "hud.press_key_to_show_debug_info_fmt": "Premi {key} per mostrare le informazioni di debug", + "hud.press_key_to_toggle_keybindings_fmt": "Premi {key} per attivare/disattivare le scorciatoie da tastiera", + "hud.press_key_to_toggle_debug_info_fmt": "Premi {key} per attivare/disattivare le informazioni di debug", + + + + + // Respawn message + "hud.press_key_to_respawn": r#"Premi {key} per rinascere al tuo Waypoint. + + + + +Premi Invio, scrivi /waypoint e conferma per impostarlo qui."#, + + + + + // Welcome message + "hud.welcome": r#"Benvenuto nell’Alpha di Veloren! + + + + +Alcuni consigli prima di cominciare: + + +MOLTO IMPORTANTE: Per impostare il tuo punto di rinascita scrivi /waypoint + + +nella chat. + + +Ciò può essere fatto anche se sei già morto! + + + + +Premi F1 per vedere i comandi chiave disponibili. + + +Scrivi /help nella chat per vedere i comandi della chat. + + + + +Ci sono forzieri e altri oggetti che appaiono casualmente nel Mondo! + + +Clicca col tasto destro del mouse per raccoglierli. + + +Per usare qualsiasi cosa tu ottenga da quei forzieri apri il tuo inventario con 'B'. + + +Fai doppio click sugli oggetti nella tua borsa per usarli o equipaggiarli. + + +Gettali via cliccandoci una volta sopra e una volta fuori dall’inventario. + + + + +Le notti possono essere molto buie in Veloren. + + +Accendi la tua lanterna scrivendo /lantern nella chat. + + + + +Vuoi sbloccare il cursore per chiudere questa finestra? Premi TAB! + + + + +Goditi il tuo soggiorno nel Mondo di Veloren."#, + + + + + "hud.settings.general": "Generale", + "hud.settings.none": "Nessuno", + "hud.settings.press_behavior.toggle": "Attiva/Disattiva" + "hud.settings.press_behavior.hold": "Tieni Premuto", + "hud.settings.help_window": "Finestra di Aiuto", + "hud.settings.debug_info": "Informazioni di Debug", + "hud.settings.tips_on_startup": "Consigli all’Avvio", + "hud.settings.ui_scale": "Proporzione Interfaccia", + "hud.settings.relative_scaling": "Proporzione Relativa", + "hud.settings.custom_scaling": "Proporzione Person.", + "hud.settings.crosshair": "Mirino", + "hud.settings.transparency": "Trasparenza", + "hud.settings.hotbar": "Barra Veloce", + "hud.settings.toggle_shortcuts": "Attivare/Disattivare Scorciatoie", + "hud.settings.toggle_bar_experience": "Attivare/Disattivare Barra dell’Esperienza", + "hud.settings.scrolling_combat_text": "Testo di Combattimento Scorrevole", + "hud.settings.single_damage_number": "Danno Nemico (Singolo)", + "hud.settings.cumulated_damage": "Danno Nemico (Cumulativo)", + "hud.settings.incoming_damage": "Danno Giocatore (Singolo)", + "hud.settings.cumulated_incoming_damage": "Danno Giocatore (Cumulativo)", + "hud.settings.energybar_numbers": "Numeri Barra dell’Energia", + "hud.settings.values": "Valori", + "hud.settings.percentages": "Percentuali", + "hud.settings.chat": "Chat", + "hud.settings.background_transparency": "Trasparenza dello Sfondo", + "hud.settings.none": "Nessuno", + + + + + "hud.settings.pan_sensitivity": "Sensibilità Camera", + "hud.settings.zoom_sensitivity": "Sensibilità Zoom", + "hud.settings.invert_scroll_zoom": "Zoom Invertito", + "hud.settings.invert_mouse_y_axis": "Asse Y del Mouse Invertito", + "hud.settings.free_look_behavior": "Comportamento Visuale Libera" + + + + + "hud.settings.view_distance": "Distanza Oggetto", + "hud.settings.maximum_fps": "FPS Massimi", + "hud.settings.fov": "Campo Visivo (gradi)", + "hud.settings.gamma": "Gamma", + "hud.settings.antialiasing_mode": "Modalità AntiAliasing", + "hud.settings.cloud_rendering_mode": "Modalità Renderizzazione Nuvole", + "hud.settings.fluid_rendering_mode": "Modalità Renderizzazione Fluido", + "hud.settings.fluid_rendering_mode.cheap": "Economico", + "hud.settings.fluid_rendering_mode.shiny": "Lucente", + "hud.settings.cloud_rendering_mode.regular": "Regolare", + "hud.settings.fullscreen": "Schermo Intero", + "hud.settings.save_window_size": "Salva dimensione finestra", + + + + + "hud.settings.music_volume": "Volume Musica", + "hud.settings.sound_effect_volume": "Volume Effetti Sonori", + "hud.settings.audio_device": "Dispositivo Audio", + + + + + // Control list + "hud.settings.control_names": r#"Cursore Libero +Attiva/Disattiva Finestra di Aiuto +Attiva/Disattiva Interfaccia +Attiva/Disattiva FPS e Informazioni di Debug +Scatta Screenshot +Attiva/Disattiva Nomi +Attiva/Disattiva Schermo Intero + + + + +Movimento in Avanti +Movimento a Sinistra +Movimento a Destra +Movimento all’Indietro + + +Salto + + +Aliante + + +Schivata + + +Rotolata + + +Scalata + + +Discesa + + +Camminata Automatica + + +Riporre/Sfoderare Armi + + +Mettere/Rimuovere Elmo + + +Sedersi + + +Cavalcatura + + +Interagire + + + + +Attacco Base +Attacco Secondario/Parata/Mira + + + + +Slot 1 Barra delle Abilità +Slot 2 Barra delle Abilità +Slot 3 Barra delle Abilità +Slot 4 Barra delle Abilità +Slot 5 Barra delle Abilità +Slot 6 Barra delle Abilità +Slot 7 Barra delle Abilità +Slot 8 Barra delle Abilità +Slot 9 Barra delle Abilità +Slot 10 Barra delle Abilità + + + + +Menù di Pausa +Impostazioni +Social +Mappa +Libro degli Incantesimi +Personaggio +Diario delle Missioni +Borsa + + + + + + +Invia Messaggio nella Chat +Scorrimento della Chat + + + +Camera Libera + + + +Comandi della Chat: + + + + +/alias [Name] - Cambia il tuo Nome nella Chat +/tp [Name] - Ti teleporta da un altro giocatore +/jump - Devia la tua posizione +/goto - Ti teleporta in una posizione +/kill - Suicidati +/pig - Fai apparire un maiale PNG +/wolf - Fai apparire un lupo PNG +/help - Mostra comandi della Chat + + +"#, + + + + + "hud.social": "Social", + "hud.social.online": "Online", + "hud.social.friends": "Amici", + "hud.social.not_yet_available": "Non ancora disponibile", + "hud.social.Faction": "Fazione", + "hud.social.play_online_fmt": "{nb_player} giocatore/i online", + + + + + "hud.spell": "Incantesimo", + + "hud.free_look_indicator": "Visuale Libera Attiva" + /// End HUD section + + + + + + + + + /// Start character selection section + "char_selection.delete_permanently": "Eliminare permanente questo Personaggio?", + "char_selection.change_server": "Cambia Server", + "char_selection.enter_world": "Unisciti al Mondo", + "char_selection.logout": "Disconnettiti", + "char_selection.create_new_charater": "Crea un nuovo Personaggio", + "char_selection.character_creation": "Creazione Personaggio", + + + + + "char_selection.human_default": "Umano Predefinito", + "char_selection.level_fmt": "Livello {level_nb}", + "char_selection.uncanny_valley": "Valle Perturbante", + "char_selection.plains_of_uncertainty": "Pianure dell'Incertezza", + "char_selection.beard": "Barba", + "char_selection.hair_style": "Stile Capelli", + "char_selection.hair_color": "Colore Capelli", + "char_selection.chest_color": "Colore Torace", + "char_selection.eye_color": "Colore Occhi", + "char_selection.skin": "Pelle", + "char_selection.eyebrows": "Sopracciglia", + "char_selection.accessories": "Accessori", + + + + + /// End chracter selection section + + + + + + + + + /// Start character window section + "character_window.character_name": "Nome Personaggio", + // Charater stats + "character_window.character_stats": r#"Stamina + + + + +Vitalità + + + + +Volontà +"#, + + + + + + + + + /// Start character window section + + + + + + /// Start Escape Menu Section + "esc_menu.logout": "Disconnettiti", + "esc_menu.quit_game": "Esci dal Gioco", + /// End Escape Menu Section + } +) \ No newline at end of file From 7224272c9577b2c4a582d77d823fdee7830fc6ea Mon Sep 17 00:00:00 2001 From: Jack Rubino Date: Sun, 1 Mar 2020 16:07:35 +0000 Subject: [PATCH 08/14] Add Italian translation --- .../haxrcorp_4089_cyrillic_altgr_extended.ttf | Bin 22120 -> 23628 bytes assets/voxygen/i18n/it.ron | 45 +++--------------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/assets/voxygen/font/haxrcorp_4089_cyrillic_altgr_extended.ttf b/assets/voxygen/font/haxrcorp_4089_cyrillic_altgr_extended.ttf index 4cd13e883a8ad3cfeed757d2c3c56590e90ea7c8..808a9fd055a021d7bedd9230cfd6745246a824be 100644 GIT binary patch delta 2255 zcmZWqYitx%6h3#h?H2YqyE{Ak>Ta>XHib~zr98C2s90aY@~o&0u(YL1U$jtaDe8`e zSbvxXodyX(LWr6Q)nJ=w!AM3_g0X^uhCtJp+K{FpNQ~BqxXgI&?6$itcXIFC*ZIyl z-#Pc*@g6eJPoh8ozyu=bU~Ngs#x-xeWPK8#{860sJ+u1h5(ttE99wbhFWrz|xUKuI zd;qc;$J;9E!;QzkY5x)+y&vaBtHXO5RTYt-JQLS5tLygd80~Ly0?axAu&Odr6|PKM z2y#QESH(nGrN7T$m~F#+a)nn>W^|1P$`mWlczO5cm zqp|(5=2%J0AG5{GBezCIfk! z+fJ7N6gBoB-b-mKpt2fZ$4-DqE!0SQ{b2M(L!+V7&|{DdR}J@#j~G`QcNh;EPZ|e} z_e?(1MpMMpW;$k)O}ETG^JC`C=6B59=1b;r3uDQ(lv%c0+AQx|`Yl7232UKsi}jH8 z6RT_;wkoWd&0__&jy=krWAE7fwq>?TTdVDe?Ue0%+qmt%-DfYczi#h}+E3YK`>_3< z!{sP+yy9qgbUQ9O#<&d5!7bvR=bE`L?sM)2r#KzX#m;A)mChDtr}KGh1-fr)Jcf#lJ75ldPI(@yq%RVJ*epY$bp{)L_8~!wZu7AD1!Qbic z@n82VfxmttFrT^MeHmD)22k~9kJGfYY`C&iW&jCjrf8KRC!Wr6$+lQW~5s}_tz95V~~ zD$2oZd;(o87erAeQ5wQqvWy9dbfHChY8C-Y6lY!&2(8!-#^o3r$uyj;wbTug(2k&P;ne$T1W*lBce&fzKQJOe1?Ej zxb}yF&+v8o398@sF-`RT9cL Pd&3eDW0>-cSC9M;%`7V` delta 852 zcmYjQYe-XZ6hHUwy4Jk!*Iu_6%bqC0sE{Ex@{vW4Q8t7=gvZt!L1~$VI!o>)$KXjzj-Ei+mDF9ZFa6?mDAmYoM z?*k|ZBkq1E&=t`%R0;e=C~gX!Jk#>@)$1ALeh2W>hl7D;!{5wB6hj>B42OfU0P!44 zqGS;fMd7yYXq6XvfQO5GG87Vead=(X@lm(a$GjzX0kk;o#p4K@ z07qIEl!V8%xUKD=a0hj+Pg4N`&`e-Gu!y0NM?o*7 zVIFb`wZO3>4Oz$$K!k`vVvKl4WSmx~g64*4%i5fFPV3P+)sWhtx>fU^l|R4Jlj*mB zB|41G#Gvt#C4Ys+yl!p^<}Fe!D84ZfHwwi3*X)=7z?`_bW<0j9u)T1g@C}KRE^;^7 zNS-Bck(1;MnWIR`P1RBDRFe8Yn`tNQq5X7}?xXL}kLk~h$ZTg?nCr|#W|moEdA5kH zU>n(Pc90!oe{wWe#CbSB*U1fVN$x$T@-E)XH}G-3pTEbC^NRv4Y!MC%(U{OL3=7YM zS>d~A61RySv0m&IZ-^t}gqRUmB)e25`J`6qsx&N3NviCU%VocOTJDpFj80?X~u(eaJrLFgx6i!;W6Z zEysjI$|@#hlj2jNN>Z6rGD>b8yRJBOV{JfAbh&ok-n#)yoY;6e^=Q+MQXCc%i$`Cq jZG{eqKqvI1KKXYQY}KDyUz}CTfp(`_{{yRcspRfIZ~^PZ diff --git a/assets/voxygen/i18n/it.ron b/assets/voxygen/i18n/it.ron index 7099e32f5c..75d8b7a9de 100644 --- a/assets/voxygen/i18n/it.ron +++ b/assets/voxygen/i18n/it.ron @@ -20,7 +20,7 @@ VoxygenLocalization( language_identifier: "it", ), convert_utf8_to_ascii: false, - fonts: { + fonts: { "opensans": Font ( asset_key: "voxygen.font.OpenSans-Regular", scale_ratio: 1.0, @@ -285,7 +285,7 @@ Goditi il tuo soggiorno nel Mondo di Veloren."#, "hud.settings.general": "Generale", "hud.settings.none": "Nessuno", - "hud.settings.press_behavior.toggle": "Attiva/Disattiva" + "hud.settings.press_behavior.toggle": "Attiva/Disattiva", "hud.settings.press_behavior.hold": "Tieni Premuto", "hud.settings.help_window": "Finestra di Aiuto", "hud.settings.debug_info": "Informazioni di Debug", @@ -317,7 +317,7 @@ Goditi il tuo soggiorno nel Mondo di Veloren."#, "hud.settings.zoom_sensitivity": "Sensibilità Zoom", "hud.settings.invert_scroll_zoom": "Zoom Invertito", "hud.settings.invert_mouse_y_axis": "Asse Y del Mouse Invertito", - "hud.settings.free_look_behavior": "Comportamento Visuale Libera" + "hud.settings.free_look_behavior": "Comportamento Visuale Libera", @@ -355,58 +355,40 @@ Attiva/Disattiva Nomi Attiva/Disattiva Schermo Intero - - Movimento in Avanti Movimento a Sinistra Movimento a Destra Movimento all’Indietro - Salto - Aliante - Schivata - Rotolata - Scalata - Discesa - Camminata Automatica - Riporre/Sfoderare Armi - Mettere/Rimuovere Elmo - Sedersi - Cavalcatura - Interagire - - Attacco Base Attacco Secondario/Parata/Mira - - Slot 1 Barra delle Abilità Slot 2 Barra delle Abilità Slot 3 Barra delle Abilità @@ -419,8 +401,6 @@ Slot 9 Barra delle Abilità Slot 10 Barra delle Abilità - - Menù di Pausa Impostazioni Social @@ -432,23 +412,15 @@ Borsa - - - Invia Messaggio nella Chat Scorrimento della Chat - - Camera Libera Comandi della Chat: - - - /alias [Name] - Cambia il tuo Nome nella Chat /tp [Name] - Ti teleporta da un altro giocatore /jump - Devia la tua posizione @@ -456,10 +428,7 @@ Comandi della Chat: /kill - Suicidati /pig - Fai apparire un maiale PNG /wolf - Fai apparire un lupo PNG -/help - Mostra comandi della Chat - - -"#, +/help - Mostra comandi della Chat"#, @@ -468,7 +437,7 @@ Comandi della Chat: "hud.social.online": "Online", "hud.social.friends": "Amici", "hud.social.not_yet_available": "Non ancora disponibile", - "hud.social.Faction": "Fazione", + "hud.social.faction": "Fazione", "hud.social.play_online_fmt": "{nb_player} giocatore/i online", @@ -476,7 +445,7 @@ Comandi della Chat: "hud.spell": "Incantesimo", - "hud.free_look_indicator": "Visuale Libera Attiva" + "hud.free_look_indicator": "Visuale Libera Attiva", /// End HUD section @@ -556,4 +525,4 @@ Volontà "esc_menu.quit_game": "Esci dal Gioco", /// End Escape Menu Section } -) \ No newline at end of file +) From eb7b1a2ff41c50539f34becdde2109166834fd5d Mon Sep 17 00:00:00 2001 From: Capucho Date: Fri, 27 Mar 2020 16:11:47 +0000 Subject: [PATCH 09/14] Added a portuguese translation --- CHANGELOG.md | 2 + .../haxrcorp_4089_cyrillic_altgr_extended.ttf | Bin 23628 -> 25284 bytes assets/voxygen/i18n/en.ron | 1 + assets/voxygen/i18n/pt_PT.ron | 372 ++++++++++++++++++ voxygen/src/menu/main/ui.rs | 2 +- 5 files changed, 376 insertions(+), 1 deletion(-) create mode 100644 assets/voxygen/i18n/pt_PT.ron diff --git a/CHANGELOG.md b/CHANGELOG.md index a579276f06..341d89117a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added gamepad/controller support - Added player feedback when attempting to pickup an item with a full inventory - Added free look +- Added Italian translation +- Added Portuguese translation ### Changed diff --git a/assets/voxygen/font/haxrcorp_4089_cyrillic_altgr_extended.ttf b/assets/voxygen/font/haxrcorp_4089_cyrillic_altgr_extended.ttf index 808a9fd055a021d7bedd9230cfd6745246a824be..cc9d503b2c30b3faf672a066143f455e119ca3bb 100644 GIT binary patch delta 1801 zcmZuxYfKbZ6#nimtSGze`#t*vgrE`X3R1On)(6tW2eC@j8Y{?SRi1*1wz5-eea9eU z8`B_KQYkfQV~anGq3N1ff|OEAjcx5C)KY&~Ym2oFH5;a9Rx}tplY7scd**)UeCOVL z{TJBf&sZ1?fCd7TD9q1axpepH(jS15PFm#_FI<$5G-e_H0Qv6aFJ{i%(D_#;z*dvL zVPjQsZDGgCcY*j(K&h%IuCJ9OLPCi^@q~)Xo#k_NhmHV=DZs+qP+4(lTxOlTmvSH{ z6er6BDa4@CCVr*l#7#=0LILrp(jp2<4U@mD;z?zKJi6XdW+372pgJ-C7|@Fl*+b=)B0!}tULASy=VT~;~Ti_a-KNYU>o zI)qyo5z|$!X{V)AQk!&AYL(uWPDpP_Z%QrFF{xQP8a*7{8!d{?i29@Mq5DJkz{EOL zswk**sVc=3${gb&+X)YYV%$^E-=286W{CG!eHsKxW04A)t5Jt~Y()dMV;lL6*oB>V z1+Nm9-3UX#Yj_=duowIA1`c394&o5uxmcNu%68CfH4p|slXj}MK)XSEM0-wqO{do7>B@C`b?v%A-95cQKU2R#U#V}= zNA&&rVSUu#H!L))H?$gh4G)YuV}>!`7&0~*j~mY#ubbjbDPdEQ>42%-G+?@ER+vrZ z8Riw{Qu99ZIrA;^n8jqtu;g1xEPE`imdlnqR)aOmT4=4cHd#+t&s%@8j@fLs`L>X) z$<}83*fwArvW?mu_6&Q0z1n`%-eK>y58CfKra00ayko6HaI`sk9Cw@s=X7Vjv)tL} zY<8~cboM##aB41(E8&{C4sL)Ob4_>Ux*A*`x-Png-3E7#d%e5K-Qn(ck9s&yt|#Pa z_Vjojc>Uh_-fC})x7+)zchqO`@xG9+)fe#%`iA}Rb6stdf3b)oe1Ui{$cwLe8^w{S zy!fwoiCC7NB`)%v7DpDX6@T;XSsX7P4C56%UG7Opgce4?m>n<&Xeeo<>I1QtrzaAT zz(;rmWM@pCnJ^~EL#*`wSfq+!ft{Iv`YqP(zLX(+mQ&RhStVTgwcQ^pIn!U+$O zkp@_wp)|?QGc%#fU$f=JMB_QCz(;mA4cR{*3sNeeV9;83I2or(*w7Fdv2NcNR=?e6x{+b;VT{@#jK>7)niO8Gj$OC$L_f0B> zJ=_`T>X^DXlj+2}tFA09K{JVD8Tv>l`!PULdKDEUnAb>7Hj|KSAt|ZEY1EK>)slSG klX%Gzw&SsY?IsBelZcUkbqyEg#VeRrOj(zz?C9S09|0fEMF0Q* delta 1103 zcmYjPdrVtp6hF7Ul(P0ddV72Oy1hl-V+^*62wT_9jj@NDL&g|xWl$)z8?Q1tES*|{ zQ}>4>xJz(Zh#^}rIMJ994ViHkoC`*rW+MbhH5KPVmd&Wcgv{FOSN&%vIo~= zYJ}?=T3x>PzUci7AZY@{mOQRbpCqA^z^O#M($mu2v^3Gh0i+BAY;}7ZU2Z&|zmB*F z(ju?7G33HOz`|%Vivk(mR)64Vk8}@Vbf7%m(%#_uy!pdHfaD;OmjDwd75Sk=V-hb( z2qr^ILZ1{w%JC#cvNC0jN==XytzopRj?){ACNpmltf^0>rDtSjW#_ETU6;2$zhJ{g z+tY>56g^v9vT3t@i(~7y=eF-aBd}}tp1sfS+yBCW@)s)(RvxN4T>a9Kqt2R)W3_dz z#C45GTU*)^uCKiVI#2omx=y_e&>aY(hvwzhCn$ip6#M6Y?}@bm+#Z0Y;{e`fI3Ye# z&WHL`W2&&~w(7AuOa+GZKIFT{q*~En2ykK4XMf1Y}2%8E^4l69xwt^%($5VbAh?S++dcO z$68)nrhP>_puM6EhqMvxDr;bE>=Cw?9c6E__jC#!tIOBz)%kS;x{r19x;V#jh1_n= z&2@2o+$UU^`$>=MGxT)%BbOJl zF)?#(|K%;YnE1!K`SFzX_JU;81x$v?MMv_N8$UvG`z`9^_h=sPzz;A7vv2~ALo;-M j4^F}<@Iw~_p&L#^2+euVxU - Deslocar a posição +/goto - Teletransporta-te para a posição +/kill - Suicidar +/pig - Invocar NPC de porco +/wolf - Invocar NPC do lobo +/help - Mostrar comandos de chat"#, + + "hud.social": "Social", + "hud.social.online": "Online", + "hud.social.friends": "Amigos", + "hud.social.not_yet_available": "Indisponível de momento", + "hud.social.faction": "Facção", + "hud.social.play_online_fmt": "{nb_player} jogador(es) online", + + "hud.spell": "Feitiço", + + "hud.free_look_indicator": "Rotação livre ativada", + /// End HUD section + + + /// Start chracter selection section + "char_selection.delete_permanently": "Deletar esta personagem permanentemente?", + "char_selection.change_server": "Mudar de servidor", + "char_selection.enter_world": "Entrar no mundo", + "char_selection.logout": "Desconectar", + "char_selection.create_new_charater": "Criar nova personagem", + "char_selection.character_creation": "Criação de personagem", + + "char_selection.human_default": "Humano padrão", + "char_selection.level_fmt": "Nível {level_nb}", + "char_selection.uncanny_valley": "Vale da estranheza", + "char_selection.plains_of_uncertainty": "Planícies da incerteza", + "char_selection.beard": "Barba", + "char_selection.hair_style": "Estilo do cabelo", + "char_selection.hair_color": "Cor do cabelo", + "char_selection.chest_color": "Cor do peitoral", + "char_selection.eye_color": "Cor dos olhos", + "char_selection.skin": "Cor da pele", + "char_selection.eyebrows": "Pestanas", + "char_selection.accessories": "Acessórios", + + /// End chracter selection section + + + /// Start character window section + "character_window.character_name": "Nome da personagem", + // Charater stats + "character_window.character_stats": r#"Resistência + +Aptidão fisíca + +Força de vontade +"#, + + + /// Start character window section + + + /// Start Escape Menu Section + "esc_menu.logout": "Desconectar", + "esc_menu.quit_game": "Sair do jogo", + /// End Escape Menu Section + } +) diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 8832cc7e59..25ed23f3df 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -428,7 +428,7 @@ impl MainMenuUi { .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .label_y(Relative::Scalar(2.0)) - .label("Accept") + .label(&self.voxygen_i18n.get("common.accept")) .label_font_size(self.fonts.cyri.scale(22)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) From b99f63a6214e88ad661bafdce8f6a971d4fc1e5e Mon Sep 17 00:00:00 2001 From: Capucho Date: Mon, 30 Mar 2020 22:00:46 +0100 Subject: [PATCH 10/14] Make so that the resume button doesn't eject the mouse --- voxygen/src/hud/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index af37606609..8147eef49b 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1948,8 +1948,8 @@ impl Hud { }, Some(esc_menu::Event::Close) => { self.show.esc_menu = false; - self.show.want_grab = false; - self.force_ungrab = true; + self.show.want_grab = true; + self.force_ungrab = false; // Unpause the game if we are on singleplayer if let Some(singleplayer) = global_state.singleplayer.as_ref() { From a136dadf29d96d146f584d39e55b3122483dcb74 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Fri, 27 Mar 2020 20:28:46 +0300 Subject: [PATCH 11/14] Add Turkish (Turkey) translation file --- CHANGELOG.md | 1 + .../haxrcorp_4089_cyrillic_altgr_extended.ttf | Bin 25284 -> 26232 bytes assets/voxygen/i18n/tr_TR.ron | 388 ++++++++++++++++++ 3 files changed, 389 insertions(+) create mode 100644 assets/voxygen/i18n/tr_TR.ron diff --git a/CHANGELOG.md b/CHANGELOG.md index 341d89117a..c397eafe55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added free look - Added Italian translation - Added Portuguese translation +- Added Turkish translation ### Changed diff --git a/assets/voxygen/font/haxrcorp_4089_cyrillic_altgr_extended.ttf b/assets/voxygen/font/haxrcorp_4089_cyrillic_altgr_extended.ttf index cc9d503b2c30b3faf672a066143f455e119ca3bb..4a439b7fd31f43899eaecfb2815fb53c1cb65073 100644 GIT binary patch delta 2093 zcmbVNeQXp}5TCcZx3~9w*Zbbv+uPf1d#F{~9z82!U9{FxwU9v2R4DBMrD6+3s@7V1 zCty`TMb>D=hCfVWz=Why(x@?d8Z?Lm(KJ;Fe^fLL(P&UpQ}FCMdx|M0hQv3Sdoyol z-o4+phBfTaw8D(`IV z=^_cZ3+>hDFKue=T>sA0lPpu&6-B1Stq%<4chVlHp4^E4O`)1coZH%{V{kPdZ7=t zK?YBfg(qM;?1UZgBs>KJ@C-Z+yI?nN6xHtMB+`RY*q_F@e+KcB0PzwZT9oKocmOuQ zgJ|r4jj*ZU)CpJ+=z`~sSdF$6XGE%jYN7_Hqtpa7LyL5ZUPtet570;H3Hm(4G388} z>0=HsA2Mf|UrdbYT2qaw!IU<=XnM_b%JdWKWaqJs>?7w?SDouVSFdZI>pj;wH|wr(cew}MWA1Se<0 zP85CbwR(%a4c;E_PVbQSsP~LF?+f@=__DquzT>`gzFEKIFZbW=Py3(qzw196a0b*s zQ(z#lKk!cAWMC?24GO`UV0-XDa4dK-crG{_;zJ8VD?)vt;n0cD`7jrr7fywjg*(D8 zg~!6D!4{ALK{)FZgp2h?GX^BF&NR$garikq;x2kr|;#s1{ZV{lc(t zLikRYjf&CoXnnLLx;;7^Jr?~<_qG*DIle!W@)E1 zB8^KI;!?am-XA{_KNG(sm&y%tx4c&#kx$7pibGOXC_Tz9Wk`8T86PdSP17mka^MXi zIfwvMR3+z_0A5xuO_U~*BB`t)w~{1lzUl(4E%o~|pSb7A z4uQl>@oRlf6BlEuuDbAEPR(9EG?_6u?EE}m&}`@2w|oCn`C}S!WYydpO!)Z($mm%t z(O3TfT8MD|7Z}WJ0y&74N*e5W_o_Gyq?s$QznMj7IC5nBebrr>14 z6j{NBt6m6V8^=I_1Y8I6wY~&jYjhKKb)l;a`NqHHe|MM;e>K?Ud2XX=dvEYtj3)#1 z-S`f*Bo-!(G#Y#hN&2@eUc8v7;jl5q;}uyfA=1OqXjBk{Xmn95R%lOcOWZf=xqiWX za}cpngw|@z?^_PTCy<7{uudyl-C&0qxCocvOZXk~qpMbzn6w?~5D92Q=@R--#lWB4 Cu=8vH delta 1284 zcmZ`(eM}Q)7=P}wch_t0+Frk|AGD?7MhKv8giJ;n$2yj5*g0aHG1~HF=lCeX7&4?C zI%UWV|F;SXY(&SZ|4hj-Q80;owLuk)3PmxHhovmo4uuzUNPMVrH^ zzls2`T?mJ3ns2={gJkqs-j9zlR!MPzwuDRR)f>d2zj zwOrH#N}|#Fc!c~MyM_u%$l;GRwRau_bqV2b0Lb#jmfFa#RaagEU=fY`nj)Ps%md|! zFGUVdbEK*MkGsRI0NeKf@Kdptw)Sf^@CCpg)R2B_T^tg4{!+p5eL~qI(2^((VEU!j z-`4ESBt6lkE~yEH#I~@)S~w;`nG(PzIUMm=0zD>`9^9vd2};?7AHi`@zQ&UXew?OA zFa82#k>0g$=mZiLkbMq3XtyRu2R(2JF2fZ309WBB_!+LlO{9Dg{)ESnRqAN3c^ZC1 z%p78VLCgXy!2|eP8KrY`N7U2mu=<($sXC;7q7JGjvnR4gvpcheSzp$@@Ni)TFy#SV zJfxx0UX32x3a}sbY=%~7gM-ix9q=x~ozMk`;C<*u?{XO8kbn>12=u~HI0hd=9~_5| zpdZz7DaRQP_8!{V%{3_R-wV@Y0>)!H#N;|^Aqov}0Fm#&+t9Qg)Ce(TTM+M1idcW# zkB9IuK7fzoxA0ZMPm~b{h#}$(F;3hfmPtKXLPp76@(ejm-XSv-M-@{QREUaFr>PV* zPd%h1x{$7>yXmv^1U*kb*2tQW=AdR+lhRz*EHMltF?mcGQ_XZRCz-R%By*d2%rdNp ztz@g&4t5~Urr1gL2D`-3oXiz+LGA$8&!xEUxJB;1R@4?~tF$rgDeVRAoc2C1@_xRA zui`uSQGS}gtK)UWx+-0xZd7+gx1yKzyY)T#G5t*e1WCvfDuu8xAetI^h8>1R!;oRp5T7wD8nQ;8vBJ35IAWYOJ~4@=d{fXAHFcU!na-N7OQhtN zc1nHHm^3ThG2>>*Txi~5t}`DqpEEC+S1pny-x9RcSb8lZmdloVR-?7p8nVW$J=S6C z1?z3=s?BEGW{cW-Y@@cXY_qlnTgEQi^X--PX8XywJ!zk?&)Jt{PJTuX$h+l)JStDg z_Z&t?fg|W>aCABb9Vy2Z$2}+SEO*v82c1dhtaH^>;3{>syS{XdyB6I>cZqwiyT_e$ z&$u%=&YaSmXwG2HRL&ER&$G?b>>2V*cy4$yUW+&2je1AClioS+q7QsdGz#fG+D8PY zQ7-aU7i@Zdi}^+DznAic&Xyh$1ntw{Jn*96jsLT-MBwSIEE}yAV5`8ND&+8EhDInel`!w6p=P9FWD=oni^7$zv8h7Ck=qU#^)g - Pozisyonunu kaydır +/goto - Bir pozisyona ışınlan +/kill - Kendini öldür +/pig - Domuz NPC'si oluştur +/wolf - Kurt NPC'si oluştur +/help - Sohbet komutlarını göster"#, + + "hud.social": "Sosyal", + "hud.social.online": "Çevrimiçi", + "hud.social.friends": "Arkadaşlar", + "hud.social.not_yet_available": "Şu anda kullanılabilir değil", + "hud.social.faction": "Klan", + "hud.social.play_online_fmt": "{nb_player} oyuncu çevrimiçi", + + "hud.spell": "Büyü", + + "hud.free_look_indicator": "Serbest bakış açık", + /// End HUD section + + + /// Start chracter selection section + // Character delete question + "char_selection.delete_permanently": r#"Bu karakteri kalıcı olarak +silmek istediğinden emin misin?"#, + + "char_selection.change_server": "Sunucu Değiştir", + "char_selection.enter_world": "Dünyaya Gir", + "char_selection.logout": "Çıkış yap", + "char_selection.create_new_charater": "Yeni Karakter Oluştur", + "char_selection.character_creation": "Karakter Oluşumu", + + "char_selection.human_default": "İnsan Varsayılanı", + "char_selection.level_fmt": "Seviye {level_nb}", + "char_selection.uncanny_valley": "Esrarengiz Vadi", + "char_selection.plains_of_uncertainty": "Belirsizlik Ovaları", + "char_selection.beard": "Sakal", + "char_selection.hair_style": "Saç Stili", + "char_selection.hair_color": "Saç Rengi", + "char_selection.chest_color": "Göğüs Rengi", + "char_selection.eye_color": "Göz Rengi", + "char_selection.skin": "Deri", + "char_selection.eyebrows": "Kaşlar", + "char_selection.accessories": "Aksesuarlar", + + /// End chracter selection section + + + /// Start character window section + "character_window.character_name": "Karakter Adı", + // Charater stats + "character_window.character_stats": r#"Dayanıklılık + +Fiziksel yetenek + +İrade gücü +"#, + + + /// Start character window section + + + /// Start Escape Menu Section + "esc_menu.logout": "Çıkış yap", + "esc_menu.quit_game": "Oyundan çık", + /// End Escape Menu Section + } +) From dd673a3bccefc938eaf5c6a4a1109f157b8a9bd1 Mon Sep 17 00:00:00 2001 From: Marli Frost Date: Sat, 28 Mar 2020 13:12:35 +0000 Subject: [PATCH 12/14] allow the game to start without an audio device --- voxygen/src/audio/mod.rs | 7 ++----- voxygen/src/main.rs | 17 +++++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/voxygen/src/audio/mod.rs b/voxygen/src/audio/mod.rs index 1709649c89..299a8c53fe 100644 --- a/voxygen/src/audio/mod.rs +++ b/voxygen/src/audio/mod.rs @@ -238,11 +238,8 @@ impl AudioFrontend { /// Returns the default audio device. /// Does not return rodio Device struct in case our audio backend changes. -pub fn get_default_device() -> String { - rodio::default_output_device() - .expect("No audio output devices detected.") - .name() - .expect("Unable to get device name") +pub fn get_default_device() -> Option { + rodio::default_output_device().map(|dev| dev.name().expect("Unable to get device name")) } /// Returns a vec of the audio devices available. diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 43b6726ab6..f27beab1ff 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -44,15 +44,16 @@ fn main() { panic!("Failed to save settings: {:?}", err); } - let audio_device = || match &settings.audio.audio_device { - Some(d) => d.to_string(), - None => audio::get_default_device(), - }; + let audio_device = settings + .audio + .audio_device + .as_ref() + .map(|s| s.clone()) + .or_else(audio::get_default_device); - let mut audio = if settings.audio.audio_on { - AudioFrontend::new(audio_device(), settings.audio.max_sfx_channels) - } else { - AudioFrontend::no_audio() + let mut audio = match (audio_device, settings.audio.audio_on) { + (Some(dev), true) => AudioFrontend::new(dev, settings.audio.max_sfx_channels), + _ => AudioFrontend::no_audio() }; audio.set_music_volume(settings.audio.music_volume); From b5d4e7c89b496159e0adbe177fb4a78e99583bc1 Mon Sep 17 00:00:00 2001 From: Marli Frost Date: Tue, 31 Mar 2020 18:02:26 +0100 Subject: [PATCH 13/14] fix: avoid rodio API when audio is disabled --- voxygen/src/main.rs | 24 ++++++++++++++---------- voxygen/src/settings.rs | 5 +++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index f27beab1ff..f874529d10 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -1,4 +1,5 @@ #![deny(unsafe_code)] +#![feature(bool_to_option)] #![recursion_limit = "2048"] use veloren_voxygen::{ @@ -44,17 +45,20 @@ fn main() { panic!("Failed to save settings: {:?}", err); } - let audio_device = settings + let mut audio = settings .audio - .audio_device - .as_ref() - .map(|s| s.clone()) - .or_else(audio::get_default_device); - - let mut audio = match (audio_device, settings.audio.audio_on) { - (Some(dev), true) => AudioFrontend::new(dev, settings.audio.max_sfx_channels), - _ => AudioFrontend::no_audio() - }; + .audio_on + .then(|| { + settings + .audio + .audio_device + .as_ref() + .map(Clone::clone) + .or_else(audio::get_default_device) + }) + .flatten() + .map(|dev| AudioFrontend::new(dev, settings.audio.max_sfx_channels)) + .unwrap_or_else(AudioFrontend::no_audio); audio.set_music_volume(settings.audio.music_volume); audio.set_sfx_volume(settings.audio.sfx_volume); diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index a8ce79e0b4..59583661e4 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -474,6 +474,11 @@ pub struct AudioSettings { /// Audio Device that Voxygen will use to play audio. pub audio_device: Option, + /// Veloren's audio system wont work on some systems, + /// so you can use this to disable it, and allow the + /// game to function + // If this option is disabled, functions in the rodio + // library MUST NOT be called. pub audio_on: bool, } From 74e9adac39d8eb6f3ca64ca8649a896f5a824c98 Mon Sep 17 00:00:00 2001 From: Marli Frost Date: Tue, 31 Mar 2020 19:12:49 +0100 Subject: [PATCH 14/14] feat: configure audio output using an enum --- voxygen/src/main.rs | 23 ++++++++--------------- voxygen/src/menu/main/mod.rs | 2 +- voxygen/src/session.rs | 3 ++- voxygen/src/settings.rs | 30 +++++++++++++++++++++--------- 4 files changed, 32 insertions(+), 26 deletions(-) diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index f874529d10..72382f5ecd 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -8,7 +8,7 @@ use veloren_voxygen::{ logging, menu::main::MainMenuState, meta::Meta, - settings::Settings, + settings::{AudioOutput, Settings}, window::Window, Direction, GlobalState, PlayState, PlayStateResult, }; @@ -45,20 +45,13 @@ fn main() { panic!("Failed to save settings: {:?}", err); } - let mut audio = settings - .audio - .audio_on - .then(|| { - settings - .audio - .audio_device - .as_ref() - .map(Clone::clone) - .or_else(audio::get_default_device) - }) - .flatten() - .map(|dev| AudioFrontend::new(dev, settings.audio.max_sfx_channels)) - .unwrap_or_else(AudioFrontend::no_audio); + let mut audio = match settings.audio.output { + AudioOutput::Off => None, + AudioOutput::Automatic => audio::get_default_device(), + AudioOutput::Device(ref dev) => Some(dev.clone()), + } + .map(|dev| AudioFrontend::new(dev, settings.audio.max_sfx_channels)) + .unwrap_or_else(AudioFrontend::no_audio); audio.set_music_volume(settings.audio.music_volume); audio.set_sfx_volume(settings.audio.sfx_volume); diff --git a/voxygen/src/menu/main/mod.rs b/voxygen/src/menu/main/mod.rs index 145d8e9b16..3e873f048d 100644 --- a/voxygen/src/menu/main/mod.rs +++ b/voxygen/src/menu/main/mod.rs @@ -36,7 +36,7 @@ impl PlayState for MainMenuState { let mut client_init: Option = None; // Kick off title music - if global_state.settings.audio.audio_on && global_state.audio.music_enabled() { + if global_state.settings.audio.output.is_enabled() && global_state.audio.music_enabled() { global_state.audio.play_title_music(); } diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 335b06b21d..2f1220c070 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -6,6 +6,7 @@ use crate::{ menu::char_selection::CharSelectionState, render::Renderer, scene::{camera, Scene, SceneData}, + settings::AudioOutput, window::{AnalogGameInput, Event, GameInput}, Direction, Error, GlobalState, PlayState, PlayStateResult, }; @@ -613,7 +614,7 @@ impl PlayState for SessionState { HudEvent::ChangeAudioDevice(name) => { global_state.audio.set_device(name.clone()); - global_state.settings.audio.audio_device = Some(name); + global_state.settings.audio.output = AudioOutput::Device(name); global_state.settings.save_to_file_warn(); }, HudEvent::ChangeMaxFPS(fps) => { diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 59583661e4..e28132f592 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -461,7 +461,26 @@ impl Default for GraphicsSettings { } } } +#[derive(Clone, Debug, Serialize, Deserialize)] +pub enum AudioOutput { + /// Veloren's audio system wont work on some systems, + /// so you can use this to disable it, and allow the + /// game to function + // If this option is disabled, functions in the rodio + // library MUST NOT be called. + Off, + Automatic, + Device(String), +} +impl AudioOutput { + pub fn is_enabled(&self) -> bool { + match self { + Self::Off => false, + _ => true, + } + } +} /// `AudioSettings` controls the volume of different audio subsystems and which /// device is used. #[derive(Clone, Debug, Serialize, Deserialize)] @@ -473,13 +492,7 @@ pub struct AudioSettings { pub max_sfx_channels: usize, /// Audio Device that Voxygen will use to play audio. - pub audio_device: Option, - /// Veloren's audio system wont work on some systems, - /// so you can use this to disable it, and allow the - /// game to function - // If this option is disabled, functions in the rodio - // library MUST NOT be called. - pub audio_on: bool, + pub output: AudioOutput, } impl Default for AudioSettings { @@ -489,8 +502,7 @@ impl Default for AudioSettings { music_volume: 0.4, sfx_volume: 0.6, max_sfx_channels: 10, - audio_device: None, - audio_on: true, + output: AudioOutput::Automatic, } } }