Esempio n. 1
0
        private void LoadingModProcessing(int progress)
        {
            switch (progress)
            {
            case 25:
                progressBar.setComment(LocateSystem.Instance.GetLocalizedString(LocateFileType.GameString, "str_processing_module_file"));
                break;

            case 50:
                progressBar.setComment(LocateSystem.Instance.GetLocalizedString(LocateFileType.GameString, "str_loading_resource"));
                break;

            case 75:
                progressBar.setComment(LocateSystem.Instance.GetLocalizedString(LocateFileType.GameString, "str_loading_module_data"));
                break;

            case 100:
                progressBar.setComment(LocateSystem.Instance.GetLocalizedString(LocateFileType.GameString, "str_finished"));
                break;
            }
            progressBar.setProgress(progress / 100);
        }
Esempio n. 2
0
        public override void enter(ModData e = null)
        {
            modData  = e;
            sceneMgr = EngineManager.Instance.root.CreateSceneManager(Mogre.SceneType.ST_GENERIC, "LoadingSceneMgr");

            ColourValue cvAmbineLight = new ColourValue(0.7f, 0.7f, 0.7f);

            sceneMgr.AmbientLight = cvAmbineLight;

            camera = sceneMgr.CreateCamera("LoadingScreenCam");
            camera.SetPosition(0, 25, -50);
            Mogre.Vector3 vectorCameraLookat = new Mogre.Vector3(0, 0, 0);
            camera.LookAt(vectorCameraLookat);
            camera.NearClipDistance = 1;

            camera.AspectRatio = EngineManager.Instance.viewport.ActualWidth / EngineManager.Instance.viewport.ActualHeight;

            EngineManager.Instance.viewport.Camera = camera;

            UIManager.Instance.DestroyAllWidgets();
            progressBar = UIManager.Instance.CreateProgressBar(UIWidgetLocation.TL_CENTER, "pbProcessBar", "Loading", 500, 300);
            progressBar.setComment(EngineManager.Instance.loadingData.Comment);

            switch (EngineManager.Instance.loadingData.Type)
            {
            case LoadingType.LOADING_MOD:
                ModManager.Instance.LoadingModProcessing += LoadingModProcessing;
                ModManager.Instance.LoadingModFinished   += LoadingModFinished;
                ModManager.Instance.LoadMod(EngineManager.Instance.loadingData.LoadingObjName);
                break;
            }

            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;
        }