/// <summary>
 /// Menu service
 /// </summary>
 /// <typeparam name="TMenuService"></typeparam>
 /// <param name="services"></param>
 /// <returns></returns>
 public static IServiceCollection AddMenuModule <TMenuService>(this IServiceCollection services)
     where TMenuService : class, IMenuService
 {
     services.AddGearScoped <IMenuService, TMenuService>();
     MenuEvents.RegisterEvents();
     return(services);
 }
Example #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #3
0
    private void StartNewGame(GameSetup resultsSetup)
    {
        board.Create();
        IsPaused = false;
        Playtime = 0;
        pieceManager.Setup(board, resultsSetup);

        MenuEvents.StartGame(true);

        GameStatData.GameSetup = resultsSetup;
    }
Example #4
0
    // Start is called before the first frame update
    void Start()
    {
        menu           = Utilities.Scene.findExactlyOne <MenuEvents>();
        originPosition = transform.position;
        originRotation = transform.rotation;

        rbody       = GetComponent <Rigidbody>();
        moveSpeed   = minSpeed;
        camera      = Camera.main;
        cameraShake = camera.GetComponent <CameraShake>();
    }
Example #5
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
 }
Example #6
0
        public static __MicroComIAvnMenuProxy Create(IAvaloniaNativeFactory factory)
        {
            var events = new MenuEvents();

            var menu = (__MicroComIAvnMenuProxy)factory.CreateMenu(events);

            events.Initialise(menu);

            menu._events = events;

            return menu;
        }
Example #7
0
 // Start is called before the first frame update
 void Start()
 {
     gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
     if (endGamePanel == null)
     {
         Debug.Log("Failed to load menu!");
     }
     menuEventsScript = GameObject.Find("Canvas").GetComponent <MenuEvents>();
     rig             = gameObject.GetComponent <Rigidbody>();
     timeTillCanJump = MaxTimeTillJump;//Allow to jump from the very start
     menuEventsScript.togglePause(false);
 }
Example #8
0
 public void OnInit()
 {
     Init = delegate { };
     AbilityDatabase.Setup();
     AddonMenus.Setup();
     StealthPrediction.Setup();
     HideNames.Setup();
     ActiveSkills.Setup();
     ObjectTracker.Setup();
     MenuEvents.Setup();
     DebugHelper.Setup();
     BuffTracker.Setup();
     Game.OnPreUpdate += Game_OnPreUpdate;
     DelayAction(Init.Invoke, 0.5f);
 }
Example #9
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Debug.Log("Pause Button pressed");

            if (IsStartDialogue)
            {
                return;
            }

            IsPaused = !IsPaused;

            MenuEvents.PauseGame(IsPaused);
        }
    }
Example #10
0
 public void OnUnload()
 {
     Console.WriteLine("Unload Common Started");
     Init = null;
     AbilityDatabase.Unload();
     AddonMenus.Unload();
     StealthPrediction.Unload();
     HideNames.Unload();
     ActiveSkills.Unload();
     ObjectTracker.Unload();
     MenuEvents.Unload();
     DebugHelper.Unload();
     BuffTracker.Unload();
     Game.OnPreUpdate -= Game_OnPreUpdate;
     Console.WriteLine("Unload Common Ended");
 }
Example #11
0
    private void LoadSaveGame()
    {
        board.Create();
        IsPaused = false;
        Playtime = SaveGameData.Data.timeFromStartGame;
        pieceManager.LoadGameSave(SaveGameData.Data, board, SaveGameData.Data.gameSetup);
        SaveGameData.Data = null;
        Playtime         += Time.timeSinceLevelLoad;

        MenuEvents.StartGame(false);

        if (SaveGameData.Data != null)
        {
            GameStatData.GameSetup = SaveGameData.Data.gameSetup;
        }
    }
    private void SaveGameDialogWindow(int windowId)
    {
        stringToEdit = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd h-mm");

        var guiStyle = GUI.skin.box;

        guiStyle.alignment = TextAnchor.MiddleCenter;

        GUI.Label(
            new Rect(10, 20, _pauseDialogWindowRect.width - 10, 30),
            "Название файла:",
            new GUIStyle
        {
            //richText = enabled,
            alignment = TextAnchor.MiddleCenter,
            fontSize  = Screen.height * 2 / 100,
            normal    = { textColor = new Color32(235, 235, 235, 255) }
        });


        stringToEdit = GUI.TextField(
            new Rect(5, 60, _pauseDialogWindowRect.width - 10, 75),
            stringToEdit, 25, guiStyle);

        if (GUI.Button(
                new Rect(5, 180, _pauseDialogWindowRect.width - 10, 35),
                "СОХРАНИТЬ"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Savegame Button pressed");

            MenuEvents.SaveGame(stringToEdit);

            showSaveGameDialog = false;
            showPauseDialog    = true;
        }
        else if (GUI.Button(new Rect(5, 220, _pauseDialogWindowRect.width - 10, 35), "НАЗАД"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Back to PauseMenu Button pressed");
            showSaveGameDialog = false;
            showPauseDialog    = true;
        }
    }
Example #13
0
    // ReSharper disable StringLiteralTypo
    private void EndGameWindowFunc()
    {
        GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "");

        GUI.Label(EndGameRect,
                  "Игра окончена\n" +
                  result +
                  "\n" +
                  "Набранные очки: " +
                  score +
                  "\n" +
                  "Общее время игры: " +
                  TimeSpan.FromSeconds(GameStatData.Playtime)
                  .ToString(@"hh\:mm\:ss\:fff") +
                  "\n" +
                  " Время ходов белых " + TimeSpan.FromSeconds(GameStatData.WhiteTime)
                  .ToString(@"hh\:mm\:ss\:fff") + "\n" +
                  " Время ходов черных " + TimeSpan.FromSeconds(GameStatData.BlackTime)
                  .ToString(@"hh\:mm\:ss\:fff") + "\n",
                  new GUIStyle
        {
            alignment = TextAnchor.UpperCenter,
            fontSize  = Screen.height * 2 / 65,
            normal    = { textColor = Color.white }
        });

        if (GUI.Button(new Rect(Screen.width / 2.0f, 380,
                                EndGameRect.width - 10, 35),
                       "ГЛАВНОЕ МЕНЮ"))
        {
            isEnabled = !isEnabled;
            SceneManager.LoadScene("MainMenuScene");
        }

        if (GUI.Button(new Rect(Screen.width / 3f, 380,
                                EndGameRect.width - 10, 35),
                       "ЗАНОВО"))
        {
            isEnabled = !isEnabled;
            MenuEvents.RestartGame();
        }
    }
    private void PauseDialogWindow(int windowId)
    {
        if (GUI.Button(
                new Rect(5, 20, _pauseDialogWindowRect.width - 10, 35),
                "ГЛАВНОЕ МЕНЮ"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("MainMenu LoadScene Button pressed");
            SceneManager.LoadScene("MainMenuScene");
        }

        if (GUI.Button(
                new Rect(5, 60, _pauseDialogWindowRect.width - 10, 35),
                "ЗАНОВО"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Restart Game Button pressed");

            menuEnabled = !menuEnabled;

            MenuEvents.RestartGame();
        }

        if (GUI.Button(
                new Rect(5, 100, _pauseDialogWindowRect.width - 10, 35),
                "СОХРАНИТЬ ИГРУ"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Save Game Button pressed");
            showPauseDialog    = false;
            showSaveGameDialog = true;
        }

        if (GUI.Button(
                new Rect(5, 140, _pauseDialogWindowRect.width - 10, 35),
                "ЗАГРУЗИТЬ ИГРУ"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Load Game Button pressed");
            showPauseDialog    = false;
            showLoadGameDialog = true;
        }

        if (GUI.Button(
                new Rect(5, 180, _pauseDialogWindowRect.width - 10, 35),
                "ОПЦИИ"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Option Button pressed");
            showOptionDialog = true;
            showPauseDialog  = false;
        }
        else if (GUI.Button(
                     new Rect(5, 220, _pauseDialogWindowRect.width - 10, 35),
                     "ВЫЙТИ ИЗ ИГРЫ"))
        {
            ClickSource.PlayOneShot(clickSound);
            Debug.Log("Quit Game Button pressed");
            Application.Quit();
        }
    }
Example #15
0
    //MenuEvents menuEvents;

    void OnEnable()
    {
        MenuEvents menuEvents = GetComponent <MenuEvents>();

        menuEvents.ChangeMenu.AddListener(SetActiveMenu);
    }
Example #16
0
 void Start()
 {
     menuEvents = Utilities.Scene.findExactlyOne <MenuEvents>();
 }
Example #17
0
 public virtual void ExecuteMenuEvent(MenuEvents menuEvent)
 {
 }