mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
maybe code style
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab;
|
||||
namespace Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
[HighQuality]
|
||||
internal enum RegionType
|
||||
@@ -355,6 +355,24 @@
|
||||
<data name="ModelIntrinsicItemQualityWhite" xml:space="preserve">
|
||||
<value>一星</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicRegionTypeCnGf01" xml:space="preserve">
|
||||
<value>国服 官方服</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicRegionTypeCnQd01" xml:space="preserve">
|
||||
<value>国服 渠道服</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicRegionTypeOsAsia" xml:space="preserve">
|
||||
<value>国际服 亚服</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicRegionTypeOsCht" xml:space="preserve">
|
||||
<value>国际服 台服</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicRegionTypeOsEuro" xml:space="preserve">
|
||||
<value>国际服 欧服</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicRegionTypeOsUsa" xml:space="preserve">
|
||||
<value>国际服 美服</value>
|
||||
</data>
|
||||
<data name="ModelIntrinsicWeaponTypeBow" xml:space="preserve">
|
||||
<value>弓</value>
|
||||
<comment>Need EXACT same string in game</comment>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
|
||||
|
||||
namespace Snap.Hutao.Service.Abstraction;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
|
||||
using Snap.Hutao.Web.Response;
|
||||
using System.Globalization;
|
||||
|
||||
@@ -5,8 +5,8 @@ using Microsoft.Extensions.Primitives;
|
||||
using Snap.Hutao.Core.Windowing;
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Entity;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Service.Abstraction;
|
||||
using Snap.Hutao.Web.Hoyolab;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
@@ -74,7 +74,7 @@ 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 List<NameValue<RegionType>> RegionTypes { get; } = SupportedRegionTypes.Get();
|
||||
|
||||
public RegionType RegionType
|
||||
{
|
||||
|
||||
41
src/Snap.Hutao/Snap.Hutao/Service/SupportedRegionTypes.cs
Normal file
41
src/Snap.Hutao/Snap.Hutao/Service/SupportedRegionTypes.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
|
||||
namespace Snap.Hutao.Service;
|
||||
|
||||
internal static class SupportedRegionTypes
|
||||
{
|
||||
private static readonly List<NameValue<RegionType>> Cultures =
|
||||
[
|
||||
ToNameValue(RegionType.CN_GF01),
|
||||
ToNameValue(RegionType.CN_QD01),
|
||||
ToNameValue(RegionType.OS_USA),
|
||||
ToNameValue(RegionType.OS_EURO),
|
||||
ToNameValue(RegionType.OS_ASIA),
|
||||
ToNameValue(RegionType.OS_CHT),
|
||||
];
|
||||
|
||||
public static List<NameValue<RegionType>> Get()
|
||||
{
|
||||
return Cultures;
|
||||
}
|
||||
|
||||
private static NameValue<RegionType> ToNameValue(RegionType regionType)
|
||||
{
|
||||
return new(
|
||||
regionType switch
|
||||
{
|
||||
RegionType.CN_GF01 => SH.ModelIntrinsicRegionTypeCnGf01,
|
||||
RegionType.CN_QD01 => SH.ModelIntrinsicRegionTypeCnQd01,
|
||||
RegionType.OS_USA => SH.ModelIntrinsicRegionTypeOsUsa,
|
||||
RegionType.OS_EURO => SH.ModelIntrinsicRegionTypeOsEuro,
|
||||
RegionType.OS_ASIA => SH.ModelIntrinsicRegionTypeOsAsia,
|
||||
RegionType.OS_CHT => SH.ModelIntrinsicRegionTypeOsCht,
|
||||
_ => SH.ModelIntrinsicRegionTypeCnGf01,
|
||||
},
|
||||
regionType);
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ using Snap.Hutao.Core.Windowing.HotKey;
|
||||
using Snap.Hutao.Factory.ContentDialog;
|
||||
using Snap.Hutao.Factory.Picker;
|
||||
using Snap.Hutao.Model;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Service;
|
||||
using Snap.Hutao.Service.GachaLog.QueryProvider;
|
||||
using Snap.Hutao.Service.Game;
|
||||
@@ -23,7 +24,6 @@ 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;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
|
||||
using Snap.Hutao.Model.Intrinsic;
|
||||
using Snap.Hutao.Web.Request.Builder;
|
||||
using Snap.Hutao.Web.Request.Builder.Abstraction;
|
||||
using Snap.Hutao.Web.Response;
|
||||
|
||||
Reference in New Issue
Block a user