Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

CustomGameEventManager.RegisterListener problem #6

Open
ElronMacBong opened this issue May 12, 2019 · 1 comment
Open

CustomGameEventManager.RegisterListener problem #6

ElronMacBong opened this issue May 12, 2019 · 1 comment

Comments

@ElronMacBong
Copy link

ElronMacBong commented May 12, 2019

export abstract class DevManager {
	private static RegisterListeners() {
		CustomGameEventManager.RegisterListener("devtools_get_mode", (playerID: number, event: table) => this.OnGetMode(playerID, event));
	}

	public static OnGetMode(playerID: number, event: table) {
		Log.Log(LogLevel.Debug, "DevManager", "OnGetMode", `playerID: ${playerID} event: ${event}`);
	}
}

This ends in the scenario that playerID is the event-table and event is nil.
Is it related to declartions or did i failed there anything?
And yes, i need that as abstract and static. ;)

@ElronMacBong
Copy link
Author

Found a solution for that:

RegisterListener(eventName: string, handler: (this: void, userID: number, event: table) => void): CCustomGameEventListener;

works perfect now. You can add this straight at line 661 on dota-api.d.ts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant