diff --git a/Saradomin/App.axaml b/Saradomin/App.axaml
index c12b409..37e80ba 100644
--- a/Saradomin/App.axaml
+++ b/Saradomin/App.axaml
@@ -19,6 +19,7 @@
+
diff --git a/Saradomin/Model/Settings/Client/ClientSettings.cs b/Saradomin/Model/Settings/Client/ClientSettings.cs
index d457eaf..76a2a76 100644
--- a/Saradomin/Model/Settings/Client/ClientSettings.cs
+++ b/Saradomin/Model/Settings/Client/ClientSettings.cs
@@ -7,11 +7,14 @@ namespace Saradomin.Model.Settings.Client
{
public const string FileName = "config.json";
+ public const string LiveServerAddress = "play.2009scape.org";
+ public const string TestServerAddress = "test.2009scape.org";
+
[JsonPropertyName("ip_management")]
- public string IpManagement { get; set; } = "play.2009scape.org";
+ public string IpManagement { get; set; } = LiveServerAddress;
[JsonPropertyName("ip_address")]
- public string ServerAddress { get; set; } = "play.2009scape.org";
+ public string ServerAddress { get; set; } = LiveServerAddress;
[JsonPropertyName("world")]
public ushort World { get; set; } = 1;
diff --git a/Saradomin/Resources/Styles/AntiAliasingRadioButton.axaml b/Saradomin/Resources/Styles/AntiAliasingRadioButton.axaml
index 8d29b9b..0272725 100644
--- a/Saradomin/Resources/Styles/AntiAliasingRadioButton.axaml
+++ b/Saradomin/Resources/Styles/AntiAliasingRadioButton.axaml
@@ -20,7 +20,8 @@
Content="{TemplateBinding Content}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- TextBlock.Foreground="{TemplateBinding Foreground}" />
+ TextBlock.Foreground="{TemplateBinding Foreground}"
+ TextBlock.FontSize="13" />
@@ -46,7 +47,8 @@
Content="{TemplateBinding Content}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- TextBlock.Foreground="{TemplateBinding Foreground}" />
+ TextBlock.Foreground="{TemplateBinding Foreground}"
+ TextBlock.FontSize="13" />
diff --git a/Saradomin/Resources/Styles/RadioButton.axaml b/Saradomin/Resources/Styles/RadioButton.axaml
new file mode 100644
index 0000000..8668143
--- /dev/null
+++ b/Saradomin/Resources/Styles/RadioButton.axaml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Saradomin/Saradomin.csproj b/Saradomin/Saradomin.csproj
index 36c1f61..f61011f 100644
--- a/Saradomin/Saradomin.csproj
+++ b/Saradomin/Saradomin.csproj
@@ -4,9 +4,13 @@
net6.0
-
-
-
+
+ x64
+ true
+ true
+ true
+ true
+
diff --git a/Saradomin/Services/SettingsService.cs b/Saradomin/Services/SettingsService.cs
index aaa8b9a..55ca4e1 100644
--- a/Saradomin/Services/SettingsService.cs
+++ b/Saradomin/Services/SettingsService.cs
@@ -32,6 +32,9 @@ namespace Saradomin.Services
private void TryReadConfigurationData()
{
+ if (!Directory.Exists(CrossPlatform.Locate2009scapeHome()))
+ Directory.CreateDirectory(CrossPlatform.Locate2009scapeHome());
+
if (File.Exists(LauncherSettingsPath))
{
using (var stream = File.OpenRead(LauncherSettingsPath))
diff --git a/Saradomin/View/Controls/SettingsView.axaml b/Saradomin/View/Controls/SettingsView.axaml
index 6bb9ef9..3e6836e 100644
--- a/Saradomin/View/Controls/SettingsView.axaml
+++ b/Saradomin/View/Controls/SettingsView.axaml
@@ -34,11 +34,11 @@
+ Text="Anti-aliasing quality"
+ Margin="0,0,0,2" />
@@ -264,17 +264,120 @@
+ DockPanel.Dock="Top">
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Saradomin/ViewModel/Controls/SettingsViewModel.cs b/Saradomin/ViewModel/Controls/SettingsViewModel.cs
index e37916f..a42461b 100644
--- a/Saradomin/ViewModel/Controls/SettingsViewModel.cs
+++ b/Saradomin/ViewModel/Controls/SettingsViewModel.cs
@@ -1,12 +1,10 @@
-using System.Collections.Generic;
+using System;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Text.Json;
-using Avalonia.Collections;
using Glitonea.Extensions;
using Glitonea.Mvvm;
using Glitonea.Utilities;
-using JetBrains.Annotations;
using Saradomin.Messaging;
using Saradomin.Model.Settings.Client;
using Saradomin.Model.Settings.Launcher;
@@ -34,6 +32,23 @@ namespace Saradomin.ViewModel.Controls
OnPropertyChanged(nameof(LoginMusicTheme));
}
}
+
+ public string ServerAddress
+ {
+ get => Client.ServerAddress;
+ set
+ {
+ Client.ServerAddress = value;
+ Client.IpManagement = value;
+
+ OnPropertyChanged(nameof(ServerAddress));
+ }
+ }
+
+ public bool IsServerAddressBeingEdited { get; set; }
+
+ public bool IsLiveServerSelected => !IsServerAddressBeingEdited && ServerAddress == ClientSettings.LiveServerAddress;
+ public bool IsTestingServerSelected => !IsServerAddressBeingEdited && ServerAddress == ClientSettings.TestServerAddress;
public ObservableCollection MusicTitles { get; private set; }
@@ -86,5 +101,24 @@ namespace Saradomin.ViewModel.Controls
{
Client.Customization.RightClickMenu.SetDefaults();
}
+
+ private void ResetServerConfiguration()
+ {
+ Client.GameServerPort = 43594;
+ Client.CacheServerPort = 43595;
+ Client.WorldListServerPort = 5555;
+
+ ServerAddress = ClientSettings.LiveServerAddress;
+ }
+
+ private void UpdateServerProfile(string param)
+ {
+ ServerAddress = param switch
+ {
+ "live" => ClientSettings.LiveServerAddress,
+ "testing" => ClientSettings.TestServerAddress,
+ _ => throw new NotSupportedException($"{param} is not a supported parameter.")
+ };
+ }
}
}
\ No newline at end of file
diff --git a/Saradomin/ViewModel/Windows/MainWindowViewModel.cs b/Saradomin/ViewModel/Windows/MainWindowViewModel.cs
index 895a174..a64625e 100644
--- a/Saradomin/ViewModel/Windows/MainWindowViewModel.cs
+++ b/Saradomin/ViewModel/Windows/MainWindowViewModel.cs
@@ -48,7 +48,8 @@ namespace Saradomin.ViewModel.Windows
using (var httpClient = new HttpClient())
{
- var response = await httpClient.GetAsync("https://2009scape.org/services/m=news/archives/latest.html");
+ var response =
+ await httpClient.GetAsync("https://2009scape.org/services/m=news/archives/latest.html");
var doc = new HtmlDocument();
doc.Load(await response.Content.ReadAsStreamAsync());
var node = doc.DocumentNode.SelectSingleNode("//div[@class='msgcontents']");
@@ -88,7 +89,6 @@ namespace Saradomin.ViewModel.Windows
CanLaunch = true;
LaunchText = $"Failed to update 2009scape: {e.Message}";
return;
- // todo messagebox
}
LaunchText = "Play! (already running)";
@@ -140,7 +140,7 @@ namespace Saradomin.ViewModel.Windows
if (!File.Exists(clientPath))
{
- LaunchText = "Cannot launch. Missing client file.";
+ LaunchText = "Cannot launch. Missing client executable. Click me again to re-try.";
throw;
}
}
@@ -149,7 +149,7 @@ namespace Saradomin.ViewModel.Windows
private void OnClientDownloadProgressUpdated(object sender, float e)
{
- LaunchText = $"Updating... (Downloading client: {e * 100}%)";
+ LaunchText = $"Updating... (Downloading client: {e * 100:F2}%)";
}
}
}
\ No newline at end of file