mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Fixed bots slider not updating correctly
This commit is contained in:
@@ -34,8 +34,11 @@ namespace OpenBullet
|
||||
if (configsListView.SelectedItems.Count == 0) return;
|
||||
if(Caller.GetType() == typeof(Runner))
|
||||
{
|
||||
if (OB.OBSettings.General.LiveConfigUpdates) ((Runner)Caller).SetConfig(((ConfigViewModel)configsListView.SelectedItem).Config);
|
||||
else ((Runner)Caller).SetConfig(IOManager.CloneConfig(((ConfigViewModel)configsListView.SelectedItem).Config));
|
||||
var config = ((ConfigViewModel)configsListView.SelectedItem).Config;
|
||||
var runner = Caller as Runner;
|
||||
|
||||
if (OB.OBSettings.General.LiveConfigUpdates) runner.SetConfig(config);
|
||||
else runner.SetConfig(IOManager.CloneConfig(config));
|
||||
}
|
||||
((MainDialog)Parent).Close();
|
||||
}
|
||||
|
||||
@@ -240,6 +240,7 @@ namespace OpenBullet.Views.Main.Runner
|
||||
public void SetConfig(Config config)
|
||||
{
|
||||
vm.SetConfig(config, OB.OBSettings.General.RecommendedBots);
|
||||
if (OB.OBSettings.General.RecommendedBots) UpdateBotsSlider(config.Settings.SuggestedBots);
|
||||
RetrieveRecord();
|
||||
}
|
||||
|
||||
@@ -248,6 +249,13 @@ namespace OpenBullet.Views.Main.Runner
|
||||
vm.SetWordlist(wordlist);
|
||||
RetrieveRecord();
|
||||
}
|
||||
|
||||
private void UpdateBotsSlider(int amount)
|
||||
{
|
||||
if (amount < botsSlider.Minimum) botsSlider.Value = botsSlider.Minimum;
|
||||
else if (amount > botsSlider.Maximum) botsSlider.Value = botsSlider.Maximum;
|
||||
else botsSlider.Value = amount;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region UI Elements
|
||||
|
||||
Reference in New Issue
Block a user