-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.cs
More file actions
56 lines (47 loc) · 2.01 KB
/
Copy pathConfiguration.cs
File metadata and controls
56 lines (47 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using Dalamud.Configuration;
using Restocker.Data;
using Restocker.Localization;
namespace Restocker;
[Serializable]
public sealed class Configuration : IPluginConfiguration
{
public int Version { get; set; } = 1;
/// <summary>
/// リテイナーベル(RetainerList addon)が開いている間に MainWindow を自動表示するか。
/// </summary>
public bool AutoOpenOnBell { get; set; } = true;
/// <summary>
/// パッシブ収集したリテイナーごとのスナップショット。
/// キーは <see cref="RetainerSnapshot.Key"/>(CharacterContentId + RetainerId の文字列)。
/// </summary>
public Dictionary<string, RetainerSnapshot> Snapshots { get; set; } = new();
/// <summary>
/// キャラクター側の所持品スナップショット。キーは <see cref="CharacterSnapshot.MakeKey"/>。
/// 新規出品でキャラ側のアイテムも対象にするため。
/// </summary>
public Dictionary<string, CharacterSnapshot> Characters { get; set; } = new();
/// <summary>
/// UI 言語。
/// -1 = FFXIV クライアント言語に従う(ZH/KO はグローバルクライアントから返らないため EN/JA/DE/FR にフォールバック)。
/// 0..5 = <see cref="Language"/> 列挙の値で明示指定。
/// </summary>
public int Language { get; set; } = -1;
public Language ResolveLanguage(Dalamud.Game.ClientLanguage clientLanguage)
{
if (Language >= 0 && Language <= 5)
return (Language)Language;
return clientLanguage switch
{
Dalamud.Game.ClientLanguage.Japanese => Localization.Language.Japanese,
Dalamud.Game.ClientLanguage.German => Localization.Language.German,
Dalamud.Game.ClientLanguage.French => Localization.Language.French,
_ => Localization.Language.English,
};
}
public void Save()
{
Plugin.PluginInterface.SavePluginConfig(this);
}
}