mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
refactor: 将 「自动肉鸽在战斗结束前延迟停止动作」 从 「运行设置」 移到 「肉鸽设置」 中
This commit is contained in:
@@ -1712,7 +1712,7 @@ namespace MaaWpfGui.Main
|
||||
case "StageInfo":
|
||||
{
|
||||
Instances.TaskQueueViewModel.AddLog(LocalizationHelper.GetString("StartCombat") + subTaskDetails!["name"]);
|
||||
if (SettingsViewModel.GameSettings.RoguelikeDelayAbortUntilCombatComplete)
|
||||
if (TaskQueueViewModel.RoguelikeTask.RoguelikeDelayAbortUntilCombatComplete)
|
||||
{
|
||||
Instances.TaskQueueViewModel.RoguelikeInCombatAndShowWait = true;
|
||||
}
|
||||
|
||||
@@ -1394,7 +1394,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
{
|
||||
Waiting = true;
|
||||
AddLog(LocalizationHelper.GetString("Waiting"));
|
||||
if (SettingsViewModel.GameSettings.RoguelikeDelayAbortUntilCombatComplete)
|
||||
if (RoguelikeTask.RoguelikeDelayAbortUntilCombatComplete)
|
||||
{
|
||||
await WaitUntilRoguelikeCombatComplete();
|
||||
|
||||
@@ -1411,7 +1411,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
private async Task WaitUntilRoguelikeCombatComplete()
|
||||
{
|
||||
int time = 0;
|
||||
while (SettingsViewModel.GameSettings.RoguelikeDelayAbortUntilCombatComplete && RoguelikeInCombatAndShowWait && time < 600 && !Stopping)
|
||||
while (RoguelikeTask.RoguelikeDelayAbortUntilCombatComplete && RoguelikeInCombatAndShowWait && time < 600 && !Stopping)
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
++time;
|
||||
|
||||
@@ -150,21 +150,6 @@ public class GameSettingsUserControlModel : PropertyChangedBase
|
||||
}
|
||||
}
|
||||
|
||||
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 _startsWithScript = ConfigurationHelper.GetValue(ConfigurationKeys.StartsWithScript, string.Empty);
|
||||
|
||||
public string StartsWithScript
|
||||
|
||||
@@ -933,6 +933,21 @@ public class RoguelikeSettingsUserControlModel : TaskViewModel
|
||||
}
|
||||
}
|
||||
|
||||
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 bool _roguelikeStartWithSeed = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.RoguelikeStartWithSeed, bool.FalseString));
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -80,12 +80,6 @@
|
||||
Margin="20,10"
|
||||
Content="{DynamicResource AutoRestartOption}"
|
||||
IsChecked="{Binding AutoRestartOnDrop}" />
|
||||
<CheckBox Margin="0,10" IsChecked="{Binding RoguelikeDelayAbortUntilCombatComplete}">
|
||||
<TextBlock
|
||||
Block.TextAlignment="Left"
|
||||
Text="{DynamicResource RoguelikeDelayAbortUntilCombatComplete}"
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
<hc:TextBox
|
||||
Grid.Row="7"
|
||||
|
||||
@@ -337,6 +337,12 @@
|
||||
Text="{DynamicResource RoguelikeStartWithSeed}"
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>-->
|
||||
<CheckBox Margin="0,10" IsChecked="{Binding RoguelikeDelayAbortUntilCombatComplete}">
|
||||
<TextBlock
|
||||
Block.TextAlignment="Left"
|
||||
Text="{DynamicResource RoguelikeDelayAbortUntilCombatComplete}"
|
||||
TextWrapping="Wrap" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user