static void Main(string[] args) { ScanDirTree(Environment.GetFolderPath(Environment.SpecialFolder.Programs)); return; Template t = TemplateParser.Parse("Template.ini"); List <string> startMenus = new List <string>(2) { Environment.GetFolderPath(Environment.SpecialFolder.Programs), @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\" }; HashSet <string> knownCategories = new HashSet <string> { "Research In Motion", "Accessories", "Accessories\\System Tools" }; foreach (var templateCategory in t) { knownCategories.Add(templateCategory.Name); } StartMenu menu = new StartMenu(); menu.KnownCategories = knownCategories; menu.AddLocations(startMenus); var commands = new List <Command>(t.TransformStartMenu(menu)); Console.WriteLine(new string('-', 80)); Console.WriteLine(menu); foreach (var cmd in commands) { Console.WriteLine(cmd); cmd.Execute(); } Console.WriteLine(new string('-', 80)); Console.WriteLine(menu); commands.Reverse(); foreach (var cmd in commands) { Console.WriteLine(cmd); cmd.UnExecute(); } Console.WriteLine(new string('-', 80)); Console.WriteLine(menu); //Console.ReadLine(); }
private void Start() { m_commsPanel = GetComponentInChildren <CommsPanel>(); m_securityPanel = GetComponentInChildren <SecurityPanel>(); m_engineeringPanel = GetComponentInChildren <EngineeringPanel>(); m_flightPanel = transform.GetChild(2).GetComponentInChildren <MapLogic>(); m_startPanel = transform.GetComponentInChildren <StartMenu>(); comsObj = transform.GetChild(1).gameObject; secObj = transform.GetChild(3).gameObject; engObj = transform.GetChild(0).gameObject; flightObj = transform.GetChild(2).gameObject; startMenuObj = transform.GetChild(4).gameObject; gameOverMenuObj = transform.GetChild(5).gameObject; gameWonObj = transform.GetChild(6).gameObject; CloseComs(); CloseSecurity(); CloseEng(); CloseFlight(); CloseStart(); CloseGameOver(); CloseGameWon(); OpenStart(); //GameStateManager.Instance.TargetState = GAME_STATE.Flight; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { base.Initialize(); IsMouseVisible = true; // Create and load space objects int xPos = DrawingConstants.X_BOARD_BUFFER; // Add space size added to account for blue arrow int yPos = DrawingConstants.Y_BOARD_BUFFER + DrawingConstants.SPACE_SIZE; for (int col = 0; col < NUM_COLUMNS; col++) { _boardColumns[col] = new BoardColumn( xPos, yPos, _imageDict[ImageNames.COLUMN_HOLDER], _imageDict[ImageNames.HIGHLIGHTED_COLUMN_HOLDER], _imageDict[ImageNames.BLUE_ARROW]); // Move to next column. xPos += DrawingConstants.SPACE_SIZE; } CurrentMenu = MenuState.Start; _winner = DiscColor.None; _startMenu = new StartMenu(_consolas24); _playAgainMenu = new PlayAgainMenu(_consolas24, GraphicsDevice); ResetGame(); }
public CherryGame() { this.graphics = new GraphicsDeviceManager(this); this.Content.RootDirectory = "Content"; this.gameObjects = new List <IDrawableGameObject>(); this.startMenu = new StartMenu(); }
private void InitializeComponent() { var viewmodel = new StartMenuViewModel(); var view = new StartMenu(viewmodel); view.Show(); }
protected override void Initialize() { EventHandler eventStartStart = onStart; EventHandler eventExitStart = OnExit; startMenu = new StartMenu(this, ref eventStartStart, ref eventExitStart); this.Components.Add(startMenu); EventHandler eventExitPause = OnExitPause; EventHandler eventContinuePause = OnContinue; pauseMenu = new PauseMenu(this, ref eventExitPause, ref eventContinuePause); this.pauseMenu.Enabled = false; this.pauseMenu.Visible = false; this.Components.Add(pauseMenu); Window.AllowUserResizing = true; base.Initialize(); UpdateSize(); Window.ClientSizeChanged += (object sender, EventArgs e) => { //map.GenerateMap(Window); UpdateSize(); }; }
/// <summary> /// Looks through all the categories in <paramref name="startMenu"/> and returns /// <see cref="DeleteFileCommand"/> commands for one that are empty. /// </summary> /// <remarks> /// This method should be called after the actual files in the start menu has been transformed. /// Applying the commands generated by this method should not invalidate the <paramref name="startMenu"/>, /// but it is not guaranteed. /// </remarks> /// <param name="startMenu">The <see cref="StartMenu"/> to cleanup.</param> /// <returns>A list of commands that can be applied to cleanup the <paramref name="startMenu"/></returns> public IEnumerable <Command> CleanupStartMenu(StartMenu startMenu) { // Look through all existing program categories. foreach (var programCategory in startMenu.Where(p => p.RealLocations.Count() > 0)) { int count = programCategory.RealLocations.Sum( l => Directory.GetFiles(l).Length + Directory.GetDirectories(l).Length ); if (count == 0) { yield return(new DeleteFileCommand(programCategory.RealLocations)); } } // Look though all restricted categories foreach (var programCategory in this.Where(c => c.IsRestricted) .Select(c => new ProgramCategory(startMenu, c.RestrictedPath))) { if (programCategory.RealLocations.Count() == 0) { continue; } int count = programCategory.RealLocations.Sum( l => Directory.GetFiles(l).Length + Directory.GetDirectories(l).Length ); if (count == 0) { yield return(new DeleteFileCommand(programCategory.RealLocations)); } } }
// Update is called once per frame void Update() { if (Input.GetButton("Cancel")) { StartMenu.RestartGame(); } }
static void Main(string[] args) { StartMenu title = new StartMenu(); title.TitleName(); Console.ReadLine(); }
static void PrintIfMore() { Console.WriteLine("\n\tPrint num if more by previor\n\n"); Random rand = new Random(); int[] arr = new int[10]; for (int i = 0; i < arr.Length; i++) { arr[i] = rand.Next(-10, 10); } Kiselev_Andrey.Array.Print(arr, "Array:"); List <int> res = new List <int>(); for (int i = 1; i < arr.Length; i++) { if (arr[i] > arr[i - 1]) { res.Add(arr[i]); } } Console.WriteLine("\nResult:"); foreach (var item in res) { Matrix.IntPrintBeautiful(item); } StartMenu.EnterClearConsole(); }
public void ProgramItemSortComparison() { Directory.CreateDirectory("Empty"); StartMenu s = new StartMenu("Empty"); ProgramCategory cat = new ProgramCategory(s); var l = new List <ProgramItem> { new ProgramItem(cat, "Z.lnk"), new ProgramItem(cat, "2.lnk"), new ProgramItem(cat, "B.lnk"), new ProgramItem(cat, "1.lnk"), new ProgramItem(cat, "A.lnk"), }; var lSorted = new List <ProgramItem> { new ProgramItem(cat, "1.lnk"), new ProgramItem(cat, "2.lnk"), new ProgramItem(cat, "A.lnk"), new ProgramItem(cat, "B.lnk"), new ProgramItem(cat, "Z.lnk"), }; Assert.IsFalse(l.SequenceEqual(lSorted)); l.Sort(); Assert.IsTrue(l.SequenceEqual(lSorted)); }
static void Fibonachy() { Console.WriteLine("\n\tFibonachy\n\n"); int num = ConsoleRead.Int("Imput count elements: "); int[] fibonachi = new int[num]; for (int i = 0; i < num; i++) { int k = i - 2; if (k < 0) { fibonachi[i] = i; } else { fibonachi[i] = fibonachi[i - 1] + fibonachi[k]; } } Console.WriteLine($"\nFibonachi array:\n"); for (int i = 0; i < num; i++) { Console.Write(fibonachi[i] + " "); } StartMenu.EnterClearConsole(); }
static void Progressions() { Console.WriteLine("\n\tArithmetic and Geometric progression\n\n"); int startNum = ConsoleRead.Int("Input start num: "); int increment = ConsoleRead.Int("Input increment: "); int countNum = ConsoleRead.Int("Input number of elements: "); int[] arrA = new int[countNum]; int[] arrG = new int[countNum]; arrA[0] = startNum; arrG[0] = startNum; for (int i = 1; i < countNum; i++) { arrA[i] = arrA[i - 1] + increment; arrG[i] = arrG[i - 1] * increment; } Kiselev_Andrey.Array.Print(arrA, "Arithmetic progression:"); Kiselev_Andrey.Array.Print(arrG, "Geometric progression:"); StartMenu.EnterClearConsole(); }
private void button3_Click(object sender, EventArgs e) { StartMenu s = new StartMenu(); s.Show(); this.Close(); }
private IEnumerator CallAdvent() { Music.PlaySE(Music.Clip.Enter); StartMenu.OnAfterEnter(); yield return(new WaitForSeconds(3)); switch (buttonNum) { case 0: Advent.StartAdventure(-1, 1); break; case 1: Advent.StartAdventure(0, 1); break; case 2: Advent.StartAdventure(1, 1); break; case 3: Advent.StartAdventure(2, 1); break; } }
public static void Main() { var printStartMenu = new StartMenu(); var keyboard = new UserInterfacecs(); StarCraftEngine engine = new StarCraftEngine(new Player("a", RaceType.Protoss, Position.Parse("1,1")), new Player("b", RaceType.Zerg, Position.Parse("2,2")), keyboard); // Event. listen for enter kay press keyboard.OnActionPressed += (sender, eventInfo) => { Console.Write("Enter command: "); string input = Console.ReadLine(); if (!string.IsNullOrEmpty(input)) { engine.ParceCommand(input); } // Console.Clear(); }; engine.InitialiseGame(); // Start engine engine.Run(); }
void InitSubMenus() { _startMenu = gameObject.GetComponent <StartMenu> (); _pauseMenu = gameObject.GetComponent <PauseMenu> (); _optionsMenu = gameObject.GetComponent <OptionsMenu> (); _statsMenu = gameObject.GetComponent <StatsMenu> (); _creditMenu = gameObject.GetComponent <CreditsMenu> (); }
void BackTask() { StartMenu.SetActive(true); ExitButton.gameObject.SetActive(true); BackButton.gameObject.SetActive(false); ActiveGame.SetActive(false); Animate = true; }
public void OnPointerClick(PointerEventData eventData) { if (StartMenu.CheckAfterEnter()) { return; } StartMenu.BackMenu(); }
//Exit button private void btnReturn_Click(object sender, EventArgs e) { //This section closes all the forms and exit the game by clicking in X on the Windows form StartMenu startMenu = new StartMenu(); startMenu.Show(); Hide(); }
// Use this for initialization void Start() { Instance = this; GameData.Initialize(); Player.Initialize(); LoadSavedGames(); Mod.LoadAllMods(); }
private void Awake() { if (Instance != null) { Destroy(Instance); } Instance = this; }
//Initializing the Manager by populating the menus //Also sets up the starting state and initializes the In Game Menu public void Init() { StartMenu = (StartMenu)MenuDictionary[MenuState.StartMenu.ToString()]; InGameMenu = (InGameMenu)MenuDictionary[MenuState.InGameMenu.ToString()]; ResultMenu = (ResultMenu)MenuDictionary[MenuState.ResultMenu.ToString()]; SetState(MenuState.StartMenu); InGameMenu.Init(); }
public void OnPointerExit(PointerEventData eventData) { if (StartMenu.CheckAfterEnter()) { return; } ChangeColor(0); }
public void StandardRun() { var knownCategories = new HashSet <string>(StringComparer.OrdinalIgnoreCase); ExtractZip("Programs.System.zip", "Programs.System"); ExtractZip("Programs.User.zip", "Programs.User"); knownCategories.Add("Accessories"); knownCategories.Add("Administrative Tools"); var startMenu = new StartMenu(knownCategories, "Programs.System", "Programs.User"); Template t = TemplateParser.Parse("TransformationTest.Setup.ini"); foreach (var templateCategory in t) { knownCategories.Add(templateCategory.Name); } startMenu.Refresh(); List <Command> realCommand = new List <Command>(); List <Command> rollbackCommands = new List <Command>(); var list = t.TransformStartMenu(startMenu).ToList(); foreach (var command in list) { command.Execute(); realCommand.Add((command as MoveProgramItemCommand).GetIoCommand()); } foreach (var command in realCommand) { command.Execute(); rollbackCommands.Add((command as MoveFileCommand).GetReverseCommand()); Console.WriteLine(command); } var obj = new CommandGroup() { Name = string.Format("Actions performed on {0} {1}", DateTime.UtcNow.ToLongDateString(), DateTime.UtcNow.ToLongTimeString()), Commands = rollbackCommands }; var cleanupCommands = t.CleanupStartMenu(startMenu).ToList(); foreach (var cleanupCommand in cleanupCommands) { Console.WriteLine(cleanupCommand); cleanupCommand.Execute(); obj.Commands.Add(((MoveFileCommand)cleanupCommand).GetReverseCommand()); } File.WriteAllText("rollback.json", fastJSON.JSON.Instance.ToJSON(obj, true, true)); }
void Awake() { startMenu = StartMenu.Instance(); displayManager = DisplayManager.Instance(); startAction = new UnityAction(StartFunction); aboutAction = new UnityAction(AboutFunction); StartThings(); }
public void OnPointerEnter(PointerEventData eventData) { if (StartMenu.CheckAfterEnter()) { return; } Music.PlaySE(Music.Clip.Dun); ChangeColor(1); }
public static void InitialiseCount(LeapInterface leap, GestureSpace space, StartMenu menu) { // Create gesture detector CountDetector count = new CountDetector(leap, space); // Register regions of interest ActivityROIs.ConnectROIs(count); count.RegisterObserver(menu); }
public void StartMenuTestInput() { StartMenu startmenu = new StartMenu(); Game game = new Game(startmenu); game.Turn(ConsoleKey.LeftArrow); Assert.AreEqual(startmenu.key, ConsoleKey.LeftArrow); }
private void Fuck_Load(object sender, EventArgs e) { StartMenu s = new StartMenu(); s.Show(); this.Opacity = 0.0f; this.ShowInTaskbar = false; }
private void FinishCreatingTestBtn_Click(object sender, RoutedEventArgs e) { MessageBox.Show($"Test{_testTitle} has been added", "Test", MessageBoxButton.OK, MessageBoxImage.Information); StartMenu instance = Application.Current.Windows.OfType <StartMenu>().FirstOrDefault(); StartMenu new_instance = new StartMenu(instance.UA); instance.Close(); new_instance.Show(); }
/**--------------------------------------------------------------------------------- * Should only be executed once. * Loads all components necessary for the script. * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call. */ public void LoadComponents() { startMenuGameObj = GameObject.Find("StartMenu_Canvas"); helpMenuGameObj = GameObject.Find("HelpMenu_Canvas"); backGameObj = GameObject.Find("HelpBack_TextBtn"); startMenuObj = startMenuGameObj.GetComponent<StartMenu>(); startMenu = startMenuGameObj.GetComponent<Canvas>(); helpMenu = helpMenuGameObj.GetComponent<Canvas>(); backText = backGameObj.GetComponent<Button>(); }
/**--------------------------------------------------------------------------------- * Should only be executed once. * Loads necessary components for Twitter menu. * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call. */ public void LoadCompononents() { startMenuGameObject = GameObject.Find("StartMenu_Canvas"); twitterMenuGameObject = GameObject.Find("TwitterMenu_Canvas"); backGameObject = GameObject.Find("TwitterBack_TextBtn"); startMenuObject = startMenuGameObject.GetComponent<StartMenu>(); twitterMenu = twitterMenuGameObject.GetComponent<Canvas>(); startMenu = startMenuGameObject.GetComponent<Canvas>(); backText = backGameObject.GetComponent<Button>(); }
static void Main(string[] args) { StartMenu menu = new StartMenu(); LeapInterface leap = new LeapInterface(); GestureSpace space = new GestureSpace(); InitialiseCount(leap, space, menu); Console.ReadLine(); leap.Stop(); leap.Destroy(); }
void Awake() { if (menu == null) { menu = this; DontDestroyOnLoad(menu); } else if (menu != this) { Destroy(menu.gameObject); WorldParen.SetActive(false); Loose.SetActive(true); menu = this; DontDestroyOnLoad(menu); StartLevel.GetComponent<Image>().sprite = TryAgain; MenuButton.SetActive(true); } }
void Start() { exitButton = exitButton.GetComponent<Button>(); menuCanvas = menuCanvas.GetComponent<Canvas>(); uiCanvas = uiCanvas.GetComponent<Canvas>(); gamePausedCanvas = gamePausedCanvas.GetComponent<Canvas>(); playButton = playButton.GetComponent<Button>(); continueButton = continueButton.GetComponent<Button>(); continueText = continueText.GetComponent<Text>(); playText = playText.GetComponent<Text>(); snakeObject = GameObject.FindGameObjectWithTag("Snake"); snakeScript = snakeObject.GetComponent<Snake>(); backgroundObject = GameObject.FindGameObjectWithTag("Background"); addPortalScript = backgroundObject.GetComponent<AddPortal>(); GameObject startmenu = GameObject.FindGameObjectWithTag("Startmenu"); startMenuScript = startmenu.GetComponent<StartMenu>(); uiCanvas.enabled = false; }
// Use this for initialization void Start() { GameController.turnoffUIs(); Menu = new StartMenu(); Menu.open(true,true,false); }
public void ProgramItemSortComparison() { Directory.CreateDirectory("Empty"); StartMenu s = new StartMenu("Empty"); ProgramCategory cat = new ProgramCategory(s); var l = new List<ProgramItem> { new ProgramItem(cat, "Z.lnk"), new ProgramItem(cat, "2.lnk"), new ProgramItem(cat, "B.lnk"), new ProgramItem(cat, "1.lnk"), new ProgramItem(cat, "A.lnk"), }; var lSorted = new List<ProgramItem> { new ProgramItem(cat, "1.lnk"), new ProgramItem(cat, "2.lnk"), new ProgramItem(cat, "A.lnk"), new ProgramItem(cat, "B.lnk"), new ProgramItem(cat, "Z.lnk"), }; Assert.IsFalse(l.SequenceEqual(lSorted)); l.Sort(); Assert.IsTrue(l.SequenceEqual(lSorted)); }
public void ProgramItemEquality() { Directory.CreateDirectory("Empty"); StartMenu s = new StartMenu("Empty"); ProgramCategory cat = new ProgramCategory(s); ProgramItem a = new ProgramItem(cat, "Hello.lnk"); ProgramItem b = new ProgramItem(cat, "Hello.lnk"); Assert.IsTrue(a == b, "Equality operator failed"); Assert.AreEqual(true, a.Equals(b), "Explicit call to IEquatable<T> method failed"); Assert.AreEqual(a, b, "Generic Assert.AreEqual call failed"); }
/**--------------------------------------------------------------------------------- * Should only be executed once. * Loads necessary components for Load Level menu. * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call. */ public void LoadComponents() { startMenuGameObject = GameObject.Find("StartMenu_Canvas"); loadMenuGameObject = GameObject.Find("LoadLevelMenu_Canvas"); backGameObject = GameObject.Find("LoadLevelBack_TextBtn"); startMenuObject = startMenuGameObject.GetComponent<StartMenu>(); startMenu = startMenuGameObject.GetComponent<Canvas>(); loadLevelMenu = loadMenuGameObject.GetComponent<Canvas>(); backText = backGameObject.GetComponent<Button>(); }
/**--------------------------------------------------------------------------------- * Should only be executed once. * Loads all components necessary for the script. * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call. * Loads audio settings from GlobalGameSettings. */ public void LoadComponents() { GlobalGameSettings.LoadSettings(); startMenuGameObject = GameObject.Find("StartMenu_Canvas"); optionsMenuGameObject = GameObject.Find("OptionsMenu_Canvas"); backGameObject = GameObject.Find("OptionsBack_TextBtn"); masterVolGameObject = GameObject.Find("SoundMaster_Slider"); masterVolText = GameObject.Find("SoundMasterCounter_Text").GetComponent<Text>(); musicVolGameObject = GameObject.Find("SoundMusic_Slider"); musicVolText = GameObject.Find("SoundMusicCounter_Text").GetComponent<Text>(); effectsVolGameObject = GameObject.Find("SoundEffects_Slider"); effectsVolText = GameObject.Find("SoundEffectsCounter_Text").GetComponent<Text>(); startMenu = startMenuGameObject.GetComponent<Canvas>(); optionsMenu = optionsMenuGameObject.GetComponent<Canvas>(); startMenuObj = startMenuGameObject.GetComponent<StartMenu>(); backText = backGameObject.GetComponent<Button>(); masterVolSlider = masterVolGameObject.GetComponent<Slider>(); effectsVolSlider = effectsVolGameObject.GetComponent<Slider>(); musicVolSlider = musicVolGameObject.GetComponent<Slider>(); int masterVol = GlobalGameSettings.GetMasterVolume(); int effectsVol = GlobalGameSettings.GetEffectsVolume(); int musicVol = GlobalGameSettings.GetMusicVolume(); masterVolSlider.value = masterVol; effectsVolSlider.value = effectsVol; musicVolSlider.value = musicVol; masterVolText.text = masterVol.ToString(); effectsVolText.text = effectsVol.ToString(); musicVolText.text = musicVol.ToString(); }
//Debug //private PointerNode _pointer = new PointerNode(PointerRole.Controller); #endregion #region Constructor /// <summary> /// Disables the UI and runs the Login procedure /// </summary> public ActivityBar() { _startupDesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); InitializeComponent(); _activityWindow = new ActivityWindow(this); _popUpWindows.Add(_activityWindow); _managerWindow = new ManagerWindow(this); _popUpWindows.Add(_managerWindow); _startMenu = new StartMenu(this); _popUpWindows.Add(_startMenu); _deviceWindow = new DeviceWindow(this); _popUpWindows.Add(_deviceWindow); //MouseHook.Register(); //MouseHook.MouseDown += MouseHookMouseClick; //MouseHook.MouseMove += MouseHookMouseMove; DisableUi(); _login = new LoginWindow(); _login.LoggedIn += LoginLoggedIn; _login.Show(); }