Skip to content

Commit

Permalink
use pkgutil
Browse files Browse the repository at this point in the history
  • Loading branch information
threeandthreee committed Sep 19, 2024
1 parent 07595ab commit 5b85442
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions worlds/ladx/LADXR/patches/aesthetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .. import entityData
import os
import bsdiff4
import pkgutil

def imageTo2bpp(filename):
import PIL.Image
Expand Down Expand Up @@ -179,10 +180,9 @@ def noText(rom):

def reduceMessageLengths(rom, rnd):
# Into text from Marin. Got to go fast, so less text. (This intro text is very long)
lines = open(os.path.join(os.path.dirname(__file__), "marin.txt"), "rb").readlines()
while lines[-1].strip() == b'':
lines.pop(-1)
rom.texts[0x01] = formatText(rnd.choice(lines).strip().decode("unicode_escape"))
lines = pkgutil.get_data(__name__, "marin.txt").decode("unicode_escape").splitlines()
lines = [l for l in lines if l.strip()]
rom.texts[0x01] = formatText(rnd.choice(lines).strip())

# Reduce length of a bunch of common texts
rom.texts[0xEA] = formatText("You've got a Guardian Acorn!")
Expand Down

0 comments on commit 5b85442

Please sign in to comment.