Improved widgets

This commit is contained in:
Devine Lu Linvega 2016-12-25 16:16:27 -07:00
parent 0f2a6cdcd9
commit 882d339407
4 changed files with 16 additions and 3 deletions

View File

@ -64,6 +64,14 @@ function Brush(rune)
this.widget_cursor = function()
{
var s = "> "+this.size+"<br />";
for (i = 0; i < ronin.brush.pointers.length; i++) {
s += ronin.brush.pointers[i].widget();
}
return s;
return this.pointers.length > 0 ? "Brush "+this.size+", "+this.pointers.length+" pointers" : "No Pointers";
}

View File

@ -90,4 +90,9 @@ function Pointer(offset = new Position(), color = new Color('000000'))
{
this.position_prev = null;
}
this.widget = function()
{
return this.offset.render()+"<br />";
}
}

View File

@ -83,12 +83,12 @@ function Surface(rune)
{
if(!this.active_layer){ return ""; }
var s = "";
var s = "# "+this.size.render()+"<br />";
Object.keys(ronin.surface.layers).forEach(function (key) {
s += ronin.surface.layers[key].widget();
});
return s; // "# "+this.active_layer.name;
return s;
}
this.widget_cursor = function()

View File

@ -55,7 +55,7 @@ function Layer(name,host = "user")
this.widget = function()
{
return "# "+this.name+"<br />";
return (ronin.surface.active_layer.name == this.name) ? "<span class='highlight'>- ("+this.name+")</span><br />" : "- "+this.name+"<br />";
}
this.move_from = null;