Skip to content

Commit

Permalink
Improve character id search
Browse files Browse the repository at this point in the history
  • Loading branch information
joaorb64 committed Oct 25, 2023
1 parent 3b65cde commit 2dd3c2b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/TSHGameAssetManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,14 @@ def run(self):
self.assetsLoaderThread.lock = self.assetsLoaderLock
self.assetsLoaderThread.start(QThread.Priority.HighestPriority)

# Setup startgg chacter id to character name
sggcharacters = json.loads(
open('./assets/characters.json', 'r').read())
self.startgg_id_to_character = {}

for c in sggcharacters.get("entities", {}).get("character", []):
self.startgg_id_to_character[str(c.get("id"))] = c

# self.programState["asset_path"] = self.selectedGame.get("path")
# self.programState["game"] = game

Expand Down Expand Up @@ -573,14 +581,6 @@ def UpdateCharacterModel(self):
self.characterModel.appendRow(item)

self.characterModel.sort(0)

# Setup startgg chacter id to character name
sggcharacters = json.loads(
open('./assets/characters.json', 'r').read())
self.startgg_id_to_character = {}

for c in sggcharacters.get("entities", {}).get("character", []):
self.startgg_id_to_character[str(c.get("id"))] = c
except:
logger.error(traceback.format_exc())

Expand Down

0 comments on commit 2dd3c2b

Please sign in to comment.