Exemplo n.º 1
0
        public ModMenus(IModConsole console, IModEvents events)
        {
            MainMenu  = new ModMainMenu(console);
            PauseMenu = new ModPauseMenu(console);
            ModsMenu  = new ModsMenu(console, this);
            InputMenu = new ModInputMenu(console);

            events.Subscribe <SettingsManager>(Common.Events.AfterStart);
            events.Subscribe <TitleScreenManager>(Common.Events.AfterStart);
            events.OnEvent += OnEvent;
        }
Exemplo n.º 2
0
        public ModMenus(IModConsole console, IModEvents events, IModInputHandler inputHandler,
                        IModManifest owmlManifest, IOwmlConfig owmlConfig, IOwmlConfig owmlDefaultConfig)
        {
            MainMenu  = new ModMainMenu(console);
            PauseMenu = new ModPauseMenu(console);
            ModsMenu  = new ModsMenu(console, this, inputHandler);
            OwmlMenu  = new OwmlConfigMenu(console, owmlManifest, owmlConfig, owmlDefaultConfig);
            InputMenu = new ModInputMenu(console);
            InputCombinationElementMenu = new ModInputCombinationElementMenu(console, inputHandler);
            InputCombinationMenu        = new ModInputCombinationMenu(console);

            events.Subscribe <SettingsManager>(Common.Events.AfterStart);
            events.Subscribe <TitleScreenManager>(Common.Events.AfterStart);
            events.OnEvent += OnEvent;
        }
Exemplo n.º 3
0
 private void OnEvent(MonoBehaviour behaviour, Common.Events ev)
 {
     if (behaviour.GetType() == typeof(SettingsManager) && ev == Common.Events.AfterStart && behaviour.name == "PauseMenuManagers")
     {
         var settingsManager = (SettingsManager)behaviour;
         PauseMenu.Initialize(settingsManager);
         ModsMenu.Initialize(PauseMenu);
     }
     else if (behaviour.GetType() == typeof(TitleScreenManager) && ev == Common.Events.AfterStart)
     {
         var titleScreenManager = (TitleScreenManager)behaviour;
         MainMenu.Initialize(titleScreenManager);
         var inputMenu = titleScreenManager.GetComponent <ProfileMenuManager>().GetValue <PopupInputMenu>("_createProfileConfirmPopup");
         InputMenu.Initialize(inputMenu);
         ModsMenu.Initialize(MainMenu);
     }
 }