Hello,
if a key / attribute is missing in the localeinfo in normally crashes and dont let you ingame - I added a "small" workaround for it (it's easy to implement):
Add these class into system.py
Python
- class LocaleInfoWrapper(object):
- def __init__(self, wrapped):
- self.wrapped = wrapped
- def __getattr__(self, name):
- # Perform custom logic here
- try:
- return getattr(self.wrapped, name)
- except AttributeError:
- dbg.TraceError("Locale attribute not found: {0}".format(name))
- return "Locale not found: {0}".format(name)
Search for that:
Add this above:
done, now you can start the game with missing locales and it will print in out to the TraceError
NOTE: This is just something I did because one of my clients work with locales and sometimes crashes my client, you need to adjust for e.g. supporting calling etc / formating strings.. blabla
for python3 you can define the __getattr__ function inside localeinfo.py which is way easier to implement.
Bitte melden Sie sich an, um diesen Link zu sehen.
best regards
clocky