New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interceptor Example Not Work. #506
Comments
no idea how to deal, i have workaround as |
or you can use esbuild aswell |
I got same situation, and I found a way to address this problem. For a example, here are some code in my project. Before PlayVoice.implementation = function (key: Il2Cpp.String, channel: Il2Cpp.String, volum: any, crossfadeDuration: any, delay: any, loop: boolean) {
Logger.logDebug(`PlayVoice in ${key}`)
key = Il2Cpp.string(audioArray[Math.floor(Math.random() * audioArray.length)])
//Logger.logDebug(`PlayVoice out ${key}`)
return this.method('PlayVoice').invoke(key, channel)
// return this.method('PlayVoice').invoke(key, channel, volum, crossfadeDuration, delay, loop)
} After PlayVoice.implementation = function (...parameters: any[]) {
const key = parameters[0];
const channel = parameters[1];
Logger.logDebug(`PlayVoice in ${key}`);
const newKey = Il2Cpp.string(audioArray[Math.floor(Math.random() * audioArray.length)]);
//Logger.logDebug(`PlayVoice out ${key}`)
return this.method('PlayVoice').invoke(newKey, channel);
// return this.method('PlayVoice').invoke(key, channel, volum, crossfadeDuration, delay, loop)
}; But this solution also leads to a new problem: we can't specify each type of parameters except |
you won't have editor hints and stuff in that case |
Copied the full example in Snippet/Interceptor . but can't compile success.
/playground/index.ts:19:5 - error TS2322: Type '(this: Class | ValueType | Object, value: String) => boolean' is not assignable to type '(this: Class | ValueType | Object, ...parameters: Type[]) => boolean'. Types of parameters 'value' and 'parameters' are incompatible. Type 'Type' is not assignable to type 'String'. Type 'number' is not assignable to type 'String'. Compiled index.ts (1221 ms)
Another Question: it works if interpetor function without parameter, how to interceptor function with multiple parameters.
The text was updated successfully, but these errors were encountered: