I'm also looking to adapt keilmillerjr's plugin so that I can call on it automatically either at time intervals or without pressing a key, rather than having to press the R key to invoke it. Not quite sure how to do that and would be grateful for any help please.
In the meantime, using keilmillerjr's code, I just stripped out the framerate code leaving the reload layout code.
I place "plugin.nut" in a sub-folder of "plugins" called "Reload", then enable it and set it to the R key under Controls.
// --------------------
// Load Modules
// --------------------
fe.load_module("helpers");
// --------------------
// Plugin User Options
// --------------------
class UserConfig </ help="A plugin that reloads layouts with a key press." /> {
</ label="Reload Layout Key",
help="The key that triggers the layout to reload. Use Custom 2. Remember to set the key in Controls. Set the key to R",
options="Custom1, Custom2, Custom3, Custom4, Custom5, Custom6",
order=1 />
reloadKey="Custom2";
}
// --------------------
// Reload
// --------------------
class Reload {
config = null;
reloadKey = null;
constructor() {
// Config
config = fe.get_config();
// Reload Layout
reloadKey = config["reloadKey"].tolower();
fe.add_signal_handler(this, "reload");
}
// Reload Layout on Key Press - R key
function reload(str) {
if (str == reloadKey) fe.signal("reload");
return false;
}
}
fe.plugin["Reload"] <- Reload();