private void CreateTools() { tools = new LETool[] { new LETSingle(), new LETCluster(), new LETPaint(), new LETRect() }; curTool = tools[0]; // Create Menu toolMenu = new ScrollMenu(wr, 180, 30, 5, 12, 30); toolMenu.Build((from tool in tools select tool.Name).ToArray()); toolMenu.BaseColor = Color.LightCoral; toolMenu.HighlightColor = Color.Red; toolMenu.TextColor = Color.Black; toolMenu.ScrollBarBaseColor = Color.Green; toolMenu.Widget.AlignY = Alignment.BOTTOM; toolMenu.Parent = voxMenu.Widget; toolMenu.Hook(); // Set The Textures foreach (var tool in tools) { tool.LoadMouseTexture(G, @"LevelEditor\Mouse\" + tool.Name + ".png"); } game.mRenderer.Texture = curTool.MouseTexture; }
public RTSUIBuildPanel(WidgetRenderer wr, int w, int h, int bCount, int sbw, int sbh) { Menu = new ScrollMenu(wr, w, h, bCount, sbw, sbh); Menu.BaseColor = UserConfig.MainScheme.WidgetBase; Menu.HighlightColor = UserConfig.MainScheme.WidgetActive; Menu.TextColor = UserConfig.MainScheme.Text; Menu.ScrollBarBaseColor = UserConfig.MainScheme.WidgetInactive; }
void Start() { scrollMenu = GetComponent <ScrollMenu>(); SetChapter(); scrollMenu.slideToWorld(LevelChooseInfos.chapterIndex); if (LevelChooseInfos.showGames) { gameChooseControllers[LevelChooseInfos.chapterIndex].SetGames(); scrollMenu.slideInLevelsFast(); } }
public NewHeroScreen(Content content) : base("Create Hero") { mContent = content; mNameBox = new TextBox("Name", "Someone Jones"); mNameBox.Position = new Vec(10, 5); mNameBox.Width = 20; Controls.Add(mNameBox); ScrollMenu sexMenu = new ScrollMenu("Sex", new string[] { "Female", "Male" }); sexMenu.Position = new Vec(5, 11); Controls.Add(sexMenu); mRaceMenu = new ScrollMenu("Race"); mRaceMenu.Position = new Vec(sexMenu.Bounds.Right + 5, 11); mRaceMenu.ItemSelected += RaceMenu_ItemSelected; foreach (HeroRace race in mContent.HeroRaces) { mRaceMenu.Items.Add(new MenuItem(race.Name)); } Controls.Add(mRaceMenu); mClassMenu = new ScrollMenu("Class", new string[] { "Warrior" }); mClassMenu.Position = new Vec(mRaceMenu.Bounds.Right + 5, 11); Controls.Add(mClassMenu); mLevelMenu = new ScrollMenu("Level", new string[] { "1", "10" }); mLevelMenu.Position = new Vec(mClassMenu.Bounds.Right + 5, 11); Controls.Add(mLevelMenu); mCheatMenu = new ScrollMenu("Cheat Death", new string[] { "Yes", "No" }); mCheatMenu.Position = new Vec(mLevelMenu.Bounds.Right + 5, 11); Controls.Add(mCheatMenu); mStatsControl = new NewStatsControl(new Vec(3, 17)); mStatsControl.Race = mContent.HeroRaces.Find(mRaceMenu.SelectedItem.Text); Controls.Add(mStatsControl); Controls.Add(new TitleBar()); Controls.Add(new StatusBar()); // default to human male sexMenu.Selected = 1; mRaceMenu.Selected = mContent.HeroRaces.IndexOf(mContent.HeroRaces.Find("Human")); FocusFirst(); }
public override void OnInspectorGUI() { ScrollMenu target = (ScrollMenu)base.target; base.OnInspectorGUI(); if (GUILayout.Button("Instantiate panels")) { target.SetPanels(); } if (GUILayout.Button("Clear panels")) { target.ClearPanels(); } }
public LoadHeroScreen(Content content) : base("Load Existing Hero") { mContent = content; mHeroesMenu = new ScrollMenu("Hero"); mHeroesMenu.Position = new Vec(5, 15); foreach (string hero in Game.Heroes) { mHeroesMenu.Items.Add(new MenuItem(hero)); } Controls.Add(mHeroesMenu); Controls.Add(new TitleBar()); Controls.Add(new StatusBar()); FocusFirst(); }
private void CreateWidgets() { wr = new WidgetRenderer(G, game.Content.Load <SpriteFont>(@"Fonts\Impact32")); voxMenu = new ScrollMenu(wr, 180, 30, 5, 12, 30); voxMenu.Build(dVox.Keys.ToArray()); voxMenu.BaseColor = Color.LightCoral; voxMenu.HighlightColor = Color.Red; voxMenu.TextColor = Color.Black; voxMenu.ScrollBarBaseColor = Color.Green; voxMenu.Widget.AlignY = Alignment.BOTTOM; voxMenu.Widget.Anchor = new Point(0, game.Window.ClientBounds.Height); voxMenu.Hook(); // TODO: Parse In Config leMenu = new LEMenu(wr, new UICLEMenu()); leMenu.Activate(); leMenu.SaveButton.OnButtonPress += SaveButton_OnButtonPress; leMenu.LoadButton.OnButtonPress += LoadButton_OnButtonPress; }
private static void DisplayMenu() { ScrollMenu scrollMenu = new ScrollMenu() { Margin = 7, HorizontalAlignment = DustInTheWind.ConsoleTools.HorizontalAlignment.Center, EraseAfterClose = true }; scrollMenu.AddItems(new IMenuItem[] { new LabelMenuItem { Text = "New Game", Command = new NewGame(SuperPlay) }, //new YesNoMenuItem //{ // Text = "Save Game", // Command = new SaveGameCommand(SaveGameToDb, _gameProg) //}, new LabelMenuItem { Text = "Load&Play", Command = new LoadGameCommand(LoadGameList) }, new LabelMenuItem { Text = "Show Score", Command = new ShowScoreMenu(ShowScore) }, new LabelMenuItem { Text = " Exit ", Command = new ExitGame(ExitGame) } }); scrollMenu.Display(); }
public static void MenuOne(string[] options) { ScrollMenu scrollMenu = new ScrollMenu(); scrollMenu.HorizontalAlignment = HorizontalAlignment.Left; Console.WriteLine("\n\n\n\n\t BIENVENIDO AL VIDEOCLUB\n"); for (int i = 0; i < options.Length; i++) { scrollMenu.AddItem(new LabelMenuItem() { IsEnabled = true, IsVisible = true, Text = options[i], HorizontalAlignment = HorizontalAlignment.Stretch, PaddingLeft = 9, PaddingRight = 30 - options[i].Length, ShortcutKey = ShortCut(i), Command = new Opcion1Command(i) }); } scrollMenu.Display(); }
public override IMenu buildMenu() { sort(); Menu menu = new Menu(); SpaceItem padding = new SpaceItem(); Row headerTitle = new Row(); headerTitle.setPadding(true, true, false); headerTitle.setColor(CrhcConstants.COLOR_BLUE_LIGHT); TextItem titleText = new TextItem(getName().ToUpper()); titleText.setColor(CrhcConstants.COLOR_RED); titleText.setFont(CrhcConstants.FONT_TITLE); headerTitle.addItem(titleText); menu.addRow(headerTitle); Row headerDesc = new Row(); headerDesc.setPadding(true, false, true); headerDesc.setColor(CrhcConstants.COLOR_BLUE_LIGHT); TextItem descText = new TextItem(getDescription()); headerDesc.addItem(descText); menu.addRow(headerDesc); Row paddingRow = new Row(5); foreach (Landmark child in this) { if (!child.isVisible()) { continue; } menu.addRow(paddingRow); Row row = new Row(); row.setPadding(true, true, true); if (CrhcConstants.LANDMARK_SORTORDER == SortOrder.NUMBER) { TextItem number = new TextItem(child.getNumber() + ". "); number.setFont(CrhcConstants.FONT_SUBTITLE); number.setColor(Color.white); row.addItem(number, .1f); TextItem text = new TextItem(child.getName()); text.setFont(CrhcConstants.FONT_SUBTITLE); text.setColor(Color.white); row.addItem(text, .4f); } else { TextItem text = new TextItem(child.getName()); text.setFont(CrhcConstants.FONT_SUBTITLE); text.setColor(Color.white); row.addItem(text, .55f); } Menu submenu = new Menu(); submenu.setColor(CrhcConstants.COLOR_BLUE_LIGHT); Row subrow = new Row(); subrow.setPadding(true, true, true); TextItem subtext = new TextItem(child.getDescription()); subrow.addItem(subtext, 1); submenu.addRow(subrow); if (child.hasAudio()) { JArray audioClips = child.getAudioClips(); for (int i = 0; i < audioClips.Count; i++) { JToken audioClip = audioClips.GetItem(i); if (i == 0) { submenu.addRow(new AudioPlayerRow(child.getUrl() + "audio.mp3")); } else { submenu.addRow(new AudioPlayerRow(child.getUrl() + "audio" + i + ".mp3")); } Row audioSourceRow = new Row(); audioSourceRow.setPadding(true, false, false); TextItem audioSourceItem = new TextItem(audioClip.Value <string>("audioSource")); audioSourceItem.setTextAnchor(TextAnchor.UpperLeft); audioSourceItem.setFont(CrhcConstants.FONT_SOURCE); audioSourceRow.addItem(audioSourceItem, 1); submenu.addRow(audioSourceRow); Row audioTranscriptionTitleRow = new Row(); TextItem audioTranscriptionTitle = new TextItem("Audio Transcription"); audioTranscriptionTitle.setFont(CrhcConstants.FONT_SUBTITLE); audioTranscriptionTitleRow.addItem(audioTranscriptionTitle, 1); audioTranscriptionTitleRow.setPadding(true, true, false); submenu.addRow(audioTranscriptionTitleRow); Row audioTranscriptionRow = new Row(); audioTranscriptionRow.setPadding(true, false, true); TextItem audioTranscriptionItem = new TextItem(audioClip.Value <string>("audioTranscription")); audioTranscriptionItem.setTextAnchor(TextAnchor.UpperLeft); audioTranscriptionRow.addItem(audioTranscriptionItem, 1); submenu.addRow(audioTranscriptionRow); } } row.addItem(new SpaceItem(), .025f); if (child.hasAddress()) { row.addItem(new DirectionButton(child), .1f); } else { row.addItem(new SpaceItem(), .1f); } row.addItem(new SpaceItem(), .025f); if (child.hasAR()) { row.addItem(new ARButton(child), .1f); } else { row.addItem(new SpaceItem(), .1f); Row subLongDescTitleRow = new Row(); TextItem subLongDescTitle = new TextItem("More Info"); subLongDescTitle.setFont(CrhcConstants.FONT_SUBTITLE); subLongDescTitleRow.addItem(subLongDescTitle, 1); subLongDescTitleRow.setPadding(true, true, false); submenu.addRow(subLongDescTitleRow); Row subLongDescRow = new Row(); TextItem subLongDesc = new TextItem(child.getLongDescription()); subLongDescRow.addItem(subLongDesc, 1); subLongDescRow.setPadding(true, false, true); submenu.addRow(subLongDescRow); } PaneRow panerow = new PaneRow(row, submenu); panerow.setClosedColor(CrhcConstants.COLOR_BLUE_DARK); panerow.setOpenColor(CrhcConstants.COLOR_RED); menu.addRow(panerow); } menu.addRow(paddingRow); menu.addRow(new SurveyRow()); menu.addRow(paddingRow); menu.addRow(new SettingsRow()); IMenu scrollMenu = new ScrollMenu(menu); IMenu fadeInMenu = new FadeInMenu(scrollMenu); fadeInMenu.setColor(CrhcConstants.COLOR_GRAY_DARK); return(new BlackoutTransitionMenu(new TourMenu(fadeInMenu, getUrl() + "header.jpg"))); }
public override void OnEntry(GameTime gameTime) { // Load All The Races And Schemes Races = new Dictionary <string, FileInfo>(); schemes = new Dictionary <string, RTSColorScheme>(); GameEngine.SearchAllInitInfo(new DirectoryInfo("Packs"), Races, schemes); if (schemes.Count < 1) { schemes.Add("Default", RTSColorScheme.Default); } string defScheme = "Default"; foreach (var kvp in schemes) { defScheme = kvp.Key; break; } // Set Init Data To Be Nothing game.LoadScreen.LoadFile = null; eld = new EngineLoadData(); eld.Teams = new TeamInitOption[GameState.MAX_PLAYERS]; for (int i = 0; i < eld.Teams.Length; i++) { eld.Teams[i].InputType = RTSInputType.None; eld.Teams[i].Race = null; eld.Teams[i].PlayerName = null; eld.Teams[i].Colors = schemes[defScheme]; } game.LoadScreen.LoadData = eld; wr = new WidgetRenderer(G, game.Content.Load <SpriteFont>(@"Fonts\Impact32")); widgets = new TeamInitWidget[eld.Teams.Length]; ButtonHighlightOptions bh1 = new ButtonHighlightOptions(120, 36, Color.Black); ButtonHighlightOptions bh2 = new ButtonHighlightOptions(120, 36, Color.DarkGray); string[] pt = { "None", "Player", "Computer", "Environment" }; for (int i = 0; i < widgets.Length; i++) { widgets[i] = new TeamInitWidget(wr, 600, 44, 8, new Color(8, 8, 8), bh1, bh2, Color.Lime); if (i > 0) { widgets[i].Parent = widgets[i - 1].BackRect; } widgets[i].TextIndex.Text = (i + 1).ToString(); widgets[i].TextUser.Text = "Unknown"; widgets[i].Set(pt, Races, schemes); } widgets[0].TextUser.Text = UserConfig.UserName; menuPresets = new ScrollMenu(wr, game.Window.ClientBounds.Width - widgets[0].BackRect.Width - 20, 24, game.Window.ClientBounds.Height / 24, 20, 40 ); menuPresets.BaseColor = UserConfig.MainScheme.WidgetBase; menuPresets.TextColor = UserConfig.MainScheme.Text; menuPresets.ScrollBarBaseColor = UserConfig.MainScheme.WidgetInactive; menuPresets.HighlightColor = UserConfig.MainScheme.WidgetActive; menuPresets.Widget.Anchor = new Point(game.Window.ClientBounds.Width - 20, 0); menuPresets.Widget.AlignX = Alignment.RIGHT; menuPresets.Build((from gp in gPresets select gp.Name).ToArray()); menuPresets.Hook(); textMap = new TextWidget(wr); textMap.Color = UserConfig.MainScheme.Text; textMap.Offset = new Point(0, 5); textMap.Height = 32; textMap.OffsetAlignY = Alignment.BOTTOM; textMap.Parent = widgets[widgets.Length - 1].BackRect; textGTController = new TextWidget(wr); textGTController.Color = UserConfig.MainScheme.Text; textGTController.Offset = new Point(0, 5); textGTController.Height = 32; textGTController.OffsetAlignY = Alignment.BOTTOM; textGTController.Parent = textMap; SetWidgetData(gPresets[0]); DevConsole.OnNewCommand += DevConsole_OnNewCommand; KeyboardEventDispatcher.OnKeyPressed += OnKeyPressed; MouseEventDispatcher.OnMousePress += OnMP; }
public void SelecionarUsuario() { scrollmMenu = gameObject.AddComponent <ScrollMenu> (); scrollmMenu.ScrollSelecao(File.ReadAllLines(Diretorios_Salvar.arquivoUsuarios), prefabBotaoSelecionarUsuario, prefabBotaoText); }
public void ExcluirJogador() { scrollMenu = gameObject.AddComponent <ScrollMenu> (); scrollMenu.ScrollSelecao(File.ReadAllLines(Diretorios_Salvar.arquivoUsuarios), prefabBotaoExcluirUsuario, prefabBotaoExcluirUsuarioTexto); }
public void EnterHuXingFloor(CameraUniversalCenter camCenter, string floorName, CanveGroupFade triggerFastMoveSM, ScrollMenu fastMoveSM) { DisplayAllFloorMesh(); currentAtFloor.floorName = ""; foreach (floor f in allFloor) { if (f.floorName == floorName) { currentAtFloor = f; isMYing = true; camCenter.ChangeCamera(f.cameraUniversal, 0.5f); if (f.pointForMove2 != null && f.pointForMove2.Length > 0) { fastMoveSM.GetComponent <RectTransform>().DOAnchorPosY(60, 1); triggerFastMoveSM.AlphaPlayForward(); string[] displayGroup = new string[f.pointForMove2.Length]; string[] paraGroup = new string[f.pointForMove2.Length]; for (int i = 0; i < f.pointForMove2.Length; i++) { displayGroup[i] = f.pointForMove2[i].name; paraGroup[i] = i.ToString(); } fastMoveSM.CreateItemGroup(displayGroup, paraGroup); } else { fastMoveSM.GetComponent <RectTransform>().DOAnchorPosY(60, 1); triggerFastMoveSM.AlphaPlayBackward(); } } } }
public static void MenuTwo(string[] menu, int j) { Console.Clear(); ScrollMenu scrollMenu = new ScrollMenu(); scrollMenu.HorizontalAlignment = HorizontalAlignment.Left; Console.WriteLine($"\n\n\n\n\t BIENVENIDO AL VIDEOCLUB {Service.User.Nombre}\n"); for (int i = 0; i < menu.Length; i++) { if (j == 0) { scrollMenu.AddItem(new LabelMenuItem() { IsEnabled = true, IsVisible = true, Text = menu[i], HorizontalAlignment = HorizontalAlignment.Stretch, PaddingLeft = 9, PaddingRight = 30 - menu[i].Length, ShortcutKey = ShortCut(i), Command = new Opcion2Command(i) }); } else if (j == 1) { scrollMenu.AddItem(new LabelMenuItem() { IsEnabled = true, IsVisible = true, Text = menu[i], HorizontalAlignment = HorizontalAlignment.Stretch, PaddingLeft = 9, PaddingRight = 30 - menu[i].Length, ShortcutKey = ShortCut(i), Command = new Opcion3Command(i) }); } else if (j == 2) { scrollMenu.AddItem(new LabelMenuItem() { IsEnabled = true, IsVisible = true, Text = menu[i], HorizontalAlignment = HorizontalAlignment.Stretch, PaddingLeft = 9, PaddingRight = 30 - menu[i].Length, ShortcutKey = ShortCut(i), Command = new Opcion4Command(i) }); } else if (j == 3) { scrollMenu.AddItem(new LabelMenuItem() { IsEnabled = true, IsVisible = true, Text = menu[i], HorizontalAlignment = HorizontalAlignment.Stretch, PaddingLeft = 9, PaddingRight = 30 - menu[i].Length, ShortcutKey = ShortCut(i), Command = new Opcion5Command(i) }); } } scrollMenu.Display(); }
// Start is called before the first frame update void Start() { this.ScrollMenuRef = GetComponent <ScrollMenu>(); }
public void ScrollMenuPosicao() //cria botoes para seecionar jogo { scrollMenu = gameObject.AddComponent <ScrollMenu> (); scrollMenu.ScrollSelecao(File.ReadAllLines(Diretorios_Salvar.arquivoMododeJogo), prefabPosicaoBotao, prefabPosicaoBotaoText); }
public void ExcluirJogo() { scrollMenu = gameObject.AddComponent <ScrollMenu> (); scrollMenu.ScrollSelecao(File.ReadAllLines(Diretorios_Salvar.arquivoMododeJogo), prefabBotaoExcluirJogo, prefabBotaoExcluirJogoText); }
public AreaPage GoToAreaPage() { Navigation.Click(); ScrollMenu.FindAndClickOnElement(_driver, "Area"); return(this); }