Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to pull tribute data from d4data. As of this commit this data is not used #456

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,3 @@ jobs:
}
} | 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 }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
13 changes: 13 additions & 0 deletions assets/lang/enUS/tributes.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion assets/lang/enUS/uniques.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
Expand Down
18 changes: 18 additions & 0 deletions src/tools/gen_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down Expand Up @@ -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",
Expand Down