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

Changes details and fixes default large image not appearing #41

Merged
merged 3 commits into from
Jun 28, 2024
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ __pycache__/
/dist/
/build/
hoi4-presence*/
*.zip
*.zip
.venv/
8 changes: 4 additions & 4 deletions src/discordRPC/countries.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ def getCountry(country: str) -> Country:

# This is raised when there is a country that isn't in the countries dictionary
if countryTuple is None:
countries[country] = (country, HOI_ICON)
countries[country] = (country, DEFAULT_LARGE_IMAGE)

# Raised if there isn't an image link
elif countryTuple[1] == "":
countries[country] = (countryTuple[0], HOI_ICON)
countries[country] = (countryTuple[0], DEFAULT_LARGE_IMAGE)

countryName = countries[country][0]
flag = countries[country][1]

return Country(countryName, flag)

HOI_ICON = "https://hoi4.paradoxwikis.com/images/8/8a/HoI4_icon.png"
DEFAULT_LARGE_IMAGE = "hoi4-logo2"

# List of countries, add more if you want
countries: dict[str, tuple[str, str]] = {
Expand All @@ -39,7 +39,7 @@ def getCountry(country: str) -> Country:
"FRA" : ("France", "https://hoi4.paradoxwikis.com/images/d/de/France.png"),
"SPR" : ("Spain", "https://hoi4.paradoxwikis.com/images/2/2c/Nationalist_Spain.png"),
"BUL" : ("Bulgaria", "https://hoi4.paradoxwikis.com/images/f/f4/Bulgaria.png"),
"D##" : ("Civil War Country", HOI_ICON),
"D##" : ("Civil War Country", DEFAULT_LARGE_IMAGE),

"AFG" : ("Afghanistan", "https://hoi4.paradoxwikis.com/images/7/7d/Afghanistan.png"),
"ALB" : ("Albania", "https://hoi4.paradoxwikis.com/images/0/07/Albania.png"),
Expand Down
2 changes: 1 addition & 1 deletion src/discordRPC/hoi4RPC.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# default values
RPC.update(
details="In menus...",
details="Preparing for war...",
large_image="hoi4-logo", # put this in a var?
large_text="thiaudiott/hoi4-presence on Github!",
start=playTime
Expand Down