Fixed crashes

This commit is contained in:
strongleong 2023-02-07 19:38:24 +11:00
parent 7a34fd006b
commit 40e264083f
7 changed files with 114 additions and 39 deletions

View file

@ -1,3 +1,6 @@
# Loader
This is just `init.py` with my custom files preloaded
This is just `init.py` with my custom files preloaded.
In the future we will come up with some mechanism for auto-preloading `.pyc` files
in some special folder. But for now it is what it is.

View file

@ -16,12 +16,7 @@
import Scrap
def log(msg):
Scrap.Print("[STRNG][INIT] " + msg + "\n")
log('Init started')
logger = None
PlaySpacelords = not Scrap.IsApp(436180) # 1 to activate the cross promotion
##################################
@ -110,6 +105,17 @@ HasSuperDeal = OffLineGame and sDealType and sDealType != "" and (UpperMap in
OutMapSkip = OffLineGame and (UpperMap in OUTMAPS)
InMapSkip = OffLineGame and (UpperMap in INMAPS)
###### Preloading custom stuff ######
Scrap.PreloadLibrary('Logger','Custom/Logger.pyc')
import Logger
logger = Logger.Logger('Loader')
logger.info('Logger initialized')
logger.debug(logger)
logger.info('Preloading MyMenu...')
Scrap.PreloadLibrary('MyMenu','Scorer/MyMenu.pyc')
logger.info('MyMenu preloaded')
#Scrap.PreloadLibrary('QuickConsole','QuickConsole.pyc') # QuickConsole no es una libreria para el sistema
@ -118,10 +124,6 @@ Scrap.PreloadLibrary('Items','Items.pyc')
Scrap.PreloadLibrary('SaveGame','SaveGame.pyc')
###### Sistema de menues y scorer ######
log('Preloading ModsMenu')
Scrap.PreloadLibrary('MyMenu','Scorer/MyMenu.pyc')
log('ModsMenu preload injected')
if (Scrap.Get("IsXbox") == 1):
Scrap.PreloadLibrary('XBMenu','Scorer/XBMenu.pyc')
else: