Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
fixed map bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
colinhartigan committed Sep 25, 2021
1 parent c70e084 commit d7be7f4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/presence/presence_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def fetch_rank_data(client,content_data):
return rank_image, rank_text

@staticmethod
def fetch_map_data(data,content_data):
def fetch_map_data(coregame_data,content_data):
for gmap in content_data["maps"]:
if gmap["path"] == data["matchMap"]:
if gmap["path"] == coregame_data["MapID"]:
return gmap["display_name"], gmap["display_name_localized"]
return "", ""

Expand All @@ -71,11 +71,11 @@ def fetch_mode_data(data, content_data):
return image,mode_name

@staticmethod
def get_content_preferences(client,pref,presence,player_data,content_data):
def get_content_preferences(client,pref,presence,player_data,coregame_data,content_data):
if pref == Localizer.get_localized_text("config", "rank"):
return Utilities.fetch_rank_data(client,content_data)
if pref == Localizer.get_localized_text("config", "map"):
gmap = Utilities.fetch_map_data(presence,content_data)
gmap = Utilities.fetch_map_data(coregame_data,content_data)
return f"splash_{gmap[0].lower()}", gmap[1]
if pref == Localizer.get_localized_text("config", "agent"):
return Utilities.fetch_agent_data(player_data["CharacterID"],content_data)
Expand Down
2 changes: 1 addition & 1 deletion src/presence/presences/ingame_presences/range.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self,rpc,client,data,match_id,content_data,config):
self.match_id = match_id
self.puuid = self.client.puuid

data["matchMap"] = "/Game/Maps/Poveglia/Range" # hotfix :)
data["MapID"] = "/Game/Maps/Poveglia/Range" # hotfix :)
self.start_time = time.time()
self.map_name, self.mode_name = Utilities.fetch_map_data(data, content_data)
self.map_image = "splash_range"
Expand Down
4 changes: 2 additions & 2 deletions src/presence/presences/ingame_presences/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def build_static_states(self):
if player["Subject"] == self.puuid:
coregame_player_data = player

self.large_image, self.large_text = Utilities.get_content_preferences(self.client,self.large_pref,presence,coregame_player_data,self.content_data)
self.small_image, self.small_text = Utilities.get_content_preferences(self.client,self.small_pref,presence,coregame_player_data,self.content_data)
self.large_image, self.large_text = Utilities.get_content_preferences(self.client,self.large_pref,presence,coregame_player_data,coregame_data,self.content_data)
self.small_image, self.small_text = Utilities.get_content_preferences(self.client,self.small_pref,presence,coregame_player_data,coregame_data,self.content_data)
_, self.mode_name = Utilities.fetch_mode_data(presence,self.content_data)

def main_loop(self):
Expand Down
1 change: 1 addition & 0 deletions src/presence/presences/menu_presences/custom_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def presence(rpc,client=None,data=None,content_data=None,config=None):

else:
party_state,party_size = Utilities.build_party_state(data)
data["MapID"] = data["matchMap"]
game_map,map_name = Utilities.fetch_map_data(data,content_data)
team = content_data["team_image_aliases"][data["customGameTeam"]] if data["customGameTeam"] in content_data["team_image_aliases"] else "game_icon_white"
team_patched = content_data["team_aliases"][data["customGameTeam"]] if data["customGameTeam"] in content_data["team_aliases"].keys() else None
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/config/app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ...localization.localization import Localizer

default_config = {
"version": "v3.1.2",
"version": "v3.1.3",
"region": ["",Client.fetch_regions()],
"client_id": 811469787657928704,
"presence_refresh_interval": 3,
Expand Down

0 comments on commit d7be7f4

Please sign in to comment.