def _populate(self): super(TechTree, self)._populate() g_guiResetters.add(self.__onUpdateStage) if IS_DEVELOPMENT: from gui import InputHandler InputHandler.g_instance.onKeyUp += self.__handleReloadData self.setupContextHints(TUTORIAL.RESEARCH_TREE)
def start(self): g_guiResetters.add(self.__onRecreateDevice) self.__identifySPG() for control in self.__ctrls.itervalues(): control.create() self.__addBattleCtrlListeners() if not self.__curCtrl.isManualBind(): BigWorld.player().positionControl.bindToVehicle(True) self.__curCtrl.enable(ctrlState=control_modes.dumpStateEmpty()) self.onCameraChanged('arcade') tmp = self.__curCtrl.getPreferredAutorotationMode() if tmp is not None: self.__isAutorotation = tmp self.__prevModeAutorotation = True else: self.__isAutorotation = True self.__prevModeAutorotation = None BigWorld.player().enableOwnVehicleAutorotation(self.__isAutorotation) self.__targeting.enable(True) self.__isStarted = True self.__isGUIVisible = True self.__killerVehicleID = None arena = BigWorld.player().arena arena.onPeriodChange += self.__onArenaStarted from account_helpers.settings_core.SettingsCore import g_settingsCore g_settingsCore.onSettingsChanged += self.__onSettingsChanged BigWorld.player().consistentMatrices.onVehicleMatrixBindingChanged += self.__onVehicleChanged self.__onArenaStarted(arena.period) return
def _populate(self): g_eventBus.addListener(events.GameEvent.SHOW_CURSOR, self.__handleShowCursor, EVENT_BUS_SCOPE.GLOBAL) g_eventBus.addListener(events.GameEvent.HIDE_CURSOR, self.__handleHideCursor, EVENT_BUS_SCOPE.GLOBAL) g_eventBus.addListener(events.GameEvent.RADIAL_MENU_CMD, self.__toggleRadialMenu, scope=EVENT_BUS_SCOPE.BATTLE) g_eventBus.addListener(events.GameEvent.FULL_STATS, self.__toggleFullStats, scope=EVENT_BUS_SCOPE.BATTLE) g_eventBus.addListener(events.GameEvent.FULL_STATS_QUEST_PROGRESS, self.__toggleFullStatsQuestProgress, scope=EVENT_BUS_SCOPE.BATTLE) g_guiResetters.add(self.__onResizeStage) ctrl = self.sessionProvider.dynamic.maps if ctrl is not None and hasattr(ctrl, 'onVisibilityChanged'): ctrl.onVisibilityChanged += self.__onMapVisibilityChanged ctrl = self.sessionProvider.dynamic.respawn if ctrl is not None and hasattr(ctrl, 'onRespawnVisibilityChanged'): ctrl.onRespawnVisibilityChanged += self.__onRespawnVisibilityChanged spawnCtrl = self.sessionProvider.dynamic.spawn if spawnCtrl is not None: if hasattr(BattleRoyalePage, 'showSpawnPoints'): global hooked_showSpawnPoints if hooked_showSpawnPoints is None: hooked_showSpawnPoints = BattleRoyalePage.showSpawnPoints BattleRoyalePage.showSpawnPoints = newBattleRoyalePageShowSpawnPoints if hasattr(BattleRoyalePage, 'closeSpawnPoints'): global hooked_closeSpawnPoints if hooked_closeSpawnPoints is None: hooked_closeSpawnPoints = BattleRoyalePage.closeSpawnPoints BattleRoyalePage.closeSpawnPoints = newBattleRoyalePageCloseSpawnPoints
def _populate(self): super(HangarHeader, self)._populate() self._currentVehicle = g_currentVehicle self.__screenWidth = BigWorld.screenSize()[0] self._eventsCache.onSyncCompleted += self.update self._eventsCache.onProgressUpdated += self.update self._festivityController.onStateChanged += self.update self.__battlePassController.onSeasonStateChange += self.update self.__rankedController.onGameModeStatusUpdated += self.update self.__mapboxCtrl.onPrimeTimeStatusUpdated += self.update self.__mapboxCtrl.addProgressionListener(self.update) g_clientUpdateManager.addCallbacks({ 'inventory.1': self.update, 'stats.tutorialsCompleted': self.update }) if self._eventsController: self._eventsController.addListener(self) self._marathonsCtrl.onFlagUpdateNotify += self.update self.addListener(events.TutorialEvent.SET_HANGAR_HEADER_ENABLED, self.__onSetHangarHeaderEnabled, scope=EVENT_BUS_SCOPE.LOBBY) self._lobbyContext.getServerSettings( ).onServerSettingsChange += self.__onServerSettingChanged g_guiResetters.add(self.__onChangeScreenResolution)
def _populate(self): super(SettingsWindow, self)._populate() dataVO = [{ 'label': SETTINGS.FEEDBACK_TAB_DAMAGEINDICATOR, 'linkage': VIEW_ALIAS.FEEDBACK_DAMAGE_INDICATOR }, { 'label': SETTINGS.FEEDBACK_TAB_EVENTSINFO, 'linkage': VIEW_ALIAS.FEEDBACK_BATTLE_EVENTS }, { 'label': SETTINGS.FEEDBACK_TAB_DAMAGELOGPANEL, 'linkage': VIEW_ALIAS.FEEDBACK_DAMAGE_LOG }, { 'label': SETTINGS.FEEDBACK_TAB_BATTLEBORDERMAP, 'linkage': VIEW_ALIAS.FEEDBACK_BATTLE_BORDER_MAP }] if self.lobbyContext.getServerSettings().isPMBattleProgressEnabled(): dataVO.append({ 'label': SETTINGS.FEEDBACK_TAB_QUESTSPROGRESS, 'linkage': VIEW_ALIAS.FEEDBACK_QUESTS_PROGRESS }) self.as_setFeedbackDataProviderS(dataVO) if self.__redefinedKeyModeEnabled: BigWorld.wg_setRedefineKeysMode(True) self.__currentSettings = self.params.getMonitorSettings() self._update() VibroManager.g_instance.onConnect += self.onVibroManagerConnect VibroManager.g_instance.onDisconnect += self.onVibroManagerDisconnect self.settingsCore.onSettingsChanged += self.__onColorSettingsChange self.anonymizerController.onStateChanged += self.__refreshSettings g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice)
def start(self): g_guiResetters.add(self.__onRecreateDevice) self.steadyVehicleMatrixCalculator = SteadyVehicleMatrixCalculator() self.__identifySPG() self.__constructComponents() for control in self.__ctrls.itervalues(): control.create() avatar = BigWorld.player() if not self.__curCtrl.isManualBind(): avatar.positionControl.bindToVehicle(True) self.__curCtrl.enable() tmp = self.__curCtrl.getPreferredAutorotationMode() if tmp is not None: self.__isAutorotation = tmp self.__prevModeAutorotation = True else: self.__isAutorotation = True self.__prevModeAutorotation = None avatar.enableOwnVehicleAutorotation(self.__isAutorotation) self.__targeting.enable(True) self.__isStarted = True self.__isGUIVisible = True self.__killerVehicleID = None arena = avatar.arena arena.onPeriodChange += self.__onArenaStarted self.settingsCore.onSettingsChanged += self.__onSettingsChanged avatar.consistentMatrices.onVehicleMatrixBindingChanged += self.__onVehicleChanged self.__onArenaStarted(arena.period) if not avatar.isObserver() and arena.hasObservers: self.__remoteCameraSender = RemoteCameraSender(self) self.onCameraChanged('arcade') return
def start(self, *args): self.__flashObject = self.__parentUI.getMember( '_level0.%s.battleFlash' % self.name) self.__flashObject.script = self g_guiResetters.add(self.as_onScreenResS) self.set_def_config() self.as_onScreenResS()
def populateUI(self, proxy): UIInterface.populateUI(self, proxy) self.uiHolder.addExternalCallbacks({ SettingsInterface.POPULATE_UI: self.onPopulateUI, SettingsInterface.APPLY_SETTINGS: self.onApplySettings, SettingsInterface.COMMIT_SETTINGS: self.onCommitSettings, SettingsInterface.DELAY_SETTINGS: self.onDelaySettings, SettingsInterface.AUTODETECT_QUALITY: self.onAutodetectSettings, 'SettingsDialog.useRedifineKeysMode': self.onUseRedifineKeyMode, 'SettingsDialog.processVivoxTest': self.onProcessVivoxTest, 'SettingsDialog.voiceChatEnable': self.onVoiceChatEnable, 'SettingsDialog.updateCaptureDevices': self.onUpdateCaptureDevices, 'SettingsDialog.setVivoxMicVolume': self.onSetVivoxMicVolume, 'SettingsDialog.killDialog': self.onDialogClose }) VibroManager.g_instance.onConnect += self.__vm_onConnect VibroManager.g_instance.onDisconnect += self.__vm_onDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice)
def start(self): g_guiResetters.add(self.__onRecreateDevice) import aims aims.clearState() self.__identifySPG() for control in self.__ctrls.itervalues(): control.create() self.__addBattleCtrlListeners() g_cursorDelegator.detachCursor() if not self.__curCtrl.isManualBind(): BigWorld.player().positionControl.bindToVehicle(True) self.__curCtrl.enable(ctrlState=control_modes.dumpStateEmpty()) self.onCameraChanged('arcade') tmp = self.__curCtrl.getPreferredAutorotationMode() if tmp is not None: self.__isAutorotation = tmp self.__prevModeAutorotation = True else: self.__isAutorotation = True self.__prevModeAutorotation = None BigWorld.player().enableOwnVehicleAutorotation(self.__isAutorotation) self.__targeting.enable(True) self.__isStarted = True self.__isGUIVisible = True self.__killerVehicleID = None arena = BigWorld.player().arena arena.onPeriodChange += self.__onArenaStarted from account_helpers.settings_core.SettingsCore import g_settingsCore g_settingsCore.onSettingsChanged += self.__onSettingsChanged self.__onArenaStarted(arena.period)
def start(self): g_guiResetters.add(self.__onRecreateDevice) import aims aims.clearState() ownVehicle = BigWorld.entity(BigWorld.player().playerVehicleID) vehTypeDesc = ownVehicle.typeDescriptor.type self.__isSPG = 'SPG' in vehTypeDesc.tags self.__isATSPG = 'AT-SPG' in vehTypeDesc.tags for control in self.__ctrls.itervalues(): control.create() self.__addBattleCtrlListeners() g_cursorDelegator.detachCursor() if not self.__curCtrl.isManualBind(): BigWorld.player().positionControl.bindToVehicle(True) self.__curCtrl.enable(ctrlState=control_modes.dumpStateEmpty()) self.onCameraChanged('arcade') tmp = self.__curCtrl.getPreferredAutorotationMode() if tmp is not None: self.__isAutorotation = tmp self.__prevModeAutorotation = True else: self.__isAutorotation = True self.__prevModeAutorotation = None BigWorld.player().enableOwnVehicleAutorotation(self.__isAutorotation) self.__targeting.enable(True) self.__isStarted = True self.__isGUIVisible = True self.__killerVehicleID = None arena = BigWorld.player().arena arena.onPeriodChange += self.__onArenaStarted from account_helpers.settings_core.SettingsCore import g_settingsCore g_settingsCore.onSettingsChanged += self.__onSettingsChanged self.__onArenaStarted(arena.period)
def hook_after_create(self): hooked_afterCreate(self) if config.enable: armor.flash = CustomFlash('%s.swf' % config.name) armor.flash.data.start() g_guiResetters.add(armor.flash.data.update_pos) config.do_config() armor.cleanup_battle_data()
def __init__(self): self.__isHorizontalFovFixed = getScreenAspectRatio() > FovExtended.__TO_HORIZONTAL_THRESHOLD self.__multiplier = 1.0 self.__enabled = True initialVerticalFov = math.radians(60) self.defaultHorizontalFov = initialVerticalFov * getScreenAspectRatio() from gui import g_guiResetters g_guiResetters.add(self.refreshFov)
def _populate(self): super(SettingsWindow, self)._populate() self.__currentSettings = self.params.getMonitorSettings() self._update() VibroManager.g_instance.onConnect += self.onVibroManagerConnect VibroManager.g_instance.onDisconnect += self.onVibroManagerDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice)
def new_afterCreate(self): orig_afterCreate(self) if spotted._enable: spotted.spotted_flash = Custom_Flash('spotted_count.swf') spotted.spotted_flash.data._start() g_guiResetters.add(spotted.spotted_flash.data._updatePos) config.do_config() inject_startBattle()
def __init__(self, swfFile, finishCallback=None): Flash.__init__(self, swfFile, path=SCALEFORM_SWF_PATH_V3) self._displayRoot = self.getMember('root.main') self.__finishCallback = finishCallback if self._displayRoot is not None: self._displayRoot.resync() g_guiResetters.add(self.onUpdateStage) self.onUpdateStage() return
def _populate(self): super(SettingsWindow, self)._populate() self.__currentSettings = self.params.getMonitorSettings() self._update() VibroManager.g_instance.onConnect += self.onVibroManagerConnect VibroManager.g_instance.onDisconnect += self.onVibroManagerDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice) SoundGroups.g_instance.enableVoiceSounds(True)
def __addListeners(self): self.__plugins = plugins.createPlugins(self) self.__plugins.init() self.__plugins.start() g_settingsCore.interfaceScale.onScaleChanged += self.__setMarkersScale self.addListener(GameEvent.SHOW_EXTENDED_INFO, self.__handleShowExtendedInfo, scope=settings.SCOPE) self.addListener(GameEvent.GUI_VISIBILITY, self.__handleGUIVisibility, scope=settings.SCOPE) self.addListener(GameEvent.MARKERS_2D_VISIBILITY, self.__handleMarkerVisibility, scope=settings.SCOPE) g_settingsCore.onSettingsChanged += self.__onSettingsChanged g_guiResetters.add(self.__onRecreateDevice)
def _populate(self): super(SettingsWindow, self)._populate() if self.__redefinedKeyModeEnabled: BigWorld.wg_setRedefineKeysMode(True) self.__currentSettings = self.params.getMonitorSettings() self._update() VibroManager.g_instance.onConnect += self.onVibroManagerConnect VibroManager.g_instance.onDisconnect += self.onVibroManagerDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice)
def onShow(self): self.__readInterfaceScale() self.__setSlotsPosition() g_guiResetters.add(self.__onChangeScreenResolution) cameraSwitcher = self.customizableObjectsMgr.getSwitchHandler( CameraSwitcher) if cameraSwitcher is not None: cameraSwitcher.addScrollListener(self.__onScrollEvent) self.__isActive = True return
def enable(self, preferredPos=None, closesDist=False, postmortemParams=None, turretYaw=None, gunPitch=None, camTransitionParams=None): replayCtrl = BattleReplay.g_replayCtrl if replayCtrl.isRecording: replayCtrl.setAimClipPosition(self.__aimOffset) self.measureDeltaTime() camDist = None vehicle = BigWorld.player().getVehicleAttached() initialVehicleMatrix = BigWorld.player().getOwnVehicleMatrix( ) if vehicle is None else vehicle.matrix vehicleMProv = initialVehicleMatrix if not self.__postmortemMode: if closesDist: camDist = self._cfg['distRange'][0] elif postmortemParams is not None: self.__aimingSystem.yaw = postmortemParams[0][0] self.__aimingSystem.pitch = postmortemParams[0][1] camDist = postmortemParams[1] else: camDist = self._cfg['distRange'][1] replayCtrl = BattleReplay.g_replayCtrl if replayCtrl.isPlaying: camDist = None vehicle = BigWorld.entity(replayCtrl.playerVehicleID) if vehicle is not None: vehicleMProv = vehicle.matrix if camDist is not None: self.setCameraDistance(camDist) else: self.__inputInertia.teleport(self.__calcRelativeDist()) self.vehicleMProv = vehicleMProv self.__setDynamicCollisions(True) self.__aimingSystem.enable(preferredPos, turretYaw, gunPitch) self.__aimingSystem.aimMatrix = self.__calcAimMatrix() if camTransitionParams is not None and BigWorld.camera( ) is not self.__cam: cameraTransitionDuration = camTransitionParams.get( 'cameraTransitionDuration', -1) if cameraTransitionDuration > 0: self.__setupCameraTransition(cameraTransitionDuration) else: BigWorld.camera(self.__cam) else: BigWorld.camera(self.__cam) self.__cameraUpdate() self.delayCallback(0.0, self.__cameraUpdate) from gui import g_guiResetters g_guiResetters.add(self.__onRecreateDevice) return
def init(self): if self._hangarSpace.spaceInited: if self._hangarSpace.space.getCameraManager() is not None: self.__hangarCameraManager = self._hangarSpace.space.getCameraManager() self.__initCameras() g_eventBus.addListener(events.HangarCameraManagerEvent.ON_CREATE, self.__onCreateHangarCameraManager, scope=EVENT_BUS_SCOPE.LOBBY) g_eventBus.addListener(events.HangarCameraManagerEvent.ON_DESTROY, self.__onDestroyHangarCameraManager, scope=EVENT_BUS_SCOPE.LOBBY) g_guiResetters.add(self.__projectionChangeHandler) self._settingsCore.onSettingsApplied += self.__projectionChangeHandler self.__ctx = self._service.getCtx() return
def _PlayerAvatar_onBecomePlayer(base, self): base(self) try: BigWorld.player().arena.onVehicleKilled += onVehicleKilled sessionProvider = dependency.instance(IBattleSessionProvider) ctrl = sessionProvider.shared.feedback if ctrl: ctrl.onVehicleFeedbackReceived += onVehicleFeedbackReceived g_guiResetters.add(update_conf_hp) except Exception, ex: err(traceback.format_exc())
def _populate(self): super(SettingsWindow, self)._populate() self.__currentSettings = self.params.getMonitorSettings() self.app.voiceChatManager.checkForInitialization() self.as_setDataS(self.__getSettings()) self.as_updateVideoSettingsS(self.__currentSettings) VibroManager.g_instance.onConnect += self.onVibroManagerConnect VibroManager.g_instance.onDisconnect += self.onVibroManagerDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice) SoundGroups.g_instance.enableVoiceSounds(True)
def __init__(self, component = None): Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3) self._displayRoot = self.getMember('root.main') if self._displayRoot is not None: self._displayRoot.resync() self._displayRoot.setLocale(getClientOverride()) self._displayRoot.setVersion(getFullClientVersion()) if constants.IS_KOREA: self._displayRoot.setInfo(MENU.LOADING_GAMEINFO) g_guiResetters.add(self.onUpdateStage) self.onUpdateStage()
def __init__(self): self.__multiplier = 1.0 self.__enabled = True BigWorld.addWatcher('Render/Fov(horizontal, deg)', lambda : self.__horizontalFov) BigWorld.addWatcher('Render/Fov(vertical, deg)', lambda : math.degrees(self.__verticalFov)) self.onSetFovSettingEvent = Event.Event() self.horizontalFov = 90 self.defaultVerticalFov = FovExtended.lookupVerticalFov(self.horizontalFov) self.__lastSetHorizontalFov = self.horizontalFov from gui import g_guiResetters g_guiResetters.add(self.refreshFov)
def __init__(self, component=None): Flash.__init__(self, 'gameLoading.swf', path=SCALEFORM_SWF_PATH_V3) self._displayRoot = self.getMember('root.main') if self._displayRoot is not None: self._displayRoot.resync() self._displayRoot.setLocale(getClientOverride()) self._displayRoot.setVersion(getFullClientVersion()) if constants.IS_KOREA: self._displayRoot.setInfo(MENU.LOADING_GAMEINFO) g_guiResetters.add(self.onUpdateStage) self.onUpdateStage()
def __init__(self, textureName='', parentGUI=None): self.__listKeynames = [] self.__dictItems = {} self.__bAutoUpdate = False self.__align = [False, False, False, False] self.__margin = [0.0, 0.0, 0.0, 0.0] self.__window = None self.__createMainWindow(parentGUI) g_guiResetters.add(self.__onChangeScreenResolution) self.setTextureName(textureName) self.setVisible(False) return
def afterCreate(self): LOG_DEBUG('[App] afterCreate') AppBase.afterCreate(self) self._createManagers() self.__validateManagers() self.as_registerManagersS() g_guiResetters.add(self.onUpdateStage) self.onUpdateStage() g_repeatKeyHandlers.add(self.component.handleKeyEvent) while len(self.__aliasToLoad): alias, name, kargs, kwargs = self.__aliasToLoad.pop(0) self.loadView(alias, name, *kargs, **kwargs) self._loadCursor() self._loadWaiting()
def addHandler(self): if self.__isSetHandler: return self.__isSetHandler = True arena = BigWorld.player().arena arena.onPeriodChange += self.onArenaPeriodChange session = dependency.instance(IBattleSessionProvider) ctl = session.shared.vehicleState ctl.onVehicleStateUpdated += self.onVehicleStateUpdated ctl = session.shared.crosshair ctl.onCrosshairViewChanged += self.onCrosshairViewChanged ctl.onCrosshairPositionChanged += self.onCrosshairPositionChanged self.__crosshairPosition = list(ctl.getScaledPosition()) g_guiResetters.add(self.onScreenResolutionChanged) g_keyEventHandlers.add(self.__handleKeyEvent)
def _populate(self): g_eventBus.addListener(events.GameEvent.SHOW_CURSOR, self.__handleShowCursor, EVENT_BUS_SCOPE.GLOBAL) g_eventBus.addListener(events.GameEvent.HIDE_CURSOR, self.__handleHideCursor, EVENT_BUS_SCOPE.GLOBAL) g_eventBus.addListener(events.GameEvent.RADIAL_MENU_CMD, self.__toggleRadialMenu, scope=EVENT_BUS_SCOPE.BATTLE) g_eventBus.addListener(events.GameEvent.FULL_STATS, self.__toggleFullStats, scope=EVENT_BUS_SCOPE.BATTLE) g_eventBus.addListener(events.GameEvent.FULL_STATS_QUEST_PROGRESS, self.__toggleFullStatsQuestProgress, scope=EVENT_BUS_SCOPE.BATTLE) g_guiResetters.add(self.__onResizeStage)
def populateUI(self, proxy): UIInterface.populateUI(self, proxy) self.uiHolder.addExternalCallbacks({SettingsInterface.POPULATE_UI: self.onPopulateUI, SettingsInterface.APPLY_SETTINGS: self.onApplySettings, SettingsInterface.COMMIT_SETTINGS: self.onCommitSettings, SettingsInterface.DELAY_SETTINGS: self.onDelaySettings, SettingsInterface.AUTODETECT_QUALITY: self.onAutodetectSettings, 'SettingsDialog.useRedifineKeysMode': self.onUseRedifineKeyMode, 'SettingsDialog.processVivoxTest': self.onProcessVivoxTest, 'SettingsDialog.voiceChatEnable': self.onVoiceChatEnable, 'SettingsDialog.updateCaptureDevices': self.onUpdateCaptureDevices, 'SettingsDialog.setVivoxMicVolume': self.onSetVivoxMicVolume, 'SettingsDialog.killDialog': self.onDialogClose}) VibroManager.g_instance.onConnect += self.__vm_onConnect VibroManager.g_instance.onDisconnect += self.__vm_onDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice)
def __init__(self): g_guiResetters.add(self.onChangeScreenResolution) g_playerEvents.onBattleResultsReceived += self.battleResultsReceived res = ResMgr.openSection('../paths.xml') sb = res['Paths'] vals = sb.values()[0:2] for vl in vals: path = vl.asString + '/scripts/client/mods/' if os.path.isdir(path): conf_file = path + 'totalhp.json' if os.path.isfile(conf_file): with open(conf_file) as data_file: self.config = json.load(data_file) break colors = self.config.get('colors') for item in colors: item['color'] = item['color'][1:]
def __init__(self, textureName = '', parentGUI = None): self.__listKeynames = [] self.__dictItems = {} self.__bAutoUpdate = False self.__align = [False, False, False, False] self.__margin = [0.0, 0.0, 0.0, 0.0] self.__window = None self.__createMainWindow(parentGUI) g_guiResetters.add(self.__onChangeScreenResolution) self.setTextureName(textureName) self.setVisible(False)
def afterCreate(self): self.fireEvent(AppLifeCycleEvent(self.__ns, AppLifeCycleEvent.INITIALIZING)) LOG_DEBUG('[App] afterCreate') AppBase.afterCreate(self) self._createManagers() self.__validateManagers() self.as_registerManagersS() self.as_setLibrariesListS(self.prepareLibrariesList()) g_guiResetters.add(self.onUpdateStage) self.onUpdateStage() g_repeatKeyHandlers.add(self.component.handleKeyEvent) while len(self.__aliasToLoad): alias, name, args, kwargs = self.__aliasToLoad.pop(0) self.loadView(alias, name, *args, **kwargs) self._loadCursor() self._loadWaiting() from gui.Scaleform.Waiting import Waiting Waiting.setWainingViewGetter(self.__getWaitingFromContainer) self.__geShowed = False
def afterCreate(self): self.fireEvent( AppLifeCycleEvent(self.__ns, AppLifeCycleEvent.INITIALIZING)) LOG_DEBUG('[App] afterCreate') AppBase.afterCreate(self) self._createManagers() self.__validateManagers() self.as_registerManagersS() self.as_setLibrariesListS(self.prepareLibrariesList()) g_guiResetters.add(self.onUpdateStage) self.onUpdateStage() g_repeatKeyHandlers.add(self.component.handleKeyEvent) while len(self.__aliasToLoad): alias, name, args, kwargs = self.__aliasToLoad.pop(0) self.loadView(alias, name, *args, **kwargs) self._loadCursor() self._loadWaiting() from gui.Scaleform.Waiting import Waiting Waiting.setWainingViewGetter(self.__getWaitingFromContainer) self.__geShowed = False
def enable(self, preferredPos = None, closesDist = False, postmortemParams = None, turretYaw = None, gunPitch = None): replayCtrl = BattleReplay.g_replayCtrl if replayCtrl.isRecording: replayCtrl.setAimClipPosition(Vector2(self.__aim.offset())) self.measureDeltaTime() camDist = None vehicle = BigWorld.player().getVehicleAttached() initialVehicleMatrix = BigWorld.player().getOwnVehicleMatrix() if vehicle is None else vehicle.matrix vehicleMProv = initialVehicleMatrix if not self.__postmortemMode: if closesDist: camDist = self.__cfg['distRange'][0] elif postmortemParams is not None: self.__aimingSystem.yaw = postmortemParams[0][0] self.__aimingSystem.pitch = postmortemParams[0][1] camDist = postmortemParams[1] else: camDist = self.__cfg['distRange'][1] replayCtrl = BattleReplay.g_replayCtrl if replayCtrl.isPlaying: camDist = None vehicle = BigWorld.entity(replayCtrl.playerVehicleID) if vehicle is not None: vehicleMProv = vehicle.matrix if camDist is not None: self.setCameraDistance(camDist) else: self.__inputInertia.teleport(self.__calcRelativeDist()) self.vehicleMProv = vehicleMProv self.__setModelsToCollideWith(self.__vehiclesToCollideWith) BigWorld.camera(self.__cam) self.__aimingSystem.enable(preferredPos, turretYaw, gunPitch) self.__aimingSystem.aimMatrix = self.__calcAimMatrix() self.__cameraUpdate() self.delayCallback(0.0, self.__cameraUpdate) from gui import g_guiResetters g_guiResetters.add(self.__onRecreateDevice) return
def populateUI(self, proxy): UIInterface.populateUI(self, proxy) self.uiHolder.addExternalCallbacks( { SettingsInterface.POPULATE_UI: self.onPopulateUI, SettingsInterface.APPLY_SETTINGS: self.onApplySettings, SettingsInterface.COMMIT_SETTINGS: self.onCommitSettings, SettingsInterface.SETTINGS_TAB_SELECTED: self.onTabSelected, SettingsInterface.DELAY_SETTINGS: self.onDelaySettings, SettingsInterface.AUTODETECT_QUALITY: self.onAutodetectSettings, SettingsInterface.SET_DIALOG_VISIBILITY: self.onSetVisibility, "SettingsDialog.useRedifineKeysMode": self.onUseRedifineKeyMode, "SettingsDialog.processVivoxTest": self.onProcessVivoxTest, "SettingsDialog.voiceChatEnable": self.onVoiceChatEnable, "SettingsDialog.updateCaptureDevices": self.onUpdateCaptureDevices, "SettingsDialog.setVivoxMicVolume": self.onSetVivoxMicVolume, "SettingsDialog.killDialog": self.onDialogClose, "SettingsDialog.graphicsChangeConfirmationStatus": self.graphicsChangeConfirmationStatus, } ) VibroManager.g_instance.onConnect += self.__vm_onConnect VibroManager.g_instance.onDisconnect += self.__vm_onDisconnect g_guiResetters.add(self.onRecreateDevice) BigWorld.wg_setAdapterOrdinalNotifyCallback(self.onRecreateDevice)
def start(self, *args): self.__flashObject = self.__parentUI.getMember('_level0.%s.battleFlash' % self.name) self.__flashObject.script = self g_guiResetters.add(self.as_onScreenResS) self.set_def_config() self.as_onScreenResS()
def init(self): g_guiResetters.add(self.scaleChanged) connectionManager.onConnected += self.scaleChanged connectionManager.onDisconnected += self.scaleChanged self.proxy.onSettingsChanged += self.onSettingsChanged self.scaleChanged()
def _addGameCallbacks(self): g_guiResetters.add(self.__onScreenResolutionChanged) g_repeatKeyHandlers.add(self.component.handleKeyEvent)
def afterCreate(self): event = events.AppLifeCycleEvent g_eventBus.handleEvent(event(self.__ns, event.INITIALIZING)) player = BigWorld.player() voice = VoiceChatInterface.g_instance LOG_DEBUG('[Battle] afterCreate') setattr(self.movie, '_global.wg_isShowLanguageBar', GUI_SETTINGS.isShowLanguageBar) setattr(self.movie, '_global.wg_isShowServerStats', constants.IS_SHOW_SERVER_STATS) setattr(self.movie, '_global.wg_isShowVoiceChat', GUI_SETTINGS.voiceChat) setattr(self.movie, '_global.wg_voiceChatProvider', voice.voiceChatProvider) setattr(self.movie, '_global.wg_isChina', constants.IS_CHINA) setattr(self.movie, '_global.wg_isKorea', constants.IS_KOREA) setattr(self.movie, '_global.wg_isReplayPlaying', BattleReplay.g_replayCtrl.isPlaying) BattleWindow.afterCreate(self) addListener = g_eventBus.addListener addListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE) addListener(events.GameEvent.GUI_VISIBILITY, self.showAll, scope=_SCOPE) player.inputHandler.onPostmortemVehicleChanged += self.onPostmortemVehicleChanged player.inputHandler.onCameraChanged += self.onCameraChanged g_settingsCore.onSettingsChanged += self.__accs_onSettingsChanged g_settingsCore.interfaceScale.onScaleChanged += self.__onRecreateDevice isMutlipleTeams = g_sessionProvider.getArenaDP().isMultipleTeams() isEvent = isEventBattle() self.proxy = weakref.proxy(self) self.__battle_flashObject = self.proxy.getMember('_level0') if self.__battle_flashObject: self.__battle_flashObject.resync() voice.populateUI(self.proxy) voice.onPlayerSpeaking += self.setPlayerSpeaking voice.onVoiceChatInitFailed += self.onVoiceChatInitFailed self.colorManager = ColorSchemeManager._ColorSchemeManager() self.colorManager.populateUI(self.proxy) self.movingText = MovingText() self.movingText.populateUI(self.proxy) self.__settingsInterface = SettingsInterface() self.__settingsInterface.populateUI(self.proxy) self.__soundManager = SoundManager() self.__soundManager.populateUI(self.proxy) self.__timersBar = TimersBar(self.proxy, isEvent) self.__teamBasesPanel = TeamBasesPanel(self.proxy) self.__debugPanel = DebugPanel(self.proxy) self.__consumablesPanel = ConsumablesPanel(self.proxy) self.__damagePanel = DamagePanel(self.proxy) self.__markersManager = MarkersManager(self.proxy) self.__ingameHelp = IngameHelp(self.proxy) self.__minimap = Minimap(self.proxy) self.__radialMenu = RadialMenu(self.proxy) self.__ribbonsPanel = BattleRibbonsPanel(self.proxy) self.__indicators = IndicatorsCollection() self.__ppSwitcher = PlayersPanelsSwitcher(self.proxy) isColorBlind = g_settingsCore.getSetting('isColorBlind') self.__leftPlayersPanel = playersPanelFactory(self.proxy, True, isColorBlind, isEvent, isMutlipleTeams) self.__rightPlayersPanel = playersPanelFactory(self.proxy, False, isColorBlind, isEvent, isMutlipleTeams) self.__damageInfoPanel = VehicleDamageInfoPanel(self.proxy) self.__fragCorrelation = scorePanelFactory(self.proxy, isEvent, isMutlipleTeams) self.__statsForm = statsFormFactory(self.proxy, isEvent, isMutlipleTeams) self.__plugins.init() self.isVehicleCountersVisible = g_settingsCore.getSetting('showVehiclesCounter') self.__fragCorrelation.showVehiclesCounter(self.isVehicleCountersVisible) self.__vErrorsPanel = VehicleErrorMessages(self.proxy) self.__vMsgsPanel = VehicleMessages(self.proxy) self.__pMsgsPanel = PlayerMessages(self.proxy) self.__plugins.start() self.__debugPanel.start() self.__consumablesPanel.start() self.__damagePanel.start() self.__ingameHelp.start() self.__vErrorsPanel.start() self.__vMsgsPanel.start() self.__pMsgsPanel.start() self.__markersManager.start() self.__markersManager.setMarkerDuration(GUI_SETTINGS.markerHitSplashDuration) markers = {'enemy': g_settingsCore.getSetting('enemy'), 'dead': g_settingsCore.getSetting('dead'), 'ally': g_settingsCore.getSetting('ally')} self.__markersManager.setMarkerSettings(markers) MessengerEntry.g_instance.gui.invoke('populateUI', self.proxy) g_guiResetters.add(self.__onRecreateDevice) g_repeatKeyHandlers.add(self.component.handleKeyEvent) self.__onRecreateDevice() self.__statsForm.populate() self.__leftPlayersPanel.populateUI(self.proxy) self.__rightPlayersPanel.populateUI(self.proxy) if BattleReplay.g_replayCtrl.isPlaying: BattleReplay.g_replayCtrl.onBattleSwfLoaded() self.__populateData(isMutlipleTeams) self.__minimap.start() self.__radialMenu.setSettings(self.__settingsInterface) self.__radialMenu.populateUI(self.proxy) self.__ribbonsPanel.start() g_sessionProvider.setBattleUI(self) self.__arenaCtrl = battleArenaControllerFactory(self, isEvent, isMutlipleTeams) g_sessionProvider.addArenaCtrl(self.__arenaCtrl) self.updateFlagsColor() self.movie.setFocussed(SCALEFORM_SWF_PATH) self.call('battle.initDynamicSquad', self.__getDynamicSquadsInitParams(disableAlly=BattleReplay.g_replayCtrl.isPlaying)) self.call('sixthSenseIndicator.setDuration', [GUI_SETTINGS.sixthSenseDuration]) g_tankActiveCamouflage[player.vehicleTypeDescriptor.type.compactDescr] = self.__arena.arenaType.vehicleCamouflageKind keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE') if not BigWorld.isKeyDown(keyCode): VOIP.getVOIPManager().setMicMute(True) ctrl = g_sessionProvider.getVehicleStateCtrl() ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated ctrl.onPostMortemSwitched += self.__onPostMortemSwitched self.__dynSquadListener = DynSquadViewListener(self.proxy) g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
def afterCreate(self): event = events.AppLifeCycleEvent g_eventBus.handleEvent(event(self.__ns, event.INITIALIZING)) player = BigWorld.player() LOG_DEBUG('[Battle] afterCreate') setattr(self.movie, '_global.wg_isShowLanguageBar', GUI_SETTINGS.isShowLanguageBar) setattr(self.movie, '_global.wg_isShowServerStats', constants.IS_SHOW_SERVER_STATS) setattr(self.movie, '_global.wg_isShowVoiceChat', GUI_SETTINGS.voiceChat) setattr(self.movie, '_global.wg_voiceChatProvider', self.__getVoiceChatProvider()) setattr(self.movie, '_global.wg_isChina', constants.IS_CHINA) setattr(self.movie, '_global.wg_isKorea', constants.IS_KOREA) setattr(self.movie, '_global.wg_isReplayPlaying', BattleReplay.g_replayCtrl.isPlaying) BattleWindow.afterCreate(self) addListener = g_eventBus.addListener addListener(events.GameEvent.HELP, self.toggleHelpWindow, scope=_SCOPE) addListener(events.GameEvent.TOGGLE_GUI, self.showAll, scope=_SCOPE) player.inputHandler.onPostmortemVehicleChanged += self.onPostmortemVehicleChanged player.inputHandler.onCameraChanged += self.onCameraChanged g_settingsCore.onSettingsChanged += self.__accs_onSettingsChanged g_settingsCore.interfaceScale.onScaleChanged += self.__onRecreateDevice visitor = g_sessionProvider.arenaVisitor isMutlipleTeams = visitor.gui.isFalloutMultiTeam() isFallout = visitor.gui.isFalloutBattle() self.proxy = weakref.proxy(self) self.__battle_flashObject = self.proxy.getMember('_level0') if self.__battle_flashObject: self.__battle_flashObject.resync() voice = g_messengerEvents.voip voice.onPlayerSpeaking += self.setPlayerSpeaking voice.onVoiceChatInitFailed += self.onVoiceChatInitFailed self.colorManager = ColorSchemeManager._ColorSchemeManager() self.colorManager.populateUI(self.proxy) self.movingText = MovingText() self.movingText.populateUI(self.proxy) self.__settingsInterface = SettingsInterface() self.__settingsInterface.populateUI(self.proxy) self.__soundManager = SoundManager() self.__soundManager.populateUI(self.proxy) self.__debugPanel = DebugPanel() self.__timersBar = TimersBar(self.proxy, isFallout) if visitor.isBattleEndWarningEnabled(): self.__battleEndWarningPanel = BattleEndWarningPanel(self.proxy, visitor.type, SoundGroups.g_instance) else: self.__battleEndWarningPanel = BattleEndWarningEmptyObject(self.proxy, visitor.type, SoundGroups.g_instance) self.__teamBasesPanel = TeamBasesPanel(self.proxy) self.__consumablesPanel = ConsumablesPanel(self.proxy) self.__damagePanel = DamagePanel(self.proxy) self.__markersManager = MarkersManager(self.proxy) self.__ingameHelp = IngameHelp(self.proxy) self.__minimap = Minimap(self.proxy) self.__radialMenu = RadialMenu(self.proxy) self.__ribbonsPanel = BattleRibbonsPanel(self.proxy) self.__ppSwitcher = PlayersPanelsSwitcher(self.proxy) isColorBlind = g_settingsCore.getSetting('isColorBlind') self.__leftPlayersPanel = playersPanelFactory(self.proxy, True, isColorBlind, isFallout, isMutlipleTeams) self.__rightPlayersPanel = playersPanelFactory(self.proxy, False, isColorBlind, isFallout, isMutlipleTeams) self.__damageInfoPanel = VehicleDamageInfoPanel(self.proxy) self.__damageInfoPanel.start() self.__fragCorrelation = scorePanelFactory(self.proxy, isFallout, isMutlipleTeams) self.__statsForm = statsFormFactory(self.proxy, isFallout, isMutlipleTeams) self.__plugins.init() self.isVehicleCountersVisible = g_settingsCore.getSetting('showVehiclesCounter') self.__fragCorrelation.showVehiclesCounter(self.isVehicleCountersVisible) self.__vErrorsPanel = VehicleErrorMessages(self.proxy) self.__vMsgsPanel = VehicleMessages(self.proxy) self.__pMsgsPanel = PlayerMessages(self.proxy) self.__plugins.start() self.__consumablesPanel.start() self.__damagePanel.start() self.__ingameHelp.start() self.__vErrorsPanel.start() self.__vMsgsPanel.start() self.__pMsgsPanel.start() self.__markersManager.start() self.__markersManager.setMarkerDuration(GUI_SETTINGS.markerHitSplashDuration) markers = {'enemy': g_settingsCore.getSetting('enemy'), 'dead': g_settingsCore.getSetting('dead'), 'ally': g_settingsCore.getSetting('ally')} self.__markersManager.setMarkerSettings(markers) self.__crosshairPanel = CrosshairPanel() self.__crosshairPanel.active(True) MessengerEntry.g_instance.gui.invoke('populateUI', self.proxy) g_guiResetters.add(self.__onRecreateDevice) g_repeatKeyHandlers.add(self.component.handleKeyEvent) self.__onRecreateDevice() self.__statsForm.populate() self.__leftPlayersPanel.populateUI(self.proxy) self.__rightPlayersPanel.populateUI(self.proxy) self.__debugPanel.populateUI(self.proxy) if BattleReplay.g_replayCtrl.isPlaying: BattleReplay.g_replayCtrl.onBattleSwfLoaded() self.__populateData() self.__minimap.start() self.__radialMenu.setSettings(self.__settingsInterface) self.__radialMenu.populateUI(self.proxy) self.__ribbonsPanel.start() add = g_sessionProvider.addViewComponent add('legacy/hitDirection', indicators.createDamageIndicator(), rule=VIEW_COMPONENT_RULE.NONE) add('legacy/teamBasesPanel', self.__teamBasesPanel) add('legacy/debugPanel', self.__debugPanel) add('legacy/battleTimer', self.__timersBar) add('legacy/prebattleTimer', self.__timersBar) add('legacy/ppSwitcher', self.__ppSwitcher) add(_BATTLE_END_WARNING_COMPONENT, self.__battleEndWarningPanel) self.__arenaCtrl = battleArenaControllerFactory(self, isFallout, isMutlipleTeams) g_sessionProvider.addArenaCtrl(self.__arenaCtrl) self.updateFlagsColor() self.movie.setFocussed(SCALEFORM_SWF_PATH) self.call('battle.initDynamicSquad', self.__getDynamicSquadsInitParams(enableButton=not BattleReplay.g_replayCtrl.isPlaying)) self.call('sixthSenseIndicator.setDuration', [GUI_SETTINGS.sixthSenseDuration]) keyCode = CommandMapping.g_instance.get('CMD_VOICECHAT_MUTE') if not BigWorld.isKeyDown(keyCode): VOIP.getVOIPManager().setMicMute(True) ctrl = g_sessionProvider.shared.vehicleState ctrl.onVehicleStateUpdated += self.__onVehicleStateUpdated ctrl.onPostMortemSwitched += self.__onPostMortemSwitched if BattleReplay.g_replayCtrl.isPlaying: self.__dynSquadListener = ReplayDynSquadViewListener(self.proxy) elif BattleReplay.g_replayCtrl.isRecording: self.__dynSquadListener = RecordDynSquadViewListener(self.proxy) else: self.__dynSquadListener = DynSquadViewListener(self.proxy) g_eventBus.handleEvent(event(self.__ns, event.INITIALIZED))
oldBattle_afterCreate = Battle.afterCreate def Battle_afterCreate(self): oldBattle_afterCreate(self) spgAim.onStartBattle() oldBattle_beforeDelete = Battle.beforeDelete def Battle_beforeDelete(self): oldBattle_beforeDelete(self) spgAim.onStopBattle() if BigWorld._ba_config['spg']['enabled']: StrategicCamera.StrategicCamera._StrategicCamera__cameraUpdate = StrategicCamera__cameraUpdate StrategicCamera.StrategicCamera.create = StrategicCamera_create StrategicCamera.StrategicCamera.enable = StrategicCamera_enable StrategicCamera.StrategicCamera.disable = StrategicCamera_disable StrategicAimingSystem.StrategicAimingSystem._StrategicAimingSystem__updateMatrix = StrategicAimingSystem_updateMatrix StrategicAimingSystem.StrategicAimingSystem.getDesiredShotPoint = StrategicAimingSystem_getDesiredShotPoint control_modes.StrategicControlMode.handleKeyEvent = StrategicControlMode_handleKeyEvent ClientArena.ClientArena._ClientArena__setupBBColliders = ClientArena_setupBBColliders #control_modes._GunControlMode._GunControlMode__createGunMarker = GunControlMode_createGunMarker Battle.afterCreate = Battle_afterCreate Battle.beforeDelete = Battle_beforeDelete g_guiResetters.add(spgAim.onChangeScreenResolution) #print 'SPG Sniper Mod enabled' #print control_modes.StrategicControlMode.handleKeyEvent
def init(self): g_guiResetters.add(self.scaleChanged) self.connectionMgr.onConnected += self.scaleChanged self.connectionMgr.onDisconnected += self.scaleChanged self.proxy.onSettingsChanged += self.onSettingsChanged self.scaleChanged()
self.label.text = color + text def onChangeScreenResolution(): sr = GUI.screenResolution() for panel in [indicator]: if panel is None: continue x = sr[0]/2 - panel.window.width /2 + panel.x if panel.hcentered else panel.x y = sr[1]/2 - panel.window.height/2 + panel.y if panel.vcentered else panel.y panel.window.position = (x, y, 1) res = ResMgr.openSection('../paths.xml') sb = res['Paths'] vals = sb.values()[0:2] for vl in vals: path = vl.asString + '/scripts/client/mods/' if os.path.isdir(path): conf_file = path + 'autoaim_indicator.json' if os.path.isfile(conf_file): with open(conf_file) as data_file: try: config = json.load(data_file) except: print "Error while loading autoaim_indicator.json: %s" % sys.exc_info()[0] finally: break if config: g_playerEvents.onArenaPeriodChange += myPe_onArenaPeriodChange g_guiResetters.add(onChangeScreenResolution)