From 9de979cd484ea8579dc0d3307e6ac22296ccd802 Mon Sep 17 00:00:00 2001 From: CJ Shrader Date: Wed, 26 Feb 2025 08:47:50 -0500 Subject: [PATCH 1/2] Added ability to pull tribute data from d4data. At this time this data is not used --- .github/workflows/release.yml | 30 +----------------------------- README.md | 3 ++- assets/lang/enUS/tributes.json | 13 +++++++++++++ assets/lang/enUS/uniques.json | 2 +- src/tools/gen_data.py | 18 ++++++++++++++++++ 5 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 assets/lang/enUS/tributes.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87335834..29522e2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,32 +73,4 @@ jobs: parse = @() } } | ConvertTo-Json - Invoke-RestMethod -Uri $webhookUrl -Method Post -ContentType "application/json" -Body $payload - - github-releases-to-discord: - needs: release - runs-on: windows-latest - steps: - # From: https://github.com/SethCohen/github-releases-to-discord - - name: Github Releases To Discord - uses: SethCohen/github-releases-to-discord@master - with: - webhook_url: ${{ secrets.DISCORD_WEBHOOK }} - color: "2105893" - username: "D4LF Release" - -# Also not working, have a request out here: https://github.com/SethCohen/github-releases-to-discord/issues/29 -# # From: https://github.com/SethCohen/github-releases-to-discord -# - name: Github Releases To Discord -# uses: SethCohen/github-releases-to-discord@master -# with: -# webhook_url: ${{ secrets.DISCORD_WEBHOOK }} -# color: "2105893" -# username: "D4LF Release" - -# Not currently working, but I have an issue out for it: https://github.com/nhevia/discord-styled-releases/issues/12 -# - name: Sending message to Discord with release notes -# uses: nhevia/discord-styled-releases@main -# with: -# webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }} -# webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }} + Invoke-RestMethod -Uri $webhookUrl -Method Post -ContentType "application/json" -Body $payload \ No newline at end of file diff --git a/README.md b/README.md index a4d04156..6cc378ae 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,8 @@ being filtered by aspect: - `minGreaterAffixCount`: Only keep uniques with a specific number of greater affixes - `minPercentOfAspect` (experimental): Only keep uniques whose aspect is above a percentage of the total possible. For example, if this is set to 80 and an aspect has a range of 100-200, then a value of 180 would be kept but a value - of 150 would be marked as junk. This functionality is new so please report any issues found with it. + of 150 would be marked as junk. Situations where a smaller value is what is wanted are automatically handled as well. + This functionality is new so please report any issues found with it. - `minPower`: The minimum item power of uniques to keep - `mythic`: If set to true, only keep mythic uniques. diff --git a/assets/lang/enUS/tributes.json b/assets/lang/enUS/tributes.json new file mode 100644 index 00000000..6095184b --- /dev/null +++ b/assets/lang/enUS/tributes.json @@ -0,0 +1,13 @@ +{ + "tribute_of_ascendance_resolute": "tribute of ascendance (resolute)", + "tribute_of_ascendance_united": "tribute of ascendance (united)", + "tribute_of_growth": "tribute of growth", + "tribute_of_harmony": "tribute of harmony", + "tribute_of_heritage": "tribute of heritage", + "tribute_of_mystique": "tribute of mystique", + "tribute_of_pride": "tribute of pride", + "tribute_of_radiance_resolute": "tribute of radiance (resolute)", + "tribute_of_radiance_united": "tribute of radiance (united)", + "tribute_of_refinement": "tribute of refinement", + "tribute_of_titans": "tribute of titans" +} diff --git a/assets/lang/enUS/uniques.json b/assets/lang/enUS/uniques.json index 6d5f1a43..0c1a6ed9 100644 --- a/assets/lang/enUS/uniques.json +++ b/assets/lang/enUS/uniques.json @@ -618,7 +618,7 @@ }, "okuns_catalyst": { "desc": "ball lightning orbits you creating a static field that damages all enemies within for of ball lightnings damage per active ball. you are unhindered as long as the field is active.", - "full": "{c_important}Ball Lightning{/c} orbits you creating a static field that damages all enemies within for {c_random}[Affix_Value_1* 100|%x|]{/c} of {c_important}Ball Lightning's{/c} damage per active ball. You are {c_important} {u}Unhindered{/u}{/c} as long as the field is active.", + "full": "{c_important}Ball Lightning{/c} orbits you creating a static field that damages all enemies within for {c_random}[Affix_Value_1* 100|%|]{/c} of {c_important}Ball Lightning's{/c} damage per active ball. You are {c_important} {u}Unhindered{/u}{/c} as long as the field is active.", "num_idx": [ 0 ], diff --git a/src/tools/gen_data.py b/src/tools/gen_data.py index 0b0b6bee..fe190291 100644 --- a/src/tools/gen_data.py +++ b/src/tools/gen_data.py @@ -60,6 +60,7 @@ def main(d4data_dir: Path, companion_app_dir: Path): f"assets/lang/{lang}/aspects.json", f"assets/lang/{lang}/uniques.json", f"assets/lang/{lang}/sigils.json", + f"assets/lang/{lang}/tributes.json", f"assets/lang/{lang}/item_types.json", f"assets/lang/{lang}/tooltips.json", ] @@ -175,6 +176,23 @@ def main(d4data_dir: Path, companion_app_dir: Path): json.dump(sigil_dict, json_file, indent=4, ensure_ascii=False, sort_keys=True) json_file.write("\n") + print(f"Gen Tributes for {language}") + tribute_dict = {} + + # Add others automatically + pattern = f"json/{language}_Text/meta/StringList/Item_*_TributeKeySigil_*.stl.json" + json_files = list(d4data_dir.glob(pattern)) + for json_file in json_files: + with open(json_file, encoding="utf-8") as file: + data = json.load(file) + name_idx, _ = (0, 1) if data["arStrings"][0]["szLabel"] == "Name" else (1, 0) + tribute_name: str = data["arStrings"][name_idx]["szText"].lower().strip().replace("’", "").replace("'", "") + tribute_dict[tribute_name.replace(" ", "_").replace("(", "").replace(")", "")] = tribute_name + + with open(D4LF_BASE_DIR / f"assets/lang/{language}/tributes.json", "w", encoding="utf-8") as json_file: + json.dump(tribute_dict, json_file, indent=4, ensure_ascii=False, sort_keys=True) + json_file.write("\n") + print(f"Gen ItemTypes for {language}") whitelist_types = [ "Amulet", From 4d830aa0d2ce10ab99fed45e1360864933409ef4 Mon Sep 17 00:00:00 2001 From: CJ Shrader Date: Wed, 26 Feb 2025 08:49:19 -0500 Subject: [PATCH 2/2] One day I'll learn to run pre-commit first --- .github/workflows/release.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29522e2c..5919f9f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,4 +73,4 @@ jobs: parse = @() } } | ConvertTo-Json - Invoke-RestMethod -Uri $webhookUrl -Method Post -ContentType "application/json" -Body $payload \ No newline at end of file + Invoke-RestMethod -Uri $webhookUrl -Method Post -ContentType "application/json" -Body $payload diff --git a/README.md b/README.md index 6cc378ae..61891831 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,7 @@ being filtered by aspect: - `minGreaterAffixCount`: Only keep uniques with a specific number of greater affixes - `minPercentOfAspect` (experimental): Only keep uniques whose aspect is above a percentage of the total possible. For example, if this is set to 80 and an aspect has a range of 100-200, then a value of 180 would be kept but a value - of 150 would be marked as junk. Situations where a smaller value is what is wanted are automatically handled as well. + of 150 would be marked as junk. Situations where a smaller value is what is wanted are automatically handled as well. This functionality is new so please report any issues found with it. - `minPower`: The minimum item power of uniques to keep - `mythic`: If set to true, only keep mythic uniques.