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
+
+
+
@@ -51,6 +65,8 @@
+
+
Always
@@ -60,5 +76,5 @@
-
+
\ No newline at end of file
diff --git a/RustTools/Themes/LoginPage.xaml b/RustTools/Themes/LoginPage.xaml
index a2e4ee4..6de3903 100644
--- a/RustTools/Themes/LoginPage.xaml
+++ b/RustTools/Themes/LoginPage.xaml
@@ -1,4 +1,5 @@
+
+
@@ -30,6 +35,11 @@
PlaceholderText="密码" />
+
@@ -102,4 +112,4 @@
Subtitle="信息" />
-
+
\ No newline at end of file
diff --git a/RustTools/Themes/LoginPage.xaml.cs b/RustTools/Themes/LoginPage.xaml.cs
index 6ba94a5..1576f57 100644
--- a/RustTools/Themes/LoginPage.xaml.cs
+++ b/RustTools/Themes/LoginPage.xaml.cs
@@ -26,11 +26,11 @@ public sealed partial class LoginPage : UserControl
ZpasswordBox.PasswordChanged += ZPasswordBox_PasswordChanged;
ZpasswordyesBox.PasswordChanged += ZPasswordBox_PasswordChanged;
- ZaccountBox.Text = "muqing1";
- ZnameBox.Text = "muqing153";
- ZpasswordBox.Password = "123456";
- ZpasswordBox.Password= "123456";
- ZemialBox.Text="123456@qq.com";
+ //ZaccountBox.Text = "muqing1";
+ //ZnameBox.Text = "muqing153";
+ //ZpasswordBox.Password = "123456";
+ //ZpasswordBox.Password= "123456";
+ //ZemialBox.Text="123456@qq.com";
}
@@ -41,18 +41,26 @@ public sealed partial class LoginPage : UserControl
///
private void Back_Click(object sender, RoutedEventArgs e)
{
- var storyboard = CreateFadeTransitionStoryboard(enroll_view,login_view);
- storyboard.Begin();
- }
- ///
- /// лע
- ///
- ///
- ///
- private void enroll_Click(object sender, RoutedEventArgs e)
- {
- var storyboard = CreateFadeTransitionStoryboard(login_view, enroll_view);
- storyboard.Begin();
+ var frameworkElement = sender as Button;
+ if (frameworkElement == null)
+ {
+ return;
+ }
+ gj.sc(frameworkElement);
+ if (frameworkElement.Content.ToString()=="ע")
+ {
+ CreateFadeTransitionStoryboard(login_view,enroll_view).Begin();
+ }else if (frameworkElement.Content.ToString() == "һ")
+ {
+ CreateFadeTransitionStoryboard(login_view, RediscoverPassGrid_view).Begin();
+ }
+ else if(enroll_view.Visibility==Visibility.Visible)
+ {
+ CreateFadeTransitionStoryboard(enroll_view, login_view).Begin();
+ }else if (RediscoverPassGrid_view.Visibility == Visibility.Visible)
+ {
+ CreateFadeTransitionStoryboard(RediscoverPassGrid_view, login_view).Begin();
+ }
}
private Storyboard CreateFadeTransitionStoryboard(FrameworkElement fromElement, FrameworkElement toElement)
diff --git a/RustTools/Themes/RediscoverPassGrid.xaml b/RustTools/Themes/RediscoverPassGrid.xaml
new file mode 100644
index 0000000..3993edf
--- /dev/null
+++ b/RustTools/Themes/RediscoverPassGrid.xaml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RustTools/Themes/RediscoverPassGrid.xaml.cs b/RustTools/Themes/RediscoverPassGrid.xaml.cs
new file mode 100644
index 0000000..5f85d53
--- /dev/null
+++ b/RustTools/Themes/RediscoverPassGrid.xaml.cs
@@ -0,0 +1,106 @@
+
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Newtonsoft.Json;
+using RustTools.DataList;
+using WinUIEx.Messaging;
+namespace RustTools.Themes;
+///
+/// һ
+///
+public sealed partial class RediscoverPassGrid : UserControl
+{
+ public event RoutedEventHandler BackClick
+ {
+ add => BackButton.Click += value;
+ remove => BackButton.Click -= value;
+ }
+ public RediscoverPassGrid()
+ {
+ InitializeComponent();
+ accountBox.TextChanged += AccountBox_TextChanged;
+ codeBox.TextChanged += AccountBox_TextChanged;
+ passwordBox.PasswordChanged += PasswordBox_PasswordChanged;
+ passwordyesBox.PasswordChanged += PasswordBox_PasswordChanged;
+ }
+
+ private void AccountBox_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ redisButton.IsEnabled = IsEnabledButton;
+ }
+ private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
+ {
+ redisButton.IsEnabled = IsEnabledButton;
+ }
+
+ ///
+ /// ֤
+ ///
+ ///
+ ///
+ private async void ButtonIcon_Click(object sender, RoutedEventArgs e)
+ {
+ Toast.IsOpen = false;
+ if (accountBox.Text == string.Empty) {
+
+ Toast.IsOpen = true;
+ Toast.Title = "ʾ";
+ Toast.Subtitle = "˺ŲΪ";
+ return;
+ }
+ try
+ {
+ var v = await ApiFox.user.requestChangePassword(accountBox.Text);
+ var message = JsonConvert.DeserializeObject(v);
+ Toast.IsOpen = true;
+ Toast.Title = "ʾ";
+ Toast.Subtitle = message.message;
+ await Task.Delay(millisecondsDelay: 1000);
+ Toast.IsOpen = false;
+ }
+ catch (Exception ex) {
+ Toast.IsOpen = true;
+ Toast.Title = "ʾ";
+ Toast.Subtitle = ex.Message;
+ await Task.Delay(millisecondsDelay: 1000);
+ Toast.IsOpen = false;
+ }
+ }
+
+ public bool IsEnabledButton =>!string.IsNullOrEmpty(accountBox.Text)&&
+ !string.IsNullOrEmpty(passwordBox.Password) &&
+ !string.IsNullOrEmpty(passwordyesBox.Password) &&
+ !string.IsNullOrEmpty(codeBox.Text);
+
+ ///
+ /// һ
+ ///
+ ///
+ ///
+ private async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ Toast.IsOpen = false;
+ try
+ {
+ var v = await ApiFox.user.changePassword(accountBox.Text, passwordBox.Password, codeBox.Text);
+ var message = JsonConvert.DeserializeObject(v);
+ Toast.IsOpen = true;
+ Toast.Title = "ʾ";
+ Toast.Subtitle = message.message;
+ await Task.Delay(millisecondsDelay: 1000);
+ Toast.IsOpen = false;
+
+ }
+ catch (Exception ex)
+ {
+ Toast.IsOpen = true;
+ Toast.Title = "ʾ";
+ Toast.Subtitle = ex.Message;
+ await Task.Delay(millisecondsDelay: 1000);
+ Toast.IsOpen = false;
+ }
+
+ }
+
+ private void RediscoverPassGrid_BackClick(object sender, RoutedEventArgs e) => throw new NotImplementedException();
+}
diff --git a/RustTools/ViewModels/CodeTableViewModel.cs b/RustTools/ViewModels/CodeTableViewModel.cs
new file mode 100644
index 0000000..e1e80cb
--- /dev/null
+++ b/RustTools/ViewModels/CodeTableViewModel.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using CommunityToolkit.Mvvm.ComponentModel;
+
+namespace RustTools.ViewModels;
+
+public class CodeTableViewModel : ObservableRecipient
+{
+
+}
diff --git a/RustTools/Views/CodeTablePage.xaml b/RustTools/Views/CodeTablePage.xaml
new file mode 100644
index 0000000..6e48266
--- /dev/null
+++ b/RustTools/Views/CodeTablePage.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/RustTools/Views/CodeTablePage.xaml.cs b/RustTools/Views/CodeTablePage.xaml.cs
new file mode 100644
index 0000000..9370ed2
--- /dev/null
+++ b/RustTools/Views/CodeTablePage.xaml.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Microsoft.UI.Xaml;
+using Microsoft.UI.Xaml.Controls;
+using Microsoft.UI.Xaml.Controls.Primitives;
+using Microsoft.UI.Xaml.Data;
+using Microsoft.UI.Xaml.Input;
+using Microsoft.UI.Xaml.Media;
+using Microsoft.UI.Xaml.Navigation;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+
+// To learn more about WinUI, the WinUI project structure,
+// and more about our project templates, see: http://aka.ms/winui-project-info.
+
+namespace RustTools.Views;
+///
+/// An empty page that can be used on its own or navigated to within a Frame.
+///
+public sealed partial class CodeTablePage : Page
+{
+ public CodeTablePage()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/RustTools/Views/ShellPage.xaml.cs b/RustTools/Views/ShellPage.xaml.cs
index fa3209a..03cdd76 100644
--- a/RustTools/Views/ShellPage.xaml.cs
+++ b/RustTools/Views/ShellPage.xaml.cs
@@ -37,10 +37,11 @@ public sealed partial class ShellPage : Page
// TODO: Set the title bar icon by updating /Assets/WindowIcon.ico.
// A custom title bar is required for full window theme and Mica support.
// https://docs.microsoft.com/windows/apps/develop/title-bar?tabs=winui3#full-customization
- App.MainWindow.ExtendsContentIntoTitleBar = true;
- App.MainWindow.SetTitleBar(AppTitleBar);
- App.MainWindow.Activated += MainWindow_Activated;
- App.MainWindow.SetIcon(Path.Combine(AppContext.BaseDirectory, "Assets/WindowIcon.ico"));
+ if (App.MainWindow != null)
+ {
+ App.MainWindow.SetTitleBar(AppTitleBar);
+ App.MainWindow.Activated += MainWindow_Activated;
+ }
AppTitleBarText.Text = "app_name".GetLocalized() + " " + "app_version".GetLocalized();
}
@@ -55,7 +56,7 @@ public sealed partial class ShellPage : Page
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
{
- App.AppTitlebar = AppTitleBarText as UIElement;
+ App.AppTitlebar = AppTitleBarText;
}
private void NavigationViewControl_DisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args)
diff --git a/RustTools/Views/UserPage.xaml.cs b/RustTools/Views/UserPage.xaml.cs
index cf4bab1..018e94a 100644
--- a/RustTools/Views/UserPage.xaml.cs
+++ b/RustTools/Views/UserPage.xaml.cs
@@ -53,10 +53,9 @@ public sealed partial class UserPage : Page
await login(account);
}
}
- catch (Exception ex)
+ catch
{
nulllogin();
- gj.sc(ex);
}
}
private void nulllogin()
@@ -75,8 +74,7 @@ public sealed partial class UserPage : Page
view.Children.Remove((LoginPage)sender);
await login(account);
}
- public string aaa { get; set; } = "aaa";
-
+
private async Task login(string account)
{
var v = await ApiFox.user.SpaceInfo(account);
@@ -86,7 +84,6 @@ public sealed partial class UserPage : Page
var data = userSpaceInfo.Data;
if (data == null) { return; }
data.HeadIcon=data.HeadIcon == string.Empty ? "/Assets/tool.png" : data.HeadIcon.Replace("..", wl.api);
- gj.sc(data.HeadIcon);
userInfo = data;
DataContext = this;
diff --git a/RustTools/WindowUI/ModuleInfoWin.xaml b/RustTools/WindowUI/ModuleInfoWin.xaml
index 07d4dc0..5730dec 100644
--- a/RustTools/WindowUI/ModuleInfoWin.xaml
+++ b/RustTools/WindowUI/ModuleInfoWin.xaml
@@ -12,57 +12,50 @@
Closed="WindowEx_Closed"
SizeChanged="WindowEx_SizeChanged"
mc:Ignorable="d">
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
-
+
+
+ Text="加载中" />
+ Text="加载中" />
-
-
+
+
+ TextWrapping="Wrap" />
+ Visibility="Collapsed" />
-
+
@@ -91,19 +83,19 @@
Name="ReportButton"
Click="AppBarButton_Click"
Icon="ReportHacked"
- Label="举报"/>
-
+ Label="举报" />
+
-
+ Label="支持" />
+
+ Label="下载" />
+ Subtitle="消息" />
-
-
-
-
-
-
diff --git a/RustTools/WindowUI/ModuleInfoWin.xaml.cs b/RustTools/WindowUI/ModuleInfoWin.xaml.cs
index 2aebb5f..6f5a2be 100644
--- a/RustTools/WindowUI/ModuleInfoWin.xaml.cs
+++ b/RustTools/WindowUI/ModuleInfoWin.xaml.cs
@@ -114,68 +114,104 @@ public sealed partial class ModuleInfoWin : WindowEx
break;
case "DownLoadButton":
- var iniHelper = new IniHelper();
- iniHelper.Load(IniHelper.FILE.Config);
- var v = iniHelper.GetValue(IniHelper.CODE.Rust, IniHelper.KEY.ModFileUrl);
- if (v == string.Empty)
- {
- var dialog = new ContentDialog()
- {
- XamlRoot = grid.XamlRoot,
- Title = "",
- Content = "úģ·",
- SecondaryButtonText = "ȡ"
-
- };
- await dialog.ShowAsync();
- return;
- }
-
- var cancellationTokenSource = new CancellationTokenSource();
- gj.sc("شģ:" + Mod.Link);
- var downloader = new FileDownloader();
- DownloadDialog.XamlRoot = grid.XamlRoot;
- var asyncOperation = DownloadDialog.ShowAsync();
- DownloadDialog.Closing += DownloadDialog_Closing;
- DownloadDialog.SecondaryButtonClick += (a, b) =>
- {
- gj.sc("ɾ");
- cancellationTokenSource.Cancel();
- downloader.Delete();
- };
- try
- {
- var PathMod = Path.Combine(v, Mod.Name);
- if (File.Exists(PathMod + ".rwmod"))
- {
- File.Delete(PathMod + ".rwmod");
- }
- // ļı·
- await downloader.DownloadFileAsync(Mod.Link, PathMod, (totalBytesRead, totalBytes) =>
- {
- DownloadDialogText.Text = $"Downloaded {totalBytesRead} of {totalBytes} bytes. {(totalBytes > 0 ? (double)totalBytesRead / totalBytes * 100 : 0):0.00}% complete.";
- //Debug.WriteLine($"Downloaded {totalBytesRead} of {totalBytes} bytes. {(totalBytes > 0 ? (double)totalBytesRead / totalBytes * 100 : 0):0.00}% complete.");
- }, cancellationTokenSource.Token);
- Debug.WriteLine("ļ");
- File.Move(PathMod, PathMod + ".rwmod");
- DownloadDialog.Closing -= DownloadDialog_Closing;
- // ֶضԻ
- DownloadDialog.Hide();
-
- }
- catch (Exception ex)
- {
- Debug.WriteLine($"Error downloading file: {ex.Message}");
- }
- finally
- {
- DownloadDialog.Closing -= DownloadDialog_Closing;
- DownloadDialog.Hide();
- }
+ DownMod();
break;
}
}
+ private async void DownMod()
+ {
+ var iniHelper = new IniHelper();
+ iniHelper.Load(IniHelper.FILE.Config);
+ var v = iniHelper.GetValue(IniHelper.CODE.Rust, IniHelper.KEY.ModFileUrl);
+ if (v == string.Empty)
+ {
+ var dialog = new ContentDialog()
+ {
+ XamlRoot = grid.XamlRoot,
+ Title = "",
+ Content = "úģ·",
+ SecondaryButtonText = "ȡ"
+
+ };
+ await dialog.ShowAsync();
+ return;
+ }
+
+ var DownloadDialog = new ContentDialog()
+ {
+ XamlRoot = grid.XamlRoot,
+ Title = "",
+ SecondaryButtonText = "ȡ"
+
+ };
+ var stack = new StackPanel();
+ var textBlock = new TextBlock();
+ stack.Children.Add(textBlock);
+ stack.Children.Add(new ProgressBar
+ {
+ Margin = new Thickness(0, 6, 0, 0),
+ IsIndeterminate = true
+ });
+ DownloadDialog.Content =stack;
+ var cancellationTokenSource = new CancellationTokenSource();
+ gj.sc("شģ:" + Mod.Link);
+ var downloader = new FileDownloader();
+ DownloadDialog.XamlRoot = grid.XamlRoot;
+ var asyncOperation = DownloadDialog.ShowAsync();
+ DownloadDialog.Closing += DownloadDialog_Closing;
+ DownloadDialog.SecondaryButtonClick += (a, b) =>
+ {
+ gj.sc("ɾ");
+ cancellationTokenSource.Cancel();
+ downloader.Delete();
+ };
+ try
+ {
+ var name = Mod.Name;//ѷǷַ滻
+ var invalidChars = Path.GetInvalidFileNameChars();
+ foreach (var a in invalidChars)
+ {
+ name = name.Replace(a.ToString(), "_");//ѷǷַ滻
+ }
+ var PathMod = Path.Combine(v, name);
+ if (File.Exists(PathMod + ".rwmod"))
+ {
+ File.Delete(PathMod + ".rwmod");
+ }
+ // ļı·
+ await downloader.DownloadFileAsync(Mod.Link, PathMod, (totalBytesRead, totalBytes) =>
+ {
+ //DownloadDialogText.Text = $"Downloaded {totalBytesRead} of {totalBytes} bytes. {(totalBytes > 0 ? (double)totalBytesRead / totalBytes * 100 : 0):0.00}% complete.";
+ textBlock.Text = $"ؽ:{(totalBytes > 0 ? (double)totalBytesRead / totalBytes * 100 : 0):0.00}%";
+ }, cancellationTokenSource.Token);
+ Debug.WriteLine("ļ");
+
+ File.Move(PathMod, PathMod + ".rwmod");
+ textBlock.Text = "ļ";
+ DownloadDialog.Closing -= DownloadDialog_Closing;
+ DownloadDialog.IsSecondaryButtonEnabled = false;
+ await Task.Delay(1500);
+ // ֶضԻ
+ DownloadDialog.Hide();
+
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine($"Error downloading file: {ex.Message}");
+ }
+ finally
+ {
+ DownloadDialog.Closing -= DownloadDialog_Closing;
+ DownloadDialog.Hide();
+ }
+ }
+
+ ///
+ /// ײʾȷť
+ ///
+ ///
+ ///
private void Toast_ActionButtonClick(TeachingTip sender, object args)
{
diff --git a/RustTools/muqing/wl.cs b/RustTools/muqing/wl.cs
index fbfbb14..0eacbc8 100644
--- a/RustTools/muqing/wl.cs
+++ b/RustTools/muqing/wl.cs
@@ -96,10 +96,10 @@ class wl
}
}
- //if (IsDelete)
- //{
- // File.Delete(savePath);
- //}
+ if (IsDelete)
+ {
+ File.Delete(savePath);
+ }
}
}