-
Savvy ? 🐒
[INTERNATIONAL] [Jack] OptionTogglerPlugin

The purpose of this plugin is to make easier to define custom actions when you press keyboard keys.
It's just one file to save as \plugins\Jack\Keyboard\OptionTogglerPlugin.cs
It (obviously) does nothing by default, you need to configure it.
There is a simple example to add a toggle feature to the minimap clipping option in hud.
PHP Code:
// save me as \plugins\User\MyKeyboardConfigurator.cs
using SharpDX.DirectInput;
using System;
using System.Collections.Generic;
using System.Linq;
using Turbo.Plugins.Default;
namespace Turbo.Plugins.User
{
public class MyKeyboardConfigurator : BasePlugin, ICustomizer
{
public MyKeyboardConfigurator()
{
Enabled = true;
}
public void Customize()
{
Hud.RunOnPlugin<Jack.Keyboard.OptionTogglerPlugin>(plugin => {
// register the letter 'K' to toggle minimap clipping
plugin.AddAction(Key.K, (hud) => hud.SceneReveal.MinimapClip = !hud.SceneReveal.MinimapClip);
// add more rules below this line
});
}
}
}
ps :
- thanks to JohnWick for the idea/request in (Default theme customization 101)
Last edited by JackCeparou; 02-14-2019 at 07:37 AM.
Reason: version tag
-
Post Thanks / Like - 4 Thanks
-
Member