mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Fix ATS directory overwrite
This commit is contained in:
parent
310bd52efc
commit
c119992df7
@ -1,63 +1,63 @@
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Modules.Abstract;
|
using Artemis.Modules.Abstract;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.EurotruckSimulator2
|
namespace Artemis.Modules.Games.EurotruckSimulator2
|
||||||
{
|
{
|
||||||
public sealed class EurotruckSimulator2ViewModel : ModuleViewModel
|
public sealed class EurotruckSimulator2ViewModel : ModuleViewModel
|
||||||
{
|
{
|
||||||
public EurotruckSimulator2ViewModel(MainManager mainManager,
|
public EurotruckSimulator2ViewModel(MainManager mainManager,
|
||||||
[Named(nameof(EurotruckSimulator2Model))] ModuleModel moduleModel,
|
[Named(nameof(EurotruckSimulator2Model))] ModuleModel moduleModel,
|
||||||
IKernel kernel) : base(mainManager, moduleModel, kernel)
|
IKernel kernel) : base(mainManager, moduleModel, kernel)
|
||||||
{
|
{
|
||||||
DisplayName = "Truck Simulator";
|
DisplayName = "Truck Simulator";
|
||||||
}
|
|
||||||
|
|
||||||
public override bool UsesProfileEditor => true;
|
|
||||||
|
|
||||||
public void Ets2BrowseDirectory()
|
|
||||||
{
|
|
||||||
var settings = (EurotruckSimulator2Settings) Settings;
|
|
||||||
var model = (EurotruckSimulator2Model) ModuleModel;
|
|
||||||
|
|
||||||
var dialog = new FolderBrowserDialog {SelectedPath = settings.Ets2GameDirectory};
|
|
||||||
var result = dialog.ShowDialog();
|
|
||||||
if (result != DialogResult.OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
settings.Ets2GameDirectory = dialog.SelectedPath;
|
|
||||||
NotifyOfPropertyChange(() => Settings);
|
|
||||||
Settings.Save();
|
|
||||||
model.PlaceTruckSimulatorPlugin(settings.Ets2GameDirectory, "eurotrucks2.exe");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AtsBrowseDirectory()
|
|
||||||
{
|
|
||||||
var settings = (EurotruckSimulator2Settings) Settings;
|
|
||||||
var model = (EurotruckSimulator2Model)ModuleModel;
|
|
||||||
|
|
||||||
var dialog = new FolderBrowserDialog {SelectedPath = settings.AtsGameDirectory};
|
|
||||||
var result = dialog.ShowDialog();
|
|
||||||
if (result != DialogResult.OK)
|
|
||||||
return;
|
|
||||||
|
|
||||||
settings.AtsGameDirectory = dialog.SelectedPath;
|
|
||||||
NotifyOfPropertyChange(() => Settings);
|
|
||||||
Settings.Save();
|
|
||||||
model.PlaceTruckSimulatorPlugin(settings.Ets2GameDirectory, "amtrucks.exe");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Ets2PlacePlugin()
|
public override bool UsesProfileEditor => true;
|
||||||
{
|
|
||||||
var ets2Path = ((EurotruckSimulator2Settings)Settings).Ets2GameDirectory;
|
public void Ets2BrowseDirectory()
|
||||||
((EurotruckSimulator2Model)ModuleModel).PlaceTruckSimulatorPlugin(ets2Path, "eurotrucks2.exe");
|
{
|
||||||
}
|
var settings = (EurotruckSimulator2Settings) Settings;
|
||||||
|
var model = (EurotruckSimulator2Model) ModuleModel;
|
||||||
public void AtsPlacePlugin()
|
|
||||||
{
|
var dialog = new FolderBrowserDialog {SelectedPath = settings.Ets2GameDirectory};
|
||||||
var atsPath = ((EurotruckSimulator2Settings)Settings).AtsGameDirectory;
|
var result = dialog.ShowDialog();
|
||||||
((EurotruckSimulator2Model)ModuleModel).PlaceTruckSimulatorPlugin(atsPath, "amtrucks.exe");
|
if (result != DialogResult.OK)
|
||||||
}
|
return;
|
||||||
}
|
|
||||||
|
settings.Ets2GameDirectory = dialog.SelectedPath;
|
||||||
|
NotifyOfPropertyChange(() => Settings);
|
||||||
|
Settings.Save();
|
||||||
|
model.PlaceTruckSimulatorPlugin(settings.Ets2GameDirectory, "eurotrucks2.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AtsBrowseDirectory()
|
||||||
|
{
|
||||||
|
var settings = (EurotruckSimulator2Settings) Settings;
|
||||||
|
var model = (EurotruckSimulator2Model)ModuleModel;
|
||||||
|
|
||||||
|
var dialog = new FolderBrowserDialog {SelectedPath = settings.AtsGameDirectory};
|
||||||
|
var result = dialog.ShowDialog();
|
||||||
|
if (result != DialogResult.OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
settings.AtsGameDirectory = dialog.SelectedPath;
|
||||||
|
NotifyOfPropertyChange(() => Settings);
|
||||||
|
Settings.Save();
|
||||||
|
model.PlaceTruckSimulatorPlugin(settings.AtsGameDirectory, "amtrucks.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Ets2PlacePlugin()
|
||||||
|
{
|
||||||
|
var ets2Path = ((EurotruckSimulator2Settings)Settings).Ets2GameDirectory;
|
||||||
|
((EurotruckSimulator2Model)ModuleModel).PlaceTruckSimulatorPlugin(ets2Path, "eurotrucks2.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AtsPlacePlugin()
|
||||||
|
{
|
||||||
|
var atsPath = ((EurotruckSimulator2Settings)Settings).AtsGameDirectory;
|
||||||
|
((EurotruckSimulator2Model)ModuleModel).PlaceTruckSimulatorPlugin(atsPath, "amtrucks.exe");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -36,9 +36,8 @@ namespace Artemis.Profiles.Layers.Types.Audio.AudioCapturing
|
|||||||
if (!SpectrumProvider.GetFftData(fftBuffer, this))
|
if (!SpectrumProvider.GetFftData(fftBuffer, this))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var spectrumPoints = CalculateSpectrumPoints(height, fftBuffer);
|
var spectrumPoints = CalculateSpectrumPoints(height, fftBuffer);
|
||||||
return spectrumPoints?.Select(s => s.Value).ToList();
|
return spectrumPoints?.Select(s => s.Value).ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user