| 300 | } |
| 301 | |
| 302 | std::optional<maajs::ValueType> TaskerImpl::action_detail(MaaActId id) |
| 303 | { |
| 304 | StringBuffer node_name; |
| 305 | StringBuffer action; |
| 306 | MaaRect box { }; |
| 307 | MaaBool success = false; |
| 308 | StringBuffer detail_json; |
| 309 | if (MaaTaskerGetActionDetail(tasker, id, node_name, action, &box, &success, detail_json)) { |
| 310 | auto result = maajs::ObjectType::New(env); |
| 311 | |
| 312 | result["name"] = maajs::StringType::New(env, node_name.str()); |
| 313 | result["action"] = maajs::StringType::New(env, action.str()); |
| 314 | result["box"] = maajs::JSConvert<MaaRect>::to_value(env, box); |
| 315 | result["success"] = maajs::BooleanType::New(env, success); |
| 316 | result["detail"] = maajs::JsonParse(env, detail_json.str()); |
| 317 | |
| 318 | return result; |
| 319 | } |
| 320 | else { |
| 321 | return std::nullopt; |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | std::optional<maajs::ValueType> TaskerImpl::node_detail(MaaNodeId id) |
| 326 | { |
nothing calls this directly
no test coverage detected