mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
add set max times function
This commit is contained in:
@@ -82,6 +82,8 @@ void Assistance::start(const std::string& task)
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
|
||||
Configer::clearExecTimes();
|
||||
m_pIder->clear_cache();
|
||||
m_next_tasks.clear();
|
||||
m_next_tasks.emplace_back(task);
|
||||
|
||||
@@ -11,11 +11,13 @@
|
||||
<CheckBox x:Name="checkBox_useStone" Content="吃石头" HorizontalAlignment="Left" Margin="50,150,0,0" VerticalAlignment="Top" Checked="checkBox_useStone_Checked" Unchecked="checkBox_useStone_Checked"/>
|
||||
<TextBox x:Name="textBox_useStone" HorizontalAlignment="Left" Height="23" Margin="112,148,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="47" TextChanged="textBox_useStone_TextChanged" InputMethod.IsInputMethodEnabled="False"/>
|
||||
<Label x:Name="label_stoneNumber" Content="颗" HorizontalAlignment="Left" Margin="164,144,0,0" VerticalAlignment="Top" RenderTransformOrigin="-5.771,-6.291"/>
|
||||
<Button x:Name="button_startSanity" Content="开始刷理智" HorizontalAlignment="Left" Margin="50,200,0,0" VerticalAlignment="Top" Width="120" Height="50" Click="button_Click_startSanity"/>
|
||||
<Button x:Name="button_stop" Content="停止" HorizontalAlignment="Left" Margin="50,280,0,0" VerticalAlignment="Top" Width="300" Height="50" Click="button_Click_stop"/>
|
||||
<Button x:Name="button_startSanity" Content="开始刷理智" HorizontalAlignment="Left" Margin="50,270,0,0" VerticalAlignment="Top" Width="120" Height="50" Click="button_Click_startSanity"/>
|
||||
<Button x:Name="button_stop" Content="停止" HorizontalAlignment="Left" Margin="50,350,0,0" VerticalAlignment="Top" Width="300" Height="50" Click="button_Click_stop"/>
|
||||
<Label x:Name="catch_status" Content="" HorizontalAlignment="Left" Margin="50,30,0,0" VerticalAlignment="Top"/>
|
||||
<Button x:Name="button_visit" Content="访问基建" HorizontalAlignment="Left" Margin="230,200,0,0" VerticalAlignment="Top" Width="120" Height="50" Click="button_Click_visit"/>
|
||||
<Button x:Name="button_visit" Content="访问基建" HorizontalAlignment="Left" Margin="230,270,0,0" VerticalAlignment="Top" Width="120" Height="50" Click="button_Click_visit"/>
|
||||
<Label x:Name="exec_times" Content="" HorizontalAlignment="Left" Margin="230,30,0,0" VerticalAlignment="Top"/>
|
||||
<Label x:Name="stone_times" Content="" HorizontalAlignment="Left" Margin="230,144,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.702,0.403"/>
|
||||
<CheckBox x:Name="checkBox_maxTimes" Content="指定次数" HorizontalAlignment="Left" Margin="50,200,0,0" VerticalAlignment="Top" Checked="checkBox_maxTimes_Checked" Unchecked="checkBox_maxTimes_Checked"/>
|
||||
<TextBox x:Name="textBox_maxTimes" HorizontalAlignment="Left" Height="23" Margin="124,198,0,0" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Width="47" TextChanged="textBox_maxTimes_TextChanged" InputMethod.IsInputMethodEnabled="False"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -114,5 +114,25 @@ namespace MeoAsstGui
|
||||
stone_times.Content = "已碎石 " + buff_stone + " 个";
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBox_maxTimes_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (checkBox_maxTimes.IsChecked == true)
|
||||
{
|
||||
AsstSetParam(p_asst, "task.maxTimes", "StartButton1", textBox_maxTimes.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
AsstSetParam(p_asst, "task.maxTimes", "StartButton1", int.MaxValue.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox_maxTimes_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (checkBox_maxTimes.IsChecked == true)
|
||||
{
|
||||
AsstSetParam(p_asst, "task.maxTimes", "StartButton1", textBox_maxTimes.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user