mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 10:10:45 +08:00
chore: remove debug code
This commit is contained in:
@@ -18,20 +18,13 @@
|
||||
#include "Vision/Miscellaneous/StageDropsImageAnalyzer.h"
|
||||
#include "Vision/RegionOCRer.h"
|
||||
|
||||
// only use in debugging, not in release
|
||||
//#define CUSTOM_TASK_ENABLE_DROPS
|
||||
|
||||
bool asst::StageDropsTaskPlugin::verify(AsstMsg msg, const json::value& details) const
|
||||
{
|
||||
if (msg != AsstMsg::SubTaskCompleted || details.get("subtask", std::string()) != "ProcessTask") {
|
||||
return false;
|
||||
}
|
||||
const std::string task = details.get("details", "task", "");
|
||||
if (task == "Fight@EndOfAction"
|
||||
#ifdef CUSTOM_TASK_ENABLE_DROPS
|
||||
|| task == "EndOfAction"
|
||||
#endif
|
||||
) {
|
||||
if (task == "Fight@EndOfAction") {
|
||||
int64_t last_start_time = status()->get_number(LastStartTimeKey).value_or(0);
|
||||
int64_t last_recognize_flag = status()->get_number(RecognitionRestrictionsKey).value_or(0);
|
||||
if (last_start_time + RecognitionTimeOffset == last_recognize_flag) {
|
||||
@@ -41,11 +34,7 @@ bool asst::StageDropsTaskPlugin::verify(AsstMsg msg, const json::value& details)
|
||||
m_is_annihilation = false;
|
||||
return true;
|
||||
}
|
||||
else if (task == "Fight@EndOfActionAnnihilation"
|
||||
#ifdef CUSTOM_TASK_ENABLE_DROPS
|
||||
|| task == "EndOfActionAnnihilation"
|
||||
#endif
|
||||
) {
|
||||
else if (task == "Fight@EndOfActionAnnihilation") {
|
||||
m_is_annihilation = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,25 +6,12 @@
|
||||
#include "Task/ProcessTask.h"
|
||||
#include "Utils/Logger.hpp"
|
||||
|
||||
// only use in debugging, not in release
|
||||
//#define CUSTOM_TASK_ENABLE_DROPS
|
||||
|
||||
#ifdef CUSTOM_TASK_ENABLE_DROPS
|
||||
#include "Task/Fight/StageDropsTaskPlugin.h"
|
||||
#endif
|
||||
|
||||
asst::CustomTask::CustomTask(const AsstCallback& callback, Assistant* inst) :
|
||||
InterfaceTask(callback, inst, TaskType),
|
||||
m_custom_task_ptr(std::make_shared<ProcessTask>(callback, inst, TaskType))
|
||||
{
|
||||
LogTraceFunction;
|
||||
m_custom_task_ptr->register_plugin<ScreenshotTaskPlugin>();
|
||||
|
||||
#ifdef CUSTOM_TASK_ENABLE_DROPS
|
||||
auto drops_plugin = m_custom_task_ptr->register_plugin<StageDropsTaskPlugin>();
|
||||
drops_plugin->set_retry_times(0);
|
||||
Log.info("CustomTask: StageDropsTaskPlugin enabled for debugging");
|
||||
#endif
|
||||
}
|
||||
|
||||
bool asst::CustomTask::set_params(const json::value& params)
|
||||
|
||||
Reference in New Issue
Block a user