Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions FASTER/Models/BasicCfg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static class BasicCfgArrays
{
public static string[] PerfPresets { get; } = {"Custom", "Arma3 Defaults", "1Mb Preset", "250Mb Preset", "1Gb Preset"};
public static double[] TerrainGrids { get; } = { 50, 25, 12.5, 6.25, 3.125 };
public static string[] Languages { get; } = { "English", "Czech", "French", "German", "Italian", "Polish", "Portuguese", "Russian", "Spanish", "Turkish", "Hungarian" };
}

[Serializable]
Expand All @@ -27,15 +28,26 @@ public class BasicCfg : INotifyPropertyChanged
private ushort maxCustomFileSize = 1024;
private ushort maxPacketSize = 1400;

private string _language = "English";
private string basicContent;

public string Language
{
get => _language;
set
{
_language = value;
RaisePropertyChanged(nameof(Language));
}
}

public string BasicContent
{
get => basicContent;
set
{
basicContent = value;
RaisePropertyChanged("BasicContent");
RaisePropertyChanged(nameof(BasicContent));
}
}

Expand All @@ -45,7 +57,7 @@ public uint ViewDistance
set
{
viewDistance = value;
RaisePropertyChanged("ViewDistance");
RaisePropertyChanged(nameof(ViewDistance));
}
}

Expand All @@ -55,7 +67,7 @@ public double TerrainGrid
set
{
terrainGrid = value;
RaisePropertyChanged("TerrainGrid");
RaisePropertyChanged(nameof(TerrainGrid));
}
}

Expand All @@ -65,7 +77,7 @@ public ushort MaxSizeGuaranteed
set
{
maxSizeGuaranteed = value;
RaisePropertyChanged("MaxSizeGuaranteed");
RaisePropertyChanged(nameof(MaxSizeGuaranteed));
}
}

Expand All @@ -75,7 +87,7 @@ public ushort MaxSizeNonGuaranteed
set
{
maxSizeNonguaranteed = value;
RaisePropertyChanged("MaxSizeNonGuaranteed");
RaisePropertyChanged(nameof(MaxSizeNonGuaranteed));
}
}

Expand All @@ -85,7 +97,7 @@ public ushort MaxMsgSend
set
{
maxMsgSend = value;
RaisePropertyChanged("MaxMsgSend");
RaisePropertyChanged(nameof(MaxMsgSend));
}
}

Expand All @@ -95,7 +107,7 @@ public ulong MinBandwidth
set
{
minBandwidth = value;
RaisePropertyChanged("MinBandwidth");
RaisePropertyChanged(nameof(MinBandwidth));
}
}

Expand All @@ -105,7 +117,7 @@ public ulong MaxBandwidth
set
{
maxBandwidth = value;
RaisePropertyChanged("MaxBandwidth");
RaisePropertyChanged(nameof(MaxBandwidth));
}
}

Expand All @@ -115,7 +127,7 @@ public ushort MaxPacketSize
set
{
maxPacketSize = value;
RaisePropertyChanged("MaxPacketSize");
RaisePropertyChanged(nameof(MaxPacketSize));
}
}

Expand All @@ -125,7 +137,7 @@ public double MinErrorToSend
set
{
minErrorToSend = value;
RaisePropertyChanged("MinErrorToSend");
RaisePropertyChanged(nameof(MinErrorToSend));
}
}

Expand All @@ -135,7 +147,7 @@ public double MinErrorToSendNear
set
{
minErrorToSendNear = value;
RaisePropertyChanged("MinErrorToSendNear");
RaisePropertyChanged(nameof(MinErrorToSendNear));
}
}

Expand All @@ -145,11 +157,12 @@ public ushort MaxCustomFileSize
set
{
maxCustomFileSize = value;
RaisePropertyChanged("MaxCustomFileSize");
RaisePropertyChanged(nameof(MaxCustomFileSize));
}
}

[XmlIgnore]
[Newtonsoft.Json.JsonIgnore]
public string PerfPreset
{
get => "Custom";
Expand Down Expand Up @@ -181,7 +194,7 @@ public string PerfPreset
MinBandwidth = 1000000000;
break;
}
RaisePropertyChanged("PerfPreset");
RaisePropertyChanged(nameof(PerfPreset));
}
}

Expand All @@ -191,7 +204,7 @@ public BasicCfg()
public string ProcessFile()
{
string output = "// These options are created by default\r\n"
+ "language=\"English\";\r\n"
+ $"language=\"{_language}\";\r\n"
+ "adapter=-1;\r\n"
+ "3D_Performance=1.000000;\r\n"
+ "Resolution_W=800;\r\n"
Expand Down
Loading