From 3f436079e8e1057f115339f4b2c6af17f2d32585 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Sat, 26 Dec 2020 12:25:50 +0100 Subject: [PATCH] Skill-Tree UI switchable tabs rework icons, fix cursor toggle auto slot placing Bow leap skill changed to bow glide skill. --- .../skill_trees/skill_prerequisites.ron | 2 +- .../skills_skill-groups_manifest.ron | 2 +- assets/voxygen/element/buttons/border.png | 4 +- assets/voxygen/element/buttons/border_mo.png | 4 +- .../voxygen/element/buttons/border_press.png | 4 +- .../element/buttons/border_pressed.png | 4 +- assets/voxygen/element/icons/axe.png | 4 +- assets/voxygen/element/icons/bow.png | 4 +- assets/voxygen/element/icons/daggers.png | 4 +- assets/voxygen/element/icons/danari_f.png | 4 +- assets/voxygen/element/icons/danari_m.png | 4 +- assets/voxygen/element/icons/dwarf_f.png | 4 +- assets/voxygen/element/icons/dwarf_m.png | 4 +- assets/voxygen/element/icons/elf_f.png | 4 +- assets/voxygen/element/icons/elf_m.png | 4 +- assets/voxygen/element/icons/hammer.png | 4 +- assets/voxygen/element/icons/human_f.png | 4 +- assets/voxygen/element/icons/human_m.png | 4 +- assets/voxygen/element/icons/orc_f.png | 4 +- assets/voxygen/element/icons/orc_m.png | 4 +- assets/voxygen/element/icons/sceptre.png | 4 +- assets/voxygen/element/icons/staff.png | 4 +- assets/voxygen/element/icons/sword.png | 4 +- assets/voxygen/element/icons/ud_f.png | 4 +- assets/voxygen/element/icons/ud_m.png | 4 +- assets/voxygen/element/misc_bg/diary_bg.png | 3 + .../voxygen/element/misc_bg/diary_frame.png | 3 + .../voxygen/element/misc_bg/sword_render.png | 3 + assets/voxygen/i18n/en.ron | 668 ++++++++++++++++++ client/src/lib.rs | 4 +- common/src/combat.rs | 7 +- common/src/comp/ability.rs | 6 +- common/src/comp/skills.rs | 2 +- voxygen/src/hud/img_ids.rs | 17 + voxygen/src/hud/mod.rs | 31 +- voxygen/src/hud/spell.rs | 414 ++++++++++- 36 files changed, 1159 insertions(+), 95 deletions(-) create mode 100644 assets/voxygen/element/misc_bg/diary_bg.png create mode 100644 assets/voxygen/element/misc_bg/diary_frame.png create mode 100644 assets/voxygen/element/misc_bg/sword_render.png diff --git a/assets/common/skill_trees/skill_prerequisites.ron b/assets/common/skill_trees/skill_prerequisites.ron index 581414c051..5d7e9aa7fc 100644 --- a/assets/common/skill_trees/skill_prerequisites.ron +++ b/assets/common/skill_trees/skill_prerequisites.ron @@ -46,7 +46,7 @@ Bow(CSpeed): {Bow(CDamage): Some(1)}, Bow(CMove): {Bow(CDamage): Some(1)}, Bow(RDamage): {Bow(UnlockRepeater): None}, - Bow(RLeap): {Bow(UnlockRepeater): None}, + Bow(RGlide): {Bow(UnlockRepeater): None}, Bow(RArrows): {Bow(UnlockRepeater): None}, Bow(RCost): {Bow(UnlockRepeater): None}, Staff(BDamage): {Staff(BExplosion): None}, diff --git a/assets/common/skill_trees/skills_skill-groups_manifest.ron b/assets/common/skill_trees/skills_skill-groups_manifest.ron index a9c6d1627d..c3318789fc 100644 --- a/assets/common/skill_trees/skills_skill-groups_manifest.ron +++ b/assets/common/skill_trees/skills_skill-groups_manifest.ron @@ -70,7 +70,7 @@ Bow(CMove), Bow(UnlockRepeater), Bow(RDamage), - Bow(RLeap), + Bow(RGlide), Bow(RArrows), Bow(RCost), ], diff --git a/assets/voxygen/element/buttons/border.png b/assets/voxygen/element/buttons/border.png index b73f4d68f5..bb997b3f9c 100644 --- a/assets/voxygen/element/buttons/border.png +++ b/assets/voxygen/element/buttons/border.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7245fce9bf3611341a321210574115ebe7da9bbda5322116330d8f9d965a01b -size 1947 +oid sha256:4e7e1a656e77aba743cf2ab59a7292bd80c396bce5405de5295b750685014caa +size 1752 diff --git a/assets/voxygen/element/buttons/border_mo.png b/assets/voxygen/element/buttons/border_mo.png index c1d2873a7e..0ffcee26b3 100644 --- a/assets/voxygen/element/buttons/border_mo.png +++ b/assets/voxygen/element/buttons/border_mo.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7e287e02aef5d7cef52cf6ba85bebeae96b069264c6506ffc69c709594085e40 -size 1941 +oid sha256:eb02334075a9fc888981aeb0a5d592ee9fbf16eaf64d90e254ba199ee4d70ffa +size 1774 diff --git a/assets/voxygen/element/buttons/border_press.png b/assets/voxygen/element/buttons/border_press.png index 5a4692bb1d..8b245d4b10 100644 --- a/assets/voxygen/element/buttons/border_press.png +++ b/assets/voxygen/element/buttons/border_press.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eba2a5e35ba1187e7bdf50001673e526d577d965948def6d42e7a86be150daf5 -size 1677 +oid sha256:a189eae831d2d950d4d73d2564c7b3fc01634db7c223e7975c3e5e8a49bc0b3c +size 1777 diff --git a/assets/voxygen/element/buttons/border_pressed.png b/assets/voxygen/element/buttons/border_pressed.png index fa6dbdfab4..65a385d336 100644 --- a/assets/voxygen/element/buttons/border_pressed.png +++ b/assets/voxygen/element/buttons/border_pressed.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b3c8d09b3b41c075294b3976f283f715745b25f0dea74363f5c5debcf9188e0b -size 1935 +oid sha256:bfc374a64d8076cd565344d011621da4d6c302b420bd209828dd13cfa403c7c5 +size 1771 diff --git a/assets/voxygen/element/icons/axe.png b/assets/voxygen/element/icons/axe.png index df36af1bdf..5b54c694ac 100644 --- a/assets/voxygen/element/icons/axe.png +++ b/assets/voxygen/element/icons/axe.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f3766a719e56fba6c580fddc9a64b735def734d162660e36b810909695036fb3 -size 1608 +oid sha256:02f2023183427408081b95f208c6808e5f0929edfc5972d0efbc21aef395acf8 +size 1753 diff --git a/assets/voxygen/element/icons/bow.png b/assets/voxygen/element/icons/bow.png index 512afbb7e6..162b496290 100644 --- a/assets/voxygen/element/icons/bow.png +++ b/assets/voxygen/element/icons/bow.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:84b5d77246b0810f4aa9becb0b031f86cd4c32e2d180f86b1863c4ab65949701 -size 1598 +oid sha256:3ac39560ea8797f57ffa6c9462845e2b6f860e14588a3f6fb23bb1918bd81d10 +size 1757 diff --git a/assets/voxygen/element/icons/daggers.png b/assets/voxygen/element/icons/daggers.png index 30c77e401a..b316c0e1fd 100644 --- a/assets/voxygen/element/icons/daggers.png +++ b/assets/voxygen/element/icons/daggers.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c96cbf8802204aa545d50ccb20088e36d9e00d260a32c6f48c3278448c1728ec -size 1630 +oid sha256:40bd670cbd50a15b2f889982af3539c16b12f399bf6b76757ecbbc7284ea4083 +size 1784 diff --git a/assets/voxygen/element/icons/danari_f.png b/assets/voxygen/element/icons/danari_f.png index 68d0fd614b..a2b87cd1cc 100644 --- a/assets/voxygen/element/icons/danari_f.png +++ b/assets/voxygen/element/icons/danari_f.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:76771174c0a15c9aa633f1b8485faec18cc4d336e3ffe7859a31272bd2fe19d4 -size 8884 +oid sha256:093755575780a74ca6ee7e56362a4d2a4365e23b0396a8d2bc9c09c93ca1c392 +size 9880 diff --git a/assets/voxygen/element/icons/danari_m.png b/assets/voxygen/element/icons/danari_m.png index 1514a37288..5b97a92fd4 100644 --- a/assets/voxygen/element/icons/danari_m.png +++ b/assets/voxygen/element/icons/danari_m.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e9794340d8421ea2609cf6fc084ad14799fbde117059b104276e1a590914de6f -size 15716 +oid sha256:e7407f4ed6f257107402a66f4341fa78655a999a53a2217f3d18be8692058d3c +size 16945 diff --git a/assets/voxygen/element/icons/dwarf_f.png b/assets/voxygen/element/icons/dwarf_f.png index 6046812192..f0f1034664 100644 --- a/assets/voxygen/element/icons/dwarf_f.png +++ b/assets/voxygen/element/icons/dwarf_f.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:371c993627f660a4e760a7cc28d7c9f6c010f11d11f5231508462e64d9830dbc -size 14064 +oid sha256:ed542857256694d022e466e6377c8c07097ed85a4358715a60e304a6d8262de5 +size 15233 diff --git a/assets/voxygen/element/icons/dwarf_m.png b/assets/voxygen/element/icons/dwarf_m.png index 0c24c2ce73..fc8ae3fca0 100644 --- a/assets/voxygen/element/icons/dwarf_m.png +++ b/assets/voxygen/element/icons/dwarf_m.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c827da2b55fce8ce6442214b66bac35d2ced14ef114b73e6dcd8642ecdb21f4e -size 17210 +oid sha256:9518b104894872162a80b50cb5d62bbd4f2deee32e3d25d7aaab407fe85f9edd +size 18356 diff --git a/assets/voxygen/element/icons/elf_f.png b/assets/voxygen/element/icons/elf_f.png index d39bb56612..58e85a865b 100644 --- a/assets/voxygen/element/icons/elf_f.png +++ b/assets/voxygen/element/icons/elf_f.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2fa0d68961a210d9eec82f9e1a1515393d94d7133caaefc9ae0ded6da54d43c0 -size 6813 +oid sha256:eccc1a9a42b6d6b78cf5017188e57b56556faa0b12208a9f8de17dd032a5aa9c +size 7853 diff --git a/assets/voxygen/element/icons/elf_m.png b/assets/voxygen/element/icons/elf_m.png index 26f18519a4..1006b0c2dd 100644 --- a/assets/voxygen/element/icons/elf_m.png +++ b/assets/voxygen/element/icons/elf_m.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f9accfbd032585de6fbcf7570bd8f14f13efc392793b1d7bd94a1c246cbec43a -size 19534 +oid sha256:dc53cb709de27513b4b9762bcd2bfeb7acf5e58c6cdf776bc837b6b41879a395 +size 20751 diff --git a/assets/voxygen/element/icons/hammer.png b/assets/voxygen/element/icons/hammer.png index 05ce709833..091292cf06 100644 --- a/assets/voxygen/element/icons/hammer.png +++ b/assets/voxygen/element/icons/hammer.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1d695a08986a980e94a59f3db480094aaf9cf564ca67a4b6e8026102c8651e0b -size 1592 +oid sha256:a1dd28a78fcf8dab0129da20526b197e5aa7076a8aa19a4f9b125f07c4b1fd0d +size 1744 diff --git a/assets/voxygen/element/icons/human_f.png b/assets/voxygen/element/icons/human_f.png index 22e187f85b..e5d389f9ff 100644 --- a/assets/voxygen/element/icons/human_f.png +++ b/assets/voxygen/element/icons/human_f.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4ede7d3668209620b7242937eb6d9e5c2e9fd190cbfbf3e345e3748c93c061f8 -size 19083 +oid sha256:e8c790a2d3787ddcea8cfdab545f8201052c4220c95a7468c7eb21f4bce572e5 +size 19738 diff --git a/assets/voxygen/element/icons/human_m.png b/assets/voxygen/element/icons/human_m.png index 042c7ae35d..e67129ed19 100644 --- a/assets/voxygen/element/icons/human_m.png +++ b/assets/voxygen/element/icons/human_m.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc8eebe95b3061b7ec014887fd405aea22694f4ac47d2d852e5ef46a797ed585 -size 23917 +oid sha256:ba312ca5b2fbae609ac993a71c0a3f9a54097576e839b87a2e37057485996957 +size 25024 diff --git a/assets/voxygen/element/icons/orc_f.png b/assets/voxygen/element/icons/orc_f.png index 15ecba956f..bd3d61fe62 100644 --- a/assets/voxygen/element/icons/orc_f.png +++ b/assets/voxygen/element/icons/orc_f.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5efae53235c444df2b8002b82bb10bd9df2d9473c82f2018dd5715c7bdffa96b -size 18594 +oid sha256:444046917b36dd93b57a63e845adca82f32e5a1718b2749172f0ea537d22c18e +size 19662 diff --git a/assets/voxygen/element/icons/orc_m.png b/assets/voxygen/element/icons/orc_m.png index 2036e0e2fb..a7cc15cb27 100644 --- a/assets/voxygen/element/icons/orc_m.png +++ b/assets/voxygen/element/icons/orc_m.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6dd5c5dc7a04233a70b55ba6f48b0e062aebbc1fcaf7ebde1edeeac366cd3d4 -size 15053 +oid sha256:362d408ac92000847c9aaddee19b5ea19c3cd34e0ef125917ca647ed4b20c9a2 +size 16275 diff --git a/assets/voxygen/element/icons/sceptre.png b/assets/voxygen/element/icons/sceptre.png index 5e88229405..809becfebc 100644 --- a/assets/voxygen/element/icons/sceptre.png +++ b/assets/voxygen/element/icons/sceptre.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc19fa33e33081df3e2405a235c4099b10d1aec2249f7466c64505065ac7d41a -size 2098 +oid sha256:3712cc033b1c3178abee7ecc808651fd149d9d0e2385e4a3d40f9f1c25372a1b +size 2048 diff --git a/assets/voxygen/element/icons/staff.png b/assets/voxygen/element/icons/staff.png index b1b45bec50..9c906a1540 100644 --- a/assets/voxygen/element/icons/staff.png +++ b/assets/voxygen/element/icons/staff.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a104cba26184e3aebf9448d9d1984a48aba1363ec0de0710630f7a93eb29981 -size 1590 +oid sha256:a426e3e15e67c4df4f3d575216e7aeeaa34f19675ce7ece82c72dc1c39371914 +size 1746 diff --git a/assets/voxygen/element/icons/sword.png b/assets/voxygen/element/icons/sword.png index 68872be34d..7bee8f2858 100644 --- a/assets/voxygen/element/icons/sword.png +++ b/assets/voxygen/element/icons/sword.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b77c2c81d822af671fd12cf49b9e6b797282a6f0af8f6cc4735c3914a52f891e -size 1600 +oid sha256:9db5daa9ed74a4fee302b34c0aa2f460a074ea8bf5b0c49456a270509d497a46 +size 1957 diff --git a/assets/voxygen/element/icons/ud_f.png b/assets/voxygen/element/icons/ud_f.png index 18ae92e417..0bc625643f 100644 --- a/assets/voxygen/element/icons/ud_f.png +++ b/assets/voxygen/element/icons/ud_f.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4e94f00ae5d656c868836b0d3d7d8dc5fcc2994f3f980cb113c0afcf88e9e04 -size 19327 +oid sha256:474562c8388dd299deb16937e30b9eb107b1a35500eb45fb6855eb88ac95230b +size 20227 diff --git a/assets/voxygen/element/icons/ud_m.png b/assets/voxygen/element/icons/ud_m.png index 1708a6f10b..6ed25eab51 100644 --- a/assets/voxygen/element/icons/ud_m.png +++ b/assets/voxygen/element/icons/ud_m.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:30f45391c02016663dcb2d503e94ec0b03420443cdffa5f25a0b3b51b0cc4250 -size 16108 +oid sha256:2d7f7583da247106505d5f630a14fae34b24048764414c10f40ffe0343b41543 +size 17352 diff --git a/assets/voxygen/element/misc_bg/diary_bg.png b/assets/voxygen/element/misc_bg/diary_bg.png new file mode 100644 index 0000000000..aa4640a080 --- /dev/null +++ b/assets/voxygen/element/misc_bg/diary_bg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d05be2cef5f590bae09c4c66717a8d804cfe25d2cc4592154ac512b34dc09ac +size 4075 diff --git a/assets/voxygen/element/misc_bg/diary_frame.png b/assets/voxygen/element/misc_bg/diary_frame.png new file mode 100644 index 0000000000..c6f5c89941 --- /dev/null +++ b/assets/voxygen/element/misc_bg/diary_frame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46dc7908200cbe5e06b936cf2187533239bd57e6121e9c823c1e2dd53bfe27ed +size 3860 diff --git a/assets/voxygen/element/misc_bg/sword_render.png b/assets/voxygen/element/misc_bg/sword_render.png new file mode 100644 index 0000000000..5f20a24624 --- /dev/null +++ b/assets/voxygen/element/misc_bg/sword_render.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f80b9a2b89dc673028b20a66a4c46666fe963a4021b245ab8e9fabec9cd72f5 +size 11974 diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index e69de29bb2..17a53e38a3 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -0,0 +1,668 @@ +/// 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! +/// +/// WARNING: Localization files shall be saved in UTF-8 format without BOM + +/// Localization for "global" English +( + metadata: ( + language_name: "English", + language_identifier: "en", + ), + 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": "username", + "common.singleplayer": "Singleplayer", + "common.multiplayer": "Multiplayer", + "common.servers": "Servers", + "common.quit": "Quit", + "common.settings": "Settings", + "common.languages": "Languages", + "common.interface": "Interface", + "common.gameplay": "Gameplay", + "common.controls": "Controls", + "common.video": "Graphics", + "common.sound": "Sound", + "common.languages": "Languages", + "common.resume": "Resume", + "common.characters": "Characters", + "common.close": "Close", + "common.yes": "Yes", + "common.no": "No", + "common.back": "Back", + "common.create": "Create", + "common.okay": "Okay", + "common.add": "Add", + "common.accept": "Accept", + "common.decline": "Decline", + "common.disclaimer": "Disclaimer", + "common.cancel": "Cancel", + "common.none": "None", + "common.error": "Error", + "common.fatal_error": "Fatal Error", + "common.you": "You", + "common.automatic": "Auto", + "common.random": "Random", + // Settings Window title + "common.interface_settings": "Interface Settings", + "common.gameplay_settings": "Gameplay Settings", + "common.controls_settings": "Controls Settings", + "common.video_settings": "Graphics Settings", + "common.sound_settings": "Sound Settings", + "common.language_settings": "Language Settings", + + // Message when connection to the server is lost + "common.connection_lost": r#"Connection lost! +Did the server restart? +Is the client up to date?"#, + + + "common.species.orc": "Orc", + "common.species.human": "Human", + "common.species.dwarf": "Dwarf", + "common.species.elf": "Elf", + "common.species.undead": "Undead", + "common.species.danari": "Danari", + + "common.weapons.axe": "Axe", + "common.weapons.sword": "Sword", + "common.weapons.staff": "Staff", + "common.weapons.bow": "Bow", + "common.weapons.hammer": "Hammer", + "common.weapons.sceptre": "Healing Sceptre", + "common.rand_appearance": "Random appearance and name", + /// End Common section + + + /// Start Main screen section + "main.username": "Username", + "main.server": "Server", + "main.password": "Password", + "main.connecting": "Connecting", + "main.creating_world": "Creating world", + "main.tip": "Tip:", + + // Welcome notice that appears the first time Veloren is started + "main.notice": r#"Welcome to the alpha version of Veloren! + +Before you dive into the fun, please keep a few things in mind: + +- This is a very early alpha. Expect bugs, extremely unfinished gameplay, unpolished mechanics, and missing features. + +- If you have constructive feedback or bug reports, you can contact us via Reddit, GitLab, or our community Discord server. + +- Veloren is licensed under the GPL 3 open-source licence. That means you're free to play, modify, and redistribute the game however + you wish (provided derived work is also under GPL 3). + +- Veloren is a non-profit community project, and everybody working on it is a volunteer. +If you like what you see, you're welcome to join the development or art teams! + +Thanks for taking the time to read this notice, we hope you enjoy the game! + +~ The Veloren Devs"#, + + // Login process description + "main.login_process": r#"Information on the Login Process: + +Please note that you now need an account +to play on auth-enabled servers. + +You can create an account over at + +https://veloren.net/account/."#, + "main.login.server_not_found": "Server not found", + "main.login.authentication_error": "Auth error on server", + "main.login.server_full": "Server is full", + "main.login.untrusted_auth_server": "Auth server not trusted", + "main.login.outdated_client_or_server": "ServerWentMad: Probably versions are incompatible, check for updates.", + "main.login.timeout": "Timeout: Server did not respond in time. (Overloaded or network issues).", + "main.login.server_shut_down": "Server shut down", + "main.login.already_logged_in": "You are already logged into the server.", + "main.login.network_error": "Network error", + "main.login.failed_sending_request": "Request to Auth server failed", + "main.login.invalid_character": "The selected character is invalid", + "main.login.client_crashed": "Client crashed", + "main.login.not_on_whitelist": "You need a Whitelist entry by an Admin to join", + "main.login.banned": "You have been banned with the following reason", + "main.login.kicked": "You have been kicked with the following reason", + "main.login.select_language": "Select a language", + + "main.servers.select_server": "Select a server", + + /// End Main screen section + + + /// Start HUD Section + "hud.do_not_show_on_startup": "Don't show this on Startup", + "hud.show_tips": "Show Tips", + "hud.quests": "Quests", + "hud.you_died": "You Died", + "hud.waypoint_saved": "Waypoint Saved", + + "hud.press_key_to_show_keybindings_fmt": "[{key}] Keybindings", + "hud.press_key_to_toggle_lantern_fmt": "[{key}] Lantern", + "hud.press_key_to_show_debug_info_fmt": "Press {key} to show debug info", + "hud.press_key_to_toggle_keybindings_fmt": "Press {key} to toggle keybindings", + "hud.press_key_to_toggle_debug_info_fmt": "Press {key} to toggle debug info", + + // Chat outputs + "hud.chat.online_msg": "[{name}] is online now", + "hud.chat.offline_msg": "{name} went offline", + + "hud.chat.default_death_msg": "[{name}] died", + "hud.chat.environmental_kill_msg": "[{name}] died in {environment}", + "hud.chat.fall_kill_msg": "[{name}] died from fall damage", + "hud.chat.suicide_msg": "[{name}] died from self-inflicted wounds", + + "hud.chat.pvp_melee_kill_msg": "[{attacker}] defeated [{victim}]", + "hud.chat.pvp_ranged_kill_msg": "[{attacker}] shot [{victim}]", + "hud.chat.pvp_explosion_kill_msg": "[{attacker}] blew up [{victim}]", + "hud.chat.pvp_energy_kill_msg": "[{attacker}] killed [{victim}] with magic", + "hud.chat.pvp_buff_kill_msg": "[{attacker}] killed [{victim}]", + + + "hud.chat.npc_melee_kill_msg": "{attacker} killed [{victim}]", + "hud.chat.npc_ranged_kill_msg": "{attacker} shot [{victim}]", + "hud.chat.npc_explosion_kill_msg": "{attacker} blew up [{victim}]", + "hud.chat.npc_energy_kill_msg": "[{attacker}] killed [{victim}] with magic", + "hud.chat.npc_other_kill_msg": "[{attacker}] killed [{victim}]", + + "hud.chat.loot_msg": "You picked up [{item}]", + "hud.chat.loot_fail": "Your Inventory is full!", + "hud.chat.goodbye": "Goodbye!", + "hud.chat.connection_lost": "Connection lost. Kicking in {time} seconds.", + + // SCT outputs + "hud.sct.experience": "{amount} Exp", + "hud.sct.block": "BLOCKED", + + // Respawn message + "hud.press_key_to_respawn": r#"Press {key} to respawn at the last campfire you visited."#, + + // Welcome message + "hud.welcome": r#"Welcome to the Veloren Alpha! + + +Some tips before you start: + + +Press F1 to see the available key commands. + +Type /help into the chat to see chat commands + + +There are chests and other objects randomly spawning in the World! + +Right-Click to collect them. + +To actually use whatever you loot from those chests open your inventory with 'B'. + +Double click the items in your bag to use or equip them. + +Throw them away by clicking them once and clicking outside of the bag + + +Nights can get pretty dark in Veloren. + +Light your lantern by pressing 'G' + + +Want to free your cursor to close this window? Press TAB! + + +Enjoy your stay in the World of Veloren."#, + +"hud.temp_quest_headline": r#"Please, help us Traveller!"#, +"hud.temp_quest_text": r#"Dungeons filled with evil cultists +have emerged all around our peaceful towns! + + +Gather some company, stack up on food +and defeat their vile leaders and acolytes. + + +Maybe you can even obtain one of their +magically infused items?"#, + + + + // Inventory + "hud.bag.inventory": "{playername}'s Inventory", + "hud.bag.stats_title": "{playername}'s Stats", + "hud.bag.exp": "Exp", + "hud.bag.armor": "Armor", + "hud.bag.stats": "Stats", + "hud.bag.head": "Head", + "hud.bag.neck": "Neck", + "hud.bag.tabard": "Tabard", + "hud.bag.shoulders": "Shoulders", + "hud.bag.chest": "Chest", + "hud.bag.hands": "Hands", + "hud.bag.lantern": "Lantern", + "hud.bag.glider": "Glider", + "hud.bag.belt": "Belt", + "hud.bag.ring": "Ring", + "hud.bag.back": "Back", + "hud.bag.legs": "Legs", + "hud.bag.feet": "Feet", + "hud.bag.mainhand": "Mainhand", + "hud.bag.offhand": "Offhand", + + // Diary + "hud.diary": "Diary", + + + // Map and Questlog + "hud.map.map_title": "Map", + "hud.map.qlog_title": "Quests", + + // Settings + "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", + "hud.settings.ui_scale": "UI-Scale", + "hud.settings.relative_scaling": "Relative Scaling", + "hud.settings.custom_scaling": "Custom Scaling", + "hud.settings.crosshair": "Crosshair", + "hud.settings.transparency": "Transparency", + "hud.settings.hotbar": "Hotbar", + "hud.settings.toggle_shortcuts": "Toggle Shortcuts", + "hud.settings.buffs_skillbar": "Buffs at Skillbar", + "hud.settings.buffs_mmap": "Buffs at Minimap", + "hud.settings.toggle_bar_experience": "Toggle Experience Bar", + "hud.settings.scrolling_combat_text": "Scrolling Combat Text", + "hud.settings.single_damage_number": "Single Damage Numbers", + "hud.settings.cumulated_damage": "Cumulated Damage", + "hud.settings.incoming_damage": "Incoming Damage", + "hud.settings.cumulated_incoming_damage": "Cumulated Incoming Damage", + "hud.settings.speech_bubble": "Speech Bubble", + "hud.settings.speech_bubble_dark_mode": "Speech Bubble Dark Mode", + "hud.settings.speech_bubble_icon": "Speech Bubble Icon", + "hud.settings.energybar_numbers": "Energybar Numbers", + "hud.settings.values": "Values", + "hud.settings.percentages": "Percentages", + "hud.settings.chat": "Chat", + "hud.settings.background_transparency": "Background Transparency", + "hud.settings.chat_character_name": "Character Names in chat", + "hud.settings.loading_tips": "Loading Screen Tips", + + "hud.settings.pan_sensitivity": "Pan Sensitivity", + "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.enable_mouse_smoothing": "Camera Smoothing", + "hud.settings.free_look_behavior": "Free look behavior", + "hud.settings.auto_walk_behavior": "Auto walk behavior", + "hud.settings.stop_auto_walk_on_input": "Stop auto walk on movement", + + "hud.settings.view_distance": "View Distance", + "hud.settings.sprites_view_distance": "Sprites View Distance", + "hud.settings.figures_view_distance": "Entities View Distance", + "hud.settings.maximum_fps": "Maximum FPS", + "hud.settings.fov": "Field of View (deg)", + "hud.settings.gamma": "Gamma", + "hud.settings.exposure": "Exposure", + "hud.settings.ambiance": "Ambiance Brightness", + "hud.settings.antialiasing_mode": "AntiAliasing Mode", + "hud.settings.upscale_factor": "Upscale Factor", + "hud.settings.cloud_rendering_mode": "Cloud Rendering Mode", + "hud.settings.fluid_rendering_mode": "Fluid Rendering Mode", + "hud.settings.fluid_rendering_mode.cheap": "Cheap", + "hud.settings.fluid_rendering_mode.shiny": "Shiny", + "hud.settings.cloud_rendering_mode.minimal": "Minimal", + "hud.settings.cloud_rendering_mode.low": "Low", + "hud.settings.cloud_rendering_mode.medium": "Medium", + "hud.settings.cloud_rendering_mode.high": "High", + "hud.settings.cloud_rendering_mode.ultra": "Ultra", + "hud.settings.fullscreen": "Fullscreen", + "hud.settings.fullscreen_mode": "Fullscreen Mode", + "hud.settings.fullscreen_mode.exclusive": "Exclusive", + "hud.settings.fullscreen_mode.borderless": "Borderless", + "hud.settings.particles": "Particles", + "hud.settings.resolution": "Resolution", + "hud.settings.bit_depth": "Bit Depth", + "hud.settings.refresh_rate": "Refresh Rate", + "hud.settings.save_window_size": "Save window size", + "hud.settings.lighting_rendering_mode": "Lighting Rendering Mode", + "hud.settings.lighting_rendering_mode.ashikhmin": "Type A - High ", + "hud.settings.lighting_rendering_mode.blinnphong": "Type B - Medium", + "hud.settings.lighting_rendering_mode.lambertian": "Type L - Cheap", + "hud.settings.shadow_rendering_mode": "Shadow Rendering Mode", + "hud.settings.shadow_rendering_mode.none": "None", + "hud.settings.shadow_rendering_mode.cheap": "Cheap", + "hud.settings.shadow_rendering_mode.map": "Map", + "hud.settings.shadow_rendering_mode.map.resolution": "Resolution", + "hud.settings.lod_detail": "LoD Detail", + "hud.settings.save_window_size": "Save window size", + + + "hud.settings.music_volume": "Music Volume", + "hud.settings.sound_effect_volume": "Sound Effects Volume", + "hud.settings.audio_device": "Audio Device", + + "hud.settings.awaitingkey": "Press a key...", + "hud.settings.unbound": "None", + "hud.settings.reset_keybinds": "Reset to Defaults", + + "hud.social": "Other Players", + "hud.social.online": "Online:", + "hud.social.friends": "Friends", + "hud.social.not_yet_available": "Not yet available", + "hud.social.faction": "Faction", + "hud.social.play_online_fmt": "{nb_player} player(s) online", + "hud.social.name": "Name", + "hud.social.level": "Level", + "hud.social.zone": "Zone", + "hud.social.account": "Account", + + + "hud.crafting": "Crafting", + "hud.crafting.recipes": "Recipes", + "hud.crafting.ingredients": "Ingredients:", + "hud.crafting.craft": "Craft", + "hud.crafting.tool_cata": "Requires:", + + "hud.group": "Group", + "hud.group.invite_to_join": "{name} invited you to their group!", + "hud.group.invite": "Invite", + "hud.group.kick": "Kick", + "hud.group.assign_leader": "Assign Leader", + "hud.group.leave": "Leave Group", + "hud.group.dead" : "Dead", + "hud.group.out_of_range": "Out of range", + "hud.group.add_friend": "Add to Friends", + "hud.group.link_group": "Link Groups", + "hud.group.in_menu": "In Menu", + "hud.group.members": "Group Members", + + "hud.spell": "Spells", + + "hud.free_look_indicator": "Free look active. Press {key} to disable.", + "hud.auto_walk_indicator": "Auto walk active", + + "hud.map.difficulty": "Difficulty", + "hud.map.towns": "Towns", + "hud.map.castles": "Castles", + "hud.map.dungeons": "Dungeons", + "hud.map.caves": "Caves", + "hud.map.cave": "Cave", + "hud.map.town": "Town", + "hud.map.castle": "Castle", + "hud.map.dungeon": "Dungeon", + "hud.map.difficulty_dungeon": "Dungeon\n\nDifficulty: {difficulty}", + "hud.map.drag": "Drag", + "hud.map.zoom": "Zoom", + "hud.map.recenter": "Recenter", + + /// End HUD section + + + /// Start GameInput section + + "gameinput.primary": "Basic Attack", + "gameinput.secondary": "Secondary Attack/Block/Aim", + "gameinput.slot1": "Hotbar Slot 1", + "gameinput.slot2": "Hotbar Slot 2", + "gameinput.slot3": "Hotbar Slot 3", + "gameinput.slot4": "Hotbar Slot 4", + "gameinput.slot5": "Hotbar Slot 5", + "gameinput.slot6": "Hotbar Slot 6", + "gameinput.slot7": "Hotbar Slot 7", + "gameinput.slot8": "Hotbar Slot 8", + "gameinput.slot9": "Hotbar Slot 9", + "gameinput.slot10": "Hotbar Slot 10", + "gameinput.swaploadout": "Swap Loadout", + "gameinput.togglecursor": "Toggle Cursor", + "gameinput.help": "Toggle Help Window", + "gameinput.toggleinterface": "Toggle Interface", + "gameinput.toggledebug": "Toggle FPS and Debug Info", + "gameinput.screenshot": "Take Screenshot", + "gameinput.toggleingameui": "Toggle Nametags", + "gameinput.fullscreen": "Toggle Fullscreen", + "gameinput.moveforward": "Move Forward", + "gameinput.moveleft": "Move Left", + "gameinput.moveright": "Move Right", + "gameinput.moveback": "Move Backwards", + "gameinput.jump": "Jump", + "gameinput.glide": "Glider", + "gameinput.roll": "Roll", + "gameinput.climb": "Climb", + "gameinput.climbdown": "Climb Down", + "gameinput.wallleap": "Wall Leap", + "gameinput.togglelantern": "Toggle Lantern", + "gameinput.mount": "Mount", + "gameinput.chat": "Chat", + "gameinput.command": "Command", + "gameinput.escape": "Escape", + "gameinput.map": "Map", + "gameinput.bag": "Bag", + "gameinput.social": "Social", + "gameinput.sit": "Sit", + "gameinput.spellbook": "Spells", + "gameinput.settings": "Settings", + "gameinput.respawn": "Respawn", + "gameinput.charge": "Charge", + "gameinput.togglewield": "Toggle Wield", + "gameinput.interact": "Interact", + "gameinput.freelook": "Free Look", + "gameinput.autowalk": "Auto Walk", + "gameinput.dance": "Dance", + "gameinput.select": "Select Entity", + "gameinput.acceptgroupinvite": "Accept Group Invite", + "gameinput.declinegroupinvite": "Decline Group Invite", + "gameinput.crafting": "Crafting", + "gameinput.fly": "Fly", + "gameinput.sneak": "Sneak", + "gameinput.swimdown": "Swim downwards", + "gameinput.swimup": "Swim upwards", + + /// End GameInput section + + + /// Start chracter selection section + "char_selection.loading_characters": "Loading characters...", + "char_selection.delete_permanently": "Permanently delete this Character?", + "char_selection.deleting_character": "Deleting Character...", + "char_selection.change_server": "Change Server", + "char_selection.enter_world": "Enter World", + "char_selection.logout": "Logout", + "char_selection.create_new_character": "Create New Character", + "char_selection.creating_character": "Creating Character...", + "char_selection.character_creation": "Character Creation", + + "char_selection.human_default": "Human Default", + "char_selection.level_fmt": "Level {level_nb}", + "char_selection.uncanny_valley": "Wilderness", + "char_selection.plains_of_uncertainty": "Plains of Uncertainty", + "char_selection.beard": "Beard", + "char_selection.hair_style": "Hair Style", + "char_selection.hair_color": "Hair Color", + "char_selection.eye_color": "Eye Color", + "char_selection.skin": "Skin", + "char_selection.eyeshape": "Eye Details", + "char_selection.accessories": "Accessories", + "char_selection.create_info_name": "Your Character needs a name!", + + /// End character selection section + + + /// Start character window section + "character_window.character_name": "Character Name", + // Character stats + "character_window.character_stats": r#"Endurance + +Fitness + +Willpower + +Protection +"#, + /// End character window section + + + /// Start Escape Menu Section + "esc_menu.logout": "Logout", + "esc_menu.quit_game": "Quit Game", + /// End Escape Menu Section + + /// Buffs and Debuffs + "buff.remove": "Click to remove", + "buff.title.missing": "Missing Title", + "buff.desc.missing": "Missing Description", + // Buffs + "buff.title.heal": "Heal", + "buff.desc.heal": "Gain health over time.", + "buff.title.potion": "Potion", + "buff.desc.potion": "Drinking...", + "buff.title.saturation": "Saturation", + "buff.desc.saturation": "Gain health over time from consumables.", + "buff.title.campfire_heal": "Campfire Heal", + "buff.desc.campfire_heal": "Resting at a campfire heals 1% per second.", + // Debuffs + "debuff.title.bleed": "Bleeding", + "debuff.desc.bleed": "Inflicts regular damage.", + }, + + + vector_map: { + "loading.tips": [ + "Press 'G' to light your lantern.", + "Press 'F1' to see all default keybindings.", + "You can type /say or /s to only chat with players directly around you.", + "You can type /region or /r to only chat with players a couple of hundred blocks around you.", + "You can type /group or /g to only chat with players in your current group.", + "To send private messages type /tell followed by a player name and your message.", + "NPCs with the same level can have a different difficulty.", + "Keep an eye out for food, chests and other loot spread all around the world!", + "Inventory filled with food? Try crafting better food from it!", + "Wondering what's there to do? Try out one of the dungeons marked on the map!", + "Don't forget to adjust the graphics for your system. Press 'N' to open the settings.", + "Playing with others is fun! Press 'O' to see who is online.", + "An NPC with a skull beneath their healthbar is quite powerful compared to yourself.", + "Press 'J' to dance. Party!", + "Press 'L-Shift' to open your Glider and conquer the skies.", + "Veloren is still in Pre-Alpha. We do our best to improve it every day!", + "If you want to join the Dev-Team or just have a chat with us join our Discord-Server.", + "You can toggle showing your amount of health on the healthbar in the settings.", + "In order to see your stats click the 'Stats' button in the inventory.", + ], + "npc.speech.villager_under_attack": [ + "Help, I'm under attack!", + "Help! I'm under attack!", + "Ouch! I'm under attack!", + "Ouch! I'm under attack! Help!", + "Help me! I'm under attack!", + "I'm under attack! Help!", + "I'm under attack! Help me!", + "Help!", + "Help! Help!", + "Help! Help! Help!", + "I'm under attack!", + "AAAHHH! I'm under attack!", + "AAAHHH! I'm under attack! Help!", + "Help! We're under attack!", + "Help! Murderer!", + "Help! There's a murderer on the loose!", + "Help! They're trying to kill me!", + "Guards, I'm under attack!", + "Guards! I'm under attack!", + "I'm under attack! Guards!", + "Help! Guards! I'm under attack!", + "Guards! Come quick!", + "Guards! Guards!", + "Guards! There's a villain attacking me!", + "Guards, slay this foul villain!", + "Guards! There's a murderer!", + "Guards! Help me!", + "You won't get away with this! Guards!", + "You fiend!", + "Help me!", + "Help! Please!", + "Ouch! Guards! Help!", + "They're coming for me!", + "Help! Help! I'm being repressed!", + "Ah, now we see the violence inherent in the system.", + "Tis but a scratch!", + "Stop that!", + "What did I ever do to you?!", + "Please stop attacking me!", + "Hey! Watch where you point that thing!", + "Heinous wretch, be gone with you!", + "Stop it! Go away!", + "Now you're making me mad!", + "Oi! Who do you think you are?!", + "I'll have your head for that!", + "Stop, please! I carry nothing of value!", + "I'll set my brother on you, he's bigger than I am!", + "Nooo, I'm telling mother!", + "Curse you!", + "Please don't do that.", + "That wasn't very nice!", + "Your weapon works, you can put it away now!", + "Spare me!", + "Please, I have a family!", + "I'm too young to die!", + "Can we talk about this?", + "Violence is never the answer!", + "Today is turning out to be a very bad day...", + "Hey, that hurt!", + "Eek!", + "How rude!", + "Stop, I beg you!", + "A pox upon you!", + "This isn't fun.", + "How dare you?!", + "You'll pay for that!", + "Keep that up and you'll be sorry!", + "Don't make me hurt you!", + "There must be some misunderstanding!", + "You don't need to do this!", + "Be gone, fiend!", + "That really hurt!", + "Why would you do that?", + "By the spirits, cease!", + "You must have me confused with someone else!", + "I don't deserve this!", + "Please don't do that again.", + "Guards, throw this monster in the lake!", + "I'll set my tarrasque on you!", + ], + } +) diff --git a/client/src/lib.rs b/client/src/lib.rs index 75e7c39186..e868cba093 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -1233,8 +1233,8 @@ impl Client { BowSkill::RDamage, ))); }, - "@unlock bow repeater leap" => { - self.send_msg(ClientGeneral::UnlockSkill(Skill::Bow(BowSkill::RLeap))); + "@unlock bow repeater glide" => { + self.send_msg(ClientGeneral::UnlockSkill(Skill::Bow(BowSkill::RGlide))); }, "@unlock bow repeater arrows" => { self.send_msg(ClientGeneral::UnlockSkill(Skill::Bow( diff --git a/common/src/combat.rs b/common/src/combat.rs index 4add6e89f9..d4eb4bfd62 100644 --- a/common/src/combat.rs +++ b/common/src/combat.rs @@ -65,10 +65,9 @@ impl Damage { DamageSource::Melee => { // Critical hit let mut critdamage = 0.0; - /* Disabled so I can actually test stuff if rand::random() { critdamage = damage * 0.3; - }*/ + } // Armor damage *= 1.0 - damage_reduction; @@ -87,9 +86,9 @@ impl Damage { }, DamageSource::Projectile => { // Critical hit - /*if rand::random() { + if rand::random() { damage *= 1.2; - }*/ + } // Armor damage *= 1.0 - damage_reduction; diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index a698fdbfb8..e329178afc 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -869,7 +869,7 @@ impl CharacterAbility { }, RepeaterRanged { ref mut energy_cost, - ref mut leap, + ref mut buildup_duration, ref mut projectile, ref mut reps_remaining, ref mut projectile_speed, @@ -883,8 +883,8 @@ impl CharacterAbility { *projectile = projectile.modified_projectile(power, 1_f32, 1_f32, 1_f32); } - if !skills.contains_key(&Bow(RLeap)) { - *leap = None; + if !skills.contains_key(&Bow(RGlide)) { + *buildup_duration = 1; } if let Some(level) = skills.get(&Bow(RArrows)).copied().flatten() { *reps_remaining += level as u32; diff --git a/common/src/comp/skills.rs b/common/src/comp/skills.rs index 124c99b7e1..eeb5abe59f 100644 --- a/common/src/comp/skills.rs +++ b/common/src/comp/skills.rs @@ -157,7 +157,7 @@ pub enum BowSkill { // Repeater upgrades UnlockRepeater, RDamage, - RLeap, + RGlide, RArrows, RCost, } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index cabe4f0d60..0a09b99cb0 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -61,6 +61,23 @@ image_ids! { prompt_bot: "voxygen.element.frames.prompt_dialog_bot", key_button: "voxygen.element.buttons.key_button", key_button_press: "voxygen.element.buttons.key_button_press", + + // Diary Window + diary_bg: "voxygen.element.misc_bg.diary_bg", + diary_frame: "voxygen.element.misc_bg.diary_frame", + sword_render: "voxygen.element.misc_bg.sword_render", + + // Skill Trees + sceptre: "voxygen.element.icons.sceptre", + sword: "voxygen.element.icons.sword", + axe: "voxygen.element.icons.axe", + hammer: "voxygen.element.icons.hammer", + bow: "voxygen.element.icons.bow", + staff: "voxygen.element.icons.staff", + wpn_icon_border: "voxygen.element.buttons.border", + wpn_icon_border_mo: "voxygen.element.buttons.border_mo", + wpn_icon_border_press: "voxygen.element.buttons.border_press", + wpn_icon_border_pressed: "voxygen.element.buttons.border_pressed", // Social Window social_frame_on: "voxygen.element.misc_bg.social_frame", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 47ddbcd701..06f2751a85 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -43,7 +43,7 @@ use serde::{Deserialize, Serialize}; use settings_window::{SettingsTab, SettingsWindow}; use skillbar::Skillbar; use social::{Social, SocialTab}; -use spell::Spell; +use spell::{SelectedSkillTree, Spell}; use crate::{ ecs::{comp as vcomp, comp::HpFloaterList}, @@ -462,6 +462,7 @@ pub struct Show { mini_map: bool, ingame: bool, settings_tab: SettingsTab, + skilltreetab: SelectedSkillTree, social_tab: SocialTab, want_grab: bool, stats: bool, @@ -512,6 +513,8 @@ impl Show { if !self.esc_menu { self.social = false; self.crafting = false; + self.bag = false; + self.map = false; self.spell = open; self.want_grab = !open; } @@ -614,6 +617,15 @@ impl Show { fn toggle_spell(&mut self) { self.spell = !self.spell; + self.bag = false; + self.crafting = false; + self.social = false; + self.map = false; + self.want_grab = !self.spell; + } + + fn open_skill_tree(&mut self, tree_sel: SelectedSkillTree) { + self.skilltreetab = tree_sel; self.social = false; } } @@ -743,6 +755,7 @@ impl Hud { group_menu: false, mini_map: true, settings_tab: SettingsTab::Interface, + skilltreetab: SelectedSkillTree::Sword, social_tab: SocialTab::Online, want_grab: true, ingame: true, @@ -2293,15 +2306,17 @@ impl Hud { // Spellbook if self.show.spell { - match Spell::new(&self.show, client, &self.imgs, &self.fonts, i18n) + for event in Spell::new(&self.show, client, &self.imgs, &self.fonts, i18n) .set(self.ids.spell, ui_widgets) { - Some(spell::Event::Close) => { - self.show.spell(false); - self.show.want_grab = true; - self.force_ungrab = false; - }, - None => {}, + match event { + spell::Event::Close => { + self.show.spell(false); + self.show.want_grab = true; + self.force_ungrab = false; + }, + spell::Event::ChangeWeaponTree(tree_sel) => self.show.open_skill_tree(tree_sel), + } } } // Map diff --git a/voxygen/src/hud/spell.rs b/voxygen/src/hud/spell.rs index 0fbf3ab91d..3457cbc532 100644 --- a/voxygen/src/hud/spell.rs +++ b/voxygen/src/hud/spell.rs @@ -1,26 +1,42 @@ -use super::{img_ids::Imgs, Show, TEXT_COLOR, UI_MAIN}; +use super::{img_ids::Imgs, Show, TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN}; use crate::{i18n::Localization, ui::fonts::Fonts}; use conrod_core::{ color, widget::{self, Button, Image, Rectangle, Text}, - widget_ids, Colorable, Positionable, Sizeable, Widget, WidgetCommon, + widget_ids, Color, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, }; use client::{self, Client}; +use inline_tweak::*; widget_ids! { pub struct Ids { - spell_frame, - spell_close, - spell_title, frame, + bg, + icon, + close, + title, content_align, + weapon_imgs[], + weapon_btns[], + skills_top_l_align, + skills_top_r_align, + skills_bot_l_align, + skills_bot_r_align, + skills_top_l[], + skills_top_r[], + skills_bot_l[], + skills_bot_r[], + sword_render, + sword_skill_0, + sword_sill_1, + } } #[derive(WidgetCommon)] pub struct Spell<'a> { - _show: &'a Show, + show: &'a Show, _client: &'a Client, imgs: &'a Imgs, @@ -29,6 +45,11 @@ pub struct Spell<'a> { #[conrod(common_builder)] common: widget::CommonBuilder, + created_btns_top_l: usize, + created_btns_top_r: usize, + created_btns_bot_l: usize, + created_btns_bot_r: usize, + example_skill_count: usize, } impl<'a> Spell<'a> { @@ -40,12 +61,17 @@ impl<'a> Spell<'a> { localized_strings: &'a Localization, ) -> Self { Self { - _show: show, + show, _client, imgs, fonts, localized_strings, common: widget::CommonBuilder::default(), + created_btns_top_l: 0, + created_btns_top_r: 0, + created_btns_bot_l: 0, + created_btns_bot_r: 0, + example_skill_count: 0, } } } @@ -54,12 +80,30 @@ impl<'a> Spell<'a> { ids: Ids, }*/ +/*pub enum DiaryTab { + SkillTrees, + Achievements, +}*/ + +pub enum SelectedSkillTree { + None, + Sword, + Hammer, + Axe, + Sceptre, + Bow, + StaffFire, +} + +const WEAPONS: [&str; 6] = ["Sword", "Hammer", "Axe", "Sceptre", "Bow", "Fire Staff"]; + pub enum Event { Close, + ChangeWeaponTree(SelectedSkillTree), } impl<'a> Widget for Spell<'a> { - type Event = Option; + type Event = Vec; type State = Ids; type Style = (); @@ -68,47 +112,359 @@ impl<'a> Widget for Spell<'a> { #[allow(clippy::unused_unit)] // TODO: Pending review in #587 fn style(&self) -> Self::Style { () } - fn update(self, args: widget::UpdateArgs) -> Self::Event { + fn update(mut self, args: widget::UpdateArgs) -> Self::Event { let widget::UpdateArgs { id: _, state, ui, .. } = args; - - Image::new(self.imgs.window_3) - .top_left_with_margins_on(ui.window, 200.0, 25.0) - .w_h(103.0 * 4.0, 122.0 * 4.0) + let mut events = Vec::new(); + let sel_tab = &self.show.skilltreetab; + // Frame + Image::new(self.imgs.diary_bg) + .w_h(1202.0, 886.0) + .mid_top_with_margin_on(ui.window, 5.0) .color(Some(UI_MAIN)) - .set(state.spell_frame, ui); + .set(state.bg, ui); + + Image::new(self.imgs.diary_frame) + .w_h(1202.0, 886.0) + .middle_of(state.bg) + .color(Some(UI_HIGHLIGHT_0)) + .set(state.frame, ui); + + // Icon + Image::new(self.imgs.spellbook_button) + .w_h(30.0, 27.0) + .top_left_with_margins_on(state.frame, 8.0, 8.0) + .set(state.icon, ui); // X-Button if Button::image(self.imgs.close_button) - .w_h(28.0, 28.0) - .hover_image(self.imgs.close_button_hover) - .press_image(self.imgs.close_button_press) - .top_right_with_margins_on(state.spell_frame, 0.0, 0.0) - .set(state.spell_close, ui) + .w_h(24.0, 25.0) + .hover_image(self.imgs.close_btn_hover) + .press_image(self.imgs.close_btn_press) + .top_right_with_margins_on(state.frame, 0.0, 0.0) + .set(state.close, ui) .was_clicked() { - return Some(Event::Close); + events.push(Event::Close); } // Title - // TODO: Use an actual character name. - Text::new(&self.localized_strings.get("hud.spell")) - .mid_top_with_margin_on(state.spell_frame, 6.0) + Text::new(&self.localized_strings.get("hud.diary")) + .mid_top_with_margin_on(state.frame, 3.0) .font_id(self.fonts.cyri.conrod_id) - .font_size(self.fonts.cyri.scale(14)) + .font_size(self.fonts.cyri.scale(29)) .color(TEXT_COLOR) - .set(state.spell_title, ui); + .set(state.title, ui); // Content Alignment - Rectangle::fill_with([95.0 * 4.0, 108.0 * 4.0], color::TRANSPARENT) - .mid_top_with_margin_on(state.spell_frame, 40.0) + Rectangle::fill_with([599.0 * 2.0, 419.0 * 2.0], color::TRANSPARENT) + .mid_top_with_margin_on(state.frame, 46.0) .set(state.content_align, ui); // Contents - // Frame + // Skill Trees - None + // Skill Tree Selection + state.update(|s| { + s.weapon_btns + .resize(WEAPONS.len(), &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.weapon_imgs + .resize(WEAPONS.len(), &mut ui.widget_id_generator()) + }); + for i in WEAPONS.iter().copied().enumerate() { + // Background weapon image + let img = Image::new(match i.1 { + "Sword" => self.imgs.sword, + "Hammer" => self.imgs.hammer, + "Axe" => self.imgs.axe, + "Sceptre" => self.imgs.sceptre, + "Bow" => self.imgs.bow, + "Fire Staff" => self.imgs.staff, + _ => self.imgs.nothing, + }); + + let img = if i.0 == 0 { + img.top_left_with_margins_on(state.content_align, tweak!(10.0), tweak!(5.0)) + } else { + img.down_from(state.weapon_btns[i.0 - 1], tweak!(5.0)) + }; + + img.w_h(tweak!(50.0), tweak!(50.0)) + .set(state.weapon_imgs[i.0], ui); + // Weapon icons + if Button::image(match i.1 { + "Sword" => match sel_tab { + SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Hammer" => match sel_tab { + SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Axe" => match sel_tab { + SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Sceptre" => match sel_tab { + SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Bow" => match sel_tab { + SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + "Fire Staff" => match sel_tab { + SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border, + }, + _ => self.imgs.wpn_icon_border, + }) + .w_h(tweak!(50.0), tweak!(50.0)) + .hover_image(match i.1 { + "Sword" => match sel_tab { + SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Hammer" => match sel_tab { + SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Axe" => match sel_tab { + SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Sceptre" => match sel_tab { + SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Bow" => match sel_tab { + SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + "Fire Staff" => match sel_tab { + SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_mo, + }, + _ => self.imgs.wpn_icon_border, + }) + .press_image(match i.1 { + "Sword" => match sel_tab { + SelectedSkillTree::Sword => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Hammer" => match sel_tab { + SelectedSkillTree::Hammer => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Axe" => match sel_tab { + SelectedSkillTree::Axe => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Sceptre" => match sel_tab { + SelectedSkillTree::Sceptre => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Bow" => match sel_tab { + SelectedSkillTree::Bow => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + "Fire Staff" => match sel_tab { + SelectedSkillTree::StaffFire => self.imgs.wpn_icon_border_pressed, + _ => self.imgs.wpn_icon_border_press, + }, + _ => self.imgs.wpn_icon_border, + }) + .middle_of(state.weapon_imgs[i.0]) + .set(state.weapon_btns[i.0], ui) + .was_clicked() + { + match i.1 { + "Sword" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Sword)), + "Hammer" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Hammer)), + "Axe" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Axe)), + "Sceptre" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Sceptre)), + "Bow" => events.push(Event::ChangeWeaponTree(SelectedSkillTree::Bow)), + "Fire Staff" => { + events.push(Event::ChangeWeaponTree(SelectedSkillTree::StaffFire)) + }, + _ => events.push(Event::ChangeWeaponTree(SelectedSkillTree::None)), + } + } + } + + // Skill Trees + // Alignment Placing + let x = tweak!(200.0); + let y = tweak!(100.0); + // Alignment rectangles for skills + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .top_left_with_margins_on(state.content_align, y, x) + .set(state.skills_top_l_align, ui); + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .top_right_with_margins_on(state.content_align, y, x) + .set(state.skills_top_r_align, ui); + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .bottom_left_with_margins_on(state.content_align, y, x) + .set(state.skills_bot_l_align, ui); + Rectangle::fill_with([124.0 * 2.0, 124.0 * 2.0], color::TRANSPARENT) + .bottom_right_with_margins_on(state.content_align, y, x) + .set(state.skills_bot_r_align, ui); + // Number of skills per rectangle per weapon, start counting at 0 + // Maximum of 9 skills/8 indices + let skills_top_l = match sel_tab { + SelectedSkillTree::Sword => 4, + SelectedSkillTree::Bow => 1, + _ => 0, + }; + let skills_top_r = match sel_tab { + SelectedSkillTree::Sword => 5, + _ => 0, + }; + let skills_bot_l = match sel_tab { + SelectedSkillTree::Sword => 3, + SelectedSkillTree::Bow => 2, + _ => 0, + }; + let skills_bot_r = match sel_tab { + SelectedSkillTree::Sword => 1, + _ => 0, + }; + // Update widget id array len + state.update(|s| { + s.skills_top_l + .resize(skills_top_l, &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.skills_top_r + .resize(skills_top_r, &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.skills_bot_l + .resize(skills_bot_l, &mut ui.widget_id_generator()) + }); + state.update(|s| { + s.skills_bot_r + .resize(skills_bot_r, &mut ui.widget_id_generator()) + }); + // Create Background Images to place skill icons on them later + // Create central skill first, others around it: + // + // 5 1 6 + // 3 0 4 + // 8 2 7 + // + // + // TOP-LEFT Skills + while self.created_btns_top_l < skills_top_l { + let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_top_l { + 0 => img = img.middle_of(state.skills_top_l_align), // Central Skill + 1 => img = img.up_from(state.skills_top_l[0], 4.0), // 12:00 + 2 => img = img.down_from(state.skills_top_l[0], 4.0), // 6:00 + 3 => img = img.left_from(state.skills_top_l[0], 4.0), // 3:00 + 4 => img = img.right_from(state.skills_top_l[0], 4.0), // 9:00 + 5 => img = img.top_left_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 10:30 */ + 6 => img = img.top_right_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 1:30 */ + 7 => img = img.bottom_left_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 4:30 */ + 8 => img = img.bottom_right_with_margins_on(state.skills_top_l[0], -41.0, -41.0), /* 7:30 */ + _ => {}, + } + img.set(state.skills_top_l[self.created_btns_top_l], ui); + self.created_btns_top_l = self.created_btns_top_l + 1; + } + // TOP-RIGHT Skills + while self.created_btns_top_r < skills_top_r { + let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_top_r { + 0 => img = img.middle_of(state.skills_top_r_align), // Central Skill + 1 => img = img.up_from(state.skills_top_r[0], 4.0), // 12:00 + 2 => img = img.down_from(state.skills_top_r[0], 4.0), // 6:00 + 3 => img = img.left_from(state.skills_top_r[0], 4.0), // 3:00 + 4 => img = img.right_from(state.skills_top_r[0], 4.0), // 9:00 + 5 => img = img.top_left_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 10:30 */ + 6 => img = img.top_right_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 1:30 */ + 7 => img = img.bottom_left_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 4:30 */ + 8 => img = img.bottom_right_with_margins_on(state.skills_top_r[0], -41.0, -41.0), /* 7:30 */ + _ => {}, + } + img.set(state.skills_top_r[self.created_btns_top_r], ui); + self.created_btns_top_r = self.created_btns_top_r + 1; + } + // BOTTOM-LEFT Skills + while self.created_btns_bot_l < skills_bot_l { + let mut img = Button::image(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_bot_l { + 0 => img = img.middle_of(state.skills_bot_l_align), // Central Skill + 1 => img = img.up_from(state.skills_bot_l[0], 4.0), // 12:00 + 2 => img = img.down_from(state.skills_bot_l[0], 4.0), // 6:00 + 3 => img = img.left_from(state.skills_bot_l[0], 4.0), // 3:00 + 4 => img = img.right_from(state.skills_bot_l[0], 4.0), // 9:00 + 5 => img = img.top_left_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 10:30 */ + 6 => img = img.top_right_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 1:30 */ + 7 => img = img.bottom_left_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 4:30 */ + 8 => img = img.bottom_right_with_margins_on(state.skills_bot_l[0], -41.0, -41.0), /* 7:30 */ + _ => {}, + } + img.set(state.skills_bot_l[self.created_btns_bot_l], ui); + self.created_btns_bot_l = self.created_btns_bot_l + 1; + } + // BOTTOM-RIGHT Skills + while self.created_btns_bot_r < skills_bot_r { + let mut btn = Image::new(self.imgs.wpn_icon_border).w_h(80.0, 80.0); + match self.created_btns_bot_r { + 0 => btn = btn.middle_of(state.skills_bot_r_align), // Central Skill + 1 => btn = btn.up_from(state.skills_bot_r[0], 4.0), // 12:00 + 2 => btn = btn.down_from(state.skills_bot_r[0], 4.0), // 6:00 + 3 => btn = btn.left_from(state.skills_bot_r[0], 4.0), // 3:00 + 4 => btn = btn.right_from(state.skills_bot_r[0], 4.0), // 9:00 + 5 => btn = btn.top_left_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 10:30 */ + 6 => btn = btn.top_right_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 1:30 */ + 7 => btn = btn.bottom_left_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 4:30 */ + 8 => btn = btn.bottom_right_with_margins_on(state.skills_bot_r[0], -41.0, -41.0), /* 7:30 */ + _ => {}, + } + btn.set(state.skills_bot_r[self.created_btns_bot_r], ui); + self.created_btns_bot_r = self.created_btns_bot_r + 1; + } + // Actual Skill-Icons and Functionality + match sel_tab { + SelectedSkillTree::Sword => { + // Sword + // fancy bg art + let art_scale = tweak!(0.6); + Image::new(self.imgs.sword_render) + .w_h(222.0 * art_scale, 818.0 * art_scale) + .middle_of(state.content_align) + .graphics_for(state.content_align) + .color(Some(Color::Rgba(1.0, 1.0, 1.0, tweak!(0.2)))) + .set(state.sword_render, ui); + // Top Left skills + // 5 1 6 + // 3 0 4 + // 8 2 7 + if Button::image(self.imgs.sword_whirlwind) + .w_h(tweak!(74.0), tweak!(74.0)) + .middle_of(state.skills_top_l[0]) + .label(&self.example_skill_count.to_string()) + .label_y(conrod_core::position::Relative::Scalar(tweak!(-28.0))) + .label_x(conrod_core::position::Relative::Scalar(tweak!(32.0))) + .label_color(TEXT_COLOR) + .label_font_size(self.fonts.cyri.scale(tweak!(16))) + .label_font_id(self.fonts.cyri.conrod_id) + .floating(true) + .set(state.sword_skill_0, ui) + .was_clicked() + { + self.example_skill_count = self.example_skill_count + 1; + }; + }, + _ => {}, + } + + events } }