Improved layer management

This commit is contained in:
Devine Lu Linvega
2017-05-21 15:02:37 -10:00
parent 748fec89f4
commit 26daabb6cd
8 changed files with 31 additions and 9 deletions

View File

@@ -90,6 +90,8 @@ function Keyboard()
this.key_escape = function()
{
ronin.overlay.key_escape();
for(var key in ronin.modules){
ronin.modules[key].key_escape();
}

View File

@@ -111,6 +111,7 @@ function Ronin()
if(rawFile.status === 200 || rawFile.status == 0)
{
var allText = rawFile.responseText;
ronin.terminal.log(new Log(null,"Loaded file "+name));
ronin.terminal.run_multi(allText.split("\n").join(";"));
}
}

View File

@@ -20,7 +20,7 @@ function Eye(rune)
this.mouse_down = function(position)
{
ronin.overlay.draw(position);
// ronin.overlay.draw(position);
this.color_picker(position);
}

View File

@@ -146,10 +146,27 @@ function Frame(rune)
this.widget = function()
{
var count = 0;
for(layer in this.layers){
var html = ""
html += this.settings.size.render()+" ";
html += this.active_layer.name+" ";
var user_layers = 0;
var managed_layers = 0;
count = 0;
for(id in this.layers){
if(this.layers[id].manager){
managed_layers += 1;
}
else{
user_layers += 1;
}
count += 1;
}
return this.active_layer.name+(count > 1 ? "("+count+" layers)" : "");
html += user_layers+"&"+managed_layers+" ";
return html
}
}

View File

@@ -93,6 +93,5 @@ function Source(rune)
this.coordinates = [];
this.last_pos = null;
ronin.terminal.input.value = "";
ronin.overlay.get_layer(true).clear();
}
}

View File

@@ -102,13 +102,13 @@ function Terminal(rune)
// Log
function Log(host,message,error = false)
function Log(host = null,message,error = false)
{
this.host = host;
this.message = message;
this.error = error;
this.element = document.createElement("log");
this.element.setAttribute("class",error ? "error" : "okay");
this.element.innerHTML = "<span class='module'>"+host.name+"</span> "+message;
console.log(this.host.constructor.name,this.message);
this.element.innerHTML = "<span class='module'>"+(this.host ? this.host.name : "Ronin")+"</span> "+message;
console.log(this.host ? this.host.name : "Ronin",this.message);
}