perf: 肉鸽选难度允许不选难度 (#10979)

* perf: 肉鸽选难度允许不选难度

* fix: 在插件中对 gui 传入的 -1 值做特殊处理
This commit is contained in:
晓丶梦丶仁
2024-10-31 21:41:36 +08:00
committed by GitHub
parent 3ecbf8bc26
commit bc39c2d2ec
2 changed files with 12 additions and 1 deletions

View File

@@ -47,7 +47,16 @@ bool asst::RoguelikeDifficultySelectionTaskPlugin::_run()
{
LogTraceFunction;
const int difficulty = m_config->get_run_for_collectible() ? 0 : m_config->get_difficulty();
int difficulty = m_config->get_difficulty();
if (difficulty == -1) {
Log.info(__FUNCTION__, "| use current difficulty, skip select_difficulty");
return true;
}
if (m_config->get_run_for_collectible()) {
difficulty = 0;
}
Log.info(__FUNCTION__, "| current_difficulty:", m_current_difficulty, "next difficulty:", difficulty);
// 仅在插件记录的当前难度与目标难度不一致时重新选择难度

View File

@@ -1962,6 +1962,8 @@ namespace MaaWpfGui.ViewModels.UI
var value = i.ToString();
RoguelikeDifficultyList.Add(new CombinedData { Display = value, Value = value });
}
RoguelikeDifficultyList.Add(new CombinedData { Display = "Current", Value = (-1).ToString() });
}
private void UpdateRoguelikeModeList()