private void ScoreChanged(ModernWpf.Controls.NumberBox sender, ModernWpf.Controls.NumberBoxValueChangedEventArgs args)
        {
            TeamConfig config = (string)sender.Tag == "Blue" ? BroadcastHubController.ClientConfig.frontend.blueTeam : BroadcastHubController.ClientConfig.frontend.redTeam;

            if (args.NewValue != config.score)
            {
                config.score = (int)args.NewValue;
                BroadcastHubController.UpdateConfig();
            }
        }
        private void PatchChanged(object sender, TextChangedEventArgs e)
        {
            TextBox        textBox = sender as TextBox;
            FrontendConfig config  = BroadcastHubController.ClientConfig.frontend;

            if (textBox.Text != config.patch)
            {
                config.patch = textBox.Text;
                BroadcastHubController.UpdateConfig();
            }
        }
        private void ColorChanged(object sender, TextChangedEventArgs e)
        {
            TextBox    textBox = sender as TextBox;
            TeamConfig config  = (string)textBox.Tag == "Blue" ? BroadcastHubController.ClientConfig.frontend.blueTeam : BroadcastHubController.ClientConfig.frontend.redTeam;

            if (textBox.Text != config.color)
            {
                config.color = textBox.Text;
                BroadcastHubController.UpdateConfig();
            }
        }
Beispiel #4
0
        public StateController(BroadcastHubController main)
        {
            InitConnection();
            BroadcastHub = main;
            if (ActiveSettings.current.UseIngame)
            {
                EnableIngame();
                CurrentSettings.Ingame = true;
            }


            if (ActiveSettings.current.UsePickBan)
            {
                EnableChampSelect();
                CurrentSettings.PickBan = true;
            }
        }
Beispiel #5
0
        private async void InitLatest()
        {
            dynamic riotVersion = JsonConvert.DeserializeObject <dynamic>(await DataDragonUtils.GetAsync($"https://ddragon.leagueoflegends.com/realms/{Realm}.json"));

            version.CDN      = riotVersion.cdn;
            version.Champion = riotVersion.n.champion;
            version.Item     = riotVersion.n.item;
            version.Summoner = riotVersion.n.summoner;

            var oldPatch = BroadcastHubController.ClientConfig.frontend.patch;

            BroadcastHubController.ClientConfig.frontend.patch = version.Champion;
            if (oldPatch != BroadcastHubController.ClientConfig.frontend.patch)
            {
                BroadcastHubController.WriteConfig("config.json", BroadcastHubController.ClientConfig);
            }

            Init();
        }
Beispiel #6
0
        public MainWindow()
        {
            new Logging((Logging.LogLevel)Enum.Parse(typeof(Logging.LogLevel), Properties.Settings.Default.LogLevel));

            InitializeComponent();

            Logging.Info("Starting League Broadcast Hub");

            this.DataContext = this;

            LoadSettings();

            NavView.SelectedItem = NavView.MenuItems.OfType <NavigationViewItem>().First();
            Navigate(NavView.SelectedItem);
            ingameController = new BroadcastHubController();
            ingameController.Start();

            Loaded += delegate
            {
                UpdateAppTitle();
            };
        }