Plugin edit and reload
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user