diff --git a/mona_generate/src/gen_meta/gen_character_meta.rs b/mona_generate/src/gen_meta/gen_character_meta.rs index c61feeb6..a382cc1a 100644 --- a/mona_generate/src/gen_meta/gen_character_meta.rs +++ b/mona_generate/src/gen_meta/gen_character_meta.rs @@ -96,7 +96,7 @@ pub fn gen_character_meta_as_js_file() -> String { let name_locale = *index_mapping.get(&meta.name_locale).unwrap(); - let icon_hash: String = icon_hashmap.get(meta.internal_name) + let icon_hash: String = icon_hashmap.get(meta.name.to_string().as_str()) .map_or(String::new(), |&hash| hash.to_string()); data.push(CharacterMeta { diff --git a/mona_generate/src/gen_meta/gen_weapon_meta.rs b/mona_generate/src/gen_meta/gen_weapon_meta.rs index cb092caa..c9f7701b 100644 --- a/mona_generate/src/gen_meta/gen_weapon_meta.rs +++ b/mona_generate/src/gen_meta/gen_weapon_meta.rs @@ -43,7 +43,7 @@ pub fn gen_weapon_meta_as_js_file() -> String { } } - let icon_hash: String = icon_hashmap.get(meta_data.internal_name) + let icon_hash: String = icon_hashmap.get(weapon_name.to_string().as_str()) .map_or(String::new(), |&hash| hash.to_string()); let my_data = WeaponMetaDataForJS { diff --git a/mona_generate/src/utils/icon_hashmap.rs b/mona_generate/src/utils/icon_hashmap.rs index 3986f43b..fc3b78f7 100644 --- a/mona_generate/src/utils/icon_hashmap.rs +++ b/mona_generate/src/utils/icon_hashmap.rs @@ -4,45 +4,124 @@ use lazy_static::lazy_static; lazy_static! { pub static ref ICON_HASHMAP: HashMap<&'static str, &'static str> = { let data = vec![ - ("Furina", "4da8d9d663e2e59f63c19815074074de"), - ("Neuvillette", "965af2f32a5376affcb99afb9915a23d"), - ("Wriothesley", "e2ea36ecfdb6f53717b1cadd394fbf49"), - ("Lyney", "15c0fae62ec91222148b753e5445c5fe"), - ("Charlotte", "99218c303fd1ca9cc53e052ebdd5cbf3"), - ("Freminet", "7ca0ad25c2cbb36cd55a8a19c1b2a39f"), - ("Lynette", "3163e147dc45dec9944d06355d778879"), - ("Momoka", "8e8c8c18039f5441d4f2f43757781ae0"), - ("Bow_Pledge", "2b3f4a4eef528e1150893d58c68a5de3"), - ("Bow_Ibis", "aef17fddf164e3ea98c4fd073a5f02a3"), - ("Bow_Mechanic", "98e0ebb9a9857e2b21deda9d8c574b89"), - ("Bow_Gurabad", "1cd241d13f320f3a0fbdfe378f423364"), - ("Bow_Vorpal", "d70cf7fcc37cfbce1a07f5f3e214f278"), - ("Catalyst_Iudex", "8f34b571d7e2d26e6c2ef2886defa86b"), - ("Catalyst_Wheatley", "74712841e6a4cc25e0a2a36874ac71d7"), - ("Catalyst_DandelionPoem", "b90f7edc1c4a6c0c132e00da99918d84"), - ("Catalyst_Vorpal", "d4f997c8b399ef27d027653ba73645a5"), - ("Catalyst_Yue", "93b6d05a8bc54d8eb69e4ed450c981c8"), - ("Pole_Shanty", "2dc8e2cc9ab49c1d0ff9f67b3c98a94d"), - ("Pole_Mechanic", "3333f73a195e3da1ed9a125658dfcf16"), - ("Pole_Vorpal", "6514981aeab437590ebbfe15f5aef671"), - ("Sword_Regalis", "1d603d4764cf292a12e268b8d8012688"), - ("Sword_Vorpal", "acde24e9fa3f3e8c14f40aa4cd1a9007"), - ("Sword_Machination", "b6259f0f93f824b169b50b6bc593dd08"), - ("Sword_Purewill", "9c06477c167aadef25d03b4ceb1320ba"), - ("Sword_Mechanic", "da80c69eada7e7fb6053b6301a6011ba"), - ("Claymore_Mechanic", "6dc1e808543a09ddc1daf1e76721cd3d"), - ("Claymore_Vorpal", "a76dd2c45f3bcfaf3f547d5c90bd20e2"), - ("Claymore_BeastTamer", "4add4bfe23684d374398998eb5eb247d"), - ("UI_RelicIcon_15032_4", "fadbbf8dbba05ad1ce0daeb4ebf89413"), - ("UI_RelicIcon_15032_2", "4ca24e57d1adc9f0247c6bffd164d8b7"), - ("UI_RelicIcon_15032_5", "9269d47e4a4edd517042c26fe534060e"), - ("UI_RelicIcon_15032_1", "4d2b22a334d4237ba2cce56aeb5bd023"), - ("UI_RelicIcon_15032_3", "2f69d44e2e79a05adbe0c9fe6391ea33"), - ("UI_RelicIcon_15031_4", "9babba990b561f2b031d5db4145c19a9"), - ("UI_RelicIcon_15031_2", "819b944729f2d5702f46d1403edba587"), - ("UI_RelicIcon_15031_5", "de01dcbf2911968336afbbb61b455831"), - ("UI_RelicIcon_15031_1", "b10902ae43e7f6d6619fe560829f7ba3"), - ("UI_RelicIcon_15031_3", "1f3958293c20e8a29f51b9f3ed259e12"), + // 5 Star Characters + ("Mualani", "43b237af6075b02d0ed6bb0d41e5bf6b"), + ("Emilie", "8eca21f28d282fc38578de3a63205a39"), + ("Clorinde", "d90efaef8591d45982ca714b27e2faaa"), + ("Arlecchino", "5af48ffeeb3cd9e2ef6a5a245ff5a502"), + ("Sigewinne", "d6228cee1b60f3e8fc3fd041ec8264ca"), + ("Chiori", "0b23eaf3248026bfb9538ccc302dc2e6"), + ("Xianyun", "1063a94eb80ebba3683821f393987d93"), + ("Navia", "4ecdeaddd3f4de79beaced7c449b9c6f"), + ("Furina", "012270473e54fd09aa6ef272f3a050bb"), + ("Neuvillette", "1b877ac8988c675cb7b3b905544aad7c"), + ("Wriothesley", "a7c3b6949ef42a1cf37cd3be87c34112"), + ("Lyney", "16a33017e331f2768f486a5667cd0318"), + // 4 Star Characters + ("Kachina", "65bda5c712894dedc44a5b7f0e2560ff"), + ("Sethos", "73f63b00c1bbe4c061e89a22765c9f93"), + ("Gaming", "492ef1d89fbb3519c6b6882e42499ba3"), + ("Chevreuse", "f74d07754a17a5025e62cbf0411ba8a0"), + ("Charlotte", "9199f0769de996add5c660f4b172ee36"), + ("Freminet", "40b78f33038bedf0e470a4a87c6fc968"), + ("Lynette", "fd29fb6cb44268355f9a22153341019d"), + ("Kirara", "2099863b9d6f7678002a3d7bc1c9450a"), + // 5 Star Weapons Bow + ("SilvershowerHeartstrings", "18d810e1ac439a81f371504efe7d8afe"), + ("TheFirstGreatMagic", "686ed9187ebb59d480917881625f0eb6"), + // 5 Star Weapons Catalyst + ("SurfsUp", "8d980ddba3723c95bb4795d554bf1640"), + ("CranesEchoingCall", "1f38d88e8b34c55143d3d48e902e32dc"), + ("TomeOfTheEternalFlow", "2c356588aba222181fda66809a9a425f"), + ("CashflowSupervision", "a8002c6d521d8fca48bc1402d7ce5e2b"), + // 5 Star Weapons Pole + ("LumidouceElegy", "a6fa4ef0c82b6f9c3f824953f7c16acf"), + ("CrimsonMoonsSemblance", "94175be57ec8e6c749a6ac22cccde18d"), + // 5 Star Weapons Claymore + ("Verdict", "f5336c01b0f1e19833a0f9e8bd04c107"), + // 5 Star Weapons Sword + ("Absolution", "72c9336d54b4653fed5e529aec9b8403"), + ("UrakuMisugiri", "a8f87169e43884ef394d23e9857d2bc5"), + ("SplendorOfTranquilWaters", "2db4d0468f073acfd6cd9b483d054721"), + // 4 Star Weapons Bow + ("ChainBreaker", "cc9373e33444d8e6d8a9b1721572f14d"), + ("RangeGauge", "3faab532af8b27a55f6450958c9afff0"), + ("Cloudforged", "6c9144ab2347a6750252e6938bba99af"), + ("SongOfStillness", "b11d52b7a92f661c313fbc3af1974157"), + ("ScionOfTheBlazingSun", "8f069e0404cd6d99b4d43e88dce0425f"), + ("IbisPiercer", "565c9a5438885c0cb05e560bcd68f474"), + // 4 Star Weapons Catalyst + ("RingOfYaxche", "087a49cb371e1953d01f1923f32462ba"), + ("AshgravenDrinkingHorn", "e9ba031389e067924e2fa035f9790da1"), + ("BalladOfTheBoundlessBlue", "705b9cf993f46e1333f24268c0549f3a"), + ("FlowingPurity", "20ecbf9b91f08b79d79299ab9663226b"), + ("SacrificialJade", "a91df42cd2802cab8477faba2b6e7ca9"), + // 4 Star Weapons Pole + ("FootprintOfTheRainbow", "a861e8083fcf30d1761e566e22868fd2"), + ("ProspectorsDrill", "e61d4d8a61fb5c968761312f18ed7812"), + ("DialoguesOfTheDesertSages", "95ed6f690c3e8a747d57a898547cce7a"), + ("RightfulReward", "1a5faad17eb91402baff10bd7820fe03"), + ("BalladOfTheFjords", "18f2b5997c222617c28b739eb92de1c1"), + // 4 Star Weapons Claymore + ("EarthShaker", "8157457687dcb9aa1fe3016e6bfb5836"), + ("PortablePowerSaw", "f1c68aba7315be5f0c41901590661c9b"), + ("UltimateOverlordsMegaMagicSword", "17209097a4d95ec61cb7bf14bd7ab85a"), + ("TidalShadow", "0ecc6129519b29b41ad796f92cac9a02"), + ("TalkingStick", "35e6503456cd18c40b4a4e856f8f78b4"), + // 4 Star Weapons Sword + ("FluteOfEzpitzal", "e0a4036946e1e9fa86a95e4ae5d8f937"), + ("SwordOfNarzissenkreuz", "6493e5f44ba0bfeee95190c67ce2ce6a"), + ("TheDockhandsAssistant", "9ee3b1bd75d9efda391a03aa99dcf1f2"), + ("FleuveCendreFerryman", "ce6493b62ee52f371173651b3257a5f9"), + ("FinaleOfTheDeep", "613168d81592aa37a10f16bb87a78c85"), + // 黑曜秘典 + ("UI_RelicIcon_15038_4", "e9c42c8132bc360bf465d5f45a5a3dc0"), + ("UI_RelicIcon_15038_5", "74684390899b5f05c1648b9404f6d7a2"), + ("UI_RelicIcon_15038_3", "29b282b1b9bbe082874fb943aab6a405"), + ("UI_RelicIcon_15038_2", "15dfd957828fdfa880424238059b6574"), + ("UI_RelicIcon_15038_1", "5f0b9ae4663323fa3a448c406cbbb112"), + // 烬城勇者绘卷 + ("UI_RelicIcon_15037_4", "07398d19576ee60535eb7552c943e738"), + ("UI_RelicIcon_15037_5", "dc8f3d29e46ac5c5fca3cc03ea240db1"), + ("UI_RelicIcon_15037_3", "daf989272d20ab0411b5408f8504a394"), + ("UI_RelicIcon_15037_2", "30c45b49df7b7f2fdeeded5514b10fd9"), + ("UI_RelicIcon_15037_1", "8c3542654bd72a5f27030508d7917a6e"), + // 未竟的遐思 + ("UI_RelicIcon_15036_4", "4feb283bbc23e58e9265e18b371c467a"), + ("UI_RelicIcon_15036_5", "05300f93fe8cddc4973950f6806e1adb"), + ("UI_RelicIcon_15036_3", "6932025ba8b59e2c531441a00c08b572"), + ("UI_RelicIcon_15036_2", "33e4aefc97fdff22388249565e0d996e"), + ("UI_RelicIcon_15036_1", "9e301f350df51d3360e109e771d44534"), + // 谐律异想断章 + ("UI_RelicIcon_15035_4", "08b16dee4e1e04e13ed33258a34b893a"), + ("UI_RelicIcon_15035_5", "074052fa955b62bdaf9435b5fde93fd8"), + ("UI_RelicIcon_15035_3", "2a21972e9b89f504c7444fb4a439d9b6"), + ("UI_RelicIcon_15035_2", "dfb10d691bffc51c66ac3ccbfb35cce1"), + ("UI_RelicIcon_15035_1", "6df7f8173e5869e349eb43d3dd1f72bd"), + // 回声之林夜话 + ("UI_RelicIcon_15034_4", "18b4d9a2f4f3c3c31811879e2e61a11b"), + ("UI_RelicIcon_15034_5", "97a19394aa477d8812b6ad3b6f29c650"), + ("UI_RelicIcon_15034_3", "ee73f8b13beb3b539593644541dd30ec"), + ("UI_RelicIcon_15034_2", "117cb2fbd79f19aa84ec4798eceea2fb"), + ("UI_RelicIcon_15034_1", "8697bbf7ae136b67a19797803e3b62ac"), + // 昔时之歌 + ("UI_RelicIcon_15033_4", "02b777d53c28acf5c25efe0c079b0e51"), + ("UI_RelicIcon_15033_5", "92822eee6aef16124898cd1a2d796fc8"), + ("UI_RelicIcon_15033_3", "8956afdebb6dbd994b881d3a3b4527cc"), + ("UI_RelicIcon_15033_2", "b85d969818f94125ec020bb04c697bcf"), + ("UI_RelicIcon_15033_1", "d905b2caa4ade21a0312a38b0a565a7c"), + // 黄金剧团 + ("UI_RelicIcon_15032_4", "9c3e75b95befcea2afa110828a2b5679"), + ("UI_RelicIcon_15032_5", "be4fa798584c3e6868a228f7e54cbfde"), + ("UI_RelicIcon_15032_3", "45d337eaca981b4b3e00d704f6e11c95"), + ("UI_RelicIcon_15032_2", "ed99c2a85aca30efdcea7ab2242ac3c1"), + ("UI_RelicIcon_15032_1", "ae3867e36dba71d529520d12491c934e"), + // 逐影猎人 + ("UI_RelicIcon_15031_4", "7e4df1daa13237119fd5d789b137b427"), + ("UI_RelicIcon_15031_5", "764fda52bb26c4e84510b8a21d4f036b"), + ("UI_RelicIcon_15031_3", "45ae02ac98e0a5863ccf35bba707afac"), + ("UI_RelicIcon_15031_2", "951e55a31658078648386a4917af39ca"), + ("UI_RelicIcon_15031_1", "b613fcca1f28ec0a3f9ee39cffe452cf"), ]; data.into_iter().collect() diff --git a/mona_generate/templates/artifact_meta_template.js b/mona_generate/templates/artifact_meta_template.js index bec57a21..ff8696c9 100644 --- a/mona_generate/templates/artifact_meta_template.js +++ b/mona_generate/templates/artifact_meta_template.js @@ -1,7 +1,7 @@ const template = "https://upload-bbs.mihoyo.com/game_record/genshin/equip/#.png" -const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_uceddf/#.png" +const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_u9b0pg/#.png" const getIcon = name => template.replace("#", name) -const getHash = md5 => newTemplate.replace("#", md5) +const getHash = hash => newTemplate.replace("#", hash) export default { {% for a in artifacts %} diff --git a/mona_generate/templates/character_meta_template.js b/mona_generate/templates/character_meta_template.js index e1773eb7..22a1d897 100644 --- a/mona_generate/templates/character_meta_template.js +++ b/mona_generate/templates/character_meta_template.js @@ -7,9 +7,9 @@ import {{ c.name }}_splash from "@image/characters/{{ c.name }}_splash" // const template = "https://upload-bbs.mihoyo.com/game_record/genshin/character_icon/UI_AvatarIcon_#.png?x-oss-process=image/crop,w_200,h_200,y_5,g_north" const template = "https://upload-bbs.mihoyo.com/game_record/genshin/character_icon/UI_AvatarIcon_#.png?x-oss-process=image/crop,w_200,h_200,y_5,g_north" -const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_uceddf/#.png?x-oss-process=image/crop,w_200,h_200,y_5,g_north" +const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_u9b0pg/#.png?x-oss-process=image/crop,w_200,h_200,y_5,g_north" const getName = name => template.replace("#", name) -const getMd5 = md5 => newTemplate.replace("#", md5) +const getHash = hash => newTemplate.replace("#", hash) export default { {% for c in characters %} @@ -24,7 +24,7 @@ export default { {% if c.icon_hash == "" -%} avatar: getName("{{ c.internal_name }}"), {% else -%} - avatar: getMd5("{{ c.icon_hash }}"), + avatar: getHash("{{ c.icon_hash }}"), {%- endif %} splash: {{ c.name }}_splash, skillName1: {{ c.skill1_name_index }}, diff --git a/mona_generate/templates/tf_meta_template.js b/mona_generate/templates/tf_meta_template.js index 36dc847d..37b4860f 100644 --- a/mona_generate/templates/tf_meta_template.js +++ b/mona_generate/templates/tf_meta_template.js @@ -6,9 +6,9 @@ import {{ t.name }}_image from "@image/{{ t.badge_path }}" {% endfor %} const template = "https://upload-bbs.mihoyo.com/game_record/genshin/character_icon/#.png" -const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_uceddf/#.png" +const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_u9b0pg/#.png" const getImage = name => template.replace("#", name) -const getIcon = md5 => newTemplate.replace("#", md5) +const getIcon = hash => newTemplate.replace("#", hash) export default { {% for t in tfs %} diff --git a/mona_generate/templates/weapon_meta_template.js b/mona_generate/templates/weapon_meta_template.js index 0c9c342a..6a85f7c5 100644 --- a/mona_generate/templates/weapon_meta_template.js +++ b/mona_generate/templates/weapon_meta_template.js @@ -4,9 +4,9 @@ // {% endfor %} const template = "https://upload-bbs.mihoyo.com/game_record/genshin/equip/UI_EquipIcon_#.png" -const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_uceddf/#.png" +const newTemplate = "https://act-webstatic.mihoyo.com/hk4e/e20200928calculate/item_icon_u9b0pg/#.png" const imageUrl = name => template.replace("#", name) -const newImageUrl = md5 => newTemplate.replace("#", md5) +const newImageUrl = hash => newTemplate.replace("#", hash) export default { {% for weapon in weapons %}