mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
rft: WpfGui重构 拆分一键长草-自动肉鸽 (#11201)
This commit is contained in:
@@ -1446,7 +1446,7 @@ namespace MaaWpfGui.Main
|
||||
case "StageInfo":
|
||||
{
|
||||
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("StartCombat") + subTaskDetails!["name"]);
|
||||
if (Instances.SettingsViewModel.RoguelikeDelayAbortUntilCombatComplete)
|
||||
if (SettingsViewModel.RoguelikeTask.RoguelikeDelayAbortUntilCombatComplete)
|
||||
{
|
||||
Instances.TaskQueueViewModel.RoguelikeInCombatAndShowWait = true;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,11 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
|
||||
#region 长草任务Model
|
||||
|
||||
/// <summary>
|
||||
/// Gets 肉鸽任务Model
|
||||
/// </summary>
|
||||
public static RoguelikeSettingsUserControlModel RoguelikeTask { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets 生稀盐酸任务Model
|
||||
/// </summary>
|
||||
@@ -180,7 +185,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
private void Init()
|
||||
{
|
||||
InitInfrast();
|
||||
InitRoguelike();
|
||||
RoguelikeTask.InitRoguelike();
|
||||
InitConfiguration();
|
||||
InitUiSettings();
|
||||
InitConnectConfig();
|
||||
@@ -242,14 +247,6 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
_dormThresholdLabel = LocalizationHelper.GetString("DormThreshold") + ": " + _dormThreshold + "%";
|
||||
}
|
||||
|
||||
private void InitRoguelike()
|
||||
{
|
||||
UpdateRoguelikeDifficultyList();
|
||||
UpdateRoguelikeModeList();
|
||||
UpdateRoguelikeSquadList();
|
||||
UpdateRoguelikeCoreCharList();
|
||||
}
|
||||
|
||||
private void InitConfiguration()
|
||||
{
|
||||
var configurations = new ObservableCollection<CombinedData>();
|
||||
@@ -888,672 +885,6 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
|
||||
#endregion 基建设置
|
||||
|
||||
#region 肉鸽设置
|
||||
|
||||
private void UpdateRoguelikeDifficultyList()
|
||||
{
|
||||
RoguelikeDifficultyList = [
|
||||
new() { Display = "MAX", Value = int.MaxValue }
|
||||
];
|
||||
|
||||
for (int i = 20; i >= 0; --i)
|
||||
{
|
||||
var value = i.ToString();
|
||||
RoguelikeDifficultyList.Add(new() { Display = value, Value = i });
|
||||
}
|
||||
|
||||
RoguelikeDifficultyList.Add(new() { Display = LocalizationHelper.GetString("Current"), Value = -1 });
|
||||
}
|
||||
|
||||
private void UpdateRoguelikeModeList()
|
||||
{
|
||||
var roguelikeMode = RoguelikeMode;
|
||||
|
||||
RoguelikeModeList =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeStrategyExp"), Value = "0" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeStrategyGold"), Value = "1" },
|
||||
|
||||
// new CombData { Display = "两者兼顾,投资过后退出", Value = "2" } // 弃用
|
||||
// new CombData { Display = Localization.GetString("3"), Value = "3" }, // 开发中
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeStrategyLastReward"), Value = "4" },
|
||||
];
|
||||
|
||||
switch (RoguelikeTheme)
|
||||
{
|
||||
case "Sami":
|
||||
|
||||
RoguelikeModeList.Add(new() { Display = LocalizationHelper.GetString("RoguelikeStrategyCollapse"), Value = "5" });
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
RoguelikeMode = RoguelikeModeList.Any(x => x.Value == roguelikeMode) ? roguelikeMode : "0";
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, List<(string Key, string Value)>> _squadDictionary = new()
|
||||
{
|
||||
["Phantom_Default"] =
|
||||
[
|
||||
("ResearchSquad", "研究分队"),
|
||||
],
|
||||
["Mizuki_Default"] =
|
||||
[
|
||||
("IS2NewSquad1", "心胜于物分队"),
|
||||
("IS2NewSquad2", "物尽其用分队"),
|
||||
("IS2NewSquad3", "以人为本分队"),
|
||||
("ResearchSquad", "研究分队"),
|
||||
],
|
||||
["Sami_Default"] =
|
||||
[
|
||||
("IS3NewSquad1", "永恒狩猎分队"),
|
||||
("IS3NewSquad2", "生活至上分队"),
|
||||
("IS3NewSquad3", "科学主义分队"),
|
||||
("IS3NewSquad4", "特训分队"),
|
||||
],
|
||||
["Sarkaz_1"] =
|
||||
[
|
||||
("IS4NewSquad2", "博闻广记分队"),
|
||||
("IS4NewSquad3", "蓝图测绘分队"),
|
||||
("IS4NewSquad6", "点刺成锭分队"),
|
||||
("IS4NewSquad7", "拟态学者分队"),
|
||||
],
|
||||
["Sarkaz_Default"] =
|
||||
[
|
||||
("IS4NewSquad1", "魂灵护送分队"),
|
||||
("IS4NewSquad2", "博闻广记分队"),
|
||||
("IS4NewSquad3", "蓝图测绘分队"),
|
||||
("IS4NewSquad4", "因地制宜分队"),
|
||||
("IS4NewSquad5", "异想天开分队"),
|
||||
("IS4NewSquad6", "点刺成锭分队"),
|
||||
("IS4NewSquad7", "拟态学者分队"),
|
||||
],
|
||||
};
|
||||
|
||||
// 通用分队
|
||||
private readonly List<(string Key, string Value)> _commonSquads =
|
||||
[
|
||||
("LeaderSquad", "指挥分队"),
|
||||
("GatheringSquad", "集群分队"),
|
||||
("SupportSquad", "后勤分队"),
|
||||
("SpearheadSquad", "矛头分队"),
|
||||
("TacticalAssaultOperative", "突击战术分队"),
|
||||
("TacticalFortificationOperative", "堡垒战术分队"),
|
||||
("TacticalRangedOperative", "远程战术分队"),
|
||||
("TacticalDestructionOperative", "破坏战术分队"),
|
||||
("First-ClassSquad", "高规格分队"),
|
||||
];
|
||||
|
||||
private void UpdateRoguelikeSquadList()
|
||||
{
|
||||
var roguelikeSquad = RoguelikeSquad;
|
||||
RoguelikeSquadList =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("DefaultSquad"), Value = string.Empty }
|
||||
];
|
||||
|
||||
// 优先匹配 Theme_Mode,其次匹配 Theme_Default
|
||||
string themeKey = $"{RoguelikeTheme}_{RoguelikeMode}";
|
||||
if (!_squadDictionary.ContainsKey(themeKey))
|
||||
{
|
||||
themeKey = $"{RoguelikeTheme}_Default";
|
||||
}
|
||||
|
||||
// 添加主题分队
|
||||
if (_squadDictionary.TryGetValue(themeKey, out var squads))
|
||||
{
|
||||
foreach (var (key, value) in squads)
|
||||
{
|
||||
RoguelikeSquadList.Add(new() { Display = LocalizationHelper.GetString(key), Value = value });
|
||||
}
|
||||
}
|
||||
|
||||
// 添加通用分队
|
||||
foreach (var (key, value) in _commonSquads)
|
||||
{
|
||||
RoguelikeSquadList.Add(new() { Display = LocalizationHelper.GetString(key), Value = value });
|
||||
}
|
||||
|
||||
// 选择当前分队
|
||||
RoguelikeSquad = RoguelikeSquadList.Any(x => x.Value == roguelikeSquad) ? roguelikeSquad : string.Empty;
|
||||
}
|
||||
|
||||
private void UpdateRoguelikeCoreCharList()
|
||||
{
|
||||
var filePath = $"resource/roguelike/{RoguelikeTheme}/recruitment.json";
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
RoguelikeCoreCharList.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
var jsonStr = File.ReadAllText(filePath);
|
||||
var json = (JObject?)JsonConvert.DeserializeObject(jsonStr);
|
||||
|
||||
var roguelikeCoreCharList = new ObservableCollection<string>();
|
||||
|
||||
if (json?["priority"] is JArray priorityArray)
|
||||
{
|
||||
foreach (var priorityItem in priorityArray)
|
||||
{
|
||||
if (priorityItem?["opers"] is not JArray opersArray)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var operItem in opersArray)
|
||||
{
|
||||
var isStart = (bool?)operItem["is_start"] ?? false;
|
||||
if (!isStart)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var name = (string?)operItem["name"];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var localizedName = DataHelper.GetLocalizedCharacterName(name, GuiSettings.OperNameLocalization);
|
||||
if (!string.IsNullOrEmpty(localizedName) && !(GameSettings.ClientType.Contains("YoStar") && DataHelper.GetLocalizedCharacterName(name, "en-us") == DataHelper.GetLocalizedCharacterName(name, "zh-cn")))
|
||||
{
|
||||
roguelikeCoreCharList.Add(localizedName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RoguelikeCoreCharList = roguelikeCoreCharList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of roguelike lists.
|
||||
/// </summary>
|
||||
public List<CombinedData> RoguelikeThemeList { get; } =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemePhantom"), Value = "Phantom" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemeMizuki"), Value = "Mizuki" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemeSami"), Value = "Sami" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemeSarkaz"), Value = "Sarkaz" },
|
||||
];
|
||||
|
||||
private ObservableCollection<GenericCombinedData<int>> _roguelikeDifficultyList = [];
|
||||
|
||||
public ObservableCollection<GenericCombinedData<int>> RoguelikeDifficultyList
|
||||
{
|
||||
get => _roguelikeDifficultyList;
|
||||
set => SetAndNotify(ref _roguelikeDifficultyList, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<CombinedData> _roguelikeModeList = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of roguelike modes.
|
||||
/// </summary>
|
||||
public ObservableCollection<CombinedData> RoguelikeModeList
|
||||
{
|
||||
get => _roguelikeModeList;
|
||||
set => SetAndNotify(ref _roguelikeModeList, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<CombinedData> _roguelikeSquadList = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of roguelike squad.
|
||||
/// </summary>
|
||||
public ObservableCollection<CombinedData> RoguelikeSquadList
|
||||
{
|
||||
get => _roguelikeSquadList;
|
||||
set => SetAndNotify(ref _roguelikeSquadList, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of roguelike roles.
|
||||
/// </summary>
|
||||
public List<CombinedData> RoguelikeRolesList { get; } =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("DefaultRoles"), Value = string.Empty },
|
||||
new() { Display = LocalizationHelper.GetString("FirstMoveAdvantage"), Value = "先手必胜" },
|
||||
new() { Display = LocalizationHelper.GetString("SlowAndSteadyWinsTheRace"), Value = "稳扎稳打" },
|
||||
new() { Display = LocalizationHelper.GetString("OvercomingYourWeaknesses"), Value = "取长补短" },
|
||||
new() { Display = LocalizationHelper.GetString("AsYourHeartDesires"), Value = "随心所欲" },
|
||||
];
|
||||
|
||||
// public List<CombData> RoguelikeCoreCharList { get; set; }
|
||||
private string _roguelikeTheme = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeTheme, "Sarkaz");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Roguelike theme.
|
||||
/// </summary>
|
||||
public string RoguelikeTheme
|
||||
{
|
||||
get => _roguelikeTheme;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeTheme, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeTheme, value);
|
||||
|
||||
UpdateRoguelikeModeList();
|
||||
UpdateRoguelikeSquadList();
|
||||
UpdateRoguelikeCoreCharList();
|
||||
}
|
||||
}
|
||||
|
||||
private int _roguelikeDifficulty = Convert.ToInt32(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeDifficulty, int.MaxValue.ToString()));
|
||||
|
||||
public int RoguelikeDifficulty
|
||||
{
|
||||
get => _roguelikeDifficulty;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeDifficulty, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeDifficulty, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeMode = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeMode, "0");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets 策略,往后打 / 刷一层就退 / 烧热水
|
||||
/// </summary>
|
||||
public string RoguelikeMode
|
||||
{
|
||||
get => _roguelikeMode;
|
||||
set
|
||||
{
|
||||
if (value == "1")
|
||||
{
|
||||
RoguelikeInvestmentEnabled = true;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeMode, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeMode, value);
|
||||
|
||||
UpdateRoguelikeSquadList();
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeSquad = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeSquad, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the roguelike squad.
|
||||
/// </summary>
|
||||
public string RoguelikeSquad
|
||||
{
|
||||
get => _roguelikeSquad;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeSquad, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeSquad, value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool RoguelikeSquadIsProfessional =>
|
||||
RoguelikeMode == "4" &&
|
||||
RoguelikeTheme != "Phantom" &&
|
||||
RoguelikeSquad is "突击战术分队" or "堡垒战术分队" or "远程战术分队" or "破坏战术分队";
|
||||
|
||||
public bool RoguelikeSquadIsFoldartal =>
|
||||
RoguelikeMode == "4" &&
|
||||
RoguelikeTheme == "Sami" &&
|
||||
RoguelikeSquad == "生活至上分队";
|
||||
|
||||
private string _roguelikeRoles = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeRoles, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the roguelike roles.
|
||||
/// </summary>
|
||||
public string RoguelikeRoles
|
||||
{
|
||||
get => _roguelikeRoles;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeRoles, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeRoles, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeCoreChar = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeCoreChar, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the roguelike core character.
|
||||
/// </summary>
|
||||
public string RoguelikeCoreChar
|
||||
{
|
||||
get => _roguelikeCoreChar;
|
||||
set
|
||||
{
|
||||
if (_roguelikeCoreChar == (value ??= string.Empty))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeCoreChar, value);
|
||||
Instances.TaskQueueViewModel.AddLog(value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeCoreChar, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<string> _roguelikeCoreCharList = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the roguelike core character.
|
||||
/// </summary>
|
||||
public ObservableCollection<string> RoguelikeCoreCharList
|
||||
{
|
||||
get => _roguelikeCoreCharList;
|
||||
private set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(RoguelikeCoreChar) && !value.Contains(RoguelikeCoreChar))
|
||||
{
|
||||
value.Add(RoguelikeCoreChar);
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeCoreCharList, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeStartWithEliteTwo = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStartWithEliteTwo, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool RoguelikeStartWithEliteTwoRaw
|
||||
{
|
||||
get => _roguelikeStartWithEliteTwo;
|
||||
set
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case true when RoguelikeUseSupportUnit:
|
||||
RoguelikeUseSupportUnit = false;
|
||||
break;
|
||||
|
||||
case false when RoguelikeOnlyStartWithEliteTwoRaw:
|
||||
RoguelikeOnlyStartWithEliteTwoRaw = false;
|
||||
break;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeStartWithEliteTwo, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStartWithEliteTwo, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool RoguelikeStartWithEliteTwo => _roguelikeStartWithEliteTwo && RoguelikeSquadIsProfessional;
|
||||
|
||||
private bool _roguelikeOnlyStartWithEliteTwo = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeOnlyStartWithEliteTwo, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether only need with elite two's core char.
|
||||
/// </summary>
|
||||
public bool RoguelikeOnlyStartWithEliteTwoRaw
|
||||
{
|
||||
get => _roguelikeOnlyStartWithEliteTwo;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeOnlyStartWithEliteTwo, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeOnlyStartWithEliteTwo, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether only need with elite two's core char.
|
||||
/// </summary>
|
||||
public bool RoguelikeOnlyStartWithEliteTwo => _roguelikeOnlyStartWithEliteTwo && RoguelikeStartWithEliteTwo;
|
||||
|
||||
private bool _roguelike3FirstFloorFoldartal = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3FirstFloorFoldartal, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3FirstFloorFoldartalRaw
|
||||
{
|
||||
get => _roguelike3FirstFloorFoldartal;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3FirstFloorFoldartal, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3FirstFloorFoldartal, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3FirstFloorFoldartal => _roguelike3FirstFloorFoldartal && RoguelikeMode == "4" && RoguelikeTheme == "Sami";
|
||||
|
||||
private string _roguelike3StartFloorFoldartal = ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3StartFloorFoldartal, string.Empty);
|
||||
|
||||
public string Roguelike3StartFloorFoldartal
|
||||
{
|
||||
get => _roguelike3StartFloorFoldartal;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3StartFloorFoldartal, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3StartFloorFoldartal, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelike3NewSquad2StartingFoldartal = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartal, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3NewSquad2StartingFoldartalRaw
|
||||
{
|
||||
get => _roguelike3NewSquad2StartingFoldartal;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3NewSquad2StartingFoldartal, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartal, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3NewSquad2StartingFoldartal => _roguelike3NewSquad2StartingFoldartal && RoguelikeSquadIsFoldartal;
|
||||
|
||||
private string _roguelike3NewSquad2StartingFoldartals = ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartals, string.Empty);
|
||||
|
||||
public string Roguelike3NewSquad2StartingFoldartals
|
||||
{
|
||||
get => _roguelike3NewSquad2StartingFoldartals;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3NewSquad2StartingFoldartals, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartals, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeExpectedCollapsalParadigms = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeExpectedCollapsalParadigms, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the expected collapsal paradigms.
|
||||
/// 需要刷的坍缩列表,分号分隔
|
||||
/// </summary>
|
||||
public string RoguelikeExpectedCollapsalParadigms
|
||||
{
|
||||
get => _roguelikeExpectedCollapsalParadigms;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeExpectedCollapsalParadigms, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeExpectedCollapsalParadigms, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeUseSupportUnit = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeUseSupportUnit, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use support unit.
|
||||
/// </summary>
|
||||
public bool RoguelikeUseSupportUnit
|
||||
{
|
||||
get => _roguelikeUseSupportUnit;
|
||||
set
|
||||
{
|
||||
if (value && RoguelikeStartWithEliteTwo)
|
||||
{
|
||||
RoguelikeStartWithEliteTwoRaw = false;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeUseSupportUnit, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeUseSupportUnit, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeEnableNonfriendSupport = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeEnableNonfriendSupport, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether can roguelike support unit belong to nonfriend
|
||||
/// </summary>
|
||||
public bool RoguelikeEnableNonfriendSupport
|
||||
{
|
||||
get => _roguelikeEnableNonfriendSupport;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeEnableNonfriendSupport, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeEnableNonfriendSupport, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeDelayAbortUntilCombatComplete = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeDelayAbortUntilCombatComplete, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether delay abort until battle complete
|
||||
/// </summary>
|
||||
public bool RoguelikeDelayAbortUntilCombatComplete
|
||||
{
|
||||
get => _roguelikeDelayAbortUntilCombatComplete;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeDelayAbortUntilCombatComplete, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeDelayAbortUntilCombatComplete, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeStartsCount = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStartsCount, "9999999");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the start count of roguelike.
|
||||
/// </summary>
|
||||
public int RoguelikeStartsCount
|
||||
{
|
||||
get => int.Parse(_roguelikeStartsCount);
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeStartsCount, value.ToString());
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStartsCount, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeInvestmentEnabled = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestmentEnabled, bool.TrueString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether investment is enabled.
|
||||
/// </summary>
|
||||
public bool RoguelikeInvestmentEnabled
|
||||
{
|
||||
get => _roguelikeInvestmentEnabled;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeInvestmentEnabled, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestmentEnabled, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeInvestmentWithMoreScore = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether investment is enabled.
|
||||
/// </summary>
|
||||
public bool RoguelikeInvestmentWithMoreScoreRaw
|
||||
{
|
||||
get => _roguelikeInvestmentWithMoreScore;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeInvestmentWithMoreScore, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether investment is enabled.
|
||||
/// </summary>
|
||||
public bool RoguelikeInvestmentWithMoreScore => _roguelikeInvestmentWithMoreScore && RoguelikeMode == "1";
|
||||
|
||||
private bool _roguelikeRefreshTraderWithDice = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeRefreshTraderWithDice, bool.FalseString));
|
||||
|
||||
public bool RoguelikeRefreshTraderWithDiceRaw
|
||||
{
|
||||
get => _roguelikeRefreshTraderWithDice;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeRefreshTraderWithDice, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeRefreshTraderWithDice, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public bool RoguelikeRefreshTraderWithDice
|
||||
{
|
||||
get => _roguelikeRefreshTraderWithDice && RoguelikeTheme == "Mizuki";
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeRefreshTraderWithDice, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeRefreshTraderWithDice, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeInvestsCount = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestsCount, "9999999");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the invests count of roguelike.
|
||||
/// </summary>
|
||||
public int RoguelikeInvestsCount
|
||||
{
|
||||
get => int.Parse(_roguelikeInvestsCount);
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeInvestsCount, value.ToString());
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestsCount, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeStopWhenInvestmentFull = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStopWhenInvestmentFull, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to stop when investment is full.
|
||||
/// </summary>
|
||||
public bool RoguelikeStopWhenInvestmentFull
|
||||
{
|
||||
get => _roguelikeStopWhenInvestmentFull;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeStopWhenInvestmentFull, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStopWhenInvestmentFull, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeStopAtFinalBoss = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStopAtFinalBoss, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to stop when investment is full.
|
||||
/// </summary>
|
||||
public bool RoguelikeStopAtFinalBoss
|
||||
{
|
||||
get => _roguelikeStopAtFinalBoss;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeStopAtFinalBoss, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStopAtFinalBoss, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#endregion 肉鸽设置
|
||||
|
||||
#region 信用相关设置
|
||||
|
||||
private string _lastCreditFightTaskTime = ConfigurationHelper.GetValue(ConfigurationKeys.LastCreditFightTaskTime, DateTime.UtcNow.ToYjDate().AddDays(-1).ToFormattedString());
|
||||
|
||||
@@ -1368,7 +1368,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
{
|
||||
Waiting = true;
|
||||
AddLog(LocalizationHelper.GetString("Waiting"));
|
||||
if (Instances.SettingsViewModel.RoguelikeDelayAbortUntilCombatComplete)
|
||||
if (SettingsViewModel.RoguelikeTask.RoguelikeDelayAbortUntilCombatComplete)
|
||||
{
|
||||
await WaitUntilRoguelikeCombatComplete();
|
||||
|
||||
@@ -1385,7 +1385,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
private async Task WaitUntilRoguelikeCombatComplete()
|
||||
{
|
||||
int time = 0;
|
||||
while (Instances.SettingsViewModel.RoguelikeDelayAbortUntilCombatComplete && RoguelikeInCombatAndShowWait && time < 600 && !Stopping)
|
||||
while (SettingsViewModel.RoguelikeTask.RoguelikeDelayAbortUntilCombatComplete && RoguelikeInCombatAndShowWait && time < 600 && !Stopping)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
++time;
|
||||
@@ -1760,31 +1760,31 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
|
||||
private static bool AppendRoguelike()
|
||||
{
|
||||
_ = int.TryParse(Instances.SettingsViewModel.RoguelikeMode, out var mode);
|
||||
_ = int.TryParse(SettingsViewModel.RoguelikeTask.RoguelikeMode, out var mode);
|
||||
|
||||
return Instances.AsstProxy.AsstAppendRoguelike(
|
||||
mode,
|
||||
Instances.SettingsViewModel.RoguelikeDifficulty,
|
||||
Instances.SettingsViewModel.RoguelikeStartsCount,
|
||||
Instances.SettingsViewModel.RoguelikeInvestmentEnabled,
|
||||
Instances.SettingsViewModel.RoguelikeInvestmentWithMoreScore,
|
||||
Instances.SettingsViewModel.RoguelikeInvestsCount,
|
||||
Instances.SettingsViewModel.RoguelikeStopWhenInvestmentFull,
|
||||
Instances.SettingsViewModel.RoguelikeSquad,
|
||||
Instances.SettingsViewModel.RoguelikeRoles,
|
||||
DataHelper.GetCharacterByNameOrAlias(Instances.SettingsViewModel.RoguelikeCoreChar)?.Name ?? Instances.SettingsViewModel.RoguelikeCoreChar,
|
||||
Instances.SettingsViewModel.RoguelikeStartWithEliteTwo,
|
||||
Instances.SettingsViewModel.RoguelikeOnlyStartWithEliteTwo,
|
||||
Instances.SettingsViewModel.Roguelike3FirstFloorFoldartal,
|
||||
Instances.SettingsViewModel.Roguelike3StartFloorFoldartal,
|
||||
Instances.SettingsViewModel.Roguelike3NewSquad2StartingFoldartal,
|
||||
Instances.SettingsViewModel.Roguelike3NewSquad2StartingFoldartals,
|
||||
Instances.SettingsViewModel.RoguelikeExpectedCollapsalParadigms,
|
||||
Instances.SettingsViewModel.RoguelikeUseSupportUnit,
|
||||
Instances.SettingsViewModel.RoguelikeEnableNonfriendSupport,
|
||||
Instances.SettingsViewModel.RoguelikeTheme,
|
||||
Instances.SettingsViewModel.RoguelikeRefreshTraderWithDice,
|
||||
Instances.SettingsViewModel.RoguelikeStopAtFinalBoss);
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeDifficulty,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeStartsCount,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeInvestmentEnabled,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeInvestmentWithMoreScore,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeInvestsCount,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeStopWhenInvestmentFull,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeSquad,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeRoles,
|
||||
DataHelper.GetCharacterByNameOrAlias(SettingsViewModel.RoguelikeTask.RoguelikeCoreChar)?.Name ?? SettingsViewModel.RoguelikeTask.RoguelikeCoreChar,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeStartWithEliteTwo,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeOnlyStartWithEliteTwo,
|
||||
SettingsViewModel.RoguelikeTask.Roguelike3FirstFloorFoldartal,
|
||||
SettingsViewModel.RoguelikeTask.Roguelike3StartFloorFoldartal,
|
||||
SettingsViewModel.RoguelikeTask.Roguelike3NewSquad2StartingFoldartal,
|
||||
SettingsViewModel.RoguelikeTask.Roguelike3NewSquad2StartingFoldartals,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeExpectedCollapsalParadigms,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeUseSupportUnit,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeEnableNonfriendSupport,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeTheme,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeRefreshTraderWithDice,
|
||||
SettingsViewModel.RoguelikeTask.RoguelikeStopAtFinalBoss);
|
||||
}
|
||||
|
||||
private static bool AppendReclamation()
|
||||
|
||||
@@ -0,0 +1,702 @@
|
||||
// <copyright file="RoguelikeSettingsUserControlModel.cs" company="MaaAssistantArknights">
|
||||
// MaaWpfGui - A part of the MaaCoreArknights project
|
||||
// Copyright (C) 2021 MistEO and Contributors
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License v3.0 only as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY
|
||||
// </copyright>
|
||||
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MaaWpfGui.Constants;
|
||||
using MaaWpfGui.Helper;
|
||||
using MaaWpfGui.Utilities.ValueType;
|
||||
using MaaWpfGui.ViewModels.UI;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Stylet;
|
||||
|
||||
namespace MaaWpfGui.ViewModels.UserControl.TaskQueue;
|
||||
|
||||
public class RoguelikeSettingsUserControlModel : PropertyChangedBase
|
||||
{
|
||||
public void InitRoguelike()
|
||||
{
|
||||
UpdateRoguelikeDifficultyList();
|
||||
UpdateRoguelikeModeList();
|
||||
UpdateRoguelikeSquadList();
|
||||
|
||||
UpdateRoguelikeCoreCharList();
|
||||
}
|
||||
|
||||
private void UpdateRoguelikeDifficultyList()
|
||||
{
|
||||
RoguelikeDifficultyList = [
|
||||
new() { Display = "MAX", Value = int.MaxValue }
|
||||
];
|
||||
|
||||
for (int i = 20; i >= 0; --i)
|
||||
{
|
||||
var value = i.ToString();
|
||||
RoguelikeDifficultyList.Add(new() { Display = value, Value = i });
|
||||
}
|
||||
|
||||
RoguelikeDifficultyList.Add(new() { Display = LocalizationHelper.GetString("Current"), Value = -1 });
|
||||
}
|
||||
|
||||
private void UpdateRoguelikeModeList()
|
||||
{
|
||||
var roguelikeMode = RoguelikeMode;
|
||||
|
||||
RoguelikeModeList =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeStrategyExp"), Value = "0" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeStrategyGold"), Value = "1" },
|
||||
|
||||
// new CombData { Display = "两者兼顾,投资过后退出", Value = "2" } // 弃用
|
||||
// new CombData { Display = Localization.GetString("3"), Value = "3" }, // 开发中
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeStrategyLastReward"), Value = "4" },
|
||||
];
|
||||
|
||||
switch (RoguelikeTheme)
|
||||
{
|
||||
case "Sami":
|
||||
|
||||
RoguelikeModeList.Add(new() { Display = LocalizationHelper.GetString("RoguelikeStrategyCollapse"), Value = "5" });
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
RoguelikeMode = RoguelikeModeList.Any(x => x.Value == roguelikeMode) ? roguelikeMode : "0";
|
||||
}
|
||||
|
||||
private readonly Dictionary<string, List<(string Key, string Value)>> _squadDictionary = new()
|
||||
{
|
||||
["Phantom_Default"] =
|
||||
[
|
||||
("ResearchSquad", "研究分队"),
|
||||
],
|
||||
["Mizuki_Default"] =
|
||||
[
|
||||
("IS2NewSquad1", "心胜于物分队"),
|
||||
("IS2NewSquad2", "物尽其用分队"),
|
||||
("IS2NewSquad3", "以人为本分队"),
|
||||
("ResearchSquad", "研究分队"),
|
||||
],
|
||||
["Sami_Default"] =
|
||||
[
|
||||
("IS3NewSquad1", "永恒狩猎分队"),
|
||||
("IS3NewSquad2", "生活至上分队"),
|
||||
("IS3NewSquad3", "科学主义分队"),
|
||||
("IS3NewSquad4", "特训分队"),
|
||||
],
|
||||
["Sarkaz_1"] =
|
||||
[
|
||||
("IS4NewSquad2", "博闻广记分队"),
|
||||
("IS4NewSquad3", "蓝图测绘分队"),
|
||||
("IS4NewSquad6", "点刺成锭分队"),
|
||||
("IS4NewSquad7", "拟态学者分队"),
|
||||
],
|
||||
["Sarkaz_Default"] =
|
||||
[
|
||||
("IS4NewSquad1", "魂灵护送分队"),
|
||||
("IS4NewSquad2", "博闻广记分队"),
|
||||
("IS4NewSquad3", "蓝图测绘分队"),
|
||||
("IS4NewSquad4", "因地制宜分队"),
|
||||
("IS4NewSquad5", "异想天开分队"),
|
||||
("IS4NewSquad6", "点刺成锭分队"),
|
||||
("IS4NewSquad7", "拟态学者分队"),
|
||||
],
|
||||
};
|
||||
|
||||
// 通用分队
|
||||
private readonly List<(string Key, string Value)> _commonSquads =
|
||||
[
|
||||
("LeaderSquad", "指挥分队"),
|
||||
("GatheringSquad", "集群分队"),
|
||||
("SupportSquad", "后勤分队"),
|
||||
("SpearheadSquad", "矛头分队"),
|
||||
("TacticalAssaultOperative", "突击战术分队"),
|
||||
("TacticalFortificationOperative", "堡垒战术分队"),
|
||||
("TacticalRangedOperative", "远程战术分队"),
|
||||
("TacticalDestructionOperative", "破坏战术分队"),
|
||||
("First-ClassSquad", "高规格分队"),
|
||||
];
|
||||
|
||||
private void UpdateRoguelikeSquadList()
|
||||
{
|
||||
var roguelikeSquad = RoguelikeSquad;
|
||||
RoguelikeSquadList =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("DefaultSquad"), Value = string.Empty }
|
||||
];
|
||||
|
||||
// 优先匹配 Theme_Mode,其次匹配 Theme_Default
|
||||
string themeKey = $"{RoguelikeTheme}_{RoguelikeMode}";
|
||||
if (!_squadDictionary.ContainsKey(themeKey))
|
||||
{
|
||||
themeKey = $"{RoguelikeTheme}_Default";
|
||||
}
|
||||
|
||||
// 添加主题分队
|
||||
if (_squadDictionary.TryGetValue(themeKey, out var squads))
|
||||
{
|
||||
foreach (var (key, value) in squads)
|
||||
{
|
||||
RoguelikeSquadList.Add(new() { Display = LocalizationHelper.GetString(key), Value = value });
|
||||
}
|
||||
}
|
||||
|
||||
// 添加通用分队
|
||||
foreach (var (key, value) in _commonSquads)
|
||||
{
|
||||
RoguelikeSquadList.Add(new() { Display = LocalizationHelper.GetString(key), Value = value });
|
||||
}
|
||||
|
||||
// 选择当前分队
|
||||
RoguelikeSquad = RoguelikeSquadList.Any(x => x.Value == roguelikeSquad) ? roguelikeSquad : string.Empty;
|
||||
}
|
||||
|
||||
private void UpdateRoguelikeCoreCharList()
|
||||
{
|
||||
var filePath = $"resource/roguelike/{RoguelikeTheme}/recruitment.json";
|
||||
if (!File.Exists(filePath))
|
||||
{
|
||||
RoguelikeCoreCharList.Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
var jsonStr = File.ReadAllText(filePath);
|
||||
var json = (JObject?)JsonConvert.DeserializeObject(jsonStr);
|
||||
|
||||
var roguelikeCoreCharList = new ObservableCollection<string>();
|
||||
|
||||
if (json?["priority"] is JArray priorityArray)
|
||||
{
|
||||
foreach (var priorityItem in priorityArray)
|
||||
{
|
||||
if (priorityItem?["opers"] is not JArray opersArray)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var operItem in opersArray)
|
||||
{
|
||||
var isStart = (bool?)operItem["is_start"] ?? false;
|
||||
if (!isStart)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var name = (string?)operItem["name"];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var localizedName = DataHelper.GetLocalizedCharacterName(name, SettingsViewModel.GuiSettings.OperNameLocalization);
|
||||
if (!string.IsNullOrEmpty(localizedName) && !(SettingsViewModel.GameSettings.ClientType.Contains("YoStar") && DataHelper.GetLocalizedCharacterName(name, "en-us") == DataHelper.GetLocalizedCharacterName(name, "zh-cn")))
|
||||
{
|
||||
roguelikeCoreCharList.Add(localizedName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RoguelikeCoreCharList = roguelikeCoreCharList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of roguelike lists.
|
||||
/// </summary>
|
||||
public List<CombinedData> RoguelikeThemeList { get; } =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemePhantom"), Value = "Phantom" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemeMizuki"), Value = "Mizuki" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemeSami"), Value = "Sami" },
|
||||
new() { Display = LocalizationHelper.GetString("RoguelikeThemeSarkaz"), Value = "Sarkaz" },
|
||||
];
|
||||
|
||||
private ObservableCollection<GenericCombinedData<int>> _roguelikeDifficultyList = [];
|
||||
|
||||
public ObservableCollection<GenericCombinedData<int>> RoguelikeDifficultyList
|
||||
{
|
||||
get => _roguelikeDifficultyList;
|
||||
set => SetAndNotify(ref _roguelikeDifficultyList, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<CombinedData> _roguelikeModeList = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of roguelike modes.
|
||||
/// </summary>
|
||||
public ObservableCollection<CombinedData> RoguelikeModeList
|
||||
{
|
||||
get => _roguelikeModeList;
|
||||
set => SetAndNotify(ref _roguelikeModeList, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<CombinedData> _roguelikeSquadList = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the list of roguelike squad.
|
||||
/// </summary>
|
||||
public ObservableCollection<CombinedData> RoguelikeSquadList
|
||||
{
|
||||
get => _roguelikeSquadList;
|
||||
set => SetAndNotify(ref _roguelikeSquadList, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of roguelike roles.
|
||||
/// </summary>
|
||||
public List<CombinedData> RoguelikeRolesList { get; } =
|
||||
[
|
||||
new() { Display = LocalizationHelper.GetString("DefaultRoles"), Value = string.Empty },
|
||||
new() { Display = LocalizationHelper.GetString("FirstMoveAdvantage"), Value = "先手必胜" },
|
||||
new() { Display = LocalizationHelper.GetString("SlowAndSteadyWinsTheRace"), Value = "稳扎稳打" },
|
||||
new() { Display = LocalizationHelper.GetString("OvercomingYourWeaknesses"), Value = "取长补短" },
|
||||
new() { Display = LocalizationHelper.GetString("AsYourHeartDesires"), Value = "随心所欲" },
|
||||
];
|
||||
|
||||
// public List<CombData> RoguelikeCoreCharList { get; set; }
|
||||
private string _roguelikeTheme = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeTheme, "Sarkaz");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Roguelike theme.
|
||||
/// </summary>
|
||||
public string RoguelikeTheme
|
||||
{
|
||||
get => _roguelikeTheme;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeTheme, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeTheme, value);
|
||||
|
||||
UpdateRoguelikeModeList();
|
||||
UpdateRoguelikeSquadList();
|
||||
UpdateRoguelikeCoreCharList();
|
||||
}
|
||||
}
|
||||
|
||||
private int _roguelikeDifficulty = Convert.ToInt32(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeDifficulty, int.MaxValue.ToString()));
|
||||
|
||||
public int RoguelikeDifficulty
|
||||
{
|
||||
get => _roguelikeDifficulty;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeDifficulty, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeDifficulty, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeMode = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeMode, "0");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets 策略,往后打 / 刷一层就退 / 烧热水
|
||||
/// </summary>
|
||||
public string RoguelikeMode
|
||||
{
|
||||
get => _roguelikeMode;
|
||||
set
|
||||
{
|
||||
if (value == "1")
|
||||
{
|
||||
RoguelikeInvestmentEnabled = true;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeMode, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeMode, value);
|
||||
|
||||
UpdateRoguelikeSquadList();
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeSquad = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeSquad, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the roguelike squad.
|
||||
/// </summary>
|
||||
public string RoguelikeSquad
|
||||
{
|
||||
get => _roguelikeSquad;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeSquad, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeSquad, value);
|
||||
}
|
||||
}
|
||||
|
||||
public bool RoguelikeSquadIsProfessional =>
|
||||
RoguelikeMode == "4" &&
|
||||
RoguelikeTheme != "Phantom" &&
|
||||
RoguelikeSquad is "突击战术分队" or "堡垒战术分队" or "远程战术分队" or "破坏战术分队";
|
||||
|
||||
public bool RoguelikeSquadIsFoldartal =>
|
||||
RoguelikeMode == "4" &&
|
||||
RoguelikeTheme == "Sami" &&
|
||||
RoguelikeSquad == "生活至上分队";
|
||||
|
||||
private string _roguelikeRoles = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeRoles, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the roguelike roles.
|
||||
/// </summary>
|
||||
public string RoguelikeRoles
|
||||
{
|
||||
get => _roguelikeRoles;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeRoles, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeRoles, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeCoreChar = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeCoreChar, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the roguelike core character.
|
||||
/// </summary>
|
||||
public string RoguelikeCoreChar
|
||||
{
|
||||
get => _roguelikeCoreChar;
|
||||
set
|
||||
{
|
||||
if (_roguelikeCoreChar == (value ??= string.Empty))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeCoreChar, value);
|
||||
Instances.TaskQueueViewModel.AddLog(value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeCoreChar, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<string> _roguelikeCoreCharList = [];
|
||||
|
||||
/// <summary>
|
||||
/// Gets the roguelike core character.
|
||||
/// </summary>
|
||||
public ObservableCollection<string> RoguelikeCoreCharList
|
||||
{
|
||||
get => _roguelikeCoreCharList;
|
||||
private set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(RoguelikeCoreChar) && !value.Contains(RoguelikeCoreChar))
|
||||
{
|
||||
value.Add(RoguelikeCoreChar);
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeCoreCharList, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeStartWithEliteTwo = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStartWithEliteTwo, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool RoguelikeStartWithEliteTwoRaw
|
||||
{
|
||||
get => _roguelikeStartWithEliteTwo;
|
||||
set
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case true when RoguelikeUseSupportUnit:
|
||||
RoguelikeUseSupportUnit = false;
|
||||
break;
|
||||
|
||||
case false when RoguelikeOnlyStartWithEliteTwoRaw:
|
||||
RoguelikeOnlyStartWithEliteTwoRaw = false;
|
||||
break;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeStartWithEliteTwo, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStartWithEliteTwo, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool RoguelikeStartWithEliteTwo => _roguelikeStartWithEliteTwo && RoguelikeSquadIsProfessional;
|
||||
|
||||
private bool _roguelikeOnlyStartWithEliteTwo = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeOnlyStartWithEliteTwo, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether only need with elite two's core char.
|
||||
/// </summary>
|
||||
public bool RoguelikeOnlyStartWithEliteTwoRaw
|
||||
{
|
||||
get => _roguelikeOnlyStartWithEliteTwo;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeOnlyStartWithEliteTwo, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeOnlyStartWithEliteTwo, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether only need with elite two's core char.
|
||||
/// </summary>
|
||||
public bool RoguelikeOnlyStartWithEliteTwo => _roguelikeOnlyStartWithEliteTwo && RoguelikeStartWithEliteTwo;
|
||||
|
||||
private bool _roguelike3FirstFloorFoldartal = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3FirstFloorFoldartal, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3FirstFloorFoldartalRaw
|
||||
{
|
||||
get => _roguelike3FirstFloorFoldartal;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3FirstFloorFoldartal, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3FirstFloorFoldartal, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3FirstFloorFoldartal => _roguelike3FirstFloorFoldartal && RoguelikeMode == "4" && RoguelikeTheme == "Sami";
|
||||
|
||||
private string _roguelike3StartFloorFoldartal = ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3StartFloorFoldartal, string.Empty);
|
||||
|
||||
public string Roguelike3StartFloorFoldartal
|
||||
{
|
||||
get => _roguelike3StartFloorFoldartal;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3StartFloorFoldartal, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3StartFloorFoldartal, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelike3NewSquad2StartingFoldartal = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartal, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3NewSquad2StartingFoldartalRaw
|
||||
{
|
||||
get => _roguelike3NewSquad2StartingFoldartal;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3NewSquad2StartingFoldartal, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartal, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether core char need start with elite two.
|
||||
/// </summary>
|
||||
public bool Roguelike3NewSquad2StartingFoldartal => _roguelike3NewSquad2StartingFoldartal && RoguelikeSquadIsFoldartal;
|
||||
|
||||
private string _roguelike3NewSquad2StartingFoldartals = ConfigurationHelper.GetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartals, string.Empty);
|
||||
|
||||
public string Roguelike3NewSquad2StartingFoldartals
|
||||
{
|
||||
get => _roguelike3NewSquad2StartingFoldartals;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelike3NewSquad2StartingFoldartals, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.Roguelike3NewSquad2StartingFoldartals, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeExpectedCollapsalParadigms = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeExpectedCollapsalParadigms, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the expected collapsal paradigms.
|
||||
/// 需要刷的坍缩列表,分号分隔
|
||||
/// </summary>
|
||||
public string RoguelikeExpectedCollapsalParadigms
|
||||
{
|
||||
get => _roguelikeExpectedCollapsalParadigms;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeExpectedCollapsalParadigms, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeExpectedCollapsalParadigms, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeUseSupportUnit = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeUseSupportUnit, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to use support unit.
|
||||
/// </summary>
|
||||
public bool RoguelikeUseSupportUnit
|
||||
{
|
||||
get => _roguelikeUseSupportUnit;
|
||||
set
|
||||
{
|
||||
if (value && RoguelikeStartWithEliteTwo)
|
||||
{
|
||||
RoguelikeStartWithEliteTwoRaw = false;
|
||||
}
|
||||
|
||||
SetAndNotify(ref _roguelikeUseSupportUnit, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeUseSupportUnit, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeEnableNonfriendSupport = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeEnableNonfriendSupport, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether can roguelike support unit belong to nonfriend
|
||||
/// </summary>
|
||||
public bool RoguelikeEnableNonfriendSupport
|
||||
{
|
||||
get => _roguelikeEnableNonfriendSupport;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeEnableNonfriendSupport, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeEnableNonfriendSupport, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeDelayAbortUntilCombatComplete = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeDelayAbortUntilCombatComplete, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether delay abort until battle complete
|
||||
/// </summary>
|
||||
public bool RoguelikeDelayAbortUntilCombatComplete
|
||||
{
|
||||
get => _roguelikeDelayAbortUntilCombatComplete;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeDelayAbortUntilCombatComplete, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeDelayAbortUntilCombatComplete, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeStartsCount = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStartsCount, "9999999");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the start count of roguelike.
|
||||
/// </summary>
|
||||
public int RoguelikeStartsCount
|
||||
{
|
||||
get => int.Parse(_roguelikeStartsCount);
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeStartsCount, value.ToString());
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStartsCount, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeInvestmentEnabled = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestmentEnabled, bool.TrueString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether investment is enabled.
|
||||
/// </summary>
|
||||
public bool RoguelikeInvestmentEnabled
|
||||
{
|
||||
get => _roguelikeInvestmentEnabled;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeInvestmentEnabled, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestmentEnabled, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeInvestmentWithMoreScore = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether investment is enabled.
|
||||
/// </summary>
|
||||
public bool RoguelikeInvestmentWithMoreScoreRaw
|
||||
{
|
||||
get => _roguelikeInvestmentWithMoreScore;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeInvestmentWithMoreScore, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestmentEnterSecondFloor, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether investment is enabled.
|
||||
/// </summary>
|
||||
public bool RoguelikeInvestmentWithMoreScore => _roguelikeInvestmentWithMoreScore && RoguelikeMode == "1";
|
||||
|
||||
private bool _roguelikeRefreshTraderWithDice = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeRefreshTraderWithDice, bool.FalseString));
|
||||
|
||||
public bool RoguelikeRefreshTraderWithDiceRaw
|
||||
{
|
||||
get => _roguelikeRefreshTraderWithDice;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeRefreshTraderWithDice, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeRefreshTraderWithDice, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public bool RoguelikeRefreshTraderWithDice
|
||||
{
|
||||
get => _roguelikeRefreshTraderWithDice && RoguelikeTheme == "Mizuki";
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeRefreshTraderWithDice, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeRefreshTraderWithDice, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private string _roguelikeInvestsCount = ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeInvestsCount, "9999999");
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the invests count of roguelike.
|
||||
/// </summary>
|
||||
public int RoguelikeInvestsCount
|
||||
{
|
||||
get => int.Parse(_roguelikeInvestsCount);
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeInvestsCount, value.ToString());
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeInvestsCount, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeStopWhenInvestmentFull = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStopWhenInvestmentFull, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to stop when investment is full.
|
||||
/// </summary>
|
||||
public bool RoguelikeStopWhenInvestmentFull
|
||||
{
|
||||
get => _roguelikeStopWhenInvestmentFull;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeStopWhenInvestmentFull, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStopWhenInvestmentFull, value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool _roguelikeStopAtFinalBoss = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStopAtFinalBoss, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to stop when investment is full.
|
||||
/// </summary>
|
||||
public bool RoguelikeStopAtFinalBoss
|
||||
{
|
||||
get => _roguelikeStopAtFinalBoss;
|
||||
set
|
||||
{
|
||||
SetAndNotify(ref _roguelikeStopAtFinalBoss, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.RoguelikeStopAtFinalBoss, value.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,10 +266,9 @@
|
||||
DataContext="{Binding TaskSettingDataContext}"
|
||||
IsEnabled="{Binding Idle}"
|
||||
Visibility="{c:Binding TaskSettingVisibilities.Mission}" />
|
||||
<userControl:RoguelikeSettingsUserControl
|
||||
s:View.ActionTarget="{Binding DataContext, RelativeSource={RelativeSource Self}}"
|
||||
DataContext="{Binding TaskSettingDataContext}"
|
||||
Visibility="{c:Binding TaskSettingVisibilities.AutoRoguelike}" />
|
||||
<taskQueue:RoguelikeSettingsUserControl
|
||||
DataContext="{Binding TaskSettingDataContext.RoguelikeTask}"
|
||||
Visibility="{c:Binding DataContext.TaskSettingVisibilities.AutoRoguelike, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" />
|
||||
<taskQueue:ReclamationSettingsUserControl
|
||||
DataContext="{Binding TaskSettingDataContext.ReclamationTask}"
|
||||
Visibility="{c:Binding DataContext.TaskSettingVisibilities.Reclamation, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<UserControl
|
||||
x:Class="MaaWpfGui.Views.UserControl.RoguelikeSettingsUserControl"
|
||||
x:Class="MaaWpfGui.Views.UserControl.TaskQueue.RoguelikeSettingsUserControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
|
||||
@@ -7,22 +7,22 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dd="urn:gong-wpf-dragdrop"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:local="clr-namespace:MaaWpfGui.Views.UserControl"
|
||||
xmlns:local="clr-namespace:MaaWpfGui.Views.UserControl.TaskQueue"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:styles="clr-namespace:MaaWpfGui.Styles"
|
||||
xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI"
|
||||
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
|
||||
xmlns:vm="clr-namespace:MaaWpfGui"
|
||||
d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}"
|
||||
xmlns:setting="clr-namespace:MaaWpfGui.ViewModels.UI"
|
||||
xmlns:taskQueue="clr-namespace:MaaWpfGui.ViewModels.UserControl.TaskQueue"
|
||||
d:Background="White"
|
||||
d:DataContext="{d:DesignInstance {x:Type taskQueue:RoguelikeSettingsUserControlModel}}"
|
||||
d:DesignWidth="220"
|
||||
s:View.ActionTarget="{Binding}"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel>
|
||||
<StackPanel IsEnabled="{Binding Idle}" Visibility="{c:Binding !TaskSettingVisibilities.EnableAdvancedSettings}">
|
||||
<StackPanel IsEnabled="{Binding Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}" Visibility="{c:Binding !EnableAdvancedSettings, Source={x:Static setting:TaskQueueViewModel.TaskSettingVisibilities}}">
|
||||
<ComboBox
|
||||
Margin="0,5"
|
||||
hc:InfoElement.Title="{DynamicResource RoguelikeTheme}"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsHitTestVisible="{Binding Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
ItemsSource="{Binding RoguelikeThemeList}"
|
||||
SelectedValue="{Binding RoguelikeTheme}"
|
||||
SelectedValuePath="Value"
|
||||
@@ -31,8 +31,9 @@
|
||||
Margin="0,5"
|
||||
hc:InfoElement.Title="{DynamicResource RoguelikeDifficulty}"
|
||||
DisplayMemberPath="Display"
|
||||
IsHitTestVisible="{Binding Path=Idle}"
|
||||
IsHitTestVisible="{Binding Path=Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
ItemsSource="{Binding RoguelikeDifficultyList}"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
SelectedValue="{Binding RoguelikeDifficulty}"
|
||||
SelectedValuePath="Value"
|
||||
Style="{StaticResource ComboBoxExtend}"
|
||||
@@ -41,7 +42,7 @@
|
||||
Margin="0,5"
|
||||
hc:InfoElement.Title="{DynamicResource Strategy}"
|
||||
DisplayMemberPath="Display"
|
||||
IsHitTestVisible="{Binding Path=Idle}"
|
||||
IsHitTestVisible="{Binding Path=Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
ItemsSource="{Binding RoguelikeModeList}"
|
||||
SelectedValue="{Binding RoguelikeMode}"
|
||||
SelectedValuePath="Value"
|
||||
@@ -50,7 +51,7 @@
|
||||
Margin="0,5"
|
||||
hc:InfoElement.Title="{DynamicResource StartingSquad}"
|
||||
DisplayMemberPath="Display"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsHitTestVisible="{Binding Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
ItemsSource="{Binding RoguelikeSquadList}"
|
||||
MaxDropDownHeight="800"
|
||||
SelectedValue="{Binding RoguelikeSquad}"
|
||||
@@ -60,7 +61,7 @@
|
||||
Margin="0,5"
|
||||
hc:InfoElement.Title="{DynamicResource StartingRoles}"
|
||||
DisplayMemberPath="Display"
|
||||
IsHitTestVisible="{Binding Idle}"
|
||||
IsHitTestVisible="{Binding Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
ItemsSource="{Binding RoguelikeRolesList}"
|
||||
SelectedValue="{Binding RoguelikeRoles}"
|
||||
SelectedValuePath="Value"
|
||||
@@ -73,7 +74,8 @@
|
||||
IsEditable="True"
|
||||
IsTextSearchEnabled="False"
|
||||
ItemsSource="{Binding RoguelikeCoreCharList}"
|
||||
Loaded="{s:Action MakeComboBoxSearchable}"
|
||||
Loaded="{s:Action MakeComboBoxSearchable,
|
||||
Target={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
ToolTip="{DynamicResource StartingCoreCharTip}">
|
||||
<hc:ComboBox.Text>
|
||||
<Binding Path="RoguelikeCoreChar" UpdateSourceTrigger="PropertyChanged">
|
||||
@@ -85,7 +87,7 @@
|
||||
</hc:ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel IsEnabled="{Binding Idle}" Visibility="{c:Binding TaskSettingVisibilities.EnableAdvancedSettings}">
|
||||
<StackPanel IsEnabled="{Binding Idle, Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}" Visibility="{c:Binding EnableAdvancedSettings, Source={x:Static setting:TaskQueueViewModel.TaskSettingVisibilities}}">
|
||||
<hc:NumericUpDown
|
||||
Margin="0,5"
|
||||
hc:InfoElement.Title="{DynamicResource StartTimesLimit}"
|
||||
@@ -159,7 +161,8 @@
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
<TextBox
|
||||
IsReadOnly="{c:Binding !Idle}"
|
||||
IsReadOnly="{c:Binding !Idle,
|
||||
Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Roguelike3StartFloorFoldartal, UpdateSourceTrigger=LostFocus}"
|
||||
Visibility="{c:Binding 'Roguelike3FirstFloorFoldartalRaw and RoguelikeMode == "4" and RoguelikeTheme == "Sami" '}" />
|
||||
@@ -173,14 +176,16 @@
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
<TextBox
|
||||
IsReadOnly="{c:Binding !Idle}"
|
||||
IsReadOnly="{c:Binding !Idle,
|
||||
Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding Roguelike3NewSquad2StartingFoldartals, UpdateSourceTrigger=LostFocus}"
|
||||
ToolTip="{DynamicResource Roguelike3NewSquad2StartingFoldartalTip}"
|
||||
Visibility="{c:Binding 'Roguelike3NewSquad2StartingFoldartalRaw and RoguelikeMode == "4" and RoguelikeTheme == "Sami" and RoguelikeSquad == "生活至上分队" '}" />
|
||||
<hc:TextBox
|
||||
hc:InfoElement.Title="{DynamicResource RoguelikeCollapseList}"
|
||||
IsReadOnly="{c:Binding !Idle}"
|
||||
IsReadOnly="{c:Binding !Idle,
|
||||
Source={x:Static setting:TaskQueueViewModel.TaskSettingDataContext}}"
|
||||
Style="{StaticResource TextBoxExtend}"
|
||||
Text="{Binding RoguelikeExpectedCollapsalParadigms, UpdateSourceTrigger=LostFocus}"
|
||||
ToolTip="{DynamicResource RoguelikeCollapseListTip}"
|
||||
@@ -14,12 +14,11 @@
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using MaaWpfGui.Helper;
|
||||
using MaaWpfGui.ViewModels.UI;
|
||||
|
||||
namespace MaaWpfGui.Views.UserControl
|
||||
namespace MaaWpfGui.Views.UserControl.TaskQueue
|
||||
{
|
||||
/// <summary>
|
||||
/// RoguelikeSettingsUserControl.xaml 的交互逻辑
|
||||
@@ -59,7 +58,7 @@ namespace MaaWpfGui.Views.UserControl
|
||||
}
|
||||
|
||||
var name = StartingCoreCharComboBox.Text;
|
||||
StartingCoreCharComboBox.ItemsSource = Instances.SettingsViewModel.RoguelikeCoreCharList;
|
||||
StartingCoreCharComboBox.ItemsSource = SettingsViewModel.RoguelikeTask.RoguelikeCoreCharList;
|
||||
StartingCoreCharComboBox.Text = name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user