Skip to content

Commit

Permalink
Missing map marker icon fix (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
pede authored Jan 2, 2024
1 parent 0ad3690 commit 5488a0e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 20 deletions.
Binary file added rustplus/api/icons/ferryterminal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rustplus/api/icons/harbour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rustplus/api/icons/mining_quarry_hqm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rustplus/api/icons/mining_quarry_stone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rustplus/api/icons/mining_quarry_sulfur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rustplus/api/icons/missile_silo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed rustplus/api/icons/quarry.png
Binary file not shown.
Binary file removed rustplus/api/icons/stable.png
Binary file not shown.
Binary file added rustplus/api/icons/stables.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 16 additions & 20 deletions rustplus/utils/rust_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def convert_time(time) -> str:
)


def format_coord(x, y, map_size) -> tuple:
def format_coord(x, y, map_size) -> Tuple[int, int]:
y = map_size - y - 75
x -= 75

Expand Down Expand Up @@ -84,7 +84,6 @@ def convert_marker(name, angle) -> Image.Image:

def convert_monument(name: str, override_images: dict) -> Image.Image:
name_to_file = {
"train_tunnel_display_name": "train.png",
"supermarket": "supermarket.png",
"mining_outpost_display_name": "mining_outpost.png",
"gas_station": "oxums.png",
Expand All @@ -108,6 +107,19 @@ def convert_monument(name: str, override_images: dict) -> Image.Image:
"large_oil_rig": "large_oil_rig.png",
"underwater_lab": "underwater_lab.png",
"AbandonedMilitaryBase": "desert_base.png",
"ferryterminal": "ferryterminal.png",
"harbor_display_name": "harbour.png",
"harbor_2_display_name": "harbour.png",
"arctic_base_a": "arctic_base.png",
"arctic_base_b": "arctic_base.png",
"missile_silo_monument": "missile_silo.png",
"stables_a": "stables.png",
"stables_b": "stables.png",
"mining_quarry_stone_display_name": "mining_quarry_stone.png",
"mining_quarry_sulfur_display_name": "mining_quarry_sulfur.png",
"mining_quarry_hqm_display_name": "mining_quarry_hqm.png",
"train_tunnel_link_display_name": "train.png",
"train_tunnel_display_name": "train.png",
}

try:
Expand All @@ -119,24 +131,8 @@ def convert_monument(name: str, override_images: dict) -> Image.Image:
file_name = name_to_file[name]
with resources.path(icons_path, file_name) as path:
icon = Image.open(path).convert("RGBA")
elif (
"mining_quarry" in name
or "harbor" in name
or "stables" in name
or "swamp" in name
or "arctic_base" in name
):
if "mining_quarry" in name:
file_name = "quarry.png"
elif "harbor" in name:
file_name = "harbour.png"
elif "stables" in name:
file_name = "stable.png"
elif "swamp" in name:
file_name = "swamp.png"
elif "arctic_base" in name:
file_name = "arctic_base.png"
with resources.path(icons_path, file_name) as path:
elif "swamp" in name:
with resources.path(icons_path, "swamp.png") as path:
icon = Image.open(path).convert("RGBA")
else:
logging.getLogger("rustplus.py").info(
Expand Down

0 comments on commit 5488a0e

Please sign in to comment.