FF1: Bizhawk Client and APWorld Support (#4448)

Co-authored-by: beauxq <beauxq@yahoo.com>
Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
Rosalie
2025-05-22 11:35:38 -04:00
committed by GitHub
parent 88b529593f
commit 9c0ad2b825
11 changed files with 356 additions and 772 deletions

View File

@@ -1,5 +1,5 @@
import json
from pathlib import Path
import pkgutil
from typing import Dict, NamedTuple, List, Optional
from BaseClasses import Region, Location, MultiWorld
@@ -18,13 +18,11 @@ class FF1Locations:
_location_table_lookup: Dict[str, LocationData] = {}
def _populate_item_table_from_data(self):
base_path = Path(__file__).parent
file_path = (base_path / "data/locations.json").resolve()
with open(file_path) as file:
locations = json.load(file)
# Hardcode progression and categories for now
self._location_table = [LocationData(name, code) for name, code in locations.items()]
self._location_table_lookup = {item.name: item for item in self._location_table}
file = pkgutil.get_data(__name__, "data/locations.json")
locations = json.loads(file)
# Hardcode progression and categories for now
self._location_table = [LocationData(name, code) for name, code in locations.items()]
self._location_table_lookup = {item.name: item for item in self._location_table}
def _get_location_table(self) -> List[LocationData]:
if not self._location_table or not self._location_table_lookup: