def initBug(): """Called once after Civ has initialized its data structures.""" global g_initDone if not g_initDone: import BugInit if BugInit.init(): g_initDone = True
def initAfterReload(): """ Initialize BUG and fires PythonReloaded event after reloading Python modules while game is still running. The first time this module is loaded after the game launches, the global context is not yet ready, and thus BUG cannot be initialized. When the Python modules are reloaded after being changed, however, this will reinitialize BUG and the main interface. """ import BugInit if BugInit.init(): try: import CvScreensInterface CvScreensInterface.reinitMainInterface() except: import BugUtil BugUtil.error("BugInit - failure rebuilding main interface after reloading Python modules") getEventManager().fireEvent("PythonReloaded") import CvMainInterface #added Sephi mainInterface = CvMainInterface.CvMainInterface() mainInterface.initState() # initialize BUG after Python modules have been reloaded initAfterReload()
def initAfterReload(): """ Initialize BUG and fires PythonReloaded event after reloading Python modules while game is still running. The first time this module is loaded after the game launches, the global context is not yet ready, and thus BUG cannot be initialized. When the Python modules are reloaded after being changed, however, this will reinitialize BUG and the main interface. """ import BugInit BugInit.init() try: import CvScreensInterface CvScreensInterface.reinitMainInterface() except: import BugUtil BugUtil.error( "BugInit - failure rebuilding main interface after reloading Python modules" ) eventManager.fireEvent("PythonReloaded")
def _handleInitBugEvent(self, eventType, argsList): """Initializes BUG before handling event normally. """ import BugInit BugInit.init() self._handleDefaultEvent(eventType, argsList)
def forceBUGModuleInit(argsList): import BugInit BugInit.init()