@Override public void apply(Mission mission) { setTr(Features.get(Features.getSingleton(), TR.class)); setMenuSystem(Features.get(getTr().getRootWindow(), MenuSystem.class)); final ControllerMapper mapper = Features.get(Features.getSingleton(), ControllerMapper.class); final ControllerInputs inputs = Features.get(mapper, ControllerInputs.class); pause = inputs.getControllerInput(PAUSE); this.mission = new WeakReference<Mission>(mission); pause.addPropertyChangeListener(controllerListener); getMenuSystem().addMenuItem(MenuSystem.MIDDLE, PAUSE_MENU_PATH); getMenuSystem().addMenuItemListener(menuSelectionListener, PAUSE_MENU_PATH); getTr().addPropertyChangeListener(TRFactory.RUN_STATE, runStateListener); }
public void play() { if (!isPlaying) { activate(); firstRun.set(true); nextLoopTimeSeconds = Features.get(getOrigin().getTR(), SoundSystemFeature.class) .getCurrentFrameBufferTimeCounter(); isPlaying = true; } }
public void setPaused(boolean paused) { if (this.paused == paused) return; final boolean oldValue = this.paused; this.paused = paused; pcs.firePropertyChange(PAUSE, oldValue, paused); Mission mission = this.mission.get(); if (mission != null) if (paused) ((TVF3Game) mission.getGame()) .getUpfrontDisplay() .submitPersistentMessage("Paused--F3 to Resume "); else ((TVF3Game) mission.getGame()).getUpfrontDisplay().removePersistentMessage(); getTr().getThreadManager().setPaused(paused); Features.get(getTr(), SoundSystemFeature.class).setPaused(paused); }