Ejemplo n.º 1
0
 public bool InitSound(Camera cam, Mods.ModData modData)
 {
     try
     {
         this.modData = modData;
         if (!hasMusic && !hasSound)
         {
             return(false);
         }
         soundEngine = MogreFreeSL.SoundManager.Instance;
         soundEngine.InitializeSound(FSL_SOUND_SYSTEM.FSL_SS_DIRECTSOUND, cam);
         var tracks = modData.MusicInfos;
         foreach (var track in tracks)
         {
             GameSound music = new GameSound();
             music.AddSound(soundEngine.CreateAmbientSound(findMusicFileByID(track.Id), track.Id, true, false));
             music.PlayType = track.PlayType;
             musicLst.Add(music);
         }
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        public override void enter(Mods.ModData e = null)
        {
            modData  = e;
            sceneMgr = GameManager.Instance.root.CreateSceneManager(Mogre.SceneType.ST_GENERIC, "MenuSceneMgr");
            ColourValue cvAmbineLight = new ColourValue(0.7f, 0.7f, 0.7f);

            sceneMgr.AmbientLight = cvAmbineLight;
            camera = sceneMgr.CreateCamera("multiplayerCam");
            GameManager.Instance.viewport.Camera = camera;
            camera.AspectRatio = GameManager.Instance.viewport.ActualWidth / GameManager.Instance.viewport.ActualHeight;
            GameManager.Instance.viewport.OverlaysEnabled = true;

            GameManager.Instance.keyboard.KeyPressed  += new MOIS.KeyListener.KeyPressedHandler(mKeyboard_KeyPressed);
            GameManager.Instance.keyboard.KeyReleased += new MOIS.KeyListener.KeyReleasedHandler(mKeyboard_KeyReleased);

            BuildGameListUI();
        }
Ejemplo n.º 3
0
        public override void enter(Mods.ModData e = null)
        {
            modData  = e;
            sceneMgr = EngineManager.Instance.root.CreateSceneManager(Mogre.SceneType.ST_GENERIC, "MenuSceneMgr");
            ColourValue cvAmbineLight = new ColourValue(0.7f, 0.7f, 0.7f);

            sceneMgr.AmbientLight = cvAmbineLight;
            camera = sceneMgr.CreateCamera("multiplayerCam");
            EngineManager.Instance.viewport.Camera = camera;
            camera.AspectRatio = EngineManager.Instance.viewport.ActualWidth / EngineManager.Instance.viewport.ActualHeight;
            EngineManager.Instance.viewport.OverlaysEnabled = true;

            ScreenManager.Instance.OnExternalEvent += OnExternalEvent;
            ScreenManager.Instance.ChangeScreen("MultiplayerServerBrowser", true, modData);

            EngineManager.Instance.mouse.MouseMoved     += mouseMoved;
            EngineManager.Instance.mouse.MousePressed   += mousePressed;
            EngineManager.Instance.mouse.MouseReleased  += mouseReleased;
            EngineManager.Instance.keyboard.KeyPressed  += keyPressed;
            EngineManager.Instance.keyboard.KeyReleased += keyReleased;
        }
Ejemplo n.º 4
0
 public void InitMod(ModData modData)
 {
     this.modData = modData;
 }