mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
@@ -1675,6 +1675,17 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
SetAndNotify(ref _customInfrastFile, value);
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.CustomInfrastFile, value);
|
||||
Instances.TaskQueueViewModel.RefreshCustomInfrastPlan();
|
||||
|
||||
// SetAndNotify 在值没有变化时不会触发 PropertyChanged 事件,所以这里手动触发一下
|
||||
var index = Instances.TaskQueueViewModel.CustomInfrastPlanIndex;
|
||||
var count = Instances.TaskQueueViewModel.CustomInfrastPlanList.Count;
|
||||
Instances.TaskQueueViewModel.NeedAddCustomInfrastPlanInfo = false;
|
||||
{
|
||||
Instances.TaskQueueViewModel.CustomInfrastPlanIndex = (index + 1) % count;
|
||||
Instances.TaskQueueViewModel.CustomInfrastPlanIndex = index;
|
||||
}
|
||||
|
||||
Instances.TaskQueueViewModel.NeedAddCustomInfrastPlanInfo = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3165,15 +3176,15 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
ConnectAddress = addresses.First();
|
||||
break;
|
||||
case > 1:
|
||||
{
|
||||
foreach (var address in addresses.Where(address => address != "emulator-5554"))
|
||||
{
|
||||
ConnectAddress = address;
|
||||
foreach (var address in addresses.Where(address => address != "emulator-5554"))
|
||||
{
|
||||
ConnectAddress = address;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ConnectAddress.Length == 0)
|
||||
|
||||
@@ -2514,6 +2514,8 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
}
|
||||
}
|
||||
|
||||
public bool NeedAddCustomInfrastPlanInfo { get; set; } = true;
|
||||
|
||||
private int _customInfrastPlanIndex = Convert.ToInt32(ConfigurationHelper.GetValue(ConfigurationKeys.CustomInfrastPlanIndex, "0"));
|
||||
|
||||
public int CustomInfrastPlanIndex
|
||||
@@ -2521,7 +2523,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
get => _customInfrastPlanIndex;
|
||||
set
|
||||
{
|
||||
if (value != _customInfrastPlanIndex)
|
||||
if (value != _customInfrastPlanIndex && NeedAddCustomInfrastPlanInfo)
|
||||
{
|
||||
var plan = CustomInfrastPlanInfoList[value];
|
||||
AddLog(plan.Name, UiLogColor.Message);
|
||||
|
||||
Reference in New Issue
Block a user