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

@ -2,7 +2,7 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
*:focus {outline: none; }
#ronin { background:#ddd; width:100%; height:100%; overflow:hidden; background-image:url(../media/graphics/grid.svg); background-position: 0px 0px; }
#frame { width:50vw; height:50vh; overflow:hidden; position:fixed; left: calc(40vw + 15px); top:100px; background:white;}
#frame { width:50vw; height:50vh; overflow:hidden; position:fixed; left: calc(40vw + 15px); top:100px; background-image:url(../media/graphics/void.svg); background-position:0px 0px; }
#frame > .layer { position:absolute; top:0px; left:0px; width:100%; height:100%;}
#overlay { position:absolute; z-index:1000;}
#frame { cursor:none;}

3
media/graphics/void.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="5" height="5" xmlns="http://www.w3.org/2000/svg" baseProfile="full" version="1.1">
<circle cx="2.5" cy="2.5" r="1" fill="#fff"></circle>
</svg>

After

Width:  |  Height:  |  Size: 159 B

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);
}