Plugin edit and reload

This commit is contained in:
luboslenco
2019-10-11 09:48:44 +02:00
parent 07e847cd11
commit 943e5110a8
2 changed files with 22 additions and 8 deletions
+20 -6
View File
@@ -78,8 +78,9 @@ class TabPlugins{
}
if (ui.isHovered && ui.inputReleasedR) {
UIMenu.draw(function(ui:Zui) {
ui.fill(0, 0, ui._w / ui.SCALE, ui.t.ELEMENT_H * 2, ui.t.SEPARATOR_COL);
ui.fill(0, 0, ui._w / ui.SCALE, ui.t.ELEMENT_H * 4, ui.t.SEPARATOR_COL);
ui.text(f, Right);
var path = Krom.getFilesLocation() + sep + dataPath + sep + "plugins" + sep + f;
if (ui.button("Delete", Left)) {
if (Config.raw.plugins.indexOf(f) >= 0) {
Config.raw.plugins.remove(f);
@@ -91,13 +92,26 @@ class TabPlugins{
#else
var cmd = "rm ";
#end
var path = Krom.getFilesLocation() + sep + dataPath + sep + "plugins" + sep + f;
Krom.sysCommand(cmd + '"' + path + '"');
}
// if (ui.button("Edit", Left)) {
// filename
// }
// if (ui.button("Reload", Left)) {}
if (ui.button("Edit", Left)) {
#if krom_windows
Krom.sysCommand('"' + path + '"');
#elseif krom_linux
Krom.sysCommand('xdg-open "' + path + '"');
#else
Krom.sysCommand('open "' + path + '"');
#end
}
if (ui.button("Reload", Left)) {
if (Config.raw.plugins.indexOf(f) >= 0) {
Plugin.stop(f);
}
iron.data.Data.deleteBlob("plugins/" + f);
if (Config.raw.plugins.indexOf(f) >= 0) {
Plugin.start(f);
}
}
});
}
}
+2 -2
View File
@@ -424,10 +424,10 @@ class UINodes {
ui._y = 3;
}
}
ui._x += ew + 3;
ui._y = 3;
if (ui.button("Search")) nodeSearch(Std.int(ui._windowX + ui._x), Std.int(ui._windowY + ui._y));
if (ui.button("Search", Left)) nodeSearch(Std.int(ui._windowX + ui._x), Std.int(ui._windowY + ui._y));
if (ui.isHovered) ui.tooltip("Search for nodes (" + Config.keymap.node_search + ")");
ui.t.BUTTON_COL = BUTTON_COL;