diff --git a/index.html b/index.html
index fc4735b..c3211a5 100644
--- a/index.html
+++ b/index.html
@@ -28,6 +28,7 @@
+
diff --git a/links/main.css b/links/main.css
index fc752b9..3e30709 100644
--- a/links/main.css
+++ b/links/main.css
@@ -4,9 +4,6 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
#ronin { width:100%; height:100%; overflow:hidden; background:#111; background-image:url(../media/graphics/grid.svg); background-position: center center; }
#frame { width:50vw; height:50vh; overflow:hidden; position:fixed; left:50%; top:50%; background:none; border-radius:5px; border:1px solid #333;}
#frame > .layer { position:absolute; top:0px; left:0px; width:100%; height:100%;}
-#frame widget { position: absolute; top:0px; left:0px; line-height: 20px; font-size:10px; z-index:9000; color:white; width:100%; height:100%; }
-#frame widget span { display:inline-block; padding:2px 10px; }
-#frame widget .cursor { position:absolute; bottom:0px; right:0px; }
#frame.bright widget { color:#000; }
#overlay { position:absolute; z-index:1000;}
#frame { cursor:none;}
@@ -26,4 +23,13 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
#terminal.hide { height:25px; }
#terminal.mini { height:120px; }
-#terminal.full { height:100vh; }
\ No newline at end of file
+#terminal.full { height:100vh; }
+
+#widget { position: absolute; top:0px; left:0px; line-height: 20px; font-size:10px; z-index:9000; color:white; width:100%; height:100%; }
+#widget span { display:inline-block; line-height:15px; padding:0px 5px; vertical-align: top; }
+#widget span name { display: block; border-bottom: 1px solid #333; line-height:25px; margin-bottom:5px;}
+#widget .cursor { }
+#widget li { display:block; }
+#widget li.active { color:#72dec2; }
+#widget li.inactive { color:#fff; }
+#widget li.managed { color:#777; }
\ No newline at end of file
diff --git a/presets/default.rin b/presets/default.rin
index 78187e2..a248610 100644
--- a/presets/default.rin
+++ b/presets/default.rin
@@ -1,3 +1,5 @@
frame.select main ;
frame.resize 400x400 ;
-brush:color #ff00ff ;
\ No newline at end of file
+brush:color #ff0000 ;
+brush.add_pointer 1,1 ;
+brush.add_pointer 2,2 ;
\ No newline at end of file
diff --git a/scripts/core/init.js b/scripts/core/init.js
index edf0a99..0906ad0 100644
--- a/scripts/core/init.js
+++ b/scripts/core/init.js
@@ -35,4 +35,4 @@ ronin.terminal.query("terminal.load default.rin");
ronin.terminal.input_element.focus();
ronin.terminal.update_hint();
-ronin.frame.update_widget();
\ No newline at end of file
+ronin.widget.update();
\ No newline at end of file
diff --git a/scripts/core/keyboard.js b/scripts/core/keyboard.js
index 76892d6..541358e 100644
--- a/scripts/core/keyboard.js
+++ b/scripts/core/keyboard.js
@@ -12,7 +12,7 @@ function Keyboard()
this.alt_held = true;
}
ronin.cursor.update(event);
- ronin.frame.update_widget();
+ ronin.widget.update();
ronin.terminal.update_hint();
}
@@ -45,7 +45,7 @@ function Keyboard()
// Passive
ronin.terminal.passive(ronin.terminal.input_element.value);
- ronin.frame.update_widget();
+ ronin.widget.update();
ronin.terminal.update_hint();
};
diff --git a/scripts/core/ronin.js b/scripts/core/ronin.js
index cf3c954..86c5ee5 100644
--- a/scripts/core/ronin.js
+++ b/scripts/core/ronin.js
@@ -19,6 +19,7 @@ function Ronin()
this.overlay = new Overlay("|");
this.terminal = new Terminal(">");
this.cursor = new Cursor(".");
+ this.widget = new Widget("?");
this.modules[this.frame.constructor.name] = this.frame;
this.modules[this.type.constructor.name] = this.type;
@@ -43,6 +44,7 @@ function Ronin()
}
this.terminal.install();
+ this.widget.install();
}
this.cursors = [];
diff --git a/scripts/modules/brush.js b/scripts/modules/brush.js
index 8138d2a..1acefb1 100644
--- a/scripts/modules/brush.js
+++ b/scripts/modules/brush.js
@@ -17,7 +17,8 @@ function Brush(rune)
pointer.offset = params.position() ? params.position() : new Position("0,0");
this.pointers.push(pointer);
- ronin.terminal.log(new Log(this,"Added pointer at: "+pointer.offset));
+ ronin.terminal.log(new Log(this,"Added pointer at: "+pointer.offset.render()));
+ ronin.widget.update();
}
this.passive = function(cmd)
@@ -36,14 +37,14 @@ function Brush(rune)
this.size_up = function()
{
this.settings["size"] -= this.settings["size"] > 1 ? 1 : 0;
- ronin.frame.update_widget();
+ ronin.frame.widget.update();
ronin.terminal.log(new Log(this,"Increased pointer size to: "+this.settings["size"]));
}
this.size_down = function()
{
this.settings["size"] += 1;
- ronin.frame.update_widget();
+ ronin.frame.widget.update();
ronin.terminal.log(new Log(this,"Decreased pointer size to: "+this.settings["size"]));
}
@@ -81,7 +82,7 @@ function Brush(rune)
return "Eraser "+this.settings["size"];
}
else{
- return "● Brush "+ronin.brush.pointers.length+"x "+this.settings["size"];
+ return "Brush "+this.settings["size"];
}
}
@@ -119,4 +120,15 @@ function Brush(rune)
ronin.brush.pointers[i].stop();
}
}
+
+ this.widget = function()
+ {
+ var s = "● Brush "+ronin.brush.pointers.length+"x "+this.settings["size"]+"
";
+
+ for(id in this.pointers){
+ s += this.pointers[id].widget();
+ }
+ return s;
+
+ }
}
\ No newline at end of file
diff --git a/scripts/modules/cursor.js b/scripts/modules/cursor.js
index fa06e79..8d8d5c3 100644
--- a/scripts/modules/cursor.js
+++ b/scripts/modules/cursor.js
@@ -206,4 +206,9 @@ function Cursor(rune)
ronin.terminal.update_hint();
this.mode.mouse_from = null;
}
+
+ this.widget = function()
+ {
+ return this.mode.mouse_mode();
+ }
}
\ No newline at end of file
diff --git a/scripts/modules/frame.js b/scripts/modules/frame.js
index 2221556..6f3db9a 100644
--- a/scripts/modules/frame.js
+++ b/scripts/modules/frame.js
@@ -12,12 +12,9 @@ function Frame(rune)
this.add_method(new Method("resize",[new Rect().name]));
this.add_method(new Method("crop",[new Position().name,new Rect().name]));
this.add_method(new Method("select",["text"]));
-
- this.widget_element = document.createElement("widget");
this.install = function()
{
- this.element.appendChild(this.widget_element);
this.blink();
}
@@ -99,42 +96,6 @@ function Frame(rune)
this.element.appendChild(layer.element);
}
- this.widget = function()
- {
- if(!this.active_layer){ return ""; }
-
- return this.rune+" "+this.settings["size"].render();
- }
-
- // Widget
-
- this.update_widget = function()
- {
- if(!this.active_layer){ return; }
-
- var s = "";
-
- s += "";
- for (var key in ronin.modules){
- s += ronin.modules[key].widget() ? ronin.modules[key].widget()+" " : "";
- }
- s += "";
-
- s += ""+ronin.cursor.mode.mouse_mode()+"";
-
- var keys = Object.keys(ronin.frame.layers);
- var loc = keys.indexOf(this.active_layer.name);
-
- if(keys.length > 1){
- s += ""+ronin.frame.active_layer.widget()+"("+(loc+1)+"/"+keys.length+")";
- }
- else{
- s += ""+ronin.frame.active_layer.widget()+"";
- }
-
- this.widget_element.innerHTML = s;
- }
-
// Commands
this.layer_up = function()
@@ -177,4 +138,21 @@ function Frame(rune)
this.mouse_up = function(position,rect)
{
}
+
+ this.widget = function()
+ {
+ var s = "";
+ for(layer in this.layers){
+ if(this.active_layer.name == layer){
+ s += "