From 2263b9be95e0d6ab6c79a4615a3539d52ce4c8f3 Mon Sep 17 00:00:00 2001 From: Pfauenauge90 <44173739+Pfauenauge90@users.noreply.github.com> Date: Thu, 9 Apr 2020 01:23:51 +0200 Subject: [PATCH] starter chest, removed unused key commands --- .../items/armor/starter/rugged_chest.ron | 8 ++ assets/voxygen/i18n/de_DE.ron | 8 +- assets/voxygen/i18n/en.ron | 4 +- assets/voxygen/item_image_manifest.ron | 4 + assets/voxygen/voxel/armor/chest/rugged-0.vox | 3 + .../voxel/humanoid_armor_chest_manifest.ron | 4 + common/src/comp/inventory/item/armor.rs | 4 +- server/src/state_ext.rs | 4 +- voxygen/src/controller.rs | 12 +-- voxygen/src/hud/bag.rs | 74 ++++++++++++------- voxygen/src/menu/char_selection/ui.rs | 7 +- voxygen/src/session.rs | 8 +- voxygen/src/settings.rs | 8 +- voxygen/src/window.rs | 9 ++- 14 files changed, 103 insertions(+), 54 deletions(-) create mode 100644 assets/common/items/armor/starter/rugged_chest.ron create mode 100644 assets/voxygen/voxel/armor/chest/rugged-0.vox diff --git a/assets/common/items/armor/starter/rugged_chest.ron b/assets/common/items/armor/starter/rugged_chest.ron new file mode 100644 index 0000000000..63ff3e0835 --- /dev/null +++ b/assets/common/items/armor/starter/rugged_chest.ron @@ -0,0 +1,8 @@ +Item( + name: "Rugged Shirt", + description: "Smells like Adventure.", + kind: Armor( + kind: Chest(Rugged0), + stats: (20), + ), +) diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index 6ee6d367f1..a36aee2c6d 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -155,9 +155,7 @@ eurer erstellen Charaktere gespeichert."#, "hud.press_key_to_toggle_debug_info_fmt": "Drückt {key} um die Debug-Info zu zeigen", /// Respawn message - "hud.press_key_to_respawn": r#"Drückt {key} um am letzten Lagerfeuer wiederbelebt zu werden. - -Drückt Enter und tippt /waypoint in den Chat um den Wegpunkt hier zu erstellen."#, + "hud.press_key_to_respawn": r#"Drückt {key} um am letzten Lagerfeuer wiederbelebt zu werden."#, /// Welcome message "hud.welcome": r#"Willkommen zur Veloren Alpha. @@ -209,6 +207,8 @@ Viel Spaß in der Welt von Veloren, Abenteurer!"#, "hud.bag.chest": "Brust", "hud.bag.hands": "Hände", "hud.bag.lantern": "Laterne", + "hud.bag.belt": "Gürtel", + "hud.bag.ring": "Ring", "hud.bag.back": "Rücken", "hud.bag.legs": "Beine", "hud.bag.feet": "Füße", @@ -321,7 +321,7 @@ Viel Spaß in der Welt von Veloren, Abenteurer!"#, "gameinput.charge": "Anstürmen", "gameinput.togglewield": "Waffe ziehen/wegstecken", "gameinput.interact": "Interagieren", - "gameinput.freelook": "Freies Umsehen", + "gameinput.freelook": "Freie Sicht", /// End GameInput section diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index 18beb7df1c..b78b7bceda 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -202,6 +202,8 @@ Enjoy your stay in the World of Veloren."#, "hud.bag.chest": "Chest", "hud.bag.hands": "Hands", "hud.bag.lantern": "Lantern", + "hud.bag.belt": "Belt", + "hud.bag.ring": "Ring", "hud.bag.back": "Back", "hud.bag.legs": "Legs", "hud.bag.feet": "Feet", @@ -317,7 +319,7 @@ Enjoy your stay in the World of Veloren."#, "gameinput.togglewield": "Toggle Wield", "gameinput.interact": "Interact", "gameinput.freelook": "Free Look", - + /// End GameInput section diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index f27302c55f..94bf948ef0 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -68,6 +68,10 @@ "voxel.armor.pants.rugged-0", (0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.2, ), + Armor(Chest(Rugged0)): VoxTrans( + "voxel.armor.chest.rugged-0", + (0.0, 0.0, 0.0), (-90.0, 180.0, 0.0), 1.2, + ), // Assassin Set Armor(Chest(Assassin)): VoxTrans( "voxel.armor.chest.assa", diff --git a/assets/voxygen/voxel/armor/chest/rugged-0.vox b/assets/voxygen/voxel/armor/chest/rugged-0.vox new file mode 100644 index 0000000000..f042bf2d91 --- /dev/null +++ b/assets/voxygen/voxel/armor/chest/rugged-0.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1b5e831f03af420439b79abb1b71d33846823acbeffd73f54bc2119bd376576 +size 2664 diff --git a/assets/voxygen/voxel/humanoid_armor_chest_manifest.ron b/assets/voxygen/voxel/humanoid_armor_chest_manifest.ron index a311ef9ae7..f64477d328 100644 --- a/assets/voxygen/voxel/humanoid_armor_chest_manifest.ron +++ b/assets/voxygen/voxel/humanoid_armor_chest_manifest.ron @@ -56,5 +56,9 @@ vox_spec: ("armor.chest.cloth_green-0", (-7.0, -3.5, 1.0)), color: None ), + Rugged0:( + vox_spec: ("armor.chest.rugged-0", (-7.0, -3.5, 2.0)), + color: None + ), }, )) diff --git a/common/src/comp/inventory/item/armor.rs b/common/src/comp/inventory/item/armor.rs index 1ab163268a..b212474273 100644 --- a/common/src/comp/inventory/item/armor.rs +++ b/common/src/comp/inventory/item/armor.rs @@ -14,8 +14,9 @@ pub enum Chest { ClothPurple0 = 11, ClothBlue0 = 12, ClothGreen0 = 13, + Rugged0 = 14, } -pub const ALL_CHESTS: [Chest; 13] = [ +pub const ALL_CHESTS: [Chest; 14] = [ Chest::Blue, Chest::Brown, Chest::Dark, @@ -29,6 +30,7 @@ pub const ALL_CHESTS: [Chest; 13] = [ Chest::ClothPurple0, Chest::ClothBlue0, Chest::ClothGreen0, + Chest::Rugged0, ]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] diff --git a/server/src/state_ext.rs b/server/src/state_ext.rs index 12b559293b..b5c178a23a 100644 --- a/server/src/state_ext.rs +++ b/server/src/state_ext.rs @@ -179,7 +179,9 @@ impl StateExt for State { }), second_item: None, shoulder: None, - chest: None, + chest: Some(assets::load_expect_cloned( + "common.items.armor.starter.rugged_chest", + )), belt: None, hand: None, pants: Some(assets::load_expect_cloned( diff --git a/voxygen/src/controller.rs b/voxygen/src/controller.rs index 6fe0d76260..a0a47836c3 100644 --- a/voxygen/src/controller.rs +++ b/voxygen/src/controller.rs @@ -103,9 +103,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings { map.entry(settings.game_buttons.climb_down) .or_default() .push(GameInput::ClimbDown); - map.entry(settings.game_buttons.wall_leap) - .or_default() - .push(GameInput::WallLeap); + /*map.entry(settings.game_buttons.wall_leap) + .or_default() + .push(GameInput::WallLeap);*/ map.entry(settings.game_buttons.mount) .or_default() .push(GameInput::Mount); @@ -157,9 +157,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings { map.entry(settings.game_buttons.swap_loadout) .or_default() .push(GameInput::SwapLoadout); - map.entry(settings.game_buttons.charge) - .or_default() - .push(GameInput::Charge); + /*map.entry(settings.game_buttons.charge) + .or_default() + .push(GameInput::Charge);*/ map }, menu_button_map: { diff --git a/voxygen/src/hud/bag.rs b/voxygen/src/hud/bag.rs index 3fb33df9ac..a4a21791de 100644 --- a/voxygen/src/hud/bag.rs +++ b/voxygen/src/hud/bag.rs @@ -336,7 +336,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .head .as_ref() - .map_or(("Head", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.head"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Head, [45.0; 2]) .mid_top_with_margin_on(state.ids.bg_frame, 60.0) @@ -347,7 +349,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .neck .as_ref() - .map_or(("Neck", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.neck"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Neck, [45.0; 2]) .mid_bottom_with_margin_on(state.ids.head_slot, -55.0) @@ -359,7 +363,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .chest .as_ref() - .map_or(("Chest", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.chest"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Chest, [85.0; 2]) .mid_bottom_with_margin_on(state.ids.neck_slot, -95.0) @@ -367,10 +373,10 @@ impl<'a> Widget for Bag<'a> { .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.chest_slot, ui); // Shoulders - let (title, desc) = loadout - .shoulder - .as_ref() - .map_or(("Shoulders", ""), |item| (item.name(), item.description())); + let (title, desc) = loadout.shoulder.as_ref().map_or( + (self.localized_strings.get("hud.bag.shoulders"), ""), + |item| (item.name(), item.description()), + ); slot_maker .fabricate(ArmorSlot::Shoulders, [70.0; 2]) .bottom_left_with_margins_on(state.ids.chest_slot, 0.0, -80.0) @@ -381,7 +387,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .hand .as_ref() - .map_or(("Hands", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.hands"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Hands, [70.0; 2]) .bottom_right_with_margins_on(state.ids.chest_slot, 0.0, -80.0) @@ -392,7 +400,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .belt .as_ref() - .map_or(("Belt", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.belt"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Belt, [45.0; 2]) .mid_bottom_with_margin_on(state.ids.chest_slot, -55.0) @@ -403,7 +413,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .pants .as_ref() - .map_or(("Legs", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.legs"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Legs, [85.0; 2]) .mid_bottom_with_margin_on(state.ids.belt_slot, -95.0) @@ -411,10 +423,10 @@ impl<'a> Widget for Bag<'a> { .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.legs_slot, ui); // Lantern - let (title, desc) = loadout - .lantern - .as_ref() - .map_or(("Lantern", ""), |item| (item.name(), item.description())); + let (title, desc) = loadout.lantern.as_ref().map_or( + (self.localized_strings.get("hud.bag.lantern"), ""), + |item| (item.name(), item.description()), + ); slot_maker .fabricate(ArmorSlot::Lantern, [45.0; 2]) .bottom_right_with_margins_on(state.ids.shoulders_slot, -55.0, 0.0) @@ -425,7 +437,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .ring .as_ref() - .map_or(("Ring", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.ring"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Ring, [45.0; 2]) .bottom_left_with_margins_on(state.ids.hands_slot, -55.0, 0.0) @@ -436,7 +450,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .back .as_ref() - .map_or(("Back", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.back"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Back, [45.0; 2]) .down_from(state.ids.lantern_slot, 10.0) @@ -447,7 +463,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .foot .as_ref() - .map_or(("Feet", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.feet"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Feet, [45.0; 2]) .down_from(state.ids.ring_slot, 10.0) @@ -458,7 +476,9 @@ impl<'a> Widget for Bag<'a> { let (title, desc) = loadout .tabard .as_ref() - .map_or(("Tabard", ""), |item| (item.name(), item.description())); + .map_or((self.localized_strings.get("hud.bag.tabard"), ""), |item| { + (item.name(), item.description()) + }); slot_maker .fabricate(ArmorSlot::Tabard, [70.0; 2]) .top_right_with_margins_on(state.ids.bg_frame, 80.5, 53.0) @@ -466,11 +486,10 @@ impl<'a> Widget for Bag<'a> { .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.tabard_slot, ui); // Mainhand/Left-Slot - let (title, desc) = loadout - .active_item - .as_ref() - .map(|i| &i.item) - .map_or(("Mainhand", ""), |item| (item.name(), item.description())); + let (title, desc) = loadout.active_item.as_ref().map(|i| &i.item).map_or( + (self.localized_strings.get("hud.bag.mainhand"), ""), + |item| (item.name(), item.description()), + ); slot_maker .fabricate(ArmorSlot::Mainhand, [85.0; 2]) .bottom_right_with_margins_on(state.ids.back_slot, -95.0, 0.0) @@ -478,11 +497,10 @@ impl<'a> Widget for Bag<'a> { .with_tooltip(self.tooltip_manager, title, desc, &item_tooltip) .set(state.ids.mainhand_slot, ui); // Offhand/Right-Slot - let (title, desc) = loadout - .second_item - .as_ref() - .map(|i| &i.item) - .map_or(("Offhand", ""), |item| (item.name(), item.description())); + let (title, desc) = loadout.second_item.as_ref().map(|i| &i.item).map_or( + (self.localized_strings.get("hud.bag.offhand"), ""), + |item| (item.name(), item.description()), + ); slot_maker .fabricate(ArmorSlot::Offhand, [85.0; 2]) .bottom_left_with_margins_on(state.ids.feet_slot, -95.0, 0.0) diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index 731b603776..4ea9422a5e 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -351,7 +351,9 @@ impl CharSelectionUi { }), second_item: None, shoulder: None, - chest: None, + chest: Some(assets::load_expect_cloned( + "common.items.armor.starter.rugged_chest", + )), belt: None, hand: None, pants: Some(assets::load_expect_cloned( @@ -378,6 +380,9 @@ impl CharSelectionUi { block_ability: None, dodge_ability: None, }); + loadout.chest = Some(assets::load_expect_cloned( + "common.items.armor.starter.rugged_chest", + )); loadout.pants = Some(assets::load_expect_cloned( "common.items.armor.starter.rugged_pants", )); diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index 5348c6f602..380a108603 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -336,9 +336,9 @@ impl PlayState for SessionState { Event::InputUpdate(GameInput::ClimbDown, state) => { self.key_state.climb_down = state; }, - Event::InputUpdate(GameInput::WallLeap, state) => { + /*Event::InputUpdate(GameInput::WallLeap, state) => { self.inputs.wall_leap.set_state(state) - }, + },*/ Event::InputUpdate(GameInput::ToggleWield, state) if state != self.key_state.toggle_wield => { @@ -420,9 +420,9 @@ impl PlayState for SessionState { } } }, - Event::InputUpdate(GameInput::Charge, state) => { + /*Event::InputUpdate(GameInput::Charge, state) => { self.inputs.charge.set_state(state); - }, + },*/ Event::InputUpdate(GameInput::FreeLook, state) => { match (global_state.settings.gameplay.free_look_behavior, state) { (PressBehavior::Toggle, true) => { diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index c062ae420f..139d61b896 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -119,7 +119,7 @@ impl ControlSettings { GameInput::Glide => KeyMouse::Key(VirtualKeyCode::LShift), GameInput::Climb => KeyMouse::Key(VirtualKeyCode::Space), GameInput::ClimbDown => KeyMouse::Key(VirtualKeyCode::LControl), - GameInput::WallLeap => MIDDLE_CLICK_KEY, + //GameInput::WallLeap => MIDDLE_CLICK_KEY, GameInput::Mount => KeyMouse::Key(VirtualKeyCode::F), GameInput::Map => KeyMouse::Key(VirtualKeyCode::M), GameInput::Bag => KeyMouse::Key(VirtualKeyCode::B), @@ -136,7 +136,7 @@ impl ControlSettings { GameInput::Respawn => KeyMouse::Key(VirtualKeyCode::Space), GameInput::Interact => KeyMouse::Mouse(MouseButton::Right), GameInput::ToggleWield => KeyMouse::Key(VirtualKeyCode::T), - GameInput::Charge => KeyMouse::Key(VirtualKeyCode::Key1), + //GameInput::Charge => KeyMouse::Key(VirtualKeyCode::Key1), GameInput::FreeLook => KeyMouse::Key(VirtualKeyCode::L), GameInput::Ability3 => KeyMouse::Key(VirtualKeyCode::Key1), GameInput::SwapLoadout => KeyMouse::Key(VirtualKeyCode::LAlt), @@ -165,7 +165,7 @@ impl Default for ControlSettings { GameInput::Glide, GameInput::Climb, GameInput::ClimbDown, - GameInput::WallLeap, + //GameInput::WallLeap, GameInput::Mount, GameInput::Enter, GameInput::Command, @@ -185,7 +185,7 @@ impl Default for ControlSettings { GameInput::Respawn, GameInput::Interact, GameInput::ToggleWield, - GameInput::Charge, + //GameInput::Charge, GameInput::FreeLook, GameInput::Ability3, GameInput::SwapLoadout, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index da2ff7f6a9..4a5102b8b1 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -6,6 +6,7 @@ use crate::{ }; use gilrs::{EventType, Gilrs}; use hashbrown::HashMap; + use log::{error, warn}; use serde_derive::{Deserialize, Serialize}; use std::fmt; @@ -27,7 +28,7 @@ pub enum GameInput { Glide, Climb, ClimbDown, - WallLeap, + //WallLeap, Mount, Enter, Command, @@ -47,7 +48,7 @@ pub enum GameInput { Respawn, Interact, ToggleWield, - Charge, + //Charge, SwapLoadout, FreeLook, } @@ -67,7 +68,7 @@ impl GameInput { GameInput::Glide => "gameinput.glide", GameInput::Climb => "gameinput.climb", GameInput::ClimbDown => "gameinput.climbdown", - GameInput::WallLeap => "gameinput.wallleap", + //GameInput::WallLeap => "gameinput.wallleap", GameInput::Mount => "gameinput.mount", GameInput::Enter => "gameinput.enter", GameInput::Command => "gameinput.command", @@ -87,7 +88,7 @@ impl GameInput { GameInput::Respawn => "gameinput.respawn", GameInput::Interact => "gameinput.interact", GameInput::ToggleWield => "gameinput.togglewield", - GameInput::Charge => "gameinput.charge", + //GameInput::Charge => "gameinput.charge", GameInput::FreeLook => "gameinput.freelook", GameInput::Ability3 => "gameinput.ability3", GameInput::SwapLoadout => "gameinput.swaploadout",