mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
设置界面和MOD重叠支持
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
<ResourceDictionary Source="Theme.xaml" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Border x:Name="BdrPanel" VerticalAlignment="Bottom" Margin="0,0,0,55" TextBlock.FontSize="24"
|
||||
<Border x:Name="BdrPanel" VerticalAlignment="Bottom" Margin="0,0,0,55" TextBlock.FontSize="24" Visibility="Collapsed"
|
||||
TextElement.FontSize="24" BorderBrush="{DynamicResource DARKPrimaryDarker}" BorderThickness="1"
|
||||
Background="{DynamicResource DARKPrimaryText}" CornerRadius="5" MouseLeave="MenuPanel_MouseLeave">
|
||||
<Grid Margin="15">
|
||||
|
@ -3,11 +3,57 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace VPet_Simulator.Core
|
||||
{
|
||||
public class Function
|
||||
{
|
||||
public static Random Rnd = new Random();
|
||||
/// <summary>
|
||||
/// 获取资源笔刷
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static Brush ResourcesBrush(BrushType name)
|
||||
{
|
||||
return (Brush)Application.Current.Resources.MergedDictionaries.Last()[name.ToString()];
|
||||
}
|
||||
public enum BrushType
|
||||
{
|
||||
Primary,
|
||||
PrimaryTrans,
|
||||
PrimaryTrans4,
|
||||
PrimaryTransA,
|
||||
PrimaryTransE,
|
||||
PrimaryLight,
|
||||
PrimaryLighter,
|
||||
PrimaryDark,
|
||||
PrimaryDarker,
|
||||
PrimaryText,
|
||||
|
||||
Secondary,
|
||||
SecondaryTrans,
|
||||
SecondaryTrans4,
|
||||
SecondaryTransA,
|
||||
SecondaryTransE,
|
||||
SecondaryLight,
|
||||
SecondaryLighter,
|
||||
SecondaryDark,
|
||||
SecondaryDarker,
|
||||
SecondaryText,
|
||||
|
||||
DARKPrimary,
|
||||
DARKPrimaryTrans,
|
||||
DARKPrimaryTrans4,
|
||||
DARKPrimaryTransA,
|
||||
DARKPrimaryTransE,
|
||||
DARKPrimaryLight,
|
||||
DARKPrimaryLighter,
|
||||
DARKPrimaryDark,
|
||||
DARKPrimaryDarker,
|
||||
DARKPrimaryText,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,16 @@ namespace VPet_Simulator.Windows
|
||||
LpsDocument lps = new LpsDocument(File.ReadAllText(fi.FullName));
|
||||
if (lps.First().Name.ToLower() == "pet")
|
||||
{
|
||||
mw.Pets.Add(new CorePet(lps, di));
|
||||
var name = lps.First().Info;
|
||||
var p = mw.Pets.FirstOrDefault(x => x.Name == name);
|
||||
if (p == null)
|
||||
mw.Pets.Add(new CorePet(lps, di));
|
||||
else
|
||||
{
|
||||
p.path.Add(di.FullName + "\\" + lps.First()["path"].Info);
|
||||
foreach (var sub in lps["graph"])
|
||||
p.GraphSetting.AddorReplaceSub(sub);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -24,11 +24,15 @@ namespace VPet_Simulator.Windows
|
||||
get
|
||||
{
|
||||
var g = new GraphCore();
|
||||
LoadGraph(g, new DirectoryInfo(path), "");
|
||||
foreach (var p in path)
|
||||
LoadGraph(g, new DirectoryInfo(p), "");
|
||||
return g;
|
||||
}
|
||||
}
|
||||
public string path;
|
||||
/// <summary>
|
||||
/// 图像位置
|
||||
/// </summary>
|
||||
public List<string> path = new List<string>();
|
||||
/// <summary>
|
||||
/// 宠物名字
|
||||
/// </summary>
|
||||
@ -42,10 +46,10 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
Name = lps.First().Info;
|
||||
Intor = lps.First()["intor"].Info;
|
||||
path = directory.FullName + "\\" + lps.First()["path"].Info;
|
||||
path.Add(directory.FullName + "\\" + lps.First()["path"].Info);
|
||||
GraphSetting = lps["graph"];
|
||||
}
|
||||
|
||||
|
||||
public static void LoadGraph(GraphCore graph, DirectoryInfo di, string path_name)
|
||||
{
|
||||
var list = di.EnumerateDirectories();
|
||||
@ -62,7 +66,7 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
if (path_name.StartsWith(GraphTypeValue[i][0]))
|
||||
{
|
||||
|
||||
|
||||
if (path_name.Contains("happy"))
|
||||
{
|
||||
graph.AddGraph(new PNGAnimation(di.FullName, Save.ModeType.Happy, (GraphType)i, GraphTypeValue[i][1], GraphTypeValue[i][2]), (GraphType)i);
|
||||
|
@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VPet_Simulator.Core;
|
||||
using VPet_Simulator.Windows.WinDesign;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
@ -53,8 +52,7 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
public void ShowSetting()
|
||||
{
|
||||
var settingWindow = new winGameSetting();
|
||||
settingWindow.ShowDialog();
|
||||
mw.winSetting.Show();
|
||||
}
|
||||
|
||||
public void ShowPanel()
|
||||
@ -63,7 +61,7 @@ namespace VPet_Simulator.Windows
|
||||
panelWindow.ShowDialog();
|
||||
}
|
||||
|
||||
public double ZoomRatio => 0.5;
|
||||
public double ZoomRatio => mw.Set.ZoomLevel;
|
||||
|
||||
public int PressLength => 500;
|
||||
}
|
||||
|
@ -39,39 +39,33 @@ namespace VPet_Simulator.Windows
|
||||
// FindorAddLine("windowssize").info = $"{value.Width},{value.Height}";
|
||||
// }
|
||||
//}
|
||||
public ResolutionType Resolution
|
||||
private double zoomlevel = 0;
|
||||
public double ZoomLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
var line = FindLine("windowssize");
|
||||
if (line == null)
|
||||
return ResolutionType.q1280x720;
|
||||
return (ResolutionType)line.InfoToInt;
|
||||
}
|
||||
set
|
||||
{
|
||||
FindorAddLine("windowssize").InfoToInt = (int)value;
|
||||
}
|
||||
}
|
||||
public int ZoomLevel
|
||||
{
|
||||
get
|
||||
{
|
||||
var line = FindLine("zoomlevel");
|
||||
if (line == null)
|
||||
return 75;
|
||||
int zl = line.InfoToInt;
|
||||
if (zl < 25 || zl > 100)
|
||||
if(zoomlevel == 0)
|
||||
{
|
||||
return 75;
|
||||
var line = FindLine("zoomlevel");
|
||||
if (line == null)
|
||||
zoomlevel = 0.5;
|
||||
else
|
||||
{
|
||||
zoomlevel = line.InfoToDouble;
|
||||
if (zoomlevel < 0.1 || zoomlevel > 8)
|
||||
{
|
||||
zoomlevel = 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
return zl;
|
||||
return zoomlevel;
|
||||
}
|
||||
set
|
||||
{
|
||||
FindorAddLine("zoomlevel").InfoToInt = value;
|
||||
FindorAddLine("zoomlevel").InfoToDouble = value;
|
||||
zoomlevel = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 分辨率类型,仅支持以下分辨率 q:1.77 l:1.6 s:1.33
|
||||
/// </summary>
|
||||
@ -194,12 +188,12 @@ namespace VPet_Simulator.Windows
|
||||
set => SetInt("autosave", value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 桌面图标是否自动对齐
|
||||
/// 是否置于顶层
|
||||
/// </summary>
|
||||
public bool ShortcutAlignment
|
||||
public bool TopMost
|
||||
{
|
||||
get => !GetBool("shortcut_alignment");
|
||||
set => SetBool("shortcut_alignment", !value);
|
||||
get => !GetBool("topmost");
|
||||
set => SetBool("topmost", !value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据收集是否被禁止(当日)
|
||||
|
35
VPet-Simulator.Windows/MainWindow.cs
Normal file
35
VPet-Simulator.Windows/MainWindow.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using VPet_Simulator.Core;
|
||||
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
public partial class MainWindow
|
||||
{
|
||||
public readonly string ModPath = Environment.CurrentDirectory + @"\mod";
|
||||
public readonly bool IsSteamUser;
|
||||
public Setting Set;
|
||||
public List<CorePet> Pets = new List<CorePet>();
|
||||
public List<CoreMOD> CoreMODs = new List<CoreMOD>();
|
||||
public GameCore Core = new GameCore();
|
||||
public winGameSetting winSetting;
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public readonly int verison = 10;
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public string Verison => $"{verison / 100}.{verison % 100}";
|
||||
|
||||
public void SetZoomLevel(double zl)
|
||||
{
|
||||
Set.ZoomLevel = zl;
|
||||
this.Height = 500 * zl;
|
||||
this.Width = 500 * zl;
|
||||
}
|
||||
}
|
||||
}
|
@ -25,12 +25,7 @@ namespace VPet_Simulator.Windows
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public readonly string ModPath = Environment.CurrentDirectory + @"\mod";
|
||||
public readonly bool IsSteamUser;
|
||||
public Setting Set;
|
||||
public List<CorePet> Pets = new List<CorePet>();
|
||||
public List<CoreMOD> CoreMODs = new List<CoreMOD>();
|
||||
public GameCore Core = new GameCore();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
//判断是不是Steam用户,因为本软件会发布到Steam
|
||||
@ -106,10 +101,13 @@ namespace VPet_Simulator.Windows
|
||||
Dispatcher.Invoke(new Action(() => LoadingText.Content = "尝试加载游戏内容"));
|
||||
//加载游戏内容
|
||||
Core.Controller = new MWController(this);
|
||||
Dispatcher.Invoke(new Action(() => Core.Graph = Pets[0].Graph));
|
||||
Core.Save = new Save();
|
||||
Dispatcher.Invoke(new Action(() => LoadingText.Visibility = Visibility.Collapsed));
|
||||
Dispatcher.Invoke(new Action(() => DisplayGrid.Child = new Main(Core)));
|
||||
Dispatcher.Invoke(new Action(() => {
|
||||
Core.Graph = Pets[0].Graph;
|
||||
LoadingText.Visibility = Visibility.Collapsed;
|
||||
winSetting = new winGameSetting(this);
|
||||
DisplayGrid.Child = new Main(Core);
|
||||
}));
|
||||
}
|
||||
|
||||
//public void DEBUGValue()
|
||||
|
@ -112,6 +112,7 @@
|
||||
<Compile Include="Function\CoreMOD.cs" />
|
||||
<Compile Include="Function\CorePet.cs" />
|
||||
<Compile Include="Function\Setting.cs" />
|
||||
<Compile Include="MainWindow.cs" />
|
||||
<Compile Include="WinDesign\winCharacterPanel.xaml.cs">
|
||||
<DependentUpon>winCharacterPanel.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<pu:WindowX x:Class="VPet_Simulator.Windows.WinDesign.winCharacterPanel"
|
||||
<pu:WindowX x:Class="VPet_Simulator.Windows.winCharacterPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Windows.WinDesign"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Windows"
|
||||
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450"
|
||||
|
@ -14,7 +14,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace VPet_Simulator.Windows.WinDesign
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// winCharacterPanel.xaml 的交互逻辑
|
||||
|
@ -1,151 +1,29 @@
|
||||
<pu:WindowX x:Class="VPet_Simulator.Windows.WinDesign.winGameSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:VPet_Simulator.Windows.WinDesign"
|
||||
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI"
|
||||
mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"
|
||||
Title="设置" Width="350" Height="450" Style="{DynamicResource BaseWindowXStyle}" WindowStartupLocation="CenterScreen">
|
||||
<Grid>
|
||||
<TabControl Margin="5" BorderThickness="0" pu:TabControlHelper.ItemsHeight="NaN"
|
||||
pu:TabControlHelper.ItemsFontSize="14" Background="Transparent" pu:TabControlHelper.ItemsPadding="10,7"
|
||||
pu:TabControlHelper.ItemsCornerRadius="4"
|
||||
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
|
||||
pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}"
|
||||
pu:TabControlHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
|
||||
Foreground="{DynamicResource PrimaryText}">
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Border Margin="5,10,5,20" CornerRadius="15" Background="{DynamicResource DARKPrimaryText}">
|
||||
<ContentControl Content="{Binding}" Margin="15,10"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
<TabItem Header="图形" Foreground="{DynamicResource PrimaryText}" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="15" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="169*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="分辨率" VerticalAlignment="Center" FontSize="14" />
|
||||
<ComboBox x:Name="ResolutionBox" Grid.Column="2" Style="{DynamicResource StandardComboBoxStyle}" SelectedIndex="0"
|
||||
SelectionChanged="ResolutionBox_SelectionChanged" Margin="0,2,0,3">
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="1280x720" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="1280x800" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="1280x960" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="1440x810" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="1440x900" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="1440x1080" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="1600x900" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="1600x1000" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="1600x1200" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="1680x945" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="1680x1050" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="1680x1260" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="1920x1080" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="1920x1200" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="1920x1440" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="2048x1152" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="2048x1260" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="2048x1536" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="2056x1440" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="2056x1600" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="2056x1920" />
|
||||
<!--1.77-->
|
||||
<ComboBoxItem Content="3840x2160" />
|
||||
<!--1.6-->
|
||||
<ComboBoxItem Content="3840x2400" />
|
||||
<!--1.33-->
|
||||
<ComboBoxItem Content="3840x2880" />
|
||||
</ComboBox>
|
||||
<TextBlock Grid.Row="1" Text="全屏幕" VerticalAlignment="Center" FontSize="14" />
|
||||
|
||||
<pu:Switch x:Name="FullScreenBox" Grid.Row="1" Grid.Column="2"
|
||||
BorderBrush="{DynamicResource PrimaryDark}" CheckedBackground="{DynamicResource Primary}"
|
||||
CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35"
|
||||
BoxHeight="18" ToggleSize="14" ToggleShadowColor="{x:Null}"
|
||||
ToggleBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="FullScreenBox_Check"
|
||||
Unchecked="FullScreenBox_Check" />
|
||||
<TextBlock Grid.Row="2" Text="缩放等级" VerticalAlignment="Center" FontSize="14" />
|
||||
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider Thumb.DragCompleted="ZoomSlider_DragCompleted" TickFrequency="1" IsSnapToTickEnabled="True"
|
||||
x:Name="ZoomSlider" Style="{DynamicResource StandardSliderStyle}"
|
||||
VerticalAlignment="Center" Maximum="100" SmallChange="1"
|
||||
PreviewMouseLeftButtonUp="ZoomSlider_MouseLeftButtonUp" Minimum="50" LargeChange="10"
|
||||
Value="75" />
|
||||
<TextBlock Grid.Column="1" Margin="15,0,0,0" VerticalAlignment="Center"
|
||||
Text="{Binding ElementName=ZoomSlider,Path=Value}" FontSize="16"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold" Background="{x:Null}" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="3" Text="主题" VerticalAlignment="Center" FontSize="14" />
|
||||
<ComboBox x:Name="ThemeBox" Grid.Row="3" Grid.Column="2" SelectionChanged="ThemeBox_SelectionChanged" Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" />
|
||||
|
||||
<TextBlock Grid.Row="4" Text="字体" VerticalAlignment="Center" FontSize="14" />
|
||||
<ComboBox x:Name="FontBox" Grid.Row="4" Grid.Column="2" SelectionChanged="FontBox_SelectionChanged" Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" />
|
||||
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="系统" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">自动保存频率</Run><LineBreak />
|
||||
<Run>在指定时间后自动保存游戏数据,频繁的自动保存可能会导致卡顿</Run>
|
||||
</TextBlock>
|
||||
<ComboBox x:Name="CBAutoSave" SelectedIndex="3" VerticalAlignment="Top" Margin="10,5,0,0"
|
||||
HorizontalAlignment="Left" Style="{DynamicResource StandardComboBoxStyle}" Width="200"
|
||||
SelectionChanged="CBAutoSave_SelectionChanged">
|
||||
<ComboBoxItem>关闭自动保存</ComboBoxItem>
|
||||
<ComboBoxItem>每天一次</ComboBoxItem>
|
||||
<ComboBoxItem>每3天一次</ComboBoxItem>
|
||||
<ComboBoxItem>每周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2个月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每3个月一次</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}" TextWrapping="Wrap"
|
||||
Margin="0,10,0,0">
|
||||
<Run FontWeight="Bold" FontSize="16">桌面</Run><LineBreak />
|
||||
<Run>系统桌面相关设置</Run>
|
||||
</TextBlock>
|
||||
<pu:WindowX x:Class="VPet_Simulator.Windows.winGameSetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:VPet_Simulator.Windows"
|
||||
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" mc:Ignorable="d" d:DesignHeight="450" Title="设置"
|
||||
Style="{DynamicResource BaseWindowXStyle}" WindowStartupLocation="CenterScreen" Closing="WindowX_Closing"
|
||||
Width="400" Height="450">
|
||||
<Viewbox>
|
||||
<Grid Width="400" Height="450">
|
||||
<TabControl Margin="5" BorderThickness="0" pu:TabControlHelper.ItemsHeight="NaN"
|
||||
pu:TabControlHelper.ItemsFontSize="14" Background="Transparent" pu:TabControlHelper.ItemsPadding="10,7"
|
||||
pu:TabControlHelper.ItemsCornerRadius="4"
|
||||
pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}"
|
||||
pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}"
|
||||
pu:TabControlHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
|
||||
Foreground="{DynamicResource PrimaryText}">
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<Border Margin="5,10,5,20" CornerRadius="15" Background="{DynamicResource DARKPrimaryText}">
|
||||
<ContentControl Content="{Binding}" Margin="15,10" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
<TabItem Header="图形" Foreground="{DynamicResource PrimaryText}"
|
||||
BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@ -160,156 +38,238 @@
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="169*" />
|
||||
</Grid.RowDefinitions>
|
||||
<pu:Switch x:Name="sDesktopAlignment" BorderBrush="{DynamicResource PrimaryDark}"
|
||||
Grid.Column="2" CheckedBackground="{DynamicResource Primary}" CheckedBorderBrush="{DynamicResource Primary}"
|
||||
<TextBlock Text="置于顶层" VerticalAlignment="Center" FontSize="14" />
|
||||
<pu:Switch x:Name="TopMostBox" Grid.Column="2" BorderBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedBackground="{DynamicResource Primary}" CheckedBorderBrush="{DynamicResource Primary}"
|
||||
Background="Transparent" BoxWidth="35" BoxHeight="18" ToggleSize="14"
|
||||
ToggleShadowColor="{x:Null}" ToggleBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Margin="10,0,0,0"
|
||||
ToolTip="桌面图标是否自动对齐网格" Checked="sDesktopAlignment_Checked" />
|
||||
<TextBlock Grid.Row="0" Text="图标对齐" VerticalAlignment="Center" FontSize="14" />
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="TopMostBox_Checked"
|
||||
Unchecked="TopMostBox_Unchecked" />
|
||||
<TextBlock Grid.Row="1" Text="缩放解锁" VerticalAlignment="Center" FontSize="14" />
|
||||
<pu:Switch x:Name="FullScreenBox" Grid.Row="1" Grid.Column="2"
|
||||
BorderBrush="{DynamicResource PrimaryDark}" CheckedBackground="{DynamicResource Primary}"
|
||||
CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35"
|
||||
BoxHeight="18" ToggleSize="14" ToggleShadowColor="{x:Null}"
|
||||
ToggleBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Checked="FullScreenBox_Check"
|
||||
Unchecked="FullScreenBox_Check" />
|
||||
<TextBlock Grid.Row="2" Text="缩放等级" VerticalAlignment="Center" FontSize="14" />
|
||||
|
||||
<Grid Grid.Column="2" Grid.Row="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Slider Thumb.DragCompleted="ZoomSlider_DragCompleted" TickFrequency="0.1"
|
||||
IsSnapToTickEnabled="True" x:Name="ZoomSlider"
|
||||
Style="{DynamicResource StandardSliderStyle}" VerticalAlignment="Center" Maximum="3"
|
||||
SmallChange=".1" Minimum="0.5" LargeChange=".1" Value="1" />
|
||||
<TextBlock Grid.Column="1" Margin="15,0,0,0" VerticalAlignment="Center"
|
||||
Text="{Binding ElementName=ZoomSlider,Path=Value}" FontSize="16"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" FontWeight="Bold" Background="{x:Null}" />
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="3" Text="主题" VerticalAlignment="Center" FontSize="14" />
|
||||
<ComboBox x:Name="ThemeBox" Grid.Row="3" Grid.Column="2"
|
||||
SelectionChanged="ThemeBox_SelectionChanged" Style="{DynamicResource StandardComboBoxStyle}"
|
||||
Margin="0,3,0,2" />
|
||||
|
||||
<TextBlock Grid.Row="4" Text="字体" VerticalAlignment="Center" FontSize="14" />
|
||||
<ComboBox x:Name="FontBox" Grid.Row="4" Grid.Column="2" SelectionChanged="FontBox_SelectionChanged"
|
||||
Style="{DynamicResource StandardComboBoxStyle}" Margin="0,3,0,2" />
|
||||
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="诊断" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" FontSize="11" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">诊断与反馈</Run><LineBreak />
|
||||
<Run>选择要发送给 LBGame 的诊断数据,诊断数据用于保护和及时更新 VOS, 解决问题并改进产品.</Run><LineBreak />
|
||||
<Run>无论选择哪个选项,设备都可以安全正常地运行.</Run> <Hyperlink Click="hyper_moreInfo">获取有关这些设置的更多信息</Hyperlink>
|
||||
</TextBlock>
|
||||
<RadioButton x:Name="RBDiagnosisYES" Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
Content="发送诊断数据: 发送有关该设备的存档, 包括购买的游戏,盈 利,饱腹,状态等各种系统内数据"
|
||||
HorizontalAlignment="Left" Margin="10,10,10,0" VerticalAlignment="Top" GroupName="diagnosis"
|
||||
Checked="RBDiagnosisYES_Checked" />
|
||||
<RadioButton x:Name="RBDiagnosisNO" Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
Content="不发送诊断数据: 适用于启用修改器,修改过游戏数据等不 符合分析数据条件. 或不希望提供游戏数据的玩家"
|
||||
HorizontalAlignment="Left" Margin="10,10,10,0" VerticalAlignment="Top" GroupName="diagnosis"
|
||||
Checked="RBDiagnosisNO_Checked" />
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,15,0,0" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="14">反馈频率</Run><LineBreak />
|
||||
<Run>VOS 应寻求我反馈按以下频率</Run>
|
||||
</TextBlock>
|
||||
<ComboBox x:Name="CBDiagnosis" SelectedIndex="1" VerticalAlignment="Top" Margin="10,5,0,0"
|
||||
HorizontalAlignment="Left" Style="{DynamicResource StandardComboBoxStyle}" Width="200"
|
||||
SelectionChanged="CBDiagnosis_SelectionChanged">
|
||||
<ComboBoxItem>每周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2个月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每3个月一次</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="MOD管理" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="15" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="ListMod" BorderThickness="0" Background="Transparent"
|
||||
Style="{DynamicResource SideMenuListBoxStyle}" VerticalAlignment="Top" FontSize="12" SelectionChanged="ListMod_SelectionChanged"
|
||||
SelectionMode="Single" />
|
||||
<StackPanel Grid.Column="2">
|
||||
</TabItem>
|
||||
<TabItem Header="系统" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">自动保存频率</Run><LineBreak />
|
||||
<Run>在指定时间后自动保存游戏数据,频繁的自动保存可能会导致卡顿</Run>
|
||||
</TextBlock>
|
||||
<ComboBox x:Name="CBAutoSave" SelectedIndex="3" VerticalAlignment="Top" Margin="10,5,0,0"
|
||||
HorizontalAlignment="Left" Style="{DynamicResource StandardComboBoxStyle}" Width="200"
|
||||
SelectionChanged="CBAutoSave_SelectionChanged">
|
||||
<ComboBoxItem>关闭自动保存</ComboBoxItem>
|
||||
<ComboBoxItem>每天一次</ComboBoxItem>
|
||||
<ComboBoxItem>每3天一次</ComboBoxItem>
|
||||
<ComboBoxItem>每周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2个月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每3个月一次</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap" Margin="0,10,0,0">
|
||||
<Run FontWeight="Bold" FontSize="16">桌面</Run><LineBreak />
|
||||
<Run>系统桌面相关设置</Run>
|
||||
</TextBlock>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="7" />
|
||||
<ColumnDefinition Width="15" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ImageMOD" HorizontalAlignment="Right" Height="85" Margin="0,5,0,0"
|
||||
VerticalAlignment="Top" Width="85" Stretch="Fill" />
|
||||
<StackPanel Grid.Column="2">
|
||||
<Label x:Name="LabelModName" Content="Core" HorizontalAlignment="Left" Margin="-5,2,0,0"
|
||||
VerticalAlignment="Top" FontWeight="Bold" FontSize="18" Background="{x:Null}"
|
||||
Foreground="{DynamicResource PrimaryText}" />
|
||||
<TextBlock Margin="0,0,0,0" TextWrapping="Wrap" FontSize="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="169*" />
|
||||
</Grid.RowDefinitions>
|
||||
<pu:Switch x:Name="sDesktopAlignment" BorderBrush="{DynamicResource PrimaryDark}"
|
||||
Grid.Column="2" CheckedBackground="{DynamicResource Primary}"
|
||||
CheckedBorderBrush="{DynamicResource Primary}" Background="Transparent" BoxWidth="35"
|
||||
BoxHeight="18" ToggleSize="14" ToggleShadowColor="{x:Null}"
|
||||
ToggleBrush="{DynamicResource PrimaryDark}"
|
||||
CheckedToggleBrush="{DynamicResource DARKPrimaryText}" Margin="10,0,0,0"
|
||||
ToolTip="桌面图标是否自动对齐网格" Checked="sDesktopAlignment_Checked" />
|
||||
<TextBlock Grid.Row="0" Text="图标对齐" VerticalAlignment="Center" FontSize="14" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="诊断" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<StackPanel>
|
||||
<TextBlock HorizontalAlignment="Left" FontSize="11" VerticalAlignment="Top" Background="{x:Null}"
|
||||
TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="16">诊断与反馈</Run><LineBreak />
|
||||
<Run>选择要发送给 LBGame 的诊断数据,诊断数据用于保护和及时更新 VOS, 解决问题并改进产品.</Run><LineBreak />
|
||||
<Run>无论选择哪个选项,设备都可以安全正常地运行.</Run> <Hyperlink Click="hyper_moreInfo">获取有关这些设置的更多信息</Hyperlink>
|
||||
</TextBlock>
|
||||
<RadioButton x:Name="RBDiagnosisYES" Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
Content="发送诊断数据: 发送有关该设备的存档, 包括购买的游戏,盈 利,饱腹,状态等各种系统内数据" HorizontalAlignment="Left"
|
||||
Margin="10,10,10,0" VerticalAlignment="Top" GroupName="diagnosis"
|
||||
Checked="RBDiagnosisYES_Checked" />
|
||||
<RadioButton x:Name="RBDiagnosisNO" Style="{DynamicResource StandardRadioButtonStyle}"
|
||||
Content="不发送诊断数据: 适用于启用修改器,修改过游戏数据等不 符合分析数据条件. 或不希望提供游戏数据的玩家" HorizontalAlignment="Left"
|
||||
Margin="10,10,10,0" VerticalAlignment="Top" GroupName="diagnosis"
|
||||
Checked="RBDiagnosisNO_Checked" />
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,15,0,0"
|
||||
Background="{x:Null}" TextWrapping="Wrap">
|
||||
<Run FontWeight="Bold" FontSize="14">反馈频率</Run><LineBreak />
|
||||
<Run>VOS 应寻求我反馈按以下频率</Run>
|
||||
</TextBlock>
|
||||
<ComboBox x:Name="CBDiagnosis" SelectedIndex="1" VerticalAlignment="Top" Margin="10,5,0,0"
|
||||
HorizontalAlignment="Left" Style="{DynamicResource StandardComboBoxStyle}" Width="200"
|
||||
SelectionChanged="CBDiagnosis_SelectionChanged">
|
||||
<ComboBoxItem>每周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2周一次</ComboBoxItem>
|
||||
<ComboBoxItem>每月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每2个月一次</ComboBoxItem>
|
||||
<ComboBoxItem>每3个月一次</ComboBoxItem>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="MOD管理" BorderBrush="{DynamicResource PrimaryDarker}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120" />
|
||||
<ColumnDefinition Width="15" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListBox x:Name="ListMod" BorderThickness="0" Background="Transparent"
|
||||
Style="{DynamicResource SideMenuListBoxStyle}" VerticalAlignment="Top" FontSize="12"
|
||||
SelectionChanged="ListMod_SelectionChanged" SelectionMode="Single" />
|
||||
<StackPanel Grid.Column="2">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="7" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image x:Name="ImageMOD" HorizontalAlignment="Right" Height="85" Margin="0,5,0,0"
|
||||
VerticalAlignment="Top" Width="85" Stretch="Fill" />
|
||||
<StackPanel Grid.Column="2">
|
||||
<Label x:Name="LabelModName" Content="Core" HorizontalAlignment="Left" Margin="-5,2,0,0"
|
||||
VerticalAlignment="Top" FontWeight="Bold" FontSize="18" Background="{x:Null}"
|
||||
Foreground="{DynamicResource PrimaryText}" />
|
||||
<TextBlock Margin="0,0,0,0" TextWrapping="Wrap" FontSize="12">
|
||||
<Run Text="模组作者: " /><LineBreak />
|
||||
<Run x:Name="runMODAuthor" Text="LorisYounger" />
|
||||
<LineBreak /><Run Text="模组版本: " /><Run x:Name="runMODVer" Text="1.0" />
|
||||
<LineBreak /><Run Text="游戏版本: " /><Run x:Name="runMODGameVer" Text="1.0" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="60" Margin="0,7,0,0"
|
||||
pu:ScrollViewerHelper.ScrollBarThickness="10" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<TextBlock x:Name="GameInfo" FontSize="12" TextWrapping="Wrap"
|
||||
Text="这里是MOD的介绍内容,你的介绍就是你的介绍
" VerticalAlignment="Top" />
|
||||
</ScrollViewer>
|
||||
<Grid Height="140">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<Label Content="MOD介绍" HorizontalAlignment="Left" Margin="-5,0,0,0"
|
||||
VerticalAlignment="Center" FontSize="18" FontWeight="Bold" Background="{x:Null}" />
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="140" Margin="0,0,0,0"
|
||||
pu:ScrollViewerHelper.ScrollBarThickness="10" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<TextBlock x:Name="GameHave" FontSize="12" TextWrapping="Wrap"
|
||||
Text="该mod有许多功能
比如说功能1
比如说功能1
比如说功能1
比如说功能1
比如说功能1"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top" />
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Label Content="内容" HorizontalAlignment="Left" Margin="-5,0,0,0" VerticalAlignment="Top"
|
||||
FontSize="18" FontWeight="Bold" Background="{x:Null}" />
|
||||
<TextBlock x:Name="ButtonOpenModFolder" Cursor="Hand" HorizontalAlignment="Left"
|
||||
Margin="0,0,0,0" TextWrapping="Wrap" Text="所在文件夹" VerticalAlignment="Top"
|
||||
FontSize="12" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" MouseDown="ButtonOpenModFolder_MouseDown" />
|
||||
<TextBlock x:Name="ButtonEnable" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="启用该模组" VerticalAlignment="Top" FontSize="12" Width="62"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" TextDecorations="Underline"
|
||||
Cursor="Hand" MouseDown="ButtonEnable_MouseDown" />
|
||||
<TextBlock x:Name="ButtonDisEnable" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="停用该模组" VerticalAlignment="Top" FontSize="12" Width="62"
|
||||
Foreground="{DynamicResource DARKPrimaryDarker}" TextDecorations="Underline"
|
||||
Cursor="Hand" MouseDown="ButtonDisEnable_MouseDown" />
|
||||
<TextBlock x:Name="ButtonPublish" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="更新至Steam" VerticalAlignment="Top" FontSize="12" Width="74"
|
||||
Foreground="DimGray" TextDecorations="Underline" Cursor="Hand" IsEnabled="False"
|
||||
MouseDown="ButtonPublish_MouseDown" />
|
||||
<TextBlock x:Name="ButtonSteam" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="创意工坊页面" VerticalAlignment="Top" FontSize="12" Width="72"
|
||||
Foreground="DimGray" TextDecorations="Underline" Cursor="Hand" IsEnabled="False"
|
||||
MouseDown="ButtonSteam_MouseDown" />
|
||||
<ProgressBar x:Name="ProgressBarUpload" Margin="0,2,0,0" Visibility="Collapsed"
|
||||
pu:ProgressBarHelper.CornerRadius="2" VerticalAlignment="Top" Height="30" Value="60"
|
||||
Background="{DynamicResource Primary}" BorderBrush="{DynamicResource PrimaryDarker}"
|
||||
pu:ProgressBarHelper.IsPercentVisible="True"
|
||||
Foreground="{DynamicResource DARKPrimary}" BorderThickness="2" />
|
||||
<Button x:Name="ButtonAllow" Content="启用代码插件" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top" Background="#FFFF2C2C" Foreground="White" FontSize="10"
|
||||
ToolTip="启用该模组的代码内容,不能保证系统安全性" Click="ButtonAllow_Click" />
|
||||
</StackPanel>
|
||||
<Button x:Name="ButtonRestart" Content="重启软件以应用更改" Margin="0,2,0,0" VerticalAlignment="Bottom"
|
||||
Background="{DynamicResource DARKPrimary}" Visibility="Collapsed"
|
||||
Foreground="{DynamicResource DARKPrimaryText}" Click="ButtonRestart_Click"
|
||||
Grid.ColumnSpan="2" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="关于" BorderBrush="{DynamicResource PrimaryDarker}" Foreground="{DynamicResource PrimaryText}">
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<TextBlock Margin="0,0,0,0" Text="虚拟主播模拟器 规格" FontSize="20" FontWeight="Bold" />
|
||||
<TextBlock Margin="0,30,0,0" FontWeight="Bold">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="60" Margin="0,7,0,0"
|
||||
pu:ScrollViewerHelper.ScrollBarThickness="10" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<TextBlock x:Name="GameInfo" FontSize="12" TextWrapping="Wrap"
|
||||
Text="这里是MOD的介绍内容,你的介绍就是你的介绍
" VerticalAlignment="Top" />
|
||||
</ScrollViewer>
|
||||
<Grid Height="140">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel>
|
||||
<Label Content="MOD介绍" HorizontalAlignment="Left" Margin="-5,0,0,0"
|
||||
VerticalAlignment="Center" FontSize="18" FontWeight="Bold" Background="{x:Null}" />
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Height="140" Margin="0,0,0,0"
|
||||
pu:ScrollViewerHelper.ScrollBarThickness="10" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<TextBlock x:Name="GameHave" FontSize="12" TextWrapping="Wrap"
|
||||
Text="该mod有许多功能
比如说功能1
比如说功能1
比如说功能1
比如说功能1
比如说功能1"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top" />
|
||||
</ScrollViewer>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="1">
|
||||
<Label Content="内容" HorizontalAlignment="Left" Margin="-5,0,0,0" VerticalAlignment="Top"
|
||||
FontSize="18" FontWeight="Bold" Background="{x:Null}" />
|
||||
<TextBlock x:Name="ButtonOpenModFolder" Cursor="Hand" HorizontalAlignment="Left"
|
||||
Margin="0,0,0,0" TextWrapping="Wrap" Text="所在文件夹" VerticalAlignment="Top"
|
||||
FontSize="12" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" MouseDown="ButtonOpenModFolder_MouseDown" />
|
||||
<TextBlock x:Name="ButtonEnable" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="启用该模组" VerticalAlignment="Top" FontSize="12"
|
||||
Width="62" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" Cursor="Hand" MouseDown="ButtonEnable_MouseDown" />
|
||||
<TextBlock x:Name="ButtonDisEnable" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="停用该模组" VerticalAlignment="Top" FontSize="12"
|
||||
Width="62" Foreground="{DynamicResource DARKPrimaryDarker}"
|
||||
TextDecorations="Underline" Cursor="Hand" MouseDown="ButtonDisEnable_MouseDown" />
|
||||
<TextBlock x:Name="ButtonPublish" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="更新至Steam" VerticalAlignment="Top" FontSize="12"
|
||||
Width="74" Foreground="DimGray" TextDecorations="Underline" Cursor="Hand"
|
||||
IsEnabled="False" MouseDown="ButtonPublish_MouseDown" />
|
||||
<TextBlock x:Name="ButtonSteam" HorizontalAlignment="Left" Margin="0,2,0,0"
|
||||
TextWrapping="Wrap" Text="创意工坊页面" VerticalAlignment="Top" FontSize="12"
|
||||
Width="72" Foreground="DimGray" TextDecorations="Underline" Cursor="Hand"
|
||||
IsEnabled="False" MouseDown="ButtonSteam_MouseDown" />
|
||||
<ProgressBar x:Name="ProgressBarUpload" Margin="0,2,0,0" Visibility="Collapsed"
|
||||
pu:ProgressBarHelper.CornerRadius="2" VerticalAlignment="Top" Height="30"
|
||||
Value="60" Background="{DynamicResource Primary}"
|
||||
BorderBrush="{DynamicResource PrimaryDarker}"
|
||||
pu:ProgressBarHelper.IsPercentVisible="True"
|
||||
Foreground="{DynamicResource DARKPrimary}" BorderThickness="2" />
|
||||
<Button x:Name="ButtonAllow" Content="启用代码插件" HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top" Background="#FFFF2C2C" Foreground="White" FontSize="10"
|
||||
ToolTip="启用该模组的代码内容,不能保证系统安全性" Click="ButtonAllow_Click" />
|
||||
</StackPanel>
|
||||
<Button x:Name="ButtonRestart" Content="重启软件以应用更改" Margin="0,2,0,0"
|
||||
VerticalAlignment="Bottom" Background="{DynamicResource DARKPrimary}"
|
||||
Visibility="Collapsed" Foreground="{DynamicResource DARKPrimaryText}"
|
||||
Click="ButtonRestart_Click" Grid.ColumnSpan="2" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="关于" BorderBrush="{DynamicResource PrimaryDarker}"
|
||||
Foreground="{DynamicResource PrimaryText}">
|
||||
<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
|
||||
<TextBlock Margin="0,0,0,0" Text="虚拟主播模拟器 规格" FontSize="20" FontWeight="Bold" />
|
||||
<TextBlock Margin="0,30,0,0" FontWeight="Bold">
|
||||
<Run>用户名</Run><LineBreak />
|
||||
<Run>版本</Run><LineBreak />
|
||||
<Run>激活</Run><LineBreak />
|
||||
</TextBlock>
|
||||
<TextBlock VerticalAlignment="Top" Margin="100,30,0,0">
|
||||
</TextBlock>
|
||||
<TextBlock VerticalAlignment="Top" Margin="100,30,0,0">
|
||||
<Run x:Name="runUserName">杨远洛里斯</Run><LineBreak />
|
||||
<Run x:Name="runabVer">v1.0 (100)</Run><LineBreak />
|
||||
<Run x:Name="runActivate">已通过Steam[uid]激活服务注册</Run><LineBreak />
|
||||
</TextBlock>
|
||||
<TextBlock Margin="0,100,0,0" Text="制作组名单" FontSize="20" FontWeight="Bold" />
|
||||
<TextBlock Margin="0,130,0,0" FontWeight="Bold">
|
||||
</TextBlock>
|
||||
<TextBlock Margin="0,100,0,0" Text="制作组名单" FontSize="20" FontWeight="Bold" />
|
||||
<TextBlock Margin="0,130,0,0" FontWeight="Bold">
|
||||
<Run>游戏策划</Run><LineBreak />
|
||||
<Run>UI&程序</Run><LineBreak />
|
||||
<Run>音效音乐</Run><LineBreak />
|
||||
@ -321,8 +281,8 @@
|
||||
<Run TextDecorations="Underline">exLB.net</Run>
|
||||
<Run> </Run>
|
||||
<Run TextDecorations="Underline">LBGame</Run>
|
||||
</TextBlock>
|
||||
<TextBlock Margin="100,130,0,0">
|
||||
</TextBlock>
|
||||
<TextBlock Margin="100,130,0,0">
|
||||
<Run>杨远洛里斯, 广大MOD作者</Run><LineBreak />
|
||||
<Run>洛里斯杨远, トニーちゃん, HKW雨辉</Run><LineBreak />
|
||||
<Run>莫皖</Run><LineBreak />
|
||||
@ -337,13 +297,13 @@
|
||||
<Hyperlink>查看引用名单</Hyperlink>
|
||||
<LineBreak />
|
||||
<Run FontStyle="Italic" FontSize="8">由于游戏暂未开发完毕,该名单并非完整名单.将在正式版完成前修改</Run><LineBreak />
|
||||
</TextBlock>
|
||||
<Image Source="/VUPSimulator;component/Res/Image/system/TopLogo2018.PNG" Width="38" Margin="99,334,0,0"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Label x:Name="GameVerison" Content="版本v1.0 (655366666)" HorizontalAlignment="Left" VerticalAlignment="Bottom"
|
||||
</TextBlock>
|
||||
<Image Source="/Res/TopLogo2018.PNG" Width="38" Margin="208,257,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Height="38" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<Label x:Name="GameVerison" Content="版本v1.0 (655366666)" HorizontalAlignment="Left" VerticalAlignment="Bottom"
|
||||
FontSize="10" Foreground="Green" Background="{x:Null}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</pu:WindowX>
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Panuon.WPF.UI;
|
||||
using Steamworks.Ugc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -13,32 +14,201 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using VPet_Simulator.Core;
|
||||
|
||||
namespace VPet_Simulator.Windows.WinDesign
|
||||
namespace VPet_Simulator.Windows
|
||||
{
|
||||
/// <summary>
|
||||
/// winGameSetting.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class winGameSetting : WindowX
|
||||
{
|
||||
public winGameSetting()
|
||||
MainWindow mw;
|
||||
private bool AllowChange = false;
|
||||
public winGameSetting(MainWindow mw)
|
||||
{
|
||||
this.mw = mw;
|
||||
mw.Topmost = false;
|
||||
InitializeComponent();
|
||||
}
|
||||
TopMostBox.IsChecked = mw.Set.TopMost;
|
||||
if (mw.Set.IsFullScreen)
|
||||
{
|
||||
FullScreenBox.IsChecked = true;
|
||||
ZoomSlider.Maximum = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
FullScreenBox.IsChecked = false;
|
||||
ZoomSlider.Maximum = 3;
|
||||
}
|
||||
ZoomSlider.Value = mw.Set.ZoomLevel * 2;
|
||||
this.Width = 400 * ZoomSlider.Value;
|
||||
this.Height = 450 * ZoomSlider.Value;
|
||||
|
||||
private void ResolutionBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
#if X64
|
||||
GameVerison.Content = $"游戏版本v{mw.Verison} x64";
|
||||
#else
|
||||
GameVerison.Content = $"游戏版本v{mw.Verison} x86";
|
||||
#endif
|
||||
//关于ui
|
||||
if (mw.IsSteamUser)
|
||||
{
|
||||
runUserName.Text = Steamworks.SteamClient.Name;
|
||||
runActivate.Text = $"已通过Steam[{Steamworks.SteamClient.SteamId.Value:x}]激活服务注册";
|
||||
}
|
||||
else
|
||||
{
|
||||
runUserName.Text = Environment.UserName;
|
||||
runActivate.Text = "尚未激活 您可能需要启动Steam或去Steam上免费领个";
|
||||
}
|
||||
runabVer.Text = $"v{mw.Verison} ({mw.verison})";
|
||||
|
||||
//mod列表
|
||||
ShowModList();
|
||||
ListMod.SelectedIndex = 0;
|
||||
ShowMod((string)((ListBoxItem)ListMod.SelectedItem).Content);
|
||||
|
||||
AllowChange = true;
|
||||
}
|
||||
public void ShowModList()
|
||||
{
|
||||
|
||||
ListMod.Items.Clear();
|
||||
foreach (CoreMOD mod in mw.CoreMODs)
|
||||
{
|
||||
ListBoxItem moditem = (ListBoxItem)ListMod.Items[ListMod.Items.Add(new ListBoxItem())];
|
||||
moditem.Content = mod.Name;
|
||||
if (mod.IsBanMOD(mw))
|
||||
{
|
||||
moditem.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mod.GameVer / 10 == mw.verison / 10)
|
||||
{
|
||||
moditem.Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText);
|
||||
}
|
||||
else
|
||||
{
|
||||
moditem.Foreground = new SolidColorBrush(Color.FromRgb(190, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
CoreMOD mod;
|
||||
private void ShowMod(string modname)
|
||||
{
|
||||
mod = mw.CoreMODs.Find(x => x.Name == modname);
|
||||
LabelModName.Content = mod.Name;
|
||||
runMODAuthor.Text = mod.Author;
|
||||
runMODGameVer.Text = CoreMOD.INTtoVER(mod.GameVer);
|
||||
runMODGameVer.Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText);
|
||||
ImageMOD.Source = new BitmapImage(new Uri(mod.Path.FullName + @"\icon.png"));
|
||||
if (mod.GameVer < mw.verison)
|
||||
{
|
||||
if (mod.GameVer / 10 == mw.verison / 10)
|
||||
{
|
||||
runMODGameVer.Text += " (兼容)";
|
||||
}
|
||||
else
|
||||
{
|
||||
runMODGameVer.Text += " (版本低)";
|
||||
runMODGameVer.Foreground = new SolidColorBrush(Color.FromRgb(190, 0, 0));
|
||||
}
|
||||
}
|
||||
else if (mod.GameVer > mw.verison)
|
||||
{
|
||||
if (mod.GameVer / 10 == mw.verison / 10)
|
||||
{
|
||||
runMODGameVer.Text += " (兼容)";
|
||||
runMODGameVer.Foreground = Function.ResourcesBrush(Function.BrushType.PrimaryText);
|
||||
}
|
||||
else
|
||||
{
|
||||
runMODGameVer.Text += " (版本高)";
|
||||
runMODGameVer.Foreground = new SolidColorBrush(Color.FromRgb(190, 0, 0));
|
||||
}
|
||||
}
|
||||
if (mod.IsBanMOD(mw))
|
||||
{
|
||||
LabelModName.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
ButtonEnable.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker);
|
||||
ButtonDisEnable.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
ButtonEnable.IsEnabled = true;
|
||||
ButtonDisEnable.IsEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LabelModName.Foreground = runMODGameVer.Foreground;
|
||||
ButtonDisEnable.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker);
|
||||
ButtonEnable.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
ButtonEnable.IsEnabled = false;
|
||||
ButtonDisEnable.IsEnabled = true;
|
||||
}
|
||||
//发布steam等功能
|
||||
if (mw.IsSteamUser)
|
||||
{
|
||||
if (mod.ItemID == 1)
|
||||
{
|
||||
ButtonSteam.IsEnabled = false;
|
||||
ButtonPublish.Text = "系统自带";
|
||||
ButtonSteam.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
}
|
||||
else if (mod.ItemID == 0)
|
||||
{
|
||||
ButtonSteam.IsEnabled = false;
|
||||
ButtonPublish.Text = "上传至Steam";
|
||||
ButtonSteam.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonSteam.IsEnabled = true;
|
||||
ButtonPublish.Text = "更新至Steam";
|
||||
ButtonSteam.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker);
|
||||
}
|
||||
if (mod.ItemID != 1 && mod.AuthorID == Steamworks.SteamClient.SteamId.AccountId)
|
||||
{
|
||||
ButtonPublish.IsEnabled = true;
|
||||
ButtonPublish.Foreground = Function.ResourcesBrush(Function.BrushType.DARKPrimaryDarker);
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonPublish.IsEnabled = false;
|
||||
ButtonPublish.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ButtonSteam.IsEnabled = false;
|
||||
ButtonPublish.Text = "未登录";
|
||||
ButtonPublish.IsEnabled = false;
|
||||
ButtonPublish.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
ButtonSteam.Foreground = new SolidColorBrush(Color.FromRgb(100, 100, 100));
|
||||
}
|
||||
runMODVer.Text = CoreMOD.INTtoVER(mod.Ver);
|
||||
GameInfo.Text = mod.Intro;
|
||||
GameHave.Text = mod.Content.Trim('\n');
|
||||
|
||||
ButtonAllow.Visibility = mod.SuccessLoad ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
private void FullScreenBox_Check(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (FullScreenBox.IsChecked == true)
|
||||
{
|
||||
mw.Set.IsFullScreen = true;
|
||||
ZoomSlider.Maximum = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
mw.Set.IsFullScreen = false;
|
||||
ZoomSlider.Maximum = 3;
|
||||
}
|
||||
}
|
||||
|
||||
private void ZoomSlider_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
|
||||
{
|
||||
|
||||
mw.SetZoomLevel(ZoomSlider.Value / 2);
|
||||
this.Width = 400 * ZoomSlider.Value;
|
||||
this.Height = 450 * ZoomSlider.Value;
|
||||
}
|
||||
|
||||
private void ThemeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
@ -83,27 +253,117 @@ namespace VPet_Simulator.Windows.WinDesign
|
||||
|
||||
private void ButtonOpenModFolder_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
System.Diagnostics.Process.Start(mod.Path.FullName);
|
||||
}
|
||||
|
||||
private void ButtonEnable_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
mw.Set.BanModRemove(mod.Name);
|
||||
ShowMod((string)LabelModName.Content);
|
||||
ButtonRestart.Visibility = Visibility.Visible;
|
||||
//int seleid = ListMod.SelectedIndex();
|
||||
ShowModList();
|
||||
}
|
||||
|
||||
private void ButtonDisEnable_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
if (mod.Name.ToLower() == "core")
|
||||
{
|
||||
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法停用", "停用失败");
|
||||
return;
|
||||
}
|
||||
mw.Set.BanMod(mod.Name);
|
||||
ShowMod((string)((ListBoxItem)ListMod.SelectedItem).Content);
|
||||
ButtonRestart.Visibility = System.Windows.Visibility.Visible;
|
||||
ShowModList();
|
||||
}
|
||||
|
||||
private void ButtonPublish_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
class ProgressClass : IProgress<float>
|
||||
{
|
||||
float lastvalue = 0;
|
||||
ProgressBar pb;
|
||||
public ProgressClass(ProgressBar p) => pb = p;
|
||||
public void Report(float value)
|
||||
{
|
||||
if (lastvalue >= value) return;
|
||||
lastvalue = value;
|
||||
pb.Dispatcher.Invoke(new Action(() => pb.Value = (int)(lastvalue * 100)));
|
||||
}
|
||||
}
|
||||
private async void ButtonPublish_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (!mw.IsSteamUser)
|
||||
{
|
||||
MessageBoxX.Show("请先登录Steam后才能上传文件", "上传MOD需要Steam登录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (mod.Name.ToLower() == "core")
|
||||
{
|
||||
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称", "MOD上传失败", MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
#if TEST || DEMO
|
||||
winMessageBox.Show(mw, "特殊版无法上传创意工坊","经测试,除正式版均无创意工坊权限,此功能仅作为展示");
|
||||
#endif
|
||||
ButtonPublish.IsEnabled = false;
|
||||
ButtonPublish.Text = "正在上传";
|
||||
ProgressBarUpload.Visibility = Visibility.Visible;
|
||||
ProgressBarUpload.Value = 0;
|
||||
if (mod.ItemID == 0)
|
||||
{
|
||||
var result = Editor.NewCommunityFile
|
||||
.WithTitle(mod.Name)
|
||||
.WithDescription(mod.Intro)
|
||||
.WithPublicVisibility()
|
||||
.WithPreviewFile(mod.Path.FullName + @"\icon.png")
|
||||
.WithContent(mod.Path);
|
||||
//foreach (string tag in mod.Content.Trim('\n').Split('\n'))
|
||||
// result.WithTag(tag);
|
||||
var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload));
|
||||
|
||||
if (r.Success)
|
||||
{
|
||||
mod.AuthorID = Steamworks.SteamClient.SteamId.AccountId;
|
||||
mod.ItemID = r.FileId.Value;
|
||||
mod.WriteFile();
|
||||
if (MessageBoxX.Show($"{mod.Name} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑详细介绍和图标?", "MOD上传成功", MessageBoxButton.YesNo, MessageBoxIcon.Success) == MessageBoxResult.Yes)
|
||||
{
|
||||
System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId);
|
||||
}
|
||||
}
|
||||
else
|
||||
MessageBoxX.Show($"{mod.Name} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件\n 如需代上传物品可以联系作者", $"MOD上传失败 {r.Result}");
|
||||
}
|
||||
else if (mod.AuthorID == Steamworks.SteamClient.SteamId.AccountId)
|
||||
{
|
||||
var result = new Editor(new Steamworks.Data.PublishedFileId() { Value = mod.ItemID })
|
||||
.WithTitle(mod.Name)
|
||||
.WithDescription(mod.Intro)
|
||||
.WithPreviewFile(mod.Path.FullName + @"\icon.png")
|
||||
.WithContent(mod.Path);
|
||||
foreach (string tag in mod.Content.Trim('\n').Split('\n'))
|
||||
result.WithTag(tag);
|
||||
var r = await result.SubmitAsync(new ProgressClass(ProgressBarUpload));
|
||||
if (r.Success)
|
||||
{
|
||||
mod.AuthorID = Steamworks.SteamClient.SteamId.AccountId;
|
||||
mod.ItemID = r.FileId.Value;
|
||||
mod.WriteFile();
|
||||
if (MessageBoxX.Show($"{mod.Name} 成功上传至WorkShop服务器\n是否跳转至创意工坊页面进行编辑新内容?", "MOD更新成功", MessageBoxButton.YesNo, MessageBoxIcon.Success) == MessageBoxResult.Yes)
|
||||
System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + r.FileId);
|
||||
}
|
||||
else
|
||||
MessageBoxX.Show($"{mod.Name} 上传至WorkShop服务器失败\n请检查网络后重试\n请注意:上传和下载工坊物品可能需要良好的网络条件", "MOD更新失败", MessageBoxIcon.Error);
|
||||
}
|
||||
ButtonPublish.IsEnabled = true;
|
||||
ButtonPublish.Text = "任务完成";
|
||||
ProgressBarUpload.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
private void ButtonSteam_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
var modname = (string)((ListBoxItem)ListMod.SelectedItem).Content;
|
||||
var mod = mw.CoreMODs.Find(x => x.Name == modname);
|
||||
System.Diagnostics.Process.Start("https://steamcommunity.com/sharedfiles/filedetails/?id=" + mod.ItemID);
|
||||
}
|
||||
|
||||
private void ButtonAllow_Click(object sender, RoutedEventArgs e)
|
||||
@ -113,17 +373,34 @@ namespace VPet_Simulator.Windows.WinDesign
|
||||
|
||||
private void ButtonRestart_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
if (MessageBoxX.Show("是否退出游戏<虚拟桌宠模拟器>?\n请注意保存游戏", "重启游戏", MessageBoxButton.YesNo, MessageBoxIcon.Warning) == MessageBoxResult.Yes)
|
||||
{
|
||||
mw.Close();
|
||||
System.Diagnostics.Process.Start(System.Reflection.Assembly.GetExecutingAssembly().Location);
|
||||
}
|
||||
}
|
||||
|
||||
private void ZoomSlider_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void hyper_moreInfo(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void WindowX_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
mw.Topmost = mw.Set.TopMost;
|
||||
e.Cancel = true;
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void TopMostBox_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mw.Set.TopMost = true;
|
||||
}
|
||||
|
||||
private void TopMostBox_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
mw.Set.TopMost = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user