Improved design a bit
This commit is contained in:
@@ -6,13 +6,6 @@ function Overlay(rune)
|
||||
|
||||
this.color = new Color("#ffffff");
|
||||
|
||||
this.install = function()
|
||||
{
|
||||
this.layer = new Layer("Overlay.Guide",this);
|
||||
this.layer.element.setAttribute("style","z-index:9000");
|
||||
ronin.surface.add_layer(this.layer);
|
||||
}
|
||||
|
||||
this.passive = function(cmd)
|
||||
{
|
||||
this.draw(cmd.position(),cmd.rect());
|
||||
|
||||
@@ -126,8 +126,13 @@ function Surface(rune)
|
||||
var keys = Object.keys(ronin.surface.layers);
|
||||
var loc = keys.indexOf(this.active_layer.name);
|
||||
|
||||
s += "<span class='layer'>"+ronin.surface.active_layer.widget()+"("+(loc+1)+"/"+keys.length+")</span>";
|
||||
|
||||
if(keys.length > 1){
|
||||
s += "<span class='layer'>"+ronin.surface.active_layer.widget()+"("+(loc+1)+"/"+keys.length+")</span>";
|
||||
}
|
||||
else{
|
||||
s += "<span class='layer'>"+ronin.surface.active_layer.widget()+"</span>";
|
||||
}
|
||||
|
||||
this.widget_element.innerHTML = s;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ function Terminal(rune)
|
||||
this.element.appendChild(this.logs_element);
|
||||
|
||||
this.hint_element.innerHTML = "_";
|
||||
|
||||
this.update_log();
|
||||
}
|
||||
|
||||
this.active = function(cmd)
|
||||
@@ -92,9 +94,21 @@ function Terminal(rune)
|
||||
|
||||
//
|
||||
|
||||
this.logs = [];
|
||||
|
||||
this.log = function(log)
|
||||
{
|
||||
this.logs_element.appendChild(log.element);
|
||||
this.logs.push(log);
|
||||
}
|
||||
|
||||
this.update_log = function()
|
||||
{
|
||||
if(ronin.terminal.logs[0]){
|
||||
ronin.terminal.logs_element.appendChild(ronin.terminal.logs[0].element);
|
||||
ronin.terminal.logs.shift();
|
||||
}
|
||||
|
||||
setTimeout(function(){ ronin.terminal.update_log(); }, 200);
|
||||
}
|
||||
|
||||
// Hint
|
||||
@@ -109,15 +123,23 @@ function Terminal(rune)
|
||||
if(content.indexOf(";") > -1){
|
||||
var h = padding+" "+content.split(";").length+" commands";
|
||||
}
|
||||
else{
|
||||
else if(ronin.module){
|
||||
var h = padding+" <span class='name'>"+ronin.module.constructor.name+"</span> ";
|
||||
for(param in ronin.module.parameters){
|
||||
var name = new ronin.module.parameters[param]().constructor.name;
|
||||
h += name+" ";
|
||||
}
|
||||
for(variable in ronin.module.variables){
|
||||
h += variable+"="+ronin.module.variables[variable]+" ";
|
||||
}
|
||||
}
|
||||
else{
|
||||
var h = padding+" ";
|
||||
}
|
||||
|
||||
this.hint_element.innerHTML = h;
|
||||
|
||||
ronin.terminal.input_element.setAttribute("style","color:"+ronin.brush.color.hex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user