You can now save presets to JSON and load them
This commit is contained in:
@@ -47,6 +47,7 @@ namespace Test_Merge
|
||||
}
|
||||
private void RefreshUI()
|
||||
{
|
||||
|
||||
lsbDrivers.DataSource = null;
|
||||
lsbDrivers.DataSource = DriverList;
|
||||
|
||||
@@ -385,5 +386,30 @@ namespace Test_Merge
|
||||
}
|
||||
RefreshUI();
|
||||
}
|
||||
|
||||
private void lsbPresets_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//Nothing
|
||||
}
|
||||
|
||||
private void btnLoadPreset_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (lsbPresets.SelectedIndex >= 0 && pbxMain.Image != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Reader reader = new Reader(lsbPresets.Items[lsbPresets.SelectedIndex].ToString(), (Bitmap)pbxMain.Image,false);
|
||||
//MainZones #0 is the big main zone containing driver zones
|
||||
Config = new ConfigurationTool((Bitmap)pbxMain.Image, reader.MainZones[0].Bounds);
|
||||
Config.MainZone = reader.MainZones[0];
|
||||
DriverList = reader.Drivers;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Could not load the settings error :" + ex);
|
||||
}
|
||||
RefreshUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user