Improved layer management
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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(";"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ function Eye(rune)
|
||||
|
||||
this.mouse_down = function(position)
|
||||
{
|
||||
ronin.overlay.draw(position);
|
||||
// ronin.overlay.draw(position);
|
||||
this.color_picker(position);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,5 @@ function Source(rune)
|
||||
this.coordinates = [];
|
||||
this.last_pos = null;
|
||||
ronin.terminal.input.value = "";
|
||||
ronin.overlay.get_layer(true).clear();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user