diff --git a/installer/AppShell.xaml b/installer/AppShell.xaml
index 031ce892..cecf050f 100755
--- a/installer/AppShell.xaml
+++ b/installer/AppShell.xaml
@@ -19,6 +19,9 @@
+
diff --git a/installer/Data/ConfigFileData.cs b/installer/Data/ConfigFileData.cs
index d0579e18..1eb78542 100644
--- a/installer/Data/ConfigFileData.cs
+++ b/installer/Data/ConfigFileData.cs
@@ -23,7 +23,7 @@ public record CommandFile
public string PlayerID { get; set; } = "0";
- public string SweeperType { get; set; } = "0";
+ public string ShipType { get; set; } = "0";
public string PlaybackFile { get; set; } = "CLGG!@#$%^&*()_+";
@@ -120,13 +120,13 @@ public string PlayerID
}
- public string SweeperType
+ public string ShipType
{
- get => file.SweeperType;
+ get => file.ShipType;
set
{
- var temp = file.SweeperType;
- file.SweeperType = value;
+ var temp = file.ShipType;
+ file.ShipType = value;
if (temp != value)
OnMemoryChanged?.Invoke(this, new EventArgs());
}
diff --git a/installer/Model/Logger.cs b/installer/Model/Logger.cs
index 6aed625b..ff982356 100644
--- a/installer/Model/Logger.cs
+++ b/installer/Model/Logger.cs
@@ -30,6 +30,22 @@ public enum LogLevel
public class LogRecord
{
public LogLevel Level { get; set; }
+ public string Color
+ {
+ get
+ {
+ return Level switch
+ {
+ LogLevel.Trace => "Black",
+ LogLevel.Debug => "Black",
+ LogLevel.Information => "Black",
+ LogLevel.Warning => "Yellow",
+ LogLevel.Error => "Red",
+ LogLevel.Critical => "DarkRed",
+ _ => "White",
+ };
+ }
+ }
public string Message { get; set; } = string.Empty;
}
diff --git a/installer/Page/HelpPage.xaml b/installer/Page/HelpPage.xaml
new file mode 100644
index 00000000..8c106fa4
--- /dev/null
+++ b/installer/Page/HelpPage.xaml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/installer/Page/HelpPage.xaml.cs b/installer/Page/HelpPage.xaml.cs
new file mode 100644
index 00000000..07018e36
--- /dev/null
+++ b/installer/Page/HelpPage.xaml.cs
@@ -0,0 +1,12 @@
+using installer.ViewModel;
+
+namespace installer.Page;
+
+public partial class HelpPage : ContentPage
+{
+ public HelpPage(HelpViewModel viewModel)
+ {
+ InitializeComponent();
+ BindingContext = viewModel;
+ }
+}
\ No newline at end of file
diff --git a/installer/Page/InstallPage.xaml b/installer/Page/InstallPage.xaml
index 88318e76..de1ecf90 100644
--- a/installer/Page/InstallPage.xaml
+++ b/installer/Page/InstallPage.xaml
@@ -8,90 +8,103 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
-
+
-
-
-
-
-
\ No newline at end of file
diff --git a/installer/Page/LaunchPage.xaml b/installer/Page/LaunchPage.xaml
index 9738fcc8..3a2a9567 100644
--- a/installer/Page/LaunchPage.xaml
+++ b/installer/Page/LaunchPage.xaml
@@ -4,136 +4,148 @@
xmlns:viewModels="clr-namespace:installer.ViewModel"
x:Class="installer.Page.LaunchPage"
Title="Launcher">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
+ Text="启动"
+ BorderWidth="2"
+ Command="{Binding StartBtnClickedCommand}"
+ IsEnabled="{Binding StartEnabled}"
+ BackgroundColor="{Binding ConstBackgroundColor}"
+ FontSize="{Binding ConstFontSize}"
+ TextColor="{Binding ConstTextColor}"/>
-
+
-
-
+
-
-
\ No newline at end of file
diff --git a/installer/Page/LoginPage.xaml b/installer/Page/LoginPage.xaml
index 72b25511..5dbe222f 100755
--- a/installer/Page/LoginPage.xaml
+++ b/installer/Page/LoginPage.xaml
@@ -5,37 +5,51 @@
x:Class="installer.Page.LoginPage"
Title="Login">
-
-
-
-
-
+ WidthRequest="500"
+ RowDefinitions="*,*,*,*,*">
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+ Text="{Binding ID}"
+ FontSize="{Binding ConstFontSize}"/>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/installer/ViewModel/HelpViewModel.cs b/installer/ViewModel/HelpViewModel.cs
new file mode 100644
index 00000000..d07beda6
--- /dev/null
+++ b/installer/ViewModel/HelpViewModel.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace installer.ViewModel
+{
+ public class HelpViewModel : BaseViewModel
+ {
+
+ public List InstallerHelp { get; }
+ public List LauncherHelp { get; }
+ public List OtherHelp { get; }
+
+ public HelpViewModel()
+ {
+ InstallerHelp = new List();
+ LauncherHelp = new List();
+ OtherHelp = new List();
+
+ InstallerHelp.Add(new HelpMessage { Title = "Installer", Content = "> 下载功能需要选择空文件夹路径" });
+ InstallerHelp.Add(new HelpMessage { Title = "Installer", Content = "> 更新前请先进行检查更新操作" });
+
+ LauncherHelp.Add(new HelpMessage { Title = "Launcher", Content = "> 修改参数后需要进行保存操作" });
+
+ OtherHelp.Add(new HelpMessage { Title = "Other", Content = "> 欢迎在比赛群中提出有关比赛的各种问题" });
+ }
+ }
+
+ public class HelpMessage
+ {
+ public string? Title { get; set; }
+ public string? Content { get; set; }
+ public string FontSize { get; } = "18";
+ }
+}
diff --git a/installer/ViewModel/InstallViewModel.cs b/installer/ViewModel/InstallViewModel.cs
index 2ccdcd6b..205e14a3 100644
--- a/installer/ViewModel/InstallViewModel.cs
+++ b/installer/ViewModel/InstallViewModel.cs
@@ -17,7 +17,7 @@ public class InstallViewModel : BaseViewModel
{
private readonly Downloader Downloader;
private readonly IFolderPicker FolderPicker;
- public ObservableCollection Exceptions { get => Downloader.LogList.List; }
+ public ObservableCollection LogCollection { get => Downloader.LogList.List; }
public InstallViewModel(IFolderPicker folderPicker, Downloader downloader)
{
@@ -42,36 +42,6 @@ public string? DebugAlert1
OnPropertyChanged();
}
}
- private string? debugAlert2;
- public string? DebugAlert2
- {
- get => debugAlert2;
- set
- {
- debugAlert2 = value;
- OnPropertyChanged();
- }
- }
- private string? debugAlert3;
- public string? DebugAlert3
- {
- get => debugAlert3;
- set
- {
- debugAlert3 = value;
- OnPropertyChanged();
- }
- }
- private string? debugAlert4;
- public string? DebugAlert4
- {
- get => debugAlert4;
- set
- {
- debugAlert4 = value;
- OnPropertyChanged();
- }
- }
private string downloadPath;
public string DownloadPath
@@ -134,7 +104,7 @@ public bool UpdateEnabled
public ICommand BrowseBtnClickedCommand { get; }
private async Task BrowseBtnClicked()
{
- DebugAlert1 = "Browse Button Clicked";
+ // DebugAlert1 = "Browse Button Clicked";
BrowseEnabled = false;
CheckEnabled = false;
DownloadEnabled = false;
@@ -153,7 +123,7 @@ private async Task BrowseBtnClicked()
public ICommand CheckUpdBtnClickedCommand { get; }
private async void CheckUpdBtnClicked()
{
- DebugAlert1 = "Check Button Clicked";
+ // DebugAlert1 = "Check Button Clicked";
BrowseEnabled = false;
CheckEnabled = false;
DownloadEnabled = false;
@@ -175,7 +145,7 @@ private async void CheckUpdBtnClicked()
public ICommand DownloadBtnClickedCommand { get; }
private async Task DownloadBtnClicked()
{
- DebugAlert1 = "Download Button Clicked";
+ // DebugAlert1 = "Download Button Clicked";
BrowseEnabled = false;
CheckEnabled = false;
DownloadEnabled = false;
@@ -190,12 +160,11 @@ private async Task DownloadBtnClicked()
}
CheckEnabled = true;
BrowseEnabled = true;
- // DebugAlert2 = "Installed" + Downloader.Data.Installed.ToString();
}
public ICommand UpdateBtnClickedCommand { get; }
private async Task UpdateBtnClicked()
{
- DebugAlert1 = "Update Button Clicked";
+ // DebugAlert1 = "Update Button Clicked";
BrowseEnabled = false;
CheckEnabled = false;
DownloadEnabled = false;
diff --git a/installer/ViewModel/LaunchViewModel.cs b/installer/ViewModel/LaunchViewModel.cs
index 57316c7e..c6062cc0 100644
--- a/installer/ViewModel/LaunchViewModel.cs
+++ b/installer/ViewModel/LaunchViewModel.cs
@@ -23,7 +23,7 @@ public LaunchViewModel(Downloader downloader)
Port = Downloader.Data.Config.Commands.Port;
TeamID = Downloader.Data.Config.Commands.TeamID;
PlayerID = Downloader.Data.Config.Commands.PlayerID;
- SweeperType = Downloader.Data.Config.Commands.SweeperType;
+ ShipType = Downloader.Data.Config.Commands.ShipType;
PlaybackFile = Downloader.Data.Config.Commands.PlaybackFile;
PlaybackSpeed = Downloader.Data.Config.Commands.PlaybackSpeed.ToString();
@@ -31,7 +31,7 @@ public LaunchViewModel(Downloader downloader)
portChanged = false;
teamIDChanged = false;
playerIDChanged = false;
- sweeperTypeChanged = false;
+ shipTypeChanged = false;
playbackFileChanged = false;
playbackSpeedChanged = false;
@@ -67,7 +67,7 @@ public LaunchViewModel(Downloader downloader)
private string? port;
private string? teamID;
private string? playerID;
- private string? sweeperType;
+ private string? shipType;
private string? playbackFile;
private string? playbackSpeed;
private bool cppSelect;
@@ -77,7 +77,7 @@ public LaunchViewModel(Downloader downloader)
private bool portChanged;
private bool teamIDChanged;
private bool playerIDChanged;
- private bool sweeperTypeChanged;
+ private bool shipTypeChanged;
private bool playbackFileChanged;
private bool playbackSpeedChanged;
private bool languageChanged;
@@ -96,7 +96,7 @@ public string? IP
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -117,7 +117,7 @@ public string? Port
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -138,7 +138,7 @@ public string? TeamID
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -159,28 +159,28 @@ public string? PlayerID
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
OnPropertyChanged();
}
}
- public string? SweeperType
+ public string? ShipType
{
- get => sweeperType;
+ get => shipType;
set
{
- sweeperType = value;
- if (sweeperType == Downloader.Data.Config.Commands.SweeperType)
- sweeperTypeChanged = false;
+ shipType = value;
+ if (shipType == Downloader.Data.Config.Commands.ShipType)
+ shipTypeChanged = false;
else
- sweeperTypeChanged = true;
+ shipTypeChanged = true;
StartEnabled = !ipChanged
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -201,7 +201,7 @@ public string? PlaybackFile
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -222,7 +222,7 @@ public string? PlaybackSpeed
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -249,7 +249,7 @@ public bool CppSelect
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -276,7 +276,7 @@ public bool PySelect
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -319,7 +319,7 @@ private async Task SaveBtnClicked()
&& !portChanged
&& !teamIDChanged
&& !playerIDChanged
- && !sweeperTypeChanged
+ && !shipTypeChanged
&& !playbackFileChanged
&& !playbackSpeedChanged
&& !languageChanged;
@@ -391,14 +391,14 @@ private void Save()
{
try
{
- if (SweeperType == null)
+ if (ShipType == null)
throw new Exception("empty");
- Downloader.Data.Config.Commands.SweeperType = SweeperType;
- sweeperTypeChanged = false;
+ Downloader.Data.Config.Commands.ShipType = ShipType;
+ shipTypeChanged = false;
}
catch (Exception e)
{
- DebugAlert = "Sweeper Type: " + e.Message;
+ DebugAlert = "Ship Type: " + e.Message;
}
});
Task.Run(() =>
@@ -457,7 +457,7 @@ private void Start()
+ Port + " "
+ TeamID + " "
+ PlayerID + " "
- + SweeperType + " "
+ + ShipType + " "
+ PlaybackFile + " "
+ PlaybackSpeed;
}