mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
@@ -127,4 +127,6 @@ internal sealed partial class SettingEntry
|
||||
/// 自定义极验接口
|
||||
/// </summary>
|
||||
public const string GeetestCustomCompositeUrl = "GeetestCustomCompositeUrl";
|
||||
|
||||
public const string RegionType = "RegionType";
|
||||
}
|
||||
|
||||
@@ -2306,6 +2306,12 @@
|
||||
<data name="ViewPageSettingGeetestVerificationHeader" xml:space="preserve">
|
||||
<value>无感验证</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingHomeAnnouncementRegionDescription" xml:space="preserve">
|
||||
<value>选择想要获取公告的游戏服务器</value>
|
||||
</data>
|
||||
<data name="ViewPageSettingHomeAnnouncementRegionHeader" xml:space="preserve">
|
||||
<value>公告所属服务器</value>
|
||||
</data>
|
||||
<data name="ViewpageSettingHomeCardDescription" xml:space="preserve">
|
||||
<value>管理主页仪表板中的卡片</value>
|
||||
</data>
|
||||
|
||||
@@ -6,6 +6,7 @@ using Snap.Hutao.Core.Windowing;
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
@@ -19,6 +20,7 @@ internal sealed partial class AppOptions : DbStoreOptions
|
||||
private bool? isEmptyHistoryWishVisible;
|
||||
private BackdropType? backdropType;
|
||||
private CultureInfo? currentCulture;
|
||||
private RegionType? regionType;
|
||||
private string? geetestCustomCompositeUrl;
|
||||
|
||||
public string PowerShellPath
|
||||
@@ -72,6 +74,14 @@ internal sealed partial class AppOptions : DbStoreOptions
|
||||
set => SetOption(ref currentCulture, SettingEntry.Culture, value, value => value.Name);
|
||||
}
|
||||
|
||||
public List<NameValue<RegionType>> RegionTypes { get; } = CollectionsNameValue.FromEnum<RegionType>();
|
||||
|
||||
public RegionType RegionType
|
||||
{
|
||||
get => GetOption(ref regionType, SettingEntry.RegionType, v => Enum.Parse<RegionType>(v), RegionType.CN_GF01).Value;
|
||||
set => SetOption(ref regionType, SettingEntry.RegionType, value, value => value.ToStringOrEmpty());
|
||||
}
|
||||
|
||||
public string GeetestCustomCompositeUrl
|
||||
{
|
||||
get => GetOption(ref geetestCustomCompositeUrl, SettingEntry.GeetestCustomCompositeUrl);
|
||||
|
||||
@@ -305,6 +305,17 @@
|
||||
</cwc:SettingsCard>
|
||||
</cwc:SettingsExpander.Items>
|
||||
</cwc:SettingsExpander>
|
||||
<cwc:SettingsCard
|
||||
Description="{shcm:ResourceString Name=ViewPageSettingHomeAnnouncementRegionDescription}"
|
||||
Header="{shcm:ResourceString Name=ViewPageSettingHomeAnnouncementRegionHeader}"
|
||||
HeaderIcon="{shcm:FontIcon Glyph=}">
|
||||
<shc:SizeRestrictedContentControl>
|
||||
<ComboBox
|
||||
DisplayMemberPath="Name"
|
||||
ItemsSource="{Binding AppOptions.RegionTypes}"
|
||||
SelectedItem="{Binding SelectedRegionType, Mode=TwoWay}"/>
|
||||
</shc:SizeRestrictedContentControl>
|
||||
</cwc:SettingsCard>
|
||||
|
||||
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" Text="{shcm:ResourceString Name=ViewPageSettingGameHeader}"/>
|
||||
<cwc:SettingsCard
|
||||
|
||||
@@ -23,6 +23,7 @@ using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.Service.User;
|
||||
using Snap.Hutao.View.Dialog;
|
||||
using Snap.Hutao.ViewModel.Guide;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Web.Hutao;
|
||||
using Snap.Hutao.Web.Response;
|
||||
using System.Globalization;
|
||||
@@ -61,6 +62,7 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
|
||||
|
||||
private NameValue<BackdropType>? selectedBackdropType;
|
||||
private NameValue<CultureInfo>? selectedCulture;
|
||||
private NameValue<RegionType>? selectedRegionType;
|
||||
private IPInformation? ipInformation;
|
||||
private FolderViewModel? cacheFolderView;
|
||||
private FolderViewModel? dataFolderView;
|
||||
@@ -104,6 +106,18 @@ internal sealed partial class SettingViewModel : Abstraction.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public NameValue<RegionType>? SelectedRegionType
|
||||
{
|
||||
get => selectedRegionType ??= AppOptions.RegionTypes.Single(t => t.Value == AppOptions.RegionType);
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref selectedRegionType, value) && value is not null)
|
||||
{
|
||||
AppOptions.RegionType = value.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public FolderViewModel? CacheFolderView { get => cacheFolderView; set => SetProperty(ref cacheFolderView, value); }
|
||||
|
||||
public FolderViewModel? DataFolderView { get => dataFolderView; set => SetProperty(ref dataFolderView, value); }
|
||||
|
||||
15
src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/RegionType.cs
Normal file
15
src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/RegionType.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab;
|
||||
|
||||
[HighQuality]
|
||||
internal enum RegionType
|
||||
{
|
||||
CN_GF01 = 1,
|
||||
CN_QD01 = 5,
|
||||
OS_USA = 6,
|
||||
OS_EURO = 7,
|
||||
OS_ASIA = 8,
|
||||
OS_CHT = 9,
|
||||
}
|
||||
Reference in New Issue
Block a user