mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Avoid bloating patch size any more than strictly needed
This commit is contained in:
8
Text.py
8
Text.py
@@ -1182,7 +1182,7 @@ class TextTable(object):
|
|||||||
else:
|
else:
|
||||||
self._text[key]=value
|
self._text[key]=value
|
||||||
|
|
||||||
def getBytes(self):
|
def getBytes(self, pad=false):
|
||||||
logger = logging.getLogger('')
|
logger = logging.getLogger('')
|
||||||
data = b''.join(self._text.values())
|
data = b''.join(self._text.values())
|
||||||
logger.debug("translation space remaining: %i", self.SIZE - len(data))
|
logger.debug("translation space remaining: %i", self.SIZE - len(data))
|
||||||
@@ -1190,7 +1190,10 @@ class TextTable(object):
|
|||||||
if len(data) > self.SIZE:
|
if len(data) > self.SIZE:
|
||||||
raise Exception("Text data is too large to fit")
|
raise Exception("Text data is too large to fit")
|
||||||
|
|
||||||
return data.ljust(self.SIZE, b'\xff')
|
if (pad):
|
||||||
|
return data.ljust(self.SIZE, b'\xff')
|
||||||
|
else:
|
||||||
|
return data
|
||||||
|
|
||||||
def removeUnwantedText(self):
|
def removeUnwantedText(self):
|
||||||
nomessage = bytes(CompressedTextMapper.convert("{NOTEXT}", False))
|
nomessage = bytes(CompressedTextMapper.convert("{NOTEXT}", False))
|
||||||
@@ -1805,3 +1808,4 @@ class TextTable(object):
|
|||||||
text['ganon_phase_3_alt'] = CompressedTextMapper.convert("Got wax in\nyour ears?\nI cannot die!")
|
text['ganon_phase_3_alt'] = CompressedTextMapper.convert("Got wax in\nyour ears?\nI cannot die!")
|
||||||
# 190
|
# 190
|
||||||
text['end_pad_data'] = bytearray([0xfb])
|
text['end_pad_data'] = bytearray([0xfb])
|
||||||
|
text['terminator'] = bytearray([0xFF, 0xFF])
|
||||||
|
Reference in New Issue
Block a user