public override void itemSelected(SelectMenu menu) { if (menu == renderMenu) { while (GameManager.Instance.trayMgr.getNumWidgets(renderMenu.getTrayLocation()) > 2) { GameManager.Instance.trayMgr.destroyWidget(renderMenu.getTrayLocation(), 2); } uint i = 0; ConfigOptionMap options = GameManager.Instance.root.GetRenderSystemByName(renderMenu.getSelectedItem()).GetConfigOptions(); foreach (var item in options) { i++; SelectMenu optionMenu = GameManager.Instance.trayMgr.createLongSelectMenu( TrayLocation.TL_CENTER, "ConfigOption" + i.ToString(), item.Key, 450, 240, 10); optionMenu.setItems(item.Value.possibleValues); try { optionMenu.selectItem(item.Value.currentValue); } catch { optionMenu.addItem(item.Value.currentValue); optionMenu.selectItem(item.Value.currentValue); } } } }
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; }
private void Configure() { GameManager.Instance.trayMgr.destroyAllWidgets(); GameManager.Instance.trayMgr.createLabel(TrayLocation.TL_CENTER, "lbConfig", "Configure"); renderMenu = GameManager.Instance.trayMgr.createLongSelectMenu(TrayLocation.TL_CENTER, "rendersys", "Render System", 450, 240, 10); StringVector rsNames = new StringVector(); Const_RenderSystemList rsList = GameManager.Instance.root.GetAvailableRenderers(); for (int i = 0; i < rsList.Count; i++) { rsNames.Add(rsList[i].Name); } renderMenu.setItems(rsNames); renderMenu.selectItem(GameManager.Instance.root.RenderSystem.Name); GameManager.Instance.trayMgr.createButton(TrayLocation.TL_RIGHT, "btnApply", "Apply"); GameManager.Instance.trayMgr.createButton(TrayLocation.TL_RIGHT, "btnBack", "Back"); }