This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C# class | |
namespace overwolf.plugins | |
{ | |
public class MyPlugin | |
{ | |
public void myPluginFunction(string param1, string param2, Action<object> callback) | |
{ | |
callback(new | |
{ | |
status = "success" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
console.log(`TRUCKY_ENV is ${process.env.TRUCKY_ENV == undefined ? 'production' : process.env.TRUCKY_ENV}`); | |
// Do this as the first thing so that any code reading it knows the right env. | |
process.env.BABEL_ENV = "production"; | |
process.env.NODE_ENV = "production"; | |
// Makes the script crash on unhandled rejections instead of silently | |
// ignoring them. In the future, promise rejections that are not handled will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// event-bus.js | |
let _listeners = []; | |
function addListener(eventName, eventHandler) { | |
_listeners.push({ eventName: eventName, handler: eventHandler }); | |
} | |
function trigger(eventName, data, log = false) { | |
for (let listener of _listeners) { | |
if (listener.eventName == eventName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
overwolf.windows.openAlert = function(content, autoCloseTimeout = 0) { | |
overwolf.windows.openWindow("Alert", function(res) { | |
overwolf.windows.getOpenWindows(function(openWindows) { | |
var window_id = res.window_id; | |
debugger; | |
var w = openWindows['Alert']; | |
//debugger; | |
overwolf.utils.getMonitorsList(function(monitors) { | |
var primaryMonitor = monitors.displays.find(d => { |