Пример #1
0
        public override void enter(ModData e = null)
        {
            sceneMgr = GameManager.Instance.root.CreateSceneManager(Mogre.SceneType.ST_GENERIC, "ModChooserSceneMgr");

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

            sceneMgr.AmbientLight = cvAmbineLight;

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

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

            GameManager.Instance.viewport.Camera = camera;
            modNames.Clear();
            modThumb.Clear();

            mods = ModManager.Instance.GetInstalledMods();
            foreach (var mod in mods)
            {
                if (mod.Value.MetaData.DisplayInChooser)
                {
                    modNames.Add(mod.Key);
                    modDescs.Add(mod.Value.MetaData.Description);
                    modThumb.Add(mod.Value.MetaData.Thumb);
                }
            }

            GameManager.Instance.trayMgr.destroyAllWidgets();
            modTitle = GameManager.Instance.trayMgr.createLabel(TrayLocation.TL_LEFT, "ModTitle", "Mod Info");
            modTitle.setCaption("Mod Info");
            modDescBox = GameManager.Instance.trayMgr.createTextBox(TrayLocation.TL_LEFT, "ModInfo", "Mod Info", 250, 208);
            modDescBox.setCaption("Mod Info");
            modChooserMenu = GameManager.Instance.trayMgr.createThickSelectMenu(TrayLocation.TL_LEFT, "SelMod", "Select Mod", 250, 10);
            modChooserMenu.setCaption("Select Mod");
            modChooserMenu.setItems(modNames);
            modSlider = GameManager.Instance.trayMgr.createThickSlider(TrayLocation.TL_LEFT, "ModSlider", "Slider Mods", 250, 80, 0, 0, 0);
            modSlider.setCaption("Slider Mods");
            if (modNames.Count > 0)
            {
                modTitle.setCaption(modChooserMenu.getSelectedItem());
            }

            GameManager.Instance.trayMgr.showLogo(TrayLocation.TL_RIGHT);
            GameManager.Instance.trayMgr.createSeparator(TrayLocation.TL_RIGHT, "LogoSep");
            GameManager.Instance.trayMgr.createButton(TrayLocation.TL_RIGHT, "Play", LocateSystem.Instance.GetLocalizedString(Localization.LocateFileType.GameString, "str_play"), 140);
            GameManager.Instance.trayMgr.createButton(TrayLocation.TL_RIGHT, "Quit", LocateSystem.Instance.GetLocalizedString(Localization.LocateFileType.GameString, "str_quit"), 140);

            setupModMenu();

            GameManager.Instance.mouse.MouseMoved          += Mouse_MouseMoved;
            GameManager.Instance.mouse.MousePressed        += Mouse_MousePressed;
            GameManager.Instance.mouse.MouseReleased       += Mouse_MouseReleased;
            GameManager.Instance.root.FrameRenderingQueued += FrameRenderingQueued;
        }