Inheritance: MonoBehaviour
        public void OnGUI(bool drawHighlight, SettingsMenu menu)
        {
            GUI.depth = 22;
            GUI.skin = _settingsSkin;

            // Background frame.
            Rect frameRect = new Rect(
                (float)Screen.width * 0.5f - (float)Screen.height * 0.52f,
                (float)Screen.height * 0.2f + (float)Screen.height * 0.42f,
                (float)Screen.height * 0.5f,
                (float)Screen.height * 0.2f);
            new ScrollsFrame(frameRect).AddNinePatch(ScrollsFrame.Border.DARK_CURVED, NinePatch.Patches.CENTER).Draw();

            // Header
            GUI.skin.label.fontSize = Screen.height / 32;
            GUI.skin.label.alignment = TextAnchor.MiddleCenter;
            GUI.skin = _regularUI;
            int fontSize = GUI.skin.label.fontSize;
            GUI.skin.label.fontSize = Screen.height / 32;
            float width = frameRect.width * 0.8f;
            float height = frameRect.height * 0.2f;
            Rect headerRect = new Rect(
                frameRect.x + ((frameRect.width - width) / 2.0f),
                frameRect.y + height / 2.0f,
                width,
                height);
            GUI.Label(headerRect, "Animation Control");

            // Slider
            GUI.skin = _settingsSkin;
            GUI.skin.button.fontSize = (Screen.height / 32);
            GUI.skin.horizontalSlider.fixedHeight = (float)(Screen.height / 30);
            GUI.skin.horizontalSliderThumb.fixedHeight = (float)(Screen.height / 30);

            Rect slideRect = new Rect(
                frameRect.x + ((frameRect.width - width) / 2.0f),
                frameRect.y + height * 2.0f,
                width,
                height);
            GUI.Label(slideRect, "Unit Animation Speed Multiplier: " + _multiplier.ToString("N0") + "x");
            slideRect.y = slideRect.y + (float)Screen.height * 0.05f;
            _multiplier = (float)Math.Round(GUI.HorizontalSlider(slideRect, _multiplier, 1.0f, 25.0f));

            // Draw fade-in
            if (menu != null)
            {
                float fadeIn = (float)typeof(SettingsMenu).GetField("fadeIn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(menu);
                GUI.color = new Color(1f, 1f, 1f, fadeIn);
                GUI.DrawTexture(frameRect, ResourceManager.LoadTexture("Shared/blackFiller"));
                GUI.color = new Color(1f, 1f, 1f, 1f);
            }

            // Update
            _mod.SetMultiplier(_multiplier);
        }
	void Start() {

		pauseMenu = this.GetComponent<PauseMenu> ();
		pauseMenu.enabled = false;

		settingsMenu = this.GetComponent<SettingsMenu> ();
		settingsMenu.enabled = false;

		levelSelect = this.GetComponent<LevelSelect> ();
		levelSelect.enabled = false;
	}
 public MenuCanvas Initialize(Camera mainCamera, bool tutorialForced)
 {
     GetComponent<Canvas>().worldCamera = mainCamera;
     _settingsMenu = GetComponentInChildren<SettingsMenu>();
     _settingsMenu.Initialize(tutorialForced);
     //_leaderboardMenu = GetComponentInChildren<LeaderboardMenu>();
     _enableDelegate = EnableButtons;
     InitializeAlertPopUp()
         .InitializeLoadingScreen();
     return this;
 }
        public ControlsProcessor(Settings settings, 
			ControllerEmulation controllerEmulation, 
			Aiming aiming, 
			ExtendedView extendedView, 
			RadialMenu radialMenu, 
			SettingsMenu settingsMenu, 
            GameState gameState,
			DebugOutput debugOutput)
        {
            _settings = settings;
            _controllerEmulation = controllerEmulation;
            _aiming = aiming;
            _extendedView = extendedView;
            _radialMenu = radialMenu;
            _settingsMenu = settingsMenu;
            _gameState = gameState;

            _debugOutput = debugOutput;
            _controllerEmulation.OnModifyState += OnModifyControllerState;
        }
Example #5
0
        public DeadzoneEditor(Settings settings, 
            SettingsMenu settingsMenu)
        {
            _settings = settings;
            _settingsMenu = settingsMenu;

            _settingsMenu.DeadzoneMenu.OnItemSelect += (m, item, indx) =>
            {
                if (indx == 0)
                {
                    _isDrawingDeadzone = true;
                }
                else
                {
                    _settings.Deadzones.RemoveAt(indx - 1);
                    _settingsMenu.DeadzoneMenu.RemoveItemAt(indx);
                    _settingsMenu.DeadzoneMenu.RefreshIndex();
                }
            };
        }
Example #6
0
 void Awake()
 {
     anim        = GetComponent <Animator>();
     sm          = GameObject.Find("_GM").GetComponent <SettingsMenu>();
     audioSource = GetComponent <AudioSource>();
 }
Example #7
0
 // Use this for initialization
 void Start()
 {
     nextMenu = PauseMenuNextMenu.NONE;
     networkManager = GetComponent<NetworkManagerScript>();
     gameManager = GetComponent<GameManagerScript>();
     settings = GetComponent<SettingsMenu>();
     mainMenu = GetComponent<MainMenuScript>();
     lobby = GetComponent<GameLobbyScript>();
     hud = GetComponent<HUDScript>();
 }
Example #8
0
 // subscribe to the settings menu
 public void SubscribeToSettings(SettingsMenu settingsMenu)
 {
     settingsMenu.notifyAudioObservers += OnAudioChange; // observation handler registration
 }
Example #9
0
 // public GameObject settingsMenu;
 void Awake()
 {
     instance = this;
 }
Example #10
0
 public void CloseSettingsMenu()
 {
     StartMenu.SetActive(true);
     SettingsMenu.SetActive(false);
 }
Example #11
0
        private static void OffensiveOnTick()
        {
            var offItem =
                Offensive.OffensiveItems.FirstOrDefault(i => i.IsReady() && i.IsOwned() && OffensiveMenu.GetCheckBoxValue("check" + (int)i.Id));

            if (offItem != null)
            {
                if ((offItem.Id == ItemId.Tiamat || offItem.Id == ItemId.Ravenous_Hydra) && CanPost)
                {
                    var killMinion =
                        EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                            m => m.IsValidTarget(offItem.Range) && m.Health <= Player.Instance.GetAutoAttackDamage(m) * 0.6f);

                    var countMinion = EntityManager.MinionsAndMonsters.EnemyMinions.Count(m => m.IsValidTarget(offItem.Range));

                    var targetTiamat = TargetSelector.GetTarget(offItem.Range, DamageType.Physical);

                    if (targetTiamat != null && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        offItem.Cast();
                        return;
                    }

                    if ((killMinion != null || countMinion >= 3) && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
                    {
                        offItem.Cast();
                        return;
                    }
                }

                if (offItem.Id == ItemId.Titanic_Hydra && CanPost)
                {
                    var killMinionT =
                        EntityManager.MinionsAndMonsters.EnemyMinions.FirstOrDefault(
                            m => m.IsValidTarget(offItem.Range) && m.Health <= 40 + Player.Instance.MaxHealth * 0.1f);

                    var countMinionT = EntityManager.MinionsAndMonsters.EnemyMinions.Count(m => m.IsValidTarget(offItem.Range));

                    var targetTitanic = TargetSelector.GetTarget(offItem.Range, DamageType.Physical);


                    if (targetTitanic != null && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
                    {
                        offItem.Cast();
                        return;
                    }

                    if ((killMinionT != null || countMinionT >= 3) && Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
                    {
                        offItem.Cast();
                        return;
                    }
                    return;
                }


                if (SettingsMenu.GetCheckBoxValue("comboUseItems")
                    ? Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)
                    : offItem.IsReady())
                {
                    var target = TargetSelector.GetTarget(offItem.Range, DamageType.Mixed);
                    if (target != null && offItem.IsReady())
                    {
                        offItem.Cast(target);
                    }
                }
            }
        }
        public static void LoadMenu()
        {
            var startMenu = MainMenu.AddMenu(MenuName, MenuName.ToLower());

            var notStart = new SimpleNotification("Mario`s Gangplank Yuklendi", "Mario`s Gangplank Basariyle yuklendi.");

            Notifications.Show(notStart, 2500);

            #region Combo
            ComboMenu = startMenu.AddSubMenu(":-Combo Menu-:");
            ComboMenu.AddGroupLabel("-:Combo Büyüler:-");
            ComboMenu.Add("qCombo", new CheckBox("• Kullan Q."));
            ComboMenu.Add("eCombo", new CheckBox("• Kullan E."));
            ComboMenu.AddLabel("If the target is close to you");
            ComboMenu.Add("eComboRangeClose", new Slider("How close to put the barrel(0 on the player)", 150, 50, 600));
            ComboMenu.AddLabel("If the target is far from you");
            ComboMenu.Add("eComboRangeFar", new Slider("How close to put the barrel(0 on the player)", 350, 300, 800));
            ComboMenu.Add("rCombo", new CheckBox("• Kullan R."));
            ComboMenu.Add("rComboCount", new Slider("R için en az düşamn(0 = Kapalı)", 2, 0, 5));
            #endregion Combo

            #region Harass
            HarassMenu = startMenu.AddSubMenu(":-Harass Menu-:");
            HarassMenu.AddGroupLabel("-:Dürtme Ayarları:-");
            HarassMenu.Add("qHarass", new CheckBox("• Kullan Q."));
            HarassMenu.Add("eHarass", new CheckBox("• Kullan E.", false));
            HarassMenu.AddGroupLabel("-:Dürtme Ayarları:-");
            HarassMenu.Add("manaHarass", new Slider("Dürtme için en az mana.", 30));
            HarassMenu.AddGroupLabel("-:Otomatikdürt Büyüleri:-");
            HarassMenu.Add("qAutoHarass", new CheckBox("• Kullan Q."));
            HarassMenu.Add("eAutoHarass", new CheckBox("• Kullan E."));
            HarassMenu.AddGroupLabel("-:Otomatikdürt Ayarları:-");
            var keyAutoHarass = HarassMenu.Add("keyAutoHarass",
                                               new KeyBind("Otomatik dürtme kapat/aç", false, KeyBind.BindTypes.PressToggle, 'T'));
            keyAutoHarass.OnValueChange += delegate
            {
                var notHarassOn  = new SimpleNotification("AutoHarass Mode Change", "AutoHarass is now On. ");
                var notHarassOff = new SimpleNotification("AutoHarass Mode Change", "AutoHarass is now Off. ");

                Notifications.Show(keyAutoHarass.CurrentValue ? notHarassOn : notHarassOff, 1000);
            };
            HarassMenu.Add("manaAutoHarass", new Slider("Otomatik dürtme için gereken mana", 45));
            #endregion Harass

            #region LaneClear
            LaneClearMenu = startMenu.AddSubMenu(":-LaneClear Menu-:");
            LaneClearMenu.AddGroupLabel("-:Lanetemizleme Büyüleri:-");
            LaneClearMenu.Add("qLane", new CheckBox("• Kullan Q varile."));
            LaneClearMenu.Add("qLaneLast", new CheckBox("• Kullan Q son vuruşta"));
            LaneClearMenu.Add("eLane", new CheckBox("• Kullan E."));
            LaneClearMenu.Add("eKeep", new Slider("• şu kadar varil", 1, 0, 4));
            LaneClearMenu.AddGroupLabel("-:Lanetemizleme Ayarları:-");
            LaneClearMenu.Add("qLaneCount", new Slider("Varil Q için gereken minyon", 2, 0, 6));
            LaneClearMenu.Add("eLaneCount", new Slider("Varil yerleştirmek için gereken minyon.", 3, 0, 6));
            LaneClearMenu.Add("manaLane", new Slider("Lanetemizleme için gereken en az mana", 30));
            #endregion LaneClear

            #region JungleClear
            JungleClearMenu = startMenu.AddSubMenu(":-JungleClear Menu-:");
            JungleClearMenu.AddGroupLabel("-:Ormantemizleme Büyüleri:-");
            JungleClearMenu.Add("qJungle", new CheckBox("• Kullan Q Barrel."));
            JungleClearMenu.Add("qJungleLast", new CheckBox("• Use Q to kill the minion."));
            JungleClearMenu.Add("eJungle", new CheckBox("• Kullan E."));
            JungleClearMenu.AddGroupLabel("-:Ormantemizleme Ayarları:-");
            JungleClearMenu.Add("manaJungle", new Slider("Orman temizleme için gereken en az mana", 30));
            #endregion JungleClear

            #region Lasthit
            LastHitMenu = startMenu.AddSubMenu(":-LastHit Menu-:");
            LastHitMenu.AddGroupLabel("-:Sonvuruş Büyüleri:-");
            LastHitMenu.Add("qLast", new CheckBox("• Kullan Q."));
            LastHitMenu.AddGroupLabel("-:Sonvuruş Ayarları:-");
            LastHitMenu.Add("manaLast", new Slider("Sonvuruş için gereken en az mana", 30));
            #endregion Lasthit

            #region Settings
            SettingsMenu = startMenu.AddSubMenu(":-Settings Menu-:");
            SettingsMenu.AddGroupLabel("-:Q KS AAyarları:-");
            SettingsMenu.Add("qKS", new CheckBox("• Q Kullan"));
            SettingsMenu.AddGroupLabel("-:R Ayarları:-");
            SettingsMenu.Add("rKS", new CheckBox("• R Kullan"));
            SettingsMenu.Add("rKSOverkill", new Slider("R KS hızlıkil, Ulti için gereken hedefin canı [{0}]", 150, 50, 400));
            SettingsMenu.Add("rToSaveAlly", new CheckBox("• Ryi dostlarını korumak için kullan"));
            SettingsMenu.Add("rToSaveAllyPercent", new Slider("• Dostları korumak için dostların klan canı ({0}).", 15));
            SettingsMenu.AddGroupLabel("-:W Ayarları:-");
            SettingsMenu.Add("wUsePercent", new Slider("• Canım şundan azsa  W Kullan({0}).", 20));
            SettingsMenu.AddSeparator(1);
            SettingsMenu.Add("wBuffStun", new CheckBox("• Sabitleme"));
            SettingsMenu.Add("wBuffSlow", new CheckBox("• Yavaşlatma", false));
            SettingsMenu.Add("wBuffBlind", new CheckBox("• Blind"));
            SettingsMenu.Add("wBuffSupression", new CheckBox("• Supression"));
            SettingsMenu.Add("wBuffSnare", new CheckBox("• Snare"));
            SettingsMenu.Add("wBuffTaunt", new CheckBox("• Taunt"));
            SettingsMenu.AddGroupLabel("-:Ayarlar:-");
            LastHitMenu.Add("manaSettings", new Slider("Büyüler için gereken mana", 30));
            #endregion Settings

            #region Drawings
            DrawingsMenu = startMenu.AddSubMenu(":-Drawings Menu-:");
            DrawingsMenu.Add("readyDraw", new CheckBox("• Büyüler hazırsa göster"));
            DrawingsMenu.Add("damageDraw", new CheckBox("•Hasartespitçisi göster"));
            DrawingsMenu.Add("perDraw", new CheckBox("• hasar tespitçisi yüzdeyle göster"));
            DrawingsMenu.Add("statDraw", new CheckBox("• hasartespitçisi istatistiklerini göster"));
            DrawingsMenu.AddGroupLabel("-:Büyüler:-");
            DrawingsMenu.Add("qDraw", new CheckBox("• göster Q."));
            DrawingsMenu.Add("wDraw", new CheckBox("• göster W."));
            DrawingsMenu.Add("eDraw", new CheckBox("• göster E."));
            DrawingsMenu.Add("barrelDraw", new CheckBox("• göster Varil."));
            #endregion Drawings
        }
Example #13
0
        private void ButtonSettings_Click(object sender, EventArgs e)
        {
            SettingsMenu settingsMenu = new SettingsMenu();

            settingsMenu.Show();
        }
Example #14
0
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            //Only if u select Caitlyn
            if (Player.Instance.ChampionName != "Caitlyn")
            {
                return;
            }

            Bootstrap.Init(null);
            TargetSelector.Init();
            Chat.Print("<font color = \"#2fff0a\">xaxiCait by xaxi</font>");

            //      SpellSlot, Range, Skillshot Type, Cast, Delay, Width.
            Q = new Spell.Skillshot(SpellSlot.Q, 1240, SkillShotType.Linear, (int)0.25f, (int)2000f, (int)60f);
            W = new Spell.Targeted(SpellSlot.W, 820);
            E = new Spell.Skillshot(SpellSlot.E, 800, SkillShotType.Linear, (int)0.25f, (int)1600f, (int)80f);
            R = new Spell.Targeted(SpellSlot.R, 2000);

            //Menu
            CaityMenu = MainMenu.AddMenu("xaxiCaitlyn", "xaxi_cait");
            CaityMenu.AddGroupLabel("Caitlyn Settings");
            CaityMenu.AddSeparator();
            CaityMenu.AddLabel("Rewritten by Xaxixeo credis: CookieMonster10");

            SettingsMenu = CaityMenu.AddSubMenu("Settings", "settings");
            SettingsMenu.AddGroupLabel("Settings");
            SettingsMenu.AddLabel("Combo");
            SettingsMenu.Add("comboQ", new CheckBox("Use Q"));
            SettingsMenu.Add("comboW", new CheckBox("Use W"));
            SettingsMenu.Add("comboE", new CheckBox("Use E KS"));
            SettingsMenu.Add("comboE2", new CheckBox("Use E Escape"));
            SettingsMenu.Add("comboR", new CheckBox("Use R KS in Combo"));
            SettingsMenu.AddSeparator();
            SettingsMenu.AddLabel("Harass");
            SettingsMenu.Add("harassQ", new CheckBox("Use Q"));
            SettingsMenu.Add("harassMana", new Slider("Mana% Q", 70, 1, 99));
            SettingsMenu.AddSeparator();
            SettingsMenu.AddLabel("LaneClear");
            SettingsMenu.Add("laneclearQ", new CheckBox("Use Q"));
            SettingsMenu.Add("laneclearMana", new Slider("Mana% Q", 90, 1, 99));
            SettingsMenu.AddSeparator();
            SettingsMenu.AddLabel("JungleClear");
            SettingsMenu.Add("jungleclearQ", new CheckBox("Use Q"));
            SettingsMenu.Add("jungleclearMana", new Slider("Mana% Q", 10, 1, 99));
            SettingsMenu.AddSeparator();
            SettingsMenu.AddLabel("Drawings");
            SettingsMenu.Add("drawQ", new CheckBox("Q Range"));
            SettingsMenu.Add("drawW", new CheckBox("W Range"));
            SettingsMenu.Add("drawE", new CheckBox("E Range"));
            SettingsMenu.Add("drawR", new CheckBox("R Range"));
            SettingsMenu.AddSeparator();
            SettingsMenu.AddLabel("Misc");
            SettingsMenu.Add("Dash", new KeyBind("Dash to mouse pos", false, KeyBind.BindTypes.HoldActive, 'Z'));
            SettingsMenu.Add("Smart Q", new CheckBox("Smart Q"));
            SettingsMenu.Add("Smart W", new CheckBox("Smart W"));
            SettingsMenu.Add("Smart E", new CheckBox("Smart E"));
            SettingsMenu.Add("Smart R", new CheckBox("KS R No Combo"));

            Game.OnTick    += Game_onTick;
            Drawing.OnDraw += Drawing_OnDraw;
            Interrupter.OnInterruptableSpell += Interrupter_OnInterruptableSpell;
            Gapcloser.OnGapcloser            += Gapcloser_OnGapCloser;
        }
Example #15
0
 // Start is called before the first frame update
 void Start()
 {
     settingsMenu = FindObjectOfType <SettingsMenu>();
 }
Example #16
0
 private void Awake()
 {
     Instance = this;
     UpdateSettings();
 }
Example #17
0
 // Start is called before the first frame update
 void Start()
 {
     Cursor.lockState = CursorLockMode.Locked;                            // lock cursor in center of screen
     settings         = gameObject.GetComponentInParent <SettingsMenu>(); // get settings access
 }
Example #18
0
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            if (Player.Instance.ChampionName != "Annie")
            {
                return;
            }

            //Hacks.AntiAFK = true;
            Bootstrap.Init(null);

            Q = new Spell.Targeted(SpellSlot.Q, 625, DamageType.Magical);
            W = new Spell.Skillshot(SpellSlot.W, 625, SkillShotType.Cone, 250, null, null, DamageType.Mixed)
            {
                ConeAngleDegrees = 50
            };
            E = new Spell.Active(SpellSlot.E);
            R = new Spell.Skillshot(SpellSlot.R, 600, SkillShotType.Circular, 0, int.MaxValue, 290, DamageType.Magical);

            menu = MainMenu.AddMenu("Unsigned Annie", "UnsignedAnnie");

            ComboMenu = menu.AddSubMenu("Combo", "combomenu");
            ComboMenu.AddGroupLabel("Combo Settings");
            ComboMenu.Add("Q", new CheckBox("Use Q"));
            ComboMenu.Add("W", new CheckBox("Use W"));
            ComboMenu.Add("E", new CheckBox("Use E"));
            ComboMenu.Add("R", new CheckBox("Use R"));
            //ComboMenu.Add("Flash Ult", new CheckBox("Flash R"));
            //ComboMenu.Add("Flash Ult People", new Slider("Flash R at x People: ", 4, 0, 5));
            ComboMenu.Add("Items", new CheckBox("Use Items"));
            ComboMenu.Add("Ignite", new CheckBox("Use Ignite"));

            LaneClear = menu.AddSubMenu("Lane Clear", "laneclear");
            LaneClear.AddGroupLabel("Lane Clear Settings");
            LaneClear.Add("Q", new CheckBox("Use Q"));
            LaneClear.Add("QForLastHit", new CheckBox("Use Q Only to Last Hit"));
            LaneClear.Add("W", new CheckBox("Use W"));

            Harass = menu.AddSubMenu("Harass", "harass");
            Harass.AddGroupLabel("Harass Settings");
            Harass.Add("Q", new CheckBox("Use Q"));
            Harass.Add("W", new CheckBox("Use W"));

            LastHit = menu.AddSubMenu("Last Hit", "lasthitmenu");
            LastHit.AddGroupLabel("Last Hit Settings");
            LastHit.Add("Q", new CheckBox("Use Q"));
            LastHit.Add("W", new CheckBox("Use W", false));

            Killsteal = menu.AddSubMenu("Killsteal", "killstealmenu");
            Killsteal.AddGroupLabel("Killsteal Settings");
            Killsteal.Add("KS", new CheckBox("Activate Killsteal"));
            Killsteal.Add("Q", new CheckBox("Use Q"));
            Killsteal.Add("W", new CheckBox("Use W"));
            Killsteal.Add("R", new CheckBox("Use R", false));
            Killsteal.Add("Ignite", new CheckBox("Use Ignite"));

            DrawingsMenu = menu.AddSubMenu("Drawings", "drawingsmenu");
            DrawingsMenu.AddGroupLabel("Drawings Settings");
            DrawingsMenu.Add("Q", new CheckBox("Draw Q/W"));
            DrawingsMenu.Add("R", new CheckBox("Draw R"));

            SettingsMenu = menu.AddSubMenu("Settings", "settingsmenu");
            SettingsMenu.AddGroupLabel("Settings");
            SettingsMenu.Add("Stack", new CheckBox("Prepare Stun at Base"));
            SettingsMenu.Add("Health Potions", new CheckBox("Auto-Use Health Potions"));
            SettingsMenu.Add("Tibbers Controller", new CheckBox("Auto-Control Tibbers"));
            SettingsMenu.Add("Auto R", new CheckBox("Auto Tibbers on 4 or more units (with stun)"));

            SpellDataInst Sum1 = _Player.Spellbook.GetSpell(SpellSlot.Summoner1);
            SpellDataInst Sum2 = _Player.Spellbook.GetSpell(SpellSlot.Summoner2);

            if (Sum1.Name == "summonerdot")
            {
                Ignite = new Spell.Targeted(SpellSlot.Summoner1, 600);
            }
            else if (Sum2.Name == "summonerdot")
            {
                Ignite = new Spell.Targeted(SpellSlot.Summoner2, 600);
            }

            Game.OnTick    += Game_OnTick;
            Drawing.OnDraw += Drawing_OnDraw;
        }
Example #19
0
    // Use this for initialization
    void Start()
    {
        arcadeAmbiance = GameObject.Find("ArcadeAmbiance");
        soundManager   = FindObjectOfType <SoundManager>();
        settingsMenu   = GameObject.FindObjectOfType <SettingsMenu>();
        GameObject keybindController = GameObject.FindGameObjectWithTag("KeybindController");

        if (keybindController != null)
        {
            keybindsMenu = keybindController.GetComponent <Keybind>();
        }

        avatars        = GameObject.FindObjectOfType <Avatars>();
        gameController = GameObject.FindObjectOfType <GameController>();

        Time.timeScale = 0;

        mainPanel          = GameObject.Find("MainPanel");
        mainBackground     = GameObject.Find("MainBackground");
        mainText           = GameObject.Find("MainText");
        mainStartButton    = GameObject.Find("MainStartButton");
        mainQuitButton     = GameObject.Find("MainQuitButton");
        mainKeybindButton  = GameObject.Find("MainKeybindButton");
        mainInitialKeyText = GameObject.Find("MainInitialKeyText");
        mainAvatarsButton  = GameObject.Find("MainAvatarsButton");
        sfxSlider          = GameObject.Find("SFXSlider");
        musicSlider        = GameObject.Find("MusicSlider");
        ambiantSlider      = GameObject.Find("AmbiantSlider");
        sfxVolumeText      = GameObject.Find("SFXVolumeText");
        sfxVolumeValue     = GameObject.Find("SFXVolumeValue");
        musicVolumeText    = GameObject.Find("MusicVolumeText");
        musicVolumeValue   = GameObject.Find("MusicVolumeValue");
        ambiantVolumeText  = GameObject.Find("AmbiantVolumeText");
        ambiantVolumeValue = GameObject.Find("AmbiantVolumeValue");
        musicChoiceText    = GameObject.Find("MusicChoiceText");
        musicDropdown      = GameObject.Find("MusicDropdown");
        seedText           = GameObject.Find("SeedText");
        OkSeed             = GameObject.Find("OkSeed");
        InputFieldSeed     = GameObject.Find("InputFieldSeed");
        InputSeedIDText    = GameObject.Find("InputSeedIDText");
        RandomSeed         = GameObject.Find("RandomButton");

        scoreText   = GameObject.Find("ScoreText");
        playerReady = GameObject.Find("PlayerReady");
        gameInfo    = GameObject.Find("GameInfo");

        scoreText.transform.localScale   = new Vector3(0, 0, 0);
        playerReady.transform.localScale = new Vector3(0, 0, 0);
        gameInfo.transform.localScale    = new Vector3(0, 0, 0);

        mainStartButton.GetComponent <Button>().onClick.AddListener(DisplaySettingsMenu);
        mainQuitButton.GetComponent <Button>().onClick.AddListener(Application.Quit);
        mainKeybindButton.GetComponent <Button>().onClick.AddListener(DisplayKeybindMenu);
        mainAvatarsButton.GetComponent <Button>().onClick.AddListener(DisplayAvatarsMenu);

        mainStartButton.transform.localScale    = new Vector3(0, 0, 0);
        mainQuitButton.transform.localScale     = new Vector3(0, 0, 0);
        mainKeybindButton.transform.localScale  = new Vector3(0, 0, 0);
        mainAvatarsButton.transform.localScale  = new Vector3(0, 0, 0);
        sfxSlider.transform.localScale          = new Vector3(0, 0, 0);
        musicSlider.transform.localScale        = new Vector3(0, 0, 0);
        ambiantSlider.transform.localScale      = new Vector3(0, 0, 0);
        sfxVolumeText.transform.localScale      = new Vector3(0, 0, 0);
        sfxVolumeValue.transform.localScale     = new Vector3(0, 0, 0);
        musicVolumeText.transform.localScale    = new Vector3(0, 0, 0);
        musicVolumeValue.transform.localScale   = new Vector3(0, 0, 0);
        ambiantVolumeText.transform.localScale  = new Vector3(0, 0, 0);
        ambiantVolumeValue.transform.localScale = new Vector3(0, 0, 0);
        musicChoiceText.transform.localScale    = new Vector3(0, 0, 0);
        musicDropdown.transform.localScale      = new Vector3(0, 0, 0);
        seedText.transform.localScale           = new Vector3(0, 0, 0);
        OkSeed.transform.localScale             = new Vector3(0, 0, 0);
        InputFieldSeed.transform.localScale     = new Vector3(0, 0, 0);
        InputSeedIDText.transform.localScale    = new Vector3(0, 0, 0);
        RandomSeed.transform.localScale         = new Vector3(0, 0, 0);

        soundManager.playMusic("mainMenu");

        Time.timeScale = 1;
    }
Example #20
0
    void setupSettingsMenu()
    {
        GameObject settingsMenuObject = (GameObject)Instantiate(settingsMenuPrefab);

        settingsMenu = settingsMenuObject.GetComponent <SettingsMenu>();
    }
        private void openSettingsThread()
        {
            Form openSettings = new SettingsMenu();

            openSettings.ShowDialog();
        }
Example #22
0
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            if (Player.Instance.ChampionName != "Ryze")
            {
                return;
            }

            //Hacks.AntiAFK = true;
            Bootstrap.Init(null);

            Q = new Spell.Skillshot(SpellSlot.Q, 1000, SkillShotType.Linear, 250, 1700, 100, DamageType.Magical);
            W = new Spell.Targeted(SpellSlot.W, 615, DamageType.Magical);
            E = new Spell.Targeted(SpellSlot.E, 615, DamageType.Magical);
            R = new Spell.Skillshot(SpellSlot.R, 1750, SkillShotType.Circular);

            menu = MainMenu.AddMenu("Unsigned Ryze", "UnsignedRyze");

            ComboMenu = menu.AddSubMenu("Combo", "combomenu");
            ComboMenu.AddGroupLabel("Combo Settings");
            ComboMenu.Add("QU", new CheckBox("Use Q"));
            ComboMenu.Add("WU", new CheckBox("Use W"));
            ComboMenu.Add("EU", new CheckBox("Use E"));
            //ComboMenu.Add("RU", new CheckBox("Use R"));
            ComboMenu.Add("IU", new CheckBox("Use Items"));
            //ComboMenu.Add("IgU", new CheckBox("Use Ignite"));

            LaneClear = menu.AddSubMenu("Lane Clear", "laneclear");
            LaneClear.AddGroupLabel("Lane Clear Settings");
            LaneClear.Add("LCQ", new CheckBox("Use Q"));
            LaneClear.Add("LCE", new CheckBox("Use E"));

            Harass = menu.AddSubMenu("Harass", "harass");
            Harass.AddGroupLabel("Harass Settings");
            Harass.Add("HQ", new CheckBox("Use Q"));
            Harass.Add("HE", new CheckBox("Use E"));

            LastHit = menu.AddSubMenu("Last Hit", "lasthitmenu");
            LastHit.AddGroupLabel("Last Hit Settings");
            LastHit.Add("LHQ", new CheckBox("Use Q"));
            LastHit.Add("LHE", new CheckBox("Use E"));

            Killsteal = menu.AddSubMenu("Killsteal", "killstealmenu");
            Killsteal.AddGroupLabel("Killsteal Settings");
            Killsteal.Add("KSER", new CheckBox("Activate Killsteal"));
            Killsteal.Add("KSQ", new CheckBox("Use Q"));
            Killsteal.Add("KSW", new CheckBox("Use W"));
            Killsteal.Add("KSE", new CheckBox("Use E"));
            Killsteal.Add("KSI", new CheckBox("Use Ignite"));

            DrawingsMenu = menu.AddSubMenu("Drawings", "drawingsmenu");
            DrawingsMenu.AddGroupLabel("Drawings Settings");
            DrawingsMenu.Add("DQ", new CheckBox("Draw Q"));
            DrawingsMenu.Add("DWE", new CheckBox("Draw W/E"));
            DrawingsMenu.Add("DR", new CheckBox("Draw R"));

            SettingsMenu = menu.AddSubMenu("Settings", "settingsmenu");
            SettingsMenu.AddGroupLabel("Settings");
            SettingsMenu.Add("SHM", new CheckBox("Auto-Use Mana and Health Potions"));
            SettingsMenu.Add("ST", new CheckBox("Stack Tear in Base"));

            SpellDataInst Sum1 = _Player.Spellbook.GetSpell(SpellSlot.Summoner1);
            SpellDataInst Sum2 = _Player.Spellbook.GetSpell(SpellSlot.Summoner2);

            if (Sum1.Name == "SummonerDot")
            {
                Ignite = new Spell.Targeted(SpellSlot.Summoner1, 600);
            }
            else if (Sum2.Name == "SummonerDot")
            {
                Ignite = new Spell.Targeted(SpellSlot.Summoner2, 600);
            }

            Game.OnTick    += Game_OnTick;
            Drawing.OnDraw += Drawing_OnDraw;
            Chat.Print(Sum1.Name);
            Chat.Print(Sum2.Name);
        }
Example #23
0
    //void Awake () {
    //	//Application.targetFrameRate = 30;

    //}

    void Start()
    {
        if (carCamerasController == null)
        {
            carCamerasController = Camera.main.GetComponent <CarCamerasController_legacy>();
        }
        settingsMenu = GetComponent <SettingsMenu>();
        carCameras   = Camera.main.GetComponent <CustomCamera>();
        if (mapCameraController == null)
        {
            if (GameObject.FindWithTag("MapCamera"))
            {
                mapCameraController = GameObject.FindWithTag("MapCamera").GetComponent <CarCamerasController_legacy>();
            }
            else if (GameObject.Find("MapCamera"))
            {
                mapCameraController = GameObject.Find("MapCamera").GetComponent <CarCamerasController_legacy>();
            }
        }

        object[] obj = GameObject.FindObjectsOfType(typeof(GameObject));
        foreach (object o in obj)
        {
            GameObject g = (GameObject)o;
            if (g.GetComponent <Light>() != null)
            {
                mlight = g.GetComponent <Light>();
            }
        }

        Time.fixedDeltaTime = fixedTimeStep;

        if (cars.Count == 0)
        {
            cars = GameObject.FindGameObjectsWithTag("Car").ToList();
        }

        foreach (GameObject car in cars)
        {
            if (car != null)
            {
                car.SetActiveRecursively(true);
                if (car.transform.GetComponent <CarDebug>() != null)
                {
                    car.transform.GetComponent <CarDebug>().enabled = false;
                }
                if (car.transform.GetComponent <Setup>() != null)
                {
                    car.transform.GetComponent <Setup>().enabled = false;
                }
                if (car.transform.GetComponent <CarDynamics>().skidmarks == null)
                {
                    Skidmarks skidclone;
                    if (skidmarks)
                    {
                        skidclone = Instantiate(skidmarks, Vector3.zero, Quaternion.identity) as Skidmarks;
                        car.transform.GetComponent <CarDynamics>().skidmarks = skidclone;
                    }
                }
            }
        }

        foreach (GameObject car in cars)
        {
            if (car != null)
            {
                DisableObject(car);
            }
        }

        if (cars.Count != 0 && cars[0] != null)
        {
            lastIndex   = -1;
            selectedCar = ChangeCar(0, lastIndex);
        }
    }
Example #24
0
    void OnGUI()
    {
        GUI.depth = 10;
        GUI.skin  = MainMenuSkin;
        GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height));
        GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background);

        if (Application.platform != RuntimePlatform.IPhonePlayer && GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton))
        {
            DialogBox.DialogBoxButtons = DialogBoxButtons.YES_NO;
            DialogBox.DialogText       = LanguageManager.getString("PROMPT_EXIT");
            DialogBox.CallbackObject   = gameObject;
            DialogBox.Show();
        }

        float offset = Screen.height / 20;

        GUI.DrawTexture(new Rect(Screen.width / 2 - LOGO_SIZE, offset, LOGO_SIZE * 2, LOGO_SIZE), Logo);

        offset += LOGO_SIZE + offset;

        float button_size = Screen.width / 3 * 2;

        if (UserInteraction.InGame)
        {
            if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("CNTNE")))
            {
                PlayerStats.Show();
                Hide();
            }
            offset += Properties.TEXT_HEIGHT * 3;
        }

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("SNGPLYR")))
        {
            Hide();
            SinglePlayerCreationMenu.Show();
        }

        offset += Properties.TEXT_HEIGHT * 3;

        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("MLTPLYR")))
        {
            TrumpSelection.Hide();
            ScoreBoard.Hide();
            Properties.ActiveGameType = GameType.MultiPlayer;
            MultiplayerObjects.gameObject.SetActive(true);
            LoginScreen.Show();
            UserInteraction.InGame = false;
            Hide();
        }

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("CRDTSBTN")))
        {
            Hide();
            CreditsMenu.Show();
        }

        offset += Properties.TEXT_HEIGHT * 3;
        if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("STNGS")))
        {
            Hide();
            SettingsMenu.BackMenu = this.GetType();
            SettingsMenu.Show();
        }

        GUI.EndGroup();
    }
Example #25
0
    public static Node MenuFactory(Menus menu)
    {
        Node ret = null;

        switch (menu)
        {
        case Menus.None:
            Sound.PauseSong();
            return(null);

            break;

        case Menus.HUD:
            ret      = new HUDMenu();
            ret.Name = "HUD";
            break;

        case Menus.Pause:
            ret      = new PauseMenu();
            ret.Name = "Pause";
            break;

        case Menus.Main:
            ret      = new MainMenu();
            ret.Name = "Main";
            break;

        case Menus.Inventory:
            ret      = new InventoryMenu();
            ret.Name = "Inventory";
            break;

        case Menus.Settings:
            ret      = new SettingsMenu();
            ret.Name = "Settings";
            break;

        case Menus.Career:
            ret      = new CareerMenu();
            ret.Name = "Career";
            break;

        case Menus.NewGame:
            ret      = new NewGameMenu();
            ret.Name = "NewGame";
            break;

        case Menus.PressEvent:
            ret      = new PressEventMenu();
            ret.Name = "PressEvent";
            break;

        case Menus.EndGame:
            ret      = new EndGameMenu();
            ret.Name = "EndGame";
            break;

        case Menus.Shop:
            ret      = new ShopMenu();
            ret.Name = "Shop";
            break;

        case Menus.RestSite:
            ret      = new RestSiteMenu();
            ret.Name = "Rest Site";
            break;
        }

        Session.session.AddChild(ret);
        IMenu menuInstance = ret as IMenu;

        if (menuInstance != null)
        {
            menuInstance.Init(0, 0, 0, 0); // Assuiming these are not subMenus
        }
        if (ret == null)
        {
            GD.Print("Menu.MenuFactory returning null for " + menu);
        }
        return(ret);
    }
Example #26
0
        public override void Load()
        {
            base.Load();

            refreshAudio();

            WidgetManager.Root.Add(mainStoryboardContainer = new DrawableContainer(WidgetManager)
            {
                Drawable = mainStoryboardDrawable = new StoryboardDrawable(project)
                {
                    UpdateFrameStats = true,
                },
                AnchorTarget = WidgetManager.Root,
                AnchorFrom   = BoxAlignment.Centre,
                AnchorTo     = BoxAlignment.Centre,
            });

            WidgetManager.Root.Add(bottomLeftLayout = new LinearLayout(WidgetManager)
            {
                AnchorTarget = WidgetManager.Root,
                AnchorFrom   = BoxAlignment.BottomLeft,
                AnchorTo     = BoxAlignment.BottomLeft,
                Padding      = new FourSide(16, 8, 16, 16),
                Horizontal   = true,
                Fill         = true,
                Children     = new Widget[]
                {
                    timeButton = new Button(WidgetManager)
                    {
                        StyleName  = "small",
                        AnchorFrom = BoxAlignment.Centre,
                        Text       = "--:--:---",
                        Tooltip    = "Current time\nCtrl-C to copy",
                        CanGrow    = false,
                    },
                    divisorButton = new Button(WidgetManager)
                    {
                        StyleName  = "small",
                        Text       = $"1/{snapDivisor}",
                        Tooltip    = "Snap divisor",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                    audioTimeFactorButton = new Button(WidgetManager)
                    {
                        StyleName  = "small",
                        Text       = $"{timeSource.TimeFactor:P0}",
                        Tooltip    = "Audio speed",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                    timeline = new TimelineSlider(WidgetManager, project)
                    {
                        AnchorFrom  = BoxAlignment.Centre,
                        SnapDivisor = snapDivisor,
                    },
                    changeMapButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.FilesO,
                        Tooltip    = "Change beatmap",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                    fitButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.Desktop,
                        Tooltip    = "Fit/Fill",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                        Checkable  = true,
                    },
                    playPauseButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.Play,
                        Tooltip    = "Play/Pause\nShortcut: Space",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                },
            });

            WidgetManager.Root.Add(bottomRightLayout = new LinearLayout(WidgetManager)
            {
                AnchorTarget = WidgetManager.Root,
                AnchorFrom   = BoxAlignment.BottomRight,
                AnchorTo     = BoxAlignment.BottomRight,
                Padding      = new FourSide(16, 16, 16, 8),
                Horizontal   = true,
                Fill         = true,
                Children     = new Widget[]
                {
                    effectsButton = new Button(WidgetManager)
                    {
                        StyleName = "small",
                        Text      = "Effects",
                    },
                    layersButton = new Button(WidgetManager)
                    {
                        StyleName = "small",
                        Text      = "Layers",
                    },
                    settingsButton = new Button(WidgetManager)
                    {
                        StyleName = "small",
                        Text      = "Settings",
                    },
                    projectFolderButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.FolderOpen,
                        Tooltip    = "Open project folder",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                    mapsetFolderButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.FolderOpen,
                        Tooltip    = "Open mapset folder\n(Right click to change)",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                    saveButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.Save,
                        Tooltip    = "Save project\nShortcut: Ctrl-S",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                    exportButton = new Button(WidgetManager)
                    {
                        StyleName  = "icon",
                        Icon       = IconFont.PuzzlePiece,
                        Tooltip    = "Export to .osb\n(Right click to export once for each diff)",
                        AnchorFrom = BoxAlignment.Centre,
                        CanGrow    = false,
                    },
                },
            });

            WidgetManager.Root.Add(effectConfigUi = new EffectConfigUi(WidgetManager)
            {
                AnchorTarget = WidgetManager.Root,
                AnchorFrom   = BoxAlignment.TopLeft,
                AnchorTo     = BoxAlignment.TopLeft,
                Offset       = new Vector2(16, 16),
                Displayed    = false,
            });
            effectConfigUi.OnDisplayedChanged += (sender, e) => resizeStoryboard();

            WidgetManager.Root.Add(effectsList = new EffectList(WidgetManager, project, effectConfigUi)
            {
                AnchorTarget = bottomRightLayout,
                AnchorFrom   = BoxAlignment.BottomRight,
                AnchorTo     = BoxAlignment.TopRight,
                Offset       = new Vector2(-16, 0),
            });
            effectsList.OnEffectPreselect += effect =>
            {
                if (effect != null)
                {
                    timeline.Highlight(effect.StartTime, effect.EndTime);
                }
                else
                {
                    timeline.ClearHighlight();
                }
            };
            effectsList.OnEffectSelected += effect => timeline.Value = (float)effect.StartTime / 1000;

            WidgetManager.Root.Add(layersList = new LayerList(WidgetManager, project.LayerManager)
            {
                AnchorTarget = bottomRightLayout,
                AnchorFrom   = BoxAlignment.BottomRight,
                AnchorTo     = BoxAlignment.TopRight,
                Offset       = new Vector2(-16, 0),
            });
            layersList.OnLayerPreselect += layer =>
            {
                if (layer != null)
                {
                    timeline.Highlight(layer.StartTime, layer.EndTime);
                }
                else
                {
                    timeline.ClearHighlight();
                }
            };
            layersList.OnLayerSelected += layer => timeline.Value = (float)layer.StartTime / 1000;

            WidgetManager.Root.Add(settingsMenu = new SettingsMenu(WidgetManager, project)
            {
                AnchorTarget = bottomRightLayout,
                AnchorFrom   = BoxAlignment.BottomRight,
                AnchorTo     = BoxAlignment.TopRight,
                Offset       = new Vector2(-16, 0),
            });

            WidgetManager.Root.Add(statusLayout = new LinearLayout(WidgetManager)
            {
                StyleName    = "tooltip",
                AnchorTarget = bottomLeftLayout,
                AnchorFrom   = BoxAlignment.BottomLeft,
                AnchorTo     = BoxAlignment.TopLeft,
                Offset       = new Vector2(16, 0),
                Horizontal   = true,
                Hoverable    = false,
                Displayed    = false,
                Children     = new Widget[]
                {
                    statusIcon = new Label(WidgetManager)
                    {
                        StyleName  = "icon",
                        AnchorFrom = BoxAlignment.Left,
                        CanGrow    = false,
                    },
                    statusMessage = new Label(WidgetManager)
                    {
                        AnchorFrom = BoxAlignment.Left,
                    },
                },
            });

            WidgetManager.Root.Add(warningsLabel = new Label(WidgetManager)
            {
                StyleName    = "tooltip",
                AnchorTarget = timeline,
                AnchorFrom   = BoxAlignment.BottomLeft,
                AnchorTo     = BoxAlignment.TopLeft,
                Offset       = new Vector2(0, -8),
            });

            WidgetManager.Root.Add(previewContainer = new DrawableContainer(WidgetManager)
            {
                StyleName    = "storyboardPreview",
                Drawable     = previewDrawable = new StoryboardDrawable(project),
                AnchorTarget = timeline,
                AnchorFrom   = BoxAlignment.Bottom,
                AnchorTo     = BoxAlignment.Top,
                Hoverable    = false,
                Displayed    = false,
                Size         = new Vector2(16, 9) * 16,
            });

            timeButton.OnClick += (sender, e) => Manager.ShowPrompt("Skip to...", value =>
            {
                if (float.TryParse(value, out float time))
                {
                    timeline.Value = time / 1000;
                }
            });

            resizeTimeline();
            timeline.OnValueChanged  += (sender, e) => pendingSeek = timeline.Value;
            timeline.OnValueCommited += (sender, e) => timeline.Snap();
            timeline.OnHovered       += (sender, e) => previewContainer.Displayed = e.Hovered;
            changeMapButton.OnClick  += (sender, e) =>
            {
                if (project.MapsetManager.BeatmapCount > 2)
                {
                    Manager.ShowContextMenu("Select a beatmap", beatmap => project.SelectBeatmap(beatmap.Id, beatmap.Name), project.MapsetManager.Beatmaps);
                }
                else
                {
                    project.SwitchMainBeatmap();
                }
            };
            Program.Settings.FitStoryboard.Bind(fitButton, () => resizeStoryboard());
            playPauseButton.OnClick += (sender, e) => timeSource.Playing = !timeSource.Playing;

            divisorButton.OnClick += (sender, e) =>
            {
                snapDivisor++;
                if (snapDivisor == 5 || snapDivisor == 7)
                {
                    snapDivisor++;
                }
                if (snapDivisor == 9)
                {
                    snapDivisor = 12;
                }
                if (snapDivisor == 13)
                {
                    snapDivisor = 16;
                }
                if (snapDivisor > 16)
                {
                    snapDivisor = 1;
                }
                timeline.SnapDivisor = snapDivisor;
                divisorButton.Text   = $"1/{snapDivisor}";
            };
            audioTimeFactorButton.OnClick += (sender, e) =>
            {
                if (e == MouseButton.Left)
                {
                    var speed = timeSource.TimeFactor;
                    if (speed > 1)
                    {
                        speed = 2;
                    }
                    speed *= 0.5;
                    if (speed < 0.2)
                    {
                        speed = 1;
                    }
                    timeSource.TimeFactor = speed;
                }
                else if (e == MouseButton.Right)
                {
                    var speed = timeSource.TimeFactor;
                    if (speed < 1)
                    {
                        speed = 1;
                    }
                    speed += speed >= 2 ? 1 : 0.5;
                    if (speed > 8)
                    {
                        speed = 1;
                    }
                    timeSource.TimeFactor = speed;
                }
                else if (e == MouseButton.Middle)
                {
                    timeSource.TimeFactor = timeSource.TimeFactor == 8 ? 1 : 8;
                }

                audioTimeFactorButton.Text = $"{timeSource.TimeFactor:P0}";
            };

            MakeTabs(
                new Button[] { settingsButton, effectsButton, layersButton },
                new Widget[] { settingsMenu, effectsList, layersList });
            projectFolderButton.OnClick += (sender, e) =>
            {
                var path = Path.GetFullPath(project.ProjectFolderPath);
                if (Directory.Exists(path))
                {
                    Process.Start(path);
                }
            };
            mapsetFolderButton.OnClick += (sender, e) =>
            {
                var path = Path.GetFullPath(project.MapsetPath);
                if (e == MouseButton.Right || !Directory.Exists(path))
                {
                    changeMapsetFolder();
                }
                else
                {
                    Process.Start(path);
                }
            };
            saveButton.OnClick   += (sender, e) => saveProject();
            exportButton.OnClick += (sender, e) =>
            {
                if (e == MouseButton.Right)
                {
                    exportProjectAll();
                }
                else
                {
                    exportProject();
                }
            };

            project.OnMapsetPathChanged     += project_OnMapsetPathChanged;
            project.OnEffectsContentChanged += project_OnEffectsContentChanged;
            project.OnEffectsStatusChanged  += project_OnEffectsStatusChanged;

            if (!project.MapsetPathIsValid)
            {
                Manager.ShowMessage($"The mapset folder cannot be found.\n{project.MapsetPath}\n\nPlease select a new one.", () => changeMapsetFolder(), true);
            }
        }
Example #27
0
 // Initial State
 private void Awake()
 {
     instance = this;
 }
 public void Start()
 {
     SettingsMenu.RegisterSettingsButton("Button\nMapper", new SettingsToggle(SetGuiVisible), false, 13);
 }
 public void OnButtonOpenSettings()
 {
     this.CloseDialog();
     SettingsMenu.Open();
 }
Example #30
0
    public void tick(KDTree tree, KDQuery query, int index, List <Particle> particles, Transform cursor, SettingsMenu settings, ParticleController.State state)
    {
        switch (state)
        {
        case ParticleController.State.Boid:
            tree.Points[index] = position;
            List <int> neighbors = new List <int>();
            query.Radius(tree, position, 1f, neighbors);
            if (neighbors.Count() == 0)
            {
                break;
            }

            Vector3 avgPosition = Vector3.zero, avgHeading = Vector3.zero, awayHeading = Vector3.zero;
            foreach (int idx in neighbors)
            {
                if (idx == index)
                {
                    continue;
                }
                Particle neighbor = particles[idx];
                avgPosition += neighbor.position;
                avgHeading  += neighbor.velocity;
                awayHeading += (position - neighbor.position).normalized / ((position - neighbor.position).magnitude + 0.01f);
            }

            Vector3 desiredVelocity = Vector3.zero;

            // separation: steer to avoid crowding local flockmates
            desiredVelocity += awayHeading * settings.separation.value;                                                   //0.01
            // alignment : steer towards the average heading of local flockmates
            desiredVelocity += avgHeading.normalized * settings.alignment.value;                                          //0.05
            // cohesion : steer to move towards the average position(center of mass) of local flockmates
            desiredVelocity += ((avgPosition / (neighbors.Count() - 1)) - position).normalized * settings.cohesion.value; //0.01

            // boundry : steer towards player if outside boundary sphere
            // TODO : make radius a param
            Vector3 boundaryBearing = cursor.position - position;
            int     radius          = 15;
            if (boundaryBearing.magnitude > radius)
            {
                desiredVelocity += boundaryBearing.normalized * 0.1f;
                // position = position.normalized * -radius;
            }

            // acceleration += desiredVelocity - velocity;
            acceleration += desiredVelocity * 0.01f;

            if (acceleration.magnitude > settings.agility.value)
            {
                acceleration = acceleration.normalized * settings.agility.value;
            }

            if (velocity.magnitude > settings.speed.value)
            {
                velocity = velocity.normalized * settings.speed.value;
            }

            break;

        default:
        case ParticleController.State.FreeFly:
            velocity -= 0.005f * velocity;     //todo make this a param
            break;
        }

        velocity    += acceleration;
        position    += velocity;
        acceleration = Vector3.zero;
    }
Example #31
0
 // Use this for initialization
 void Start()
 {
     lobby = GetComponent<GameLobbyScript>();
     settings = GetComponent<SettingsMenu>();
     networkManager = GetComponent<NetworkManagerScript>();
 }
Example #32
0
        public Gta5EyeTracking()
        {
            Debug.Log("Begin Initialize");

            //Disposing
            _shutDownRequestedEvent = new ManualResetEvent(false);

            //Settings
            _settingsStorage = new SettingsStorage();
            _settings = _settingsStorage.LoadSettings();

            //Statistics
            var version = Assembly.GetExecutingAssembly().GetName().Version;
            var versionString = version.Major + "." + version.Minor + "." + version.Build;
            _googleAnalyticsApi = new GoogleAnalyticsApi("UA-68420530-1", _settings.UserGuid, "GTA V Eye Tracking Mod", "gta5eyetracking", versionString);

            //Gaze
            _tobiiTracker = new TobiiInteractionEngineTracker();

            //Menu
            _menuPool = new MenuPool();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);

            _introScreen = new IntroScreen(_menuPool, _settings);

            //Debug
            _debugGazeVisualization = new DefaultCrosshair(Color.FromArgb(220, 255, 0, 0), Color.FromArgb(220, 0, 255, 255));
            _debugOutput = new DebugOutput();

            //Hids
            _mouseEmulation = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();

            //Features
            _gameState = new GameState(_controllerEmulation, _menuPool);
            _animationHelper = new AnimationHelper();
            _aiming = new Aiming(_settings, _animationHelper, _gameState);
            _extendedView = new ExtendedView(_settings, _gameState, _tobiiTracker, _aiming, _debugOutput);
            _radialMenu = new RadialMenu(_controllerEmulation, _tobiiTracker);

            //Window
            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            //General
            _gazeProjector = new GazeProjector(_settings);
            _controlsProcessor = new ControlsProcessor(_settings,_controllerEmulation,_aiming,_extendedView,_radialMenu,_settingsMenu, _gameState, _debugOutput);

            KeyDown += OnKeyDown;
            Tick += OnTick;
            Aborted += OnAborted;
            Debug.Log("End Initialize");
        }
Example #33
0
        public override void Update(GameTime gameTime)
        {
            if (!Active)
            {
                return;
            }

            Input.Update(gameTime);

            if (!SettingsMenu.IsActive)
            {
                if (Input.IsDown(Commands.GameExit))
                {
                    Deactivate();
                }
                if (Input.IsPressed(Commands.ToggleHexCoordinates))
                {
                    Map.ShowCoords = !Map.ShowCoords;
                }
                if (Input.IsPressed(Commands.ToggleHexGrid))
                {
                    Map.ShowGrid = !Map.ShowGrid;
                }
                if (Input.IsPressed(Commands.ToggleWireframe))
                {
                    Map.Wireframe = !Map.Wireframe;
                }
                if (Input.IsPressed(Commands.ToggleHexHeights))
                {
                    Map.ShowHexHeights = !Map.ShowHexHeights;
                }

                if (Input.IsPressed(Commands.OpenMenu))
                {
                    SettingsMenu.Show();
                }

                if (Input.IsPressed(Commands.CmdRaiseTerrain))
                {
                    EditorPanel.ActiveTool = EditorTools.Elevation;
                }
                if (Input.IsPressed(Commands.CmdTrees))
                {
                    EditorPanel.ActiveTool = EditorTools.Trees;
                }

                var mouse    = Mouse.GetState();
                var mouseLoc = mouse.Position.ToVector2();
                var viewPort = GraphicsDevice.Viewport;
                if (viewPort.Bounds.Contains(mouseLoc))
                {
                    var ray = Camera.CalculateRay(mouseLoc, viewPort);
                    if (EditorPanel.ActiveTool == EditorTools.Elevation)
                    {
                        var vertex = Map.PickVertex(ray);
                        if (vertex != null)
                        {
                            var mapDirty = false;
                            if (Input.MouseClicked(true))
                            {
                                Map.RaiseVertex(vertex.Value);
                                mapDirty = true;
                            }
                            else if (Input.MouseDown(true))
                            {
                                Map.RaiseVertex(vertex.Value);
                                mapDirty = true;
                            }
                            else if (Input.MouseClicked(false))
                            {
                                Map.LowerVertex(vertex.Value);
                                mapDirty = true;
                            }
                            else if (Input.MouseDown(false))
                            {
                                Map.LowerVertex(vertex.Value);
                                mapDirty = true;
                            }
                            if (mapDirty)
                            {
                                Map.Rebuild(GraphicsDevice);
                            }
                        }
                    }
                    else if (EditorPanel.ActiveTool == EditorTools.Trees)
                    {
                        var hex = Map.PickHex(ray);
                        if (hex != null)
                        {
                            if (Input.MouseClicked(true))
                            {
                                hex.IsForest = true;
                            }
                            else if (Input.MouseDown(true))
                            {
                                hex.IsForest = true;
                            }
                            else if (Input.MouseClicked(false))
                            {
                                hex.IsForest = false;
                            }
                            else if (Input.MouseDown(false))
                            {
                                hex.IsForest = false;
                            }
                        }
                    }
                }
                Camera.Update(gameTime);
            }
        }
Example #34
0
 public void OnSettingsPressed()
 {
     SettingsMenu.Show();
     //Debug.Log("Settings button was pressed.");
 }
Example #35
0
        private void ShutDown()
        {
            _shutDownRequestFlag = true;
            KeyDown -= OnKeyDown;
            Tick -= OnTick;

            _shutDownRequestedEvent.WaitOne(100);
            Debug.Log("Begin ShutDown");
            _settingsStorage.SaveSettings(_settings);

            //General
            RecordGameSessionEnded();

            if (_controlsProcessor != null)
            {
                _controlsProcessor.Dispose();
                _controlsProcessor = null;
            }

            //Window
            if (_foregroundWindowWatcher != null)
            {
                _foregroundWindowWatcher.Dispose();
                _foregroundWindowWatcher = null;
            }

            //Menu
            if (_settingsMenu != null)
            {
                _settingsMenu = null;
            }

            //Features
            if (_aiming != null)
            {
                _aiming.Dispose();
                _aiming = null;
            }

            if (_extendedView != null)
            {
                _extendedView.Dispose();
                _extendedView = null;
            }

            //Hids
            if (_controllerEmulation != null)
            {
                _controllerEmulation.Enabled = false;
                _controllerEmulation.RemoveHooks();
                _controllerEmulation = null;
            }

            if (_tobiiTracker != null)
            {
                _tobiiTracker.Dispose();
                _tobiiTracker = null;
            }
            Debug.Log("End ShutDown");
        }
Example #36
0
        public MapEditor(GraphicsDevice graphicsDevice, ContentManager content)
        {
            GraphicsDevice = graphicsDevice;
            Content        = content;
            Input          = new Input();
            var bindings = new Dictionary <string, List <Keys> > {
                [Commands.CameraStrafeLeft] = new List <Keys> {
                    Keys.Left
                },
                [Commands.CameraStrafeRight] = new List <Keys> {
                    Keys.Right
                },
                [Commands.CameraForward] = new List <Keys> {
                    Keys.Up
                },
                [Commands.CameraBackward] = new List <Keys> {
                    Keys.Down
                },
                [Commands.CameraZoomIn] = new List <Keys> {
                    Keys.OemPlus, Keys.Add
                },
                [Commands.CameraZoomOut] = new List <Keys> {
                    Keys.OemMinus, Keys.Subtract
                },
                [Commands.CameraOrbitRight] = new List <Keys> {
                    Keys.PageDown
                },
                [Commands.CameraOrbitLeft] = new List <Keys> {
                    Keys.Delete
                },
                [Commands.CameraOrbitDown] = new List <Keys> {
                    Keys.End
                },
                [Commands.CameraOrbitUp] = new List <Keys> {
                    Keys.Home
                },

                [Commands.OpenMenu] = new List <Keys> {
                    Keys.Escape
                },

                [Commands.ToggleHexCoordinates] = new List <Keys> {
                    Keys.C
                },
                [Commands.ToggleHexGrid] = new List <Keys> {
                    Keys.G
                },
                [Commands.ToggleWireframe] = new List <Keys> {
                    Keys.W
                },
                [Commands.ToggleHexHeights] = new List <Keys> {
                    Keys.H
                },
                [Commands.CmdRaiseTerrain] = new List <Keys> {
                    Keys.F1
                },
                [Commands.CmdTrees] = new List <Keys> {
                    Keys.F2
                },


                [Commands.SaveMap] = new List <Keys> {
                    Keys.S
                },
                [Commands.LoadMap] = new List <Keys> {
                    Keys.L
                }
            };

            Input.AddBindings(bindings);

            Camera = new Camera(Input);
            Camera.SetLens(MathHelper.ToRadians(45), graphicsDevice.DisplayMode.AspectRatio, .01f, 1000f);
            Camera.LookAt(new Vector3(0, 10, 1), Vector3.Zero, Vector3.Up);

            SettingsMenu = new SettingsMenu(Exit, SaveMap, LoadMap);

            EditorPanel = new MapEditorTools(content);
            Interface.AddEntity(EditorPanel);



            SpriteBatch = new SpriteBatch(GraphicsDevice);
            _font       = Content.Load <SpriteFont>("default");

            var texture = Content.Load <Texture2D>("Dry Grass 2");

            Map = new HexMap(GraphicsDevice, 100, 100, texture, _font);
            MapResources.LoadContent(Content);
        }
Example #37
0
 public void BackButtonPressed()
 {
     MainMenu.SetActive(true);
     SettingsMenu.SetActive(false);
 }
Example #38
0
    void Awake()
    {
        //Application.targetFrameRate = 30;
        if (carCamerasController == null)
        {
            carCamerasController = Camera.main.GetComponent <CarCamerasController>();
        }
        settingsMenu = GetComponent <SettingsMenu>();
        carCameras   = Camera.main.GetComponent <CarCameras>();
        if (mapCameraController == null)
        {
            if (GameObject.FindWithTag("MapCamera"))
            {
                mapCameraController = GameObject.FindWithTag("MapCamera").GetComponent <CarCamerasController>();
            }
            else if (GameObject.Find("MapCamera"))
            {
                mapCameraController = GameObject.Find("MapCamera").GetComponent <CarCamerasController>();
            }
        }

        object[] obj = GameObject.FindObjectsOfType(typeof(GameObject));
        foreach (object o in obj)
        {
            GameObject g = (GameObject)o;
            if (g.GetComponent <Light>() != null)
            {
                mlight = g.GetComponent <Light>();
            }
        }

        Time.fixedDeltaTime = fixedTimeStep;

        if (cars.Length == 0)
        {
            cars = GameObject.FindGameObjectsWithTag("Car");
        }

        foreach (GameObject car in cars)
        {
            if (car != null)
            {
                car.SetActiveRecursively(true);
                if (car.transform.GetComponent <CarDebug>() != null)
                {
                    car.transform.GetComponent <CarDebug>().enabled = false;
                }
                if (car.transform.GetComponent <Setup>() != null)
                {
                    car.transform.GetComponent <Setup>().enabled = false;
                }
                if (car.transform.GetComponent <CarDynamics>().skidmarks == null)
                {
                    Skidmarks skidclone;
                    if (skidmarks)
                    {
                        skidclone = Instantiate(skidmarks, Vector3.zero, Quaternion.identity) as Skidmarks;
                        car.transform.GetComponent <CarDynamics>().skidmarks = skidclone;
                    }
                }
            }
        }
    }