Skip to content

Commit

Permalink
fix(nodejs): missing roi of custom reco
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-para committed Dec 11, 2024
1 parent 75057d5 commit 02a1113
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions source/binding/NodeJS/release/maa-node/src/pi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ export const Pi = {
notify(message: string, details_json: string): maa.MaybePromise<void> {},

register_custom_recognizer(id: maa.Id, name: string, func: CustomRecognizerCallback) {
maa.pi_register_custom_recognizer(id, name, (context, id, task, name, param, image) => {
maa.pi_register_custom_recognizer(id, name, (context, id, task, name, param, image, roi) => {
const self: CustomRecognizerSelf = {
context: new Context(context),
id,
task,
name,
param: JSON.parse(param),
image
image,
roi
}
return func.apply(self, [self])
})
Expand Down
5 changes: 3 additions & 2 deletions source/binding/NodeJS/release/maa-node/src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ export class ResourceBase {
!maa.resource_register_custom_recognition(
this.handle,
name,
(context, id, task, name, param, image) => {
(context, id, task, name, param, image, roi) => {
const self: CustomRecognizerSelf = {
context: new Context(context),
id,
task,
name,
param: JSON.parse(param),
image
image,
roi
}
return func.apply(self, [self])
}
Expand Down
1 change: 1 addition & 0 deletions source/binding/NodeJS/release/maa-node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface CustomRecognizerSelf {
name: string
param: unknown
image: maa.ImageData
roi: maa.Rect
}

export interface CustomActionSelf {
Expand Down

0 comments on commit 02a1113

Please sign in to comment.