Skip to content

Instantly share code, notes, and snippets.

View dowmeister's full-sized avatar

Francesco Bramato dowmeister

View GitHub Profile
C# class
namespace overwolf.plugins
{
public class MyPlugin
{
public void myPluginFunction(string param1, string param2, Action<object> callback)
{
callback(new
{
status = "success"
@dowmeister
dowmeister / build.js
Created September 21, 2020 13:39
Custom React Webpack script for Overwolf app
"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
@dowmeister
dowmeister / gist:cb1f8cb9ec99b211a9e0a3f8829e211a
Last active March 1, 2022 12:33
Overwolf - EventBus example with trigger to close the app from the main visible window
// 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)
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 => {