Update from .net Framework to .NET 8.0

This commit is contained in:
Niek Schoemaker 2024-08-12 19:31:37 +02:00
parent 30873a287d
commit 7c9200207f
No known key found for this signature in database
GPG Key ID: BDF9404CFECB0006
11 changed files with 54 additions and 97 deletions

View File

@ -1,20 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="SharpDX" Version="4.2.0" /> <PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" /> <PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Properties\" /> <Folder Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\magic.dat" /> <Resource Include="Resources\magic.dat" />
</ItemGroup> </ItemGroup>
</Project>
</Project>

View File

@ -11,6 +11,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using SharpDX; using SharpDX;
using Color = SharpDX.Color; using Color = SharpDX.Color;
using Half = SharpDX.Half;
namespace CodeWalker namespace CodeWalker
{ {

View File

@ -1,11 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>CW.ico</ApplicationIcon> <ApplicationIcon>CW.ico</ApplicationIcon>
<AssemblyName>CodeWalker Error Report Tool</AssemblyName> <AssemblyName>CodeWalker Error Report Tool</AssemblyName>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>CWPeds.ico</ApplicationIcon> <ApplicationIcon>CWPeds.ico</ApplicationIcon>
<Copyright>dexyfex</Copyright> <Copyright>dexyfex</Copyright>
@ -10,13 +9,10 @@
<Authors>dexyfex</Authors> <Authors>dexyfex</Authors>
<AssemblyName>CodeWalker Ped Viewer</AssemblyName> <AssemblyName>CodeWalker Ped Viewer</AssemblyName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CodeWalker\CodeWalker.csproj" /> <ProjectReference Include="..\CodeWalker\CodeWalker.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<ApplicationIcon>CWRPFExplorer.ico</ApplicationIcon> <ApplicationIcon>CWRPFExplorer.ico</ApplicationIcon>
@ -11,13 +10,10 @@
<Authors>dexyfex</Authors> <Authors>dexyfex</Authors>
<AssemblyName>CodeWalker RPF Explorer</AssemblyName> <AssemblyName>CodeWalker RPF Explorer</AssemblyName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CodeWalker\CodeWalker.csproj" /> <ProjectReference Include="..\CodeWalker\CodeWalker.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>CWVehicles.ico</ApplicationIcon> <ApplicationIcon>CWVehicles.ico</ApplicationIcon>
<Copyright>dexyfex</Copyright> <Copyright>dexyfex</Copyright>
@ -10,13 +9,10 @@
<Authors>dexyfex</Authors> <Authors>dexyfex</Authors>
<AssemblyName>CodeWalker Vehicle Viewer</AssemblyName> <AssemblyName>CodeWalker Vehicle Viewer</AssemblyName>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CodeWalker\CodeWalker.csproj" /> <ProjectReference Include="..\CodeWalker\CodeWalker.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,15 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<TargetFramework>net48</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DockPanelSuite.ThemeVS2015" Version="3.0.6" /> <PackageReference Include="DockPanelSuite.ThemeVS2015" Version="3.1.1" />
<PackageReference Include="SharpDX" Version="4.2.0" /> <PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.Mathematics" Version="4.2.0" /> <PackageReference Include="SharpDX.Mathematics" Version="4.2.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -5,6 +5,9 @@ using System.Drawing;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows.Forms; using System.Windows.Forms;
using Microsoft.Win32;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
using Point = System.Drawing.Point; using Point = System.Drawing.Point;
@ -240,34 +243,18 @@ namespace CodeWalker
{ {
if (Environment.OSVersion.Version.Major >= 6) if (Environment.OSVersion.Version.Major >= 6)
{ {
var ofd = new OpenFileDialog(); var ofd = new OpenFolderDialog();
ofd.Filter = "Folders|\n";
ofd.AddExtension = false;
ofd.CheckFileExists = false;
ofd.DereferenceLinks = true; ofd.DereferenceLinks = true;
ofd.Multiselect = false; ofd.Multiselect = false;
ofd.InitialDirectory = fbd.SelectedPath; ofd.InitialDirectory = fbd.SelectedPath;
int result = 0; ofd.ValidateNames = true;
var ns = "System.Windows.Forms";
var asmb = Assembly.GetAssembly(typeof(OpenFileDialog));
var dialogint = GetType(asmb, ns, "FileDialogNative.IFileDialog");
var dialog = Call(typeof(OpenFileDialog), ofd, "CreateVistaDialog");
Call(typeof(OpenFileDialog), ofd, "OnBeforeVistaDialog", dialog);
var options = Convert.ToUInt32(Call(typeof(FileDialog), ofd, "GetOptions"));
options |= Convert.ToUInt32(GetEnumValue(asmb, ns, "FileDialogNative.FOS", "FOS_PICKFOLDERS"));
Call(dialogint, dialog, "SetOptions", options);
var pfde = New(asmb, ns, "FileDialog.VistaDialogEvents", ofd);
var parameters = new object[] { pfde, (uint)0 };
Call(dialogint, dialog, "Advise", parameters);
var adviseres = Convert.ToUInt32(parameters[1]);
try { result = Convert.ToInt32(Call(dialogint, dialog, "Show", hWndOwner)); }
finally { Call(dialogint, dialog, "Unadvise", adviseres); }
GC.KeepAlive(pfde);
fbd.SelectedPath = ofd.FileName; var result = ofd.ShowDialog() ?? false;
return (result == 0) ? DialogResult.OK : DialogResult.Cancel; fbd.SelectedPath = ofd.FolderName;
return result ? DialogResult.OK : DialogResult.Cancel;
} }
else else
{ {

View File

@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net48</TargetFramework> <TargetFramework>net8.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<ApplicationIcon>CW.ico</ApplicationIcon> <ApplicationIcon>CW.ico</ApplicationIcon>
@ -10,14 +9,13 @@
<Company>dexyfex software</Company> <Company>dexyfex software</Company>
<Authors>dexyfex</Authors> <Authors>dexyfex</Authors>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DockPanelSuite.ThemeVS2015" Version="3.0.6" /> <PackageReference Include="DockPanelSuite.ThemeVS2015" Version="3.1.1" />
<PackageReference Include="FCTB" Version="2.16.24" /> <PackageReference Include="FCTB" Version="2.16.24" />
<PackageReference Include="OxyPlot.WindowsForms" Version="2.1.2" />
<PackageReference Include="SharpDX" Version="4.2.0" /> <PackageReference Include="SharpDX" Version="4.2.0" />
<PackageReference Include="SharpDX.D3DCompiler" Version="4.2.0" /> <PackageReference Include="SharpDX.D3DCompiler" Version="4.2.0" />
<PackageReference Include="SharpDX.Direct2D1" Version="4.2.0" /> <PackageReference Include="SharpDX.Direct2D1" Version="4.2.0" />
@ -26,16 +24,10 @@
<PackageReference Include="SharpDX.XAudio2" Version="4.2.0" /> <PackageReference Include="SharpDX.XAudio2" Version="4.2.0" />
<PackageReference Include="SharpDX.XInput" Version="4.2.0" /> <PackageReference Include="SharpDX.XInput" Version="4.2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CodeWalker.Core\CodeWalker.Core.csproj" /> <ProjectReference Include="..\CodeWalker.Core\CodeWalker.Core.csproj" />
<ProjectReference Include="..\CodeWalker.WinForms\CodeWalker.WinForms.csproj" /> <ProjectReference Include="..\CodeWalker.WinForms\CodeWalker.WinForms.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="System.Windows.Forms.DataVisualization" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Properties\Settings.Designer.cs"> <Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
@ -43,12 +35,10 @@
<DependentUpon>Settings.settings</DependentUpon> <DependentUpon>Settings.settings</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Update="Properties\Settings.settings"> <None Update="Properties\Settings.settings">
<Generator>PublicSettingsSingleFileGenerator</Generator> <Generator>PublicSettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -30,9 +30,7 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RelForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RelForm));
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); OxyPlot.PlotModel plotView = new OxyPlot.PlotModel();
System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
this.RelPropertyGrid = new CodeWalker.WinForms.PropertyGridFix(); this.RelPropertyGrid = new CodeWalker.WinForms.PropertyGridFix();
this.MainTabControl = new System.Windows.Forms.TabControl(); this.MainTabControl = new System.Windows.Forms.TabControl();
this.XmlTabPage = new System.Windows.Forms.TabPage(); this.XmlTabPage = new System.Windows.Forms.TabPage();
@ -53,7 +51,7 @@
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.SynthVariablesTextBox = new System.Windows.Forms.TextBox(); this.SynthVariablesTextBox = new System.Windows.Forms.TextBox();
this.SynthOutputsTextBox = new System.Windows.Forms.TextBox(); this.SynthOutputsTextBox = new System.Windows.Forms.TextBox();
this.SynthBufferChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.plotView1 = new OxyPlot.WindowsForms.PlotView();
this.SynthPlayButton = new System.Windows.Forms.Button(); this.SynthPlayButton = new System.Windows.Forms.Button();
this.SynthCopyXMLButton = new System.Windows.Forms.Button(); this.SynthCopyXMLButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
@ -86,7 +84,7 @@
this.NameTableTabPage.SuspendLayout(); this.NameTableTabPage.SuspendLayout();
this.SearchTabPage.SuspendLayout(); this.SearchTabPage.SuspendLayout();
this.SynthsTabPage.SuspendLayout(); this.SynthsTabPage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.SynthBufferChart)).BeginInit(); this.plotView1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.SynthTextBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.SynthTextBox)).BeginInit();
this.MainToolbar.SuspendLayout(); this.MainToolbar.SuspendLayout();
this.MainStatusStrip.SuspendLayout(); this.MainStatusStrip.SuspendLayout();
@ -297,7 +295,7 @@
this.SynthsTabPage.Controls.Add(this.label2); this.SynthsTabPage.Controls.Add(this.label2);
this.SynthsTabPage.Controls.Add(this.SynthVariablesTextBox); this.SynthsTabPage.Controls.Add(this.SynthVariablesTextBox);
this.SynthsTabPage.Controls.Add(this.SynthOutputsTextBox); this.SynthsTabPage.Controls.Add(this.SynthOutputsTextBox);
this.SynthsTabPage.Controls.Add(this.SynthBufferChart); this.SynthsTabPage.Controls.Add(this.plotView1);
this.SynthsTabPage.Controls.Add(this.SynthPlayButton); this.SynthsTabPage.Controls.Add(this.SynthPlayButton);
this.SynthsTabPage.Controls.Add(this.SynthCopyXMLButton); this.SynthsTabPage.Controls.Add(this.SynthCopyXMLButton);
this.SynthsTabPage.Controls.Add(this.label1); this.SynthsTabPage.Controls.Add(this.label1);
@ -360,23 +358,18 @@
// //
// SynthBufferChart // SynthBufferChart
// //
this.SynthBufferChart.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.plotView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
chartArea1.Name = "ChartArea1"; var plotModel = new OxyPlot.PlotModel();
this.SynthBufferChart.ChartAreas.Add(chartArea1); this.plotView1.Location = new System.Drawing.Point(363, 31);
legend1.Name = "Legend1"; this.plotView1.Name = "SynthBufferChart";
this.SynthBufferChart.Legends.Add(legend1); plotModel.Series.Add(new OxyPlot.Series.LineSeries { Title = "Buffer", LegendKey = "Main" });
this.SynthBufferChart.Location = new System.Drawing.Point(363, 31); plotModel.IsLegendVisible = true;
this.SynthBufferChart.Name = "SynthBufferChart"; plotModel.Legends.Add(new OxyPlot.Legends.Legend { LegendPosition = OxyPlot.Legends.LegendPosition.RightMiddle, LegendPlacement = OxyPlot.Legends.LegendPlacement.Outside, LegendOrientation = OxyPlot.Legends.LegendOrientation.Horizontal, Key = "Main" });
series1.ChartArea = "ChartArea1"; this.plotView1.Model = plotModel;
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; this.plotView1.Size = new System.Drawing.Size(460, 112);
series1.IsXValueIndexed = true; this.plotView1.TabIndex = 38;
series1.Legend = "Legend1"; this.plotView1.Text = "chart1";
series1.Name = "Buffer";
this.SynthBufferChart.Series.Add(series1);
this.SynthBufferChart.Size = new System.Drawing.Size(460, 112);
this.SynthBufferChart.TabIndex = 38;
this.SynthBufferChart.Text = "chart1";
// //
// SynthPlayButton // SynthPlayButton
// //
@ -649,7 +642,8 @@
this.SearchTabPage.PerformLayout(); this.SearchTabPage.PerformLayout();
this.SynthsTabPage.ResumeLayout(false); this.SynthsTabPage.ResumeLayout(false);
this.SynthsTabPage.PerformLayout(); this.SynthsTabPage.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.SynthBufferChart)).EndInit(); this.plotView1.ResumeLayout(false);
this.plotView1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.SynthTextBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.SynthTextBox)).EndInit();
this.MainToolbar.ResumeLayout(false); this.MainToolbar.ResumeLayout(false);
this.MainToolbar.PerformLayout(); this.MainToolbar.PerformLayout();
@ -704,7 +698,7 @@
private FastColoredTextBoxNS.FastColoredTextBox SynthTextBox; private FastColoredTextBoxNS.FastColoredTextBox SynthTextBox;
private System.Windows.Forms.Button SynthCopyXMLButton; private System.Windows.Forms.Button SynthCopyXMLButton;
private System.Windows.Forms.Button SynthPlayButton; private System.Windows.Forms.Button SynthPlayButton;
private System.Windows.Forms.DataVisualization.Charting.Chart SynthBufferChart; private OxyPlot.WindowsForms.PlotView plotView1;
private System.Windows.Forms.TextBox SynthOutputsTextBox; private System.Windows.Forms.TextBox SynthOutputsTextBox;
private System.Windows.Forms.TextBox SynthVariablesTextBox; private System.Windows.Forms.TextBox SynthVariablesTextBox;
private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label3;

View File

@ -12,7 +12,8 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting; using OxyPlot;
using OxyPlot.Series;
using System.Xml; using System.Xml;
using Range = FastColoredTextBoxNS.Range; using Range = FastColoredTextBoxNS.Range;
using TextStyle = FastColoredTextBoxNS.TextStyle; using TextStyle = FastColoredTextBoxNS.TextStyle;
@ -750,12 +751,16 @@ namespace CodeWalker.Forms
int i = synthesizer.Synth.OutputsIndices[0]; int i = synthesizer.Synth.OutputsIndices[0];
try try
{ {
var series = SynthBufferChart.Series.FindByName($"B{i}"); var series = plotView1.Model.Series.FirstOrDefault(p => p.Title == $"B{i}") as LineSeries;
if (series != null) if (series != null)
{ {
series.Points.Clear(); series.Points.Clear();
foreach (var v in buffersCopy[i]) var thisBuffer = buffersCopy[i];
series.Points.AddY(Math.Max(Math.Min(v, 2.0f), -2.0f));//make sure crazy accidental values don't crash it later for (int j = 0; j < thisBuffer.Length; j++)
{
series.Points.Add(new DataPoint(j, Math.Max(Math.Min(thisBuffer[j], 2.0f), -2.0f)));
}
plotView1.InvalidatePlot(true);
} }
} }
catch { } catch { }
@ -763,12 +768,13 @@ namespace CodeWalker.Forms
}; };
} }
SynthBufferChart.Series.Clear(); plotView1.Model.Series.Clear();
//plotView1.Model.GetLegend("Main");
for (int i = 0; i < newSynth.BuffersCount; i++) for (int i = 0; i < newSynth.BuffersCount; i++)
{ {
var series = SynthBufferChart.Series.Add($"B{i}");
series.IsXValueIndexed = true; plotView1.Model.Series.Add(new LineSeries { Title = $"B{i}", RenderInLegend = true, LegendKey = $"Main" });
series.ChartType = SeriesChartType.FastLine; //plotView1.Model.Legends.Add(new OxyPlot.Legends.Legend { LegendPosition = OxyPlot.Legends.LegendPosition.RightMiddle, LegendPlacement = OxyPlot.Legends.LegendPlacement.Outside, LegendOrientation = OxyPlot.Legends.LegendOrientation.Vertical, Key = $"B{i}" });
} }
SynthPlayButton.Enabled = false; SynthPlayButton.Enabled = false;