Skip to content

Commit

Permalink
Merge pull request #41 from ThiaudioTT/fix/bug-fixes
Browse files Browse the repository at this point in the history
Changes details and fixes default large image not appearing
  • Loading branch information
ThiaudioTT authored Jun 28, 2024
2 parents 82287af + b51eaa9 commit 0a208b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
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

0 comments on commit 0a208b3

Please sign in to comment.