void JobWordList() { Write("\n\tВыбран режим: "); WriteLine("работа со списком слов\n"); SetLanguage wordsLingva; SetActWordsList actWordList = SetActWordsList.Undefined; do { SelectMenu += MenuPool.CreateMenuSelectLanguage().SelectOption; ListOfWords words = new ListOfWords(); wordsLingva = (SetLanguage)SelectMenu?.Invoke("Выбор языка:"); SelectMenu = null; if (wordsLingva != SetLanguage.Undefined) { words.WordLanuage = wordsLingva; words.UserLanguage = wordsLingva; words.ReadFromXML(); WriteLine("\n\tВыбран язык: {0}", dictLingva[words.WordLanuage]); do { SelectMenu += MenuPool.CreateMenuWordsList().SelectOption; actWordList = (SetActWordsList) SelectMenu?.Invoke("Что вы хотите сделать со списком слов?"); SelectMenu = null; words.dictActWordList[actWordList](); } while (actWordList != SetActWordsList.Undefined); words.WriteToXML(); } } while (wordsLingva != SetLanguage.Undefined); }
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 SelectMenuSteps(IWebDriver driver) : base(driver) { this.driver = driver; homepage = new Homepage(driver); widgets = new WidgetsMenu(driver); selectmenu = new SelectMenu(driver); }
private void CheckConfigure() { bool isModified = false; Dictionary <string, string> displayOptions = new Dictionary <string, string>(); ConfigOptionMap options = GameManager.Instance.root.GetRenderSystemByName(renderMenu.getSelectedItem()).GetConfigOptions(); for (uint i = 3; i < GameManager.Instance.trayMgr.getNumWidgets(renderMenu.getTrayLocation()); i++) { SelectMenu optionMenu = (SelectMenu)GameManager.Instance.trayMgr.getWidget(renderMenu.getTrayLocation(), i); if (optionMenu.getSelectedItem() != options[optionMenu.getCaption()].currentValue) { isModified = true; } displayOptions.Add(optionMenu.getCaption(), optionMenu.getSelectedItem()); } OgreConfigFileAdapter ofa = new OgreConfigFileAdapter("ogre.cfg"); List <OgreConfigNode> ogrecfgdata = ofa.ReadConfigData(); OgreConfigNode oneConfig = ogrecfgdata.Where(o => o.Section == renderMenu.getSelectedItem()).FirstOrDefault(); Dictionary <string, string> fileOptions = oneConfig.Settings; if (isModified) { int indexDeleted = ogrecfgdata.IndexOf(oneConfig); ogrecfgdata.RemoveAt(indexDeleted); oneConfig.Settings = displayOptions; ogrecfgdata.Insert(indexDeleted, oneConfig); ofa.SaveConfig(ogrecfgdata); m_bQuit = true; ReConfigure(renderMenu.getSelectedItem(), displayOptions); } }
private void _setupControls() { TrayManager.ShowCursor(); // make room for the controls TrayManager.ShowLogo(TrayLocation.TopRight); TrayManager.ShowFrameStats(TrayLocation.TopRight); TrayManager.ToggleAdvancedFrameStats(); this.infoLabel = TrayManager.CreateLabel(TrayLocation.Top, "TInfo", "", 350); this.editMenu = TrayManager.CreateLongSelectMenu(TrayLocation.Bottom, "EditMode", "Edit Mode", 370, 250, 3); this.editMenu.AddItem("None"); this.editMenu.AddItem("Elevation"); this.editMenu.AddItem("Blend"); this.editMenu.SelectItem(0); // no edit mode this.editMenu.SelectedIndexChanged += _itemSelected; this.flyBox = TrayManager.CreateCheckBox(TrayLocation.Bottom, "Fly", "Fly"); this.flyBox.SetChecked(false, false); this.flyBox.CheckChanged += _checkBoxToggled; this.shadowsMenu = TrayManager.CreateLongSelectMenu(TrayLocation.Bottom, "Shadows", "Shadows", 370, 250, 3); this.shadowsMenu.AddItem("None"); this.shadowsMenu.AddItem("Color Shadows"); this.shadowsMenu.AddItem("Depth Shadows"); this.shadowsMenu.SelectItem(0); this.shadowsMenu.SelectedIndexChanged += _itemSelected; var names = new List <string>(); names.Add("Help"); //a friendly reminder TrayManager.CreateParamsPanel(TrayLocation.TopLeft, "Help", 100, names).SetParamValue(0, "H/F1"); }
/// <summary> /// Event for when the menu changes, sets the MouseSelectors SelectionMode /// </summary> /// <param name="sender">SelectMenu object</param> /// <param name="e">EventArgs</param> private void selectionModeMenu_SelectedIndexChanged(SelectMenu sender) { if (sender != null) { this._MouseSelector.SelectionMode = (MouseSelector.SelectionModeType)sender.SelectionIndex; } }
private void SetupControls() { SelectMenu technique = TrayManager.CreateThickSelectMenu(TrayLocation.TopLeft, "TechniqueType", "Instancing Technique", 200, 3); technique.AddItem("Instancing"); technique.AddItem("Static Geometry"); technique.AddItem("Independent Entities"); SelectMenu objectType = TrayManager.CreateThickSelectMenu(TrayLocation.TopLeft, "ObjectType", "Object : ", 200, 4); objectType.AddItem("razor"); objectType.AddItem("knot"); objectType.AddItem("tudorhouse"); objectType.AddItem("woodpallet"); TrayManager.CreateThickSlider(TrayLocation.TopLeft, "ObjectCountSlider", "Object count", 200, 50, 0, 1000, 101). SetValue(160, false); TrayManager.CreateThickSlider(TrayLocation.TopLeft, "CPUOccupationSlider", "CPU Load (ms)", 200, 75, 0, 1000.0f / 60, 20); TrayManager.CreateCheckBox(TrayLocation.TopLeft, "ShadowCheckBox", "Shadows", 200); TrayManager.CreateCheckBox(TrayLocation.TopLeft, "PostEffectCheckBox", "Post Effect", 200); TrayManager.ShowCursor(); }
/// <summary> /// /// </summary> protected void SetupGUI() { SelectMenu selectMenu = TrayManager.CreateLongSelectMenu(TrayLocation.TopLeft, "MaterialSelectMenu", "Material", 300, 200, 5); for (int i = 0; i < this.materialControlsContainer.Count; i++) { selectMenu.AddItem(this.materialControlsContainer[i].DisplayName); } selectMenu.SelectedIndexChanged += selectMenu_SelectedIndexChanged; CheckBox box = TrayManager.CreateCheckBox(TrayLocation.TopLeft, "SpinLightButton", "Spin Light", 175); box.IsChecked = true; box.CheckChanged += new CheckChangedHandler(box_CheckChanged); Button btn = TrayManager.CreateButton(TrayLocation.TopRight, "PageButtonControl", "Page", 175); btn.CursorPressed += new CursorPressedHandler(btn_CursorPressed); for (int i = 0; i < ControlsPerPage; i++) { this.shaderControls[i] = TrayManager.CreateThickSlider(TrayLocation.TopRight, "ShaderControlSlider" + i, "Control", 256, 80, 0, 1, 100); } selectMenu.SelectItem(0); TrayManager.ShowCursor(); }
void JobUser() { Write("\n\tВыбран режим: "); WriteLine("пользователь словаря\n"); Translate translate = new Translate(); Word wordOut = new Word(); Word wordIn = new Word(); Word word = null; int idOut = 0; List <int> listIdIn = null; SetMenu continueJob; do { Write("Введите слово, которое нужно перевести -->"); wordOut.WriteLetter = ReadLine(); if (translate.wordsOut.IsInList(wordOut.WriteLetter, ref word)) { idOut = translate.wordsOut.GetID(wordOut); listIdIn = translate.GetListInID(idOut); WriteLine(translate.wordsOut.GetWord(idOut)); foreach (int id in listIdIn) { WriteLine(translate.wordsIn.GetWord(id)); } } else { WriteLine("Такого слова нет в списке"); } SelectMenu += MenuPool.CreateMenuContinueStop().SelectOption; continueJob = (SetMenu)SelectMenu?.Invoke("Выберите дальнейшее действие:"); SelectMenu = null; } while (continueJob != SetMenu.Undefined); }
public static void DrawMenu(Menu menu) { // draw the background spriteBatch.Draw(GetTexture("blank"), menu.Rectangle, Color.Black); // draw the text Vector2 textPos = menu.Position + new OrderedPair(5); string wrappedText = WrapText(menu.Text, menu.Size.X); spriteBatch.DrawString(Font, wrappedText, textPos, Color.White); if (menu is SelectMenu) { SelectMenu selectMenu = menu as SelectMenu; // draw the cursor if (selectMenu.DrawCursor) { Rectangle cursorRect = new Rectangle(new Point((int)textPos.X + 250, (int)textPos.Y + selectMenu.SelectedIndex * 23), new Point(16)); spriteBatch.Draw(GetTexture("marble"), cursorRect, Color.White); } // draw the menu items foreach (MenuItem item in selectMenu.Items) { string itemText = item.Text; spriteBatch.DrawString(Font, itemText, textPos, Color.White); textPos.Y += 23; } } }
public void LoadCredits() { menus = SelectMenu.none; CreditPannel.gameObject.SetActive(true); MainMenuPannel.gameObject.SetActive(false); LoadingPannel.gameObject.SetActive(false); SaveSlotPannel.gameObject.SetActive(false); }
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; }
void SetNewNoun(ref Word word) { WriteLine("существительное\n"); SelectMenu += MenuPool.CreateMenuSelectGender().SelectOption; word.GenderNoun = (SetGender)SelectMenu?.Invoke("Выберите род существительного"); SelectMenu = null; Write("Введите форму множественного числа -->"); word.PluralForm = ReadLine(); }
public void LoadMainMenu() { menus = SelectMenu.inMain; CreditPannel.gameObject.SetActive(false); MainMenuPannel.gameObject.SetActive(true); LoadingPannel.gameObject.SetActive(false); SaveSlotPannel.gameObject.SetActive(false); SelectedItem = 0; MenuObjects[SelectedItem].gameObject.GetComponent <Button>().Select(); }
public void ContenuGame() { menus = SelectMenu.inSaves; CreditPannel.gameObject.SetActive(false); MainMenuPannel.gameObject.SetActive(false); LoadingPannel.gameObject.SetActive(false); SaveSlotPannel.gameObject.SetActive(true); ConstructSaveSlots(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void ActiveDraw(Renderer renderer, string asset, Vector2 position, SelectMenu menu) { if (imageState[menu]) { renderer.DrawTexture(asset, position); } else { renderer.DrawTexture(asset, position, 0.7f); } }
void OnEnable() { ListaNomes = serializedObject.FindProperty("NomeOpcoes"); ListaDestinos = serializedObject.FindProperty("Destino"); ListaTipos = serializedObject.FindProperty("TipoDeOpcoes"); Objetos = serializedObject.FindProperty("obj"); IndexSize = serializedObject.FindProperty("Sizes"); Prefabricavel = serializedObject.FindProperty("ConteinerPrefab"); Tamanho = serializedObject.FindProperty("size"); menu = (SelectMenu)target; }
public void LoadGame(int SaveSlot) { menus = SelectMenu.inLoading; PlayerPrefs.SetInt("MenuLoadGameSlot", SaveSlot); // enable load menu CreditPannel.gameObject.SetActive(false); MainMenuPannel.gameObject.SetActive(false); LoadingPannel.gameObject.SetActive(true); SaveSlotPannel.gameObject.SetActive(false); Invoke("WaitLoading", LoadMenuTime); }
private void _itemSelected(SelectMenu menu) { if (menu == this.editMenu) { this.mode = (Mode)this.editMenu.SelectionIndex; } else if (menu == this.shadowsMenu) { this.shadowMode = (ShadowMode)this.shadowsMenu.SelectionIndex; _changeShadows(); } }
private void Start() { audioSource = GetComponent <AudioSource>(); menu = GetComponentInParent <SelectMenu>(); // Add a BoxCollider if the interactible does not contain one. Collider collider = GetComponentInChildren <Collider>(); if (collider == null) { gameObject.AddComponent <BoxCollider>(); } }
public override void itemSelected(SelectMenu menu) { switch (menu.getSelectionIndex()) { case 0: m_pCamera.PolygonMode = (PolygonMode.PM_SOLID); break; case 1: m_pCamera.PolygonMode = (PolygonMode.PM_WIREFRAME); break; case 2: m_pCamera.PolygonMode = (PolygonMode.PM_POINTS); break; } }
/// <summary> /// Creates and initializes all the scene's GUI elements not defined in SdkSample /// </summary> protected void SetupGUI() { this.selectionModeMenu = TrayManager.CreateLongSelectMenu(TrayLocation.TopRight, "SelectionModeMenu", "Selection Mode", 300, 150, 3); this.selectionModeMenu.AddItem("None"); this.selectionModeMenu.AddItem("Mouse Select"); this.selectionModeMenu.AddItem("Selection Box"); this.selectionModeMenu.SelectItem(0); this.selectionModeMenu.SelectedIndexChanged += selectionModeMenu_SelectedIndexChanged; this.MouseLocationLabel = TrayManager.CreateLabel(TrayLocation.TopLeft, "Mouse Location", "", 350); TrayManager.ShowCursor(); }
public void GetNewWord() { Word word = new Word(); WriteLine("добавить запись \n"); Write("Введите буквенное написание слова -->"); word.WriteLetter = ReadLine(); SelectMenu += MenuPool.CreateMenuPartOfSpeech().SelectOption; word.PartOfSpeech = (SetPartOfSpeech)SelectMenu?.Invoke("Какая часть речи?"); SelectMenu = null; dictPartofSpeech[word.PartOfSpeech](ref word); Write("Введите смысловое описание слова -->"); word.Description = ReadLine(); AddNewWord(word); }
void SetNewVerb(ref Word word) { WriteLine("глагол\n"); SelectMenu += MenuPool.CreateMenuSelectTransitive().SelectOption; word.Transitive = (SetTransitiveForm)SelectMenu?.Invoke("Этот глагол переходный/непереходный?"); SelectMenu = null; SelectMenu += MenuPool.CreateMenuSelectСonjugationType().SelectOption; word.ConjugationType = (SetConjugationType) SelectMenu?.Invoke("Выберите спряжение (сильное/слабое):"); SelectMenu = null; if (word.ConjugationType == SetConjugationType.Strong) { Write("Введите глагол, с которым спрягается -->"); word.AuxiliaryVerb = ReadLine(); } }
public MainMenu(InterfaceManager manager) : base(manager) { SelectMenu menu = new SelectMenu("New Game", "Load Game", "Options", "Exit"); menu.Position = new Vector2(); menu.OptionSelected += (option) => { if (option.Equals("New Game", StringComparison.Ordinal)) { InterfaceManager.ChangeScreen("GameOverlay"); } }; AddControl(menu); }
void JobTransalte() { Write("\n\tВыбран режим: "); WriteLine("работа с переводом\n"); Translate translate = new Translate(); Word wordOut = new Word(); Word wordIn = new Word(); Word word = null; SetMenu continueJob; int idOut = 0; int idIn = 0; do { Write("Введите слово, которое нужно перевести -->"); wordOut.WriteLetter = ReadLine(); if (translate.wordsOut.IsInList(wordOut.WriteLetter, ref word)) { idOut = translate.wordsOut.GetID(word); word = null; Write("Введите слово-перевод -->"); wordIn.WriteLetter = ReadLine(); if (translate.wordsIn.IsInList(wordIn.WriteLetter, ref word)) { idIn = translate.wordsIn.GetID(word); } else { WriteLine("Такого слова нет в списке"); } } else { WriteLine("Такого слова нет в списке"); } if (idOut != 0 && idIn != 0) { translate.AddNewTranslate(idOut, idIn); WriteLine(translate.wordsOut.GetWord(idOut)); WriteLine(translate.wordsIn.GetWord(idIn)); } SelectMenu += MenuPool.CreateMenuContinueStop().SelectOption; continueJob = (SetMenu)SelectMenu?.Invoke("Выберите дальнейшее действие:"); SelectMenu = null; } while (continueJob != SetMenu.Undefined); translate.WriteToXML(); }
IEnumerator MoveMenu(object[] obj) { SelectMenu menu = obj[0] as SelectMenu; float yValue = (float)obj[1]; RectTransform tr = menu.GetComponent <RectTransform>(); Vector2 v2 = tr.anchoredPosition; v2.y = yValue; float f = Time.deltaTime * 3; int OneFrame = (int)(1f / f); for (int i = 0; i < OneFrame; i++) { tr.anchoredPosition = Vector2.Lerp(tr.anchoredPosition, v2, f * 2.5f); yield return(null); } }
private void selectMenu_SelectedIndexChanged(SelectMenu sender) { if (sender != null) { this.currentMaterial = sender.SelectionIndex; this.activeMaterial = (Material)MaterialManager.Instance.GetByName(this.materialControlsContainer[this.currentMaterial].MaterialName); this.activeMaterial.Load(); int numShaders = this.materialControlsContainer[this.currentMaterial].ShaderControlsCount; this.numPages = (numShaders / ControlsPerPage) + (numShaders % ControlsPerPage == 0 ? 0 : 1); ChangePage(0); if (this.oceanSurfaceEnt != null) { this.oceanSurfaceEnt.MaterialName = this.materialControlsContainer[this.currentMaterial].MaterialName; } } }
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"); }
private void ItemSelected( SelectMenu menu ) { if ( menu == this.lightingModelMenu ) { int curModelIndex = menu.SelectionIndex; if ( curModelIndex >= (int)ShaderSystemLightingModel.PerVertexLighting && curModelIndex <= (int)ShaderSystemLightingModel.NormalMapLightingObjectSpace ) { CurrentLightingModel = (ShaderSystemLightingModel)curModelIndex; } } else if ( menu == this.fogModeMenu ) { int curModeIndex = menu.SelectionIndex; if ( curModeIndex >= (int)FogMode.None && curModeIndex <= (int)FogMode.Linear ) { SceneManager.SetFog( (FogMode)curModeIndex, new ColorEx( 1, 1, 1, 0 ), 0.0015f, 350.0f, 1500.0f ); } } else if ( menu == this.shadowMenu ) { int curShadowTypeIndex = menu.SelectionIndex; ApplyShadowType( curShadowTypeIndex ); } else if ( menu == this.languageMenu ) { ShaderGenerator.Instance.TargetLangauge = menu.SelectedItem; } }
/// <summary> /// /// </summary> private void SetupControls() { TrayManager.ShowCursor(); // make room for the controls TrayManager.ShowLogo( TrayLocation.TopRight ); TrayManager.ShowFrameStats( TrayLocation.TopRight ); TrayManager.ToggleAdvancedFrameStats(); infoLabel = TrayManager.CreateLabel( TrayLocation.Top, "TInfo", "", 350 ); editMenu = TrayManager.CreateLongSelectMenu( TrayLocation.Bottom, "EditMode", "Edit Mode", 370, 250, 3 ); editMenu.AddItem( "None" ); editMenu.AddItem( "Elevation" ); editMenu.AddItem( "Blend" ); editMenu.SelectItem( 0 ); // no edit mode flyBox = TrayManager.CreateCheckBox( TrayLocation.Bottom, "Fly", "Fly" ); flyBox.SetChecked( false, false ); shadowsMenu = TrayManager.CreateLongSelectMenu( TrayLocation.Bottom, "Shadows", "Shadows", 370, 250, 3 ); shadowsMenu.AddItem( "None" ); shadowsMenu.AddItem( "Color Shadows" ); shadowsMenu.AddItem( "Depth Shadows" ); shadowsMenu.SelectItem( 0 ); IList<string> names = new List<string>(); names.Add("Help"); //a friendly reminder TrayManager.CreateParamsPanel( TrayLocation.TopLeft, "Help", 100, names ).SetParamValue( 0, "H/F1" ); }
private void SetupUI() { //Create language selection this.languageMenu = TrayManager.CreateLongSelectMenu( TrayLocation.TopLeft, "LangMode", "Language", 220, 120, 10 ); //Use GLSL ES in case of OpenGL ES 2 render system if ( Root.RenderSystem.Name.Contains( "OpenGL ES 2" ) ) { this.languageMenu.AddItem( "glsles" ); ShaderGenerator.Instance.TargetLangauge = "glsles"; } else if ( Root.RenderSystem.Name.Contains( "OpenGL" ) ) { this.languageMenu.AddItem( "glsl" ); ShaderGenerator.Instance.TargetLangauge = "glsl"; } else if ( Root.RenderSystem.Name.Contains( "Direct3D9" ) ) { this.languageMenu.AddItem( "hlsl" ); ShaderGenerator.Instance.TargetLangauge = "hlsl"; } this.languageMenu.AddItem( "cg" ); //Create check boxes to toggle lights. this.dirLightCheckBox = TrayManager.CreateCheckBox( TrayLocation.TopLeft, DirectionalLightName, "Directional Light", 220 ); this.pointLightCheckBox = TrayManager.CreateCheckBox( TrayLocation.TopLeft, PointLightName, "Point Light", 220 ); this.spotLightCheckBox = TrayManager.CreateCheckBox( TrayLocation.TopLeft, SpotLightName, "Spot Light", 220 ); this.instancedViewportsCheckBox = TrayManager.CreateCheckBox( TrayLocation.TopLeft, InstancedViewportsName, "Instanced Viewports", 220 ); this.addLotsOfModels = TrayManager.CreateCheckBox( TrayLocation.TopLeft, InstancedViewportsName, "Add Lots of Models", 220 ); this.dirLightCheckBox.IsChecked = true; this.dirLightCheckBox.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); this.pointLightCheckBox.IsChecked = true; this.pointLightCheckBox.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); this.spotLightCheckBox.IsChecked = false; this.spotLightCheckBox.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); this.instancedViewportsCheckBox.IsChecked = false; this.instancedViewportsCheckBox.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); this.addLotsOfModels.IsChecked = false; this.addLotsOfModels.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); CheckBox cb; cb = TrayManager.CreateCheckBox( TrayLocation.TopLeft, PerPixelFogBox, "Per Pixel Fog", 220 ); cb.IsChecked = this.perPixelFogEnable; cb.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); cb = TrayManager.CreateCheckBox( TrayLocation.TopLeft, AtlasAutoBorderMode, "Atlas auto border", 220 ); cb.IsChecked = true; cb.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); //Create fog widgets. this.fogModeMenu = TrayManager.CreateLongSelectMenu( TrayLocation.TopLeft, "FogMode", "Fog Mode", 220, 120, 10 ); this.fogModeMenu.AddItem( "None" ); this.fogModeMenu.AddItem( "Exp" ); this.fogModeMenu.AddItem( "Exp2" ); this.fogModeMenu.AddItem( "Linear" ); //Create shadow menu this.shadowMenu = TrayManager.CreateLongSelectMenu( TrayLocation.TopLeft, "ShadowType", "Shadow", 220, 120, 10 ); this.shadowMenu.AddItem( "None" ); //shadowMenu.AddItem("PSSM 3"); //Flush shader cache button. var b = TrayManager.CreateButton( TrayLocation.TopLeft, FlushButtonName, "Flush Shader Cache", 220 ); //Create target model widgets this.targetObjMatName = TrayManager.CreateLabel( TrayLocation.TopLeft, "TargetObjMatName", string.Empty, 220 ); this.targetObjVS = TrayManager.CreateLabel( TrayLocation.TopLeft, "TargetObjVS", string.Empty, 220 ); this.targetObjFS = TrayManager.CreateLabel( TrayLocation.TopLeft, "TargetObjFS", string.Empty, 220 ); //Create main entity widgets. TrayManager.CreateLabel( TrayLocation.Bottom, "MainEntityLable", "Main Entity Settings", 240 ); var scb = TrayManager.CreateCheckBox( TrayLocation.Bottom, SpecularBox, "Specular", 240 ); scb.IsChecked = this.specularEnable; scb.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); //Allow reflection map only on PS3 and above since with all lights on + specular + bump we //exceed the instruction count limits of PS2 if ( GpuProgramManager.Instance.IsSyntaxSupported( "ps_3_0" ) || GpuProgramManager.Instance.IsSyntaxSupported( "glsles" ) || GpuProgramManager.Instance.IsSyntaxSupported( "fp30" ) ) { var rcb = TrayManager.CreateCheckBox( TrayLocation.Bottom, ReflectionMapBox, "Reflection Map", 240 ); rcb.IsChecked = true; rcb.CheckChanged += new CheckChangedHandler( CheckBoxToggled ); this.reflectionPowerSlider = TrayManager.CreateThickSlider( TrayLocation.Bottom, ReflectionMapPowerSlider, "Reflection Power", 240, 80, 0, 1, 100 ); this.reflectionPowerSlider.SetValue( 0.5f, false ); this.reflectionPowerSlider.SliderMoved += new SliderMovedHandler( SliderMoved ); } this.lightingModelMenu = TrayManager.CreateLongSelectMenu( TrayLocation.Bottom, "targetModelLighting", string.Empty, 240, 230, 10 ); this.lightingModelMenu.AddItem( "Per Vertex" ); this.lightingModelMenu.AddItem( "Per Pixel" ); this.lightingModelMenu.AddItem( "Normal Map - Tangent Space" ); this.lightingModelMenu.AddItem( "Normal Map - Object Space" ); TrayManager.CreateButton( TrayLocation.Bottom, ExportButtonName, "Export Material", 240 ); this.layerBlendLabel = TrayManager.CreateLabel( TrayLocation.Right, "Blend Type", "Blend Type", 240 ); TrayManager.CreateButton( TrayLocation.Right, LayerblendButtonName, "Change Blend Type", 220 ); this.modifierValueSlider = TrayManager.CreateThickSlider( TrayLocation.Right, ModifierValueSlider, "Modifier", 240, 80, 0, 1, 100 ); this.modifierValueSlider.SetValue( 0.0f, false ); this.modifierValueSlider.SliderMoved += new SliderMovedHandler( SliderMoved ); UpdateLayerBlendingCaption( this.layerBlendSubRS.GetBlendMode( 1 ) ); TrayManager.ShowCursor(); }
private void selectMenu_SelectedIndexChanged( SelectMenu sender ) { if ( sender != null ) { this.currentMaterial = sender.SelectionIndex; this.activeMaterial = (Material)MaterialManager.Instance.GetByName( this.materialControlsContainer[ this.currentMaterial ].MaterialName ); this.activeMaterial.Load(); int numShaders = this.materialControlsContainer[ this.currentMaterial ].ShaderControlsCount; this.numPages = ( numShaders/ControlsPerPage ) + ( numShaders%ControlsPerPage == 0 ? 0 : 1 ); ChangePage( 0 ); if ( this.oceanSurfaceEnt != null ) { this.oceanSurfaceEnt.MaterialName = this.materialControlsContainer[ this.currentMaterial ].MaterialName; } } }
/// <summary> /// Creates and initializes all the scene's GUI elements not defined in SdkSample /// </summary> protected void SetupGUI() { selectionModeMenu = TrayManager.CreateLongSelectMenu( TrayLocation.TopRight, "SelectionModeMenu", "Selection Mode", 300, 150, 3 ); selectionModeMenu.AddItem( "None" ); selectionModeMenu.AddItem( "Mouse Select" ); selectionModeMenu.AddItem( "Selection Box" ); selectionModeMenu.SelectItem( 0 ); selectionModeMenu.SelectedIndexChanged += new System.EventHandler( selectionModeMenu_SelectedIndexChanged ); MouseLocationLabel = TrayManager.CreateLabel( TrayLocation.TopLeft, "Mouse Location", "", 350 ); TrayManager.ShowCursor(); }
private void _itemSelected( SelectMenu menu ) { if ( menu == this.editMenu ) { this.mode = (Mode)this.editMenu.SelectionIndex; } else if ( menu == this.shadowsMenu ) { this.shadowMode = (ShadowMode)this.shadowsMenu.SelectionIndex; _changeShadows(); } }
/// <summary> /// Event for when the menu changes, sets the MouseSelectors SelectionMode /// </summary> /// <param name="sender">SelectMenu object</param> /// <param name="e">EventArgs</param> private void selectionModeMenu_SelectedIndexChanged( SelectMenu sender ) { if ( sender != null ) { this._MouseSelector.SelectionMode = (MouseSelector.SelectionModeType)sender.SelectionIndex; } }