加入登陆的UI

This commit is contained in:
muqing 2024-08-15 09:40:33 +08:00
parent 02f8e1c036
commit 91659543fa
43 changed files with 421 additions and 361 deletions

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RustTools.muqing;
using RustTools.muqing;
namespace RustTools.ApiFox;

View File

@ -2,17 +2,16 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.UI.Xaml;
using Microsoft.Windows.AppLifecycle;
using RustTools.Activation;
using RustTools.Contracts.Services;
using RustTools.Models;
using RustTools.muqing;
using RustTools.Services;
using RustTools.ViewModels;
using RustTools.Views;
using RustTools.muqing;
using RustTools.Activation;
using RustTools.WindowUI;
using Windows.ApplicationModel.Activation;
using Microsoft.Windows.AppLifecycle;
using WinUIEx;
namespace RustTools;
@ -41,7 +40,10 @@ public partial class App : Microsoft.UI.Xaml.Application
}
public static UIElement? AppTitlebar { get; set; }
public static UIElement? AppTitlebar
{
get; set;
}
public static WindowEx? MainWindow;
public App()

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.ObjectModel;
using Newtonsoft.Json;
using Newtonsoft.Json;
public class CommunityList
{

View File

@ -1,11 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Runtime.InteropServices.JavaScript.JSType;
namespace RustTools.DataList;
namespace RustTools.DataList;
public class HomeBanner
{

View File

@ -1,5 +1,4 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json;
public class ModInfo
{

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json;
public class ModListResponse

View File

@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RustTools.DataList;
namespace RustTools.DataList;
public class MovingInfo
{
public class Data

View File

@ -1,12 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Payments;
using System.Collections.ObjectModel;
namespace RustTools.Editor;
public class EditorLoad
@ -67,7 +59,8 @@ public class EditorLoad
// Type = ExplorerItem.ExplorerItemType.Folder,
//};
//LoadDirectory(directoryInfos,rootItem);
foreach (var file in directoryInfos.GetDirectories()) {
foreach (var file in directoryInfos.GetDirectories())
{
var explorerItem = new ExplorerItem()
{
Name = file.Name,

View File

@ -1,14 +1,11 @@

using Microsoft.UI.Xaml.Controls;
using System.Diagnostics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using RustTools.muqing;
using Windows.ApplicationModel.DataTransfer;
using Microsoft.UI.Xaml.Input;
using Windows.Storage;
using RustTools.Helpers;
using Microsoft.UI.Xaml.Media;
using Windows.Foundation;
using System.Diagnostics;
namespace RustTools.Editor;
@ -34,7 +31,8 @@ public class EditorTreeView: TreeView
e.Data.SetData("path", firstItem.Dir);
e.Data.RequestedOperation = DataPackageOperation.Move; // Use Copy to avoid moving items
}
private void EditorTreeView_DragItemsCompleted(TreeView sender, TreeViewDragItemsCompletedEventArgs e) {
private void EditorTreeView_DragItemsCompleted(TreeView sender, TreeViewDragItemsCompletedEventArgs e)
{
// 获取拖拽的项
var items = e.Items.Cast<ExplorerItem>().ToList();

View File

@ -1,18 +1,10 @@
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Reflection.Metadata;
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Documents;
using Microsoft.UI.Xaml.Input;
using RustTools.muqing;
using Windows.ApplicationModel.DataTransfer;
using WinRT.Interop;
namespace RustTools.Editor;
/// <summary>
@ -59,7 +51,8 @@ public sealed partial class EditorWin : WindowEx
// 防止窗口关闭
e.Handled = true;
}
if (ClosedDialog != null) {
if (ClosedDialog != null)
{
return;
}
// 显示一个对话框,告知用户窗口不能关闭

View File

@ -1,12 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.ComponentModel;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace RustTools.Editor;
public class ExplorerItemTemplateSelector : DataTemplateSelector

View File

@ -1,6 +1,4 @@
using RustTools.Helpers;
using Windows.Storage;
using Windows.Storage;
using Windows.Storage.Streams;
namespace RustTools.Helpers;

View File

@ -2,7 +2,6 @@
using Microsoft.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Windows.UI;
using Windows.UI.ViewManagement;

View File

@ -1,9 +1,5 @@
using System.Resources;
using Microsoft.UI.Xaml;
using RustTools.Helpers;
using RustTools.Helpers;
using RustTools.muqing;
using RustTools.WindowUI;
using Windows.Storage;
using Windows.UI.ViewManagement;
namespace RustTools;

View File

@ -62,12 +62,26 @@
</ItemGroup>
<ItemGroup>
<None Remove="Themes\ButtonIcon.xaml" />
<None Remove="Themes\LoginPage.xaml" />
<None Remove="Themes\NullPage.xaml" />
</ItemGroup>
<ItemGroup>
<Page Update="Themes\LoginPage.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
<SubType>Designer</SubType>
</Page>
<Page Update="Themes\NullPage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<CustomAdditionalCompileInputs Remove="Themes\ButtonIcon.xaml" />
</ItemGroup>
<ItemGroup>
<Resource Remove="Themes\ButtonIcon.xaml" />
</ItemGroup>
</Project>

View File

@ -3,8 +3,6 @@
using RustTools.Contracts.Services;
using RustTools.Helpers;
using RustTools.Models;
using Windows.ApplicationModel;
using Windows.Storage;
namespace RustTools.Services;

View File

@ -1,18 +1,5 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Documents;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Foundation.Collections;
namespace RustTools.Styles;
public sealed class TitleSubtitleControl : Control
@ -24,16 +11,9 @@ public sealed class TitleSubtitleControl : Control
public string TitleText
{
get
{
return (string)GetValue(TitleTextProperty);
get => (string)GetValue(TitleTextProperty);
set => SetValue(TitleTextProperty, value);
}
set
{
SetValue(TitleTextProperty, value);
}
}
public static readonly DependencyProperty TitleTextProperty =
DependencyProperty.Register("TitleText", typeof(string), typeof(TitleSubtitleControl), new PropertyMetadata(""));

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<UserControl
x:Class="RustTools.Themes.ButtonIcon"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:RustTools.Themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewmodels="using:RustTools.ViewModels"
d:DataContext="{d:DesignInstance Type=viewmodels:ButtonViewModel}"
mc:Ignorable="d">
<Button
Name="button"
Padding="9"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
CornerRadius="9">
<FontIcon Glyph="{x:Bind Glyph, Mode=OneWay}" />
</Button>
</UserControl>

View File

@ -0,0 +1,31 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace RustTools.Themes;
public sealed partial class ButtonIcon : UserControl
{
public ButtonIcon()
{
this.InitializeComponent();
DefaultStyleKey = typeof(ButtonIcon);
}
public string Glyph
{
get => (string)GetValue(GlyphProperty);
set => SetValue(GlyphProperty, value);
}
public static readonly DependencyProperty GlyphProperty =
DependencyProperty.Register("Glyph", typeof(string), typeof(ButtonIcon), new PropertyMetadata("\uE70A")); // ÉèÖÃĬÈÏÖµ
public event RoutedEventHandler Click
{
add
{
button.Click += value;
}
remove
{
button.Click -= value;
}
}
}

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8" ?>
<UserControl
x:Class="RustTools.Themes.LoginPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:RustTools.Themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Border
Margin="16"
Padding="26"
Background="{StaticResource CardStrokeColorDefault}"
CornerRadius="13">
<Grid MinWidth="350" HorizontalAlignment="Center">
<StackPanel x:Name="login_view">
<TextBlock HorizontalAlignment="Center" Text="登陆" />
<StackPanel>
<TextBox
Margin="0,16,0,16"
InputScope="AlphanumericPin"
PlaceholderText="账号" />
<PasswordBox Margin="0,0,0,16" PlaceholderText="密码" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button
Width="100"
Margin="16"
Click="login_Click"
Content="登陆"
Style="{StaticResource AccentButtonStyle}" />
<Button
Margin="0,0,0,0"
Click="enroll_Click"
Content="注册" />
</StackPanel>
<CheckBox>
<CheckBox.Content>
<StackPanel Orientation="Horizontal" ToolTipService.ToolTip="虽然没什么用但是这是常规的">
<TextBlock VerticalAlignment="Center" Text="我同意" />
<HyperlinkButton
x:Name="hlbTerms"
Content="《服务协议》"
NavigateUri="https://rust.coldmint.top/resources/agreement/service_agreement.html" />
<TextBlock VerticalAlignment="Center" Text="与" />
<HyperlinkButton
x:Name="hlbPrivacy"
Content="《隐私政策》"
NavigateUri="https://rust.coldmint.top/resources/agreement/privacy_policy.html" />
</StackPanel>
</CheckBox.Content>
</CheckBox>
</StackPanel>
<StackPanel x:Name="enroll_view" Visibility="Collapsed">
<local:ButtonIcon
x:Name="Back_Button"
Click="Back_Click"
Glyph="&#xE72B;" />
<TextBlock HorizontalAlignment="Center" Text="注册" />
<StackPanel>
<TextBox
Margin="0,16,0,16"
InputScope="AlphanumericPin"
PlaceholderText="账号" />
<TextBox
Margin="0,0,0,16"
InputScope="NameOrPhoneNumber"
PlaceholderText="用户名/昵称" />
<PasswordBox Margin="0,0,0,16" PlaceholderText="密码" />
<PasswordBox Margin="0,0,0,16" PlaceholderText="确认密码" />
<TextBox
Margin="0,0,0,16"
InputScope="EmailNameOrAddress"
PlaceholderText="邮箱" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Margin="0,0,0,0" Content="注册" />
</StackPanel>
</StackPanel>
</Grid>
</Border>
</UserControl>

View File

@ -0,0 +1,91 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation;
namespace RustTools.Themes;
public sealed partial class LoginPage : UserControl
{
public LoginPage()
{
InitializeComponent();
DefaultStyleKey = typeof(LoginPage);
}
/// <summary>
/// 返回到登陆
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void Back_Click(object sender, RoutedEventArgs e)
{
var storyboard = CreateFadeTransitionStoryboard(enroll_view,login_view);
storyboard.Begin();
}
/// <summary>
/// 切换到注册
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void enroll_Click(object sender, RoutedEventArgs e)
{
var storyboard = CreateFadeTransitionStoryboard(login_view, enroll_view);
storyboard.Begin();
}
private void FadeOutStoryboard_Completed(object? sender, object e)
{
// 确保动画完成后执行切换
if (login_view.Visibility == Visibility.Visible)
{
login_view.Visibility = Visibility.Collapsed;
enroll_view.Visibility = Visibility.Visible;
}
else
{
enroll_view.Visibility = Visibility.Collapsed;
login_view.Visibility = Visibility.Visible;
}
}
private Storyboard CreateFadeTransitionStoryboard(FrameworkElement fromElement, FrameworkElement toElement)
{
var storyboard = new Storyboard();
// 淡出动画
var fadeOutAnimation = new DoubleAnimation
{
From = 1,
To = 0,
Duration = new Duration(TimeSpan.FromSeconds(0.5))
};
Storyboard.SetTarget(fadeOutAnimation, fromElement);
Storyboard.SetTargetProperty(fadeOutAnimation, "Opacity");
storyboard.Children.Add(fadeOutAnimation);
storyboard.Completed += (a, b) =>
{
fromElement.Visibility = Visibility.Collapsed;
toElement.Visibility = Visibility.Visible;
// 淡入动画
var storyboard1 = new Storyboard();
var fadeInAnimation = new DoubleAnimation
{
From = 0,
To = 1,
Duration = new Duration(TimeSpan.FromSeconds(0.5))
};
Storyboard.SetTarget(fadeInAnimation, toElement);
Storyboard.SetTargetProperty(fadeInAnimation, "Opacity");
storyboard1.Children.Add(fadeInAnimation);
storyboard1.Begin();
};
return storyboard;
}
private void login_Click(object sender, RoutedEventArgs e)
{
}
}

View File

@ -1,18 +1,11 @@
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 RustTools.Styles;
namespace RustTools.Themes;
public sealed partial class NullPage : UserControl
{
public NullPage()
{
this.InitializeComponent();
DefaultStyleKey = typeof(NullPage);
}
}

View File

@ -0,0 +1,8 @@
using CommunityToolkit.Mvvm.ComponentModel;
namespace RustTools.ViewModels
{
public class ButtonViewModel : ObservableObject
{
}
}

View File

@ -3,7 +3,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
using Newtonsoft.Json;
using RustTools.DataList;
using RustTools.muqing;
using Windows.System;
namespace RustTools.ViewModels;

View File

@ -1,8 +1,6 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.UI.Xaml.Media.Imaging;
using Newtonsoft.Json;
using RustTools.muqing;
namespace RustTools.ViewModels;

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@ -14,7 +9,7 @@ namespace RustTools.ViewModels;
/// <summary>
/// 模组界面配置
/// </summary>
public class ModuleViewModel : ObservableRecipient
public class ModuleViewModel : ObservableRecipient
{
public ObservableCollection<DataObject> ListMod = new();

View File

@ -1,8 +1,6 @@
using System.Collections.ObjectModel;
using System.Net.Http.Json;
using CommunityToolkit.Mvvm.ComponentModel;
using Newtonsoft.Json;
using RustTools.muqing;
namespace RustTools.ViewModels;

View File

@ -10,10 +10,6 @@ using RustTools.Contracts.Services;
using RustTools.Helpers;
using Windows.ApplicationModel;
using Windows.Storage.AccessCache;
using Windows.Storage.Pickers;
using Windows.Storage;
using RustTools.muqing;
namespace RustTools.ViewModels;

View File

@ -1,20 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI;
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 RustTools.muqing;
using RustTools.ViewModels;
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.
@ -26,7 +13,10 @@ namespace RustTools.Views;
/// </summary>
public sealed partial class ConcernPage : Page
{
public ConcernViewModel ViewModels { get; set; }
public ConcernViewModel ViewModels
{
get; set;
}
public ConcernPage()
{
ViewModels = App.GetService<ConcernViewModel>();

View File

@ -1,11 +1,11 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Text.RegularExpressions;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Newtonsoft.Json;
using RustTools.DataList;
using RustTools.ViewModels;
using System.Text.RegularExpressions;
using RustTools.WindowUI;
namespace RustTools.Views;
public sealed partial class HomePage : Page

View File

@ -1,15 +1,9 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Reflection.Metadata.Ecma335;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Media;
using RustTools.muqing;
using RustTools.ViewModels;
using static IniHelper;
using static System.Collections.Specialized.BitVector32;
namespace RustTools.Views;
/// <summary>
/// 模组碎片

View File

@ -1,21 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
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 RustTools.ViewModels;
using Newtonsoft.Json;
using RustTools.muqing;
using System.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

View File

@ -90,7 +90,8 @@ public sealed partial class SettingsPage : Page
await dialog.ShowAsync();
}
private void Dialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args){
private void Dialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
sender.Hide();
var mod = new Mod(XamlRoot, (FileDri) =>
{
@ -103,7 +104,8 @@ public sealed partial class SettingsPage : Page
});
}
private async void Dialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args){
private async void Dialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
var openPicker = new FolderPicker();
var window = App.MainWindow;
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);
@ -139,7 +141,8 @@ public sealed partial class SettingsPage : Page
if (a.Name.Equals("MapsFileUrlText"))
{
var Url = MapsFileUrlText.Text;
if (!Directory.Exists(Url)&&Url!=string.Empty) {
if (!Directory.Exists(Url) && Url != string.Empty)
{
Url = iniHelper.GetValue(IniHelper.CODE.Rust, IniHelper.KEY.MapsFileUrl);
MapsFileUrlText.Text = Url;
}

View File

@ -1,11 +1,9 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using RustTools.Contracts.Services;
using RustTools.Helpers;
using RustTools.muqing;
using RustTools.ViewModels;
using Windows.System;

View File

@ -7,51 +7,12 @@
xmlns:local="using:RustTools.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:styles="using:RustTools.Styles"
xmlns:themes="using:RustTools.Themes"
mc:Ignorable="d">
<Grid>
<Grid
MinWidth="350"
Margin="16"
HorizontalAlignment="Center">
<StackPanel>
<TextBlock HorizontalAlignment="Center" Text="登陆" />
<StackPanel>
<TextBox
Margin="0,16,0,16"
InputScope="AlphanumericPin"
PlaceholderText="账号" />
<PasswordBox Margin="0,0,0,16" PlaceholderText="密码" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button
Width="100"
Margin="16"
Content="登陆"
Style="{StaticResource AccentButtonStyle}" />
<Button Margin="0,0,0,0" Content="注册" />
</StackPanel>
<CheckBox>
<CheckBox.Content>
<StackPanel Orientation="Horizontal" ToolTipService.ToolTip="虽然没什么用但是这是常规的">
<TextBlock VerticalAlignment="Center" Text="我同意" />
<HyperlinkButton
x:Name="hlbTerms"
Content="《服务协议》"
NavigateUri="https://rust.coldmint.top/resources/agreement/service_agreement.html" />
<TextBlock VerticalAlignment="Center" Text="与" />
<HyperlinkButton
x:Name="hlbPrivacy"
Content="《隐私政策》"
NavigateUri="https://rust.coldmint.top/resources/agreement/privacy_policy.html" />
</StackPanel>
</CheckBox.Content>
</CheckBox>
</StackPanel>
</Grid>
<themes:LoginPage x:Name="loginpage" />
<Grid Name="gridview" Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="110" />
<RowDefinition Height="*" />

View File

@ -1,17 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
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 RustTools.ViewModels;
// To learn more about WinUI, the WinUI project structure,
@ -24,7 +11,10 @@ namespace RustTools.Views;
/// </summary>
public sealed partial class UserPage : Page
{
public UserViewModel UserViewModel { get; set; }
public UserViewModel UserViewModel
{
get; set;
}
public UserPage()
{
UserViewModel = App.GetService<UserViewModel>();

View File

@ -1,7 +1,6 @@
using System.Diagnostics;
using System.IO;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using RustTools.muqing;
@ -15,7 +14,8 @@ public sealed partial class ImportModule : WindowEx
{
InitializeComponent();
ExtendsContentIntoTitleBar = true;
if (file == string.Empty) {
if (file == string.Empty)
{
Close();
return;
}

View File

@ -1,16 +1,11 @@
using System.Collections.ObjectModel;
using System.Diagnostics;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using RustTools.muqing;
using Newtonsoft.Json;
using System.Collections.ObjectModel;
using Windows.ApplicationModel.Core;
using System.Diagnostics;
using Windows.UI.ViewManagement;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI;
using RustTools.muqing;
using static RustTools.muqing.wl;
using System.Threading;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

View File

@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using RustTools.muqing;
using Windows.Storage;
using Windows.Storage;
public class IniHelper
{
@ -107,7 +103,8 @@ public class IniHelper
/// </summary>
public void Save()
{
if (filePath==null||filePath==string.Empty) {
if (filePath == null || filePath == string.Empty)
{
return;
}

View File

@ -2,17 +2,14 @@
using System.Diagnostics;
namespace RustTools.muqing;
using System;
using System.Diagnostics.Tracing;
using System.Management;
using System.Runtime.InteropServices;
using Microsoft.UI;
using Microsoft.UI.Composition.SystemBackdrops;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Windows.UI.ViewManagement;
using System.Runtime.InteropServices;
using Windows.UI;
using System.Text.RegularExpressions;
using Windows.UI.ViewManagement;
#pragma warning disable CS8981 // 该类型名称仅包含小写 ascii 字符。此类名称可能会成为该语言的保留值。
#pragma warning disable IDE1006 // 命名样式

View File

@ -1,16 +1,11 @@
using System.Diagnostics;
using System.Reflection.Emit;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using RustTools.muqing;
using Windows.ApplicationModel.Core;
using Windows.UI.Core;
using Microsoft.UI.Dispatching;
public class Mod
{
@ -57,7 +52,8 @@ public class Mod
Debug.WriteLine("开始执行文件搜索引擎");
//先找steam中的位置
steam();
if (FileDir == string.Empty) {
if (FileDir == string.Empty)
{
//找不到执行搜索引擎
gj.sc("找不到执行搜索引擎");
dialog = new ContentDialog()
@ -75,7 +71,8 @@ public class Mod
await init();
// 使用 DispatcherQueue 将 UI 更新委托回 UI 线程
_dispatcherQueue.TryEnqueue(() => {
_dispatcherQueue.TryEnqueue(() =>
{
dialog.Closing -= Dialog_Closing;
dialog.Hide();
action?.Invoke(FileDir);
@ -100,7 +97,8 @@ public class Mod
}
private void Dialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args){
private void Dialog_Closing(ContentDialog sender, ContentDialogClosingEventArgs args)
{
gj.sc(args.Result);
if (args.Result != ContentDialogResult.Primary)
{

View File

@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics;
using System.IO.Compression;
using Windows.Storage;
using Windows.Storage.Streams;
namespace RustTools.muqing;
#pragma warning disable CS8981 // 该类型名称仅包含小写 ascii 字符。此类名称可能会成为该语言的保留值。
@ -36,7 +32,8 @@ public class wj
File.WriteAllText(filePath, str);
return true;
}
catch (Exception ex) {
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
// 将 UUID 写入文件

View File

@ -1,6 +1,4 @@
using System.Text.RegularExpressions;
using System.Threading;
using RestSharp;
using RestSharp;
namespace RustTools.muqing;
#pragma warning disable CS8981 // 该类型名称仅包含小写 ascii 字符。此类名称可能会成为该语言的保留值。