diff --git a/links/main.css b/links/main.css index 2bfe2d5..321300c 100644 --- a/links/main.css +++ b/links/main.css @@ -9,9 +9,6 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #frame { cursor:none;} #terminal { position: fixed;top: 0px;left: 0px;background: #000;width: 40vw;height: 100vh;overflow: hidden;} -#terminal textarea { display: block;position: fixed;top: 100px;width: calc(40vw - 16px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px} -#terminal textarea:hover { border-left:1px solid #555; } -#terminal textarea { z-index:900; } #terminal logs { display: none;position: absolute;bottom:20px;width:100vw;color:white} #terminal logs log { display: block; font-size:10px; line-height:25px; padding:0px 5px; color:#666;} #terminal logs log .rune { color:white; } @@ -35,11 +32,14 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #terminal #widget li.inactive { color:#fff; } #terminal #widget li.managed { color:#777; } -#terminal hint { display: block;position: fixed;top: 100px;width: calc(40vw - 45px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px; z-index:9000;} +#terminal hint { display: block;position: fixed;top: 100px;width: calc(40vw - 45px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #999;border-left:1px solid #333;margin-left:15px;} #terminal hint line { display: inline; width:calc(100% - 30px); } #terminal hint line .input { opacity:1; } #terminal hint line .status { position: absolute;right:30px; } -#terminal hint line .input .module { color: white; } -#terminal hint line .input .method { color: red; } -#terminal hint line .input .setting { color: #72dec2; } +#terminal hint line .input .module { background: #222; } +#terminal hint line .input .method { background: #333; } +#terminal hint line .input .setting { background: #444; } +#terminal textarea { display: block;position: fixed;top: 100px;width: calc(40vw - 16px);height: calc(100vh - 130px);padding: 0px 15px;line-height: 20px;font-size: 12px;background: none;color: #ccc;border-left:1px solid #333;margin-left:15px} +#terminal textarea:hover { border-left:1px solid #555; } +#terminal textarea { z-index:900; } \ No newline at end of file diff --git a/presets/blank.rin b/presets/blank.rin new file mode 100644 index 0000000..dbd13db --- /dev/null +++ b/presets/blank.rin @@ -0,0 +1,5 @@ +~ Blank + +frame.resize 400x400 +layer.fill #A1A1A1 +brush:color #ff0000 diff --git a/scripts/core/init.js b/scripts/core/init.js index 12a8e39..e8ded9a 100644 --- a/scripts/core/init.js +++ b/scripts/core/init.js @@ -31,4 +31,6 @@ starting_canvas.height = window.innerHeight - 300; starting_canvas.width = parseInt(starting_canvas.width/40) * 40; starting_canvas.height = parseInt(starting_canvas.height/40) * 40; -ronin.widget.update(); \ No newline at end of file +// ronin.terminal.load("default.rin"); +ronin.terminal.load("blank.rin"); +ronin.widget.update(); diff --git a/scripts/modules/cursor.js b/scripts/modules/cursor.js index 44b9bb2..0d7c82b 100644 --- a/scripts/modules/cursor.js +++ b/scripts/modules/cursor.js @@ -155,6 +155,7 @@ function Cursor(rune) if(this.mode == mode){ return; } this.mode = mode; document.body.setAttribute("class",this.mode.constructor.name); + ronin.widget.update(); } this.mouse_down = function(position) diff --git a/scripts/modules/frame.js b/scripts/modules/frame.js index 983959b..2564f74 100644 --- a/scripts/modules/frame.js +++ b/scripts/modules/frame.js @@ -16,9 +16,7 @@ function Frame(rune) this.install = function() { this.blink(); - var l = new Layer("background"); - this.add_layer(l); - this.select_layer(l); + this.select(new Command(["background"])); this.resize(new Command(["300x300"])); } diff --git a/scripts/modules/path.js b/scripts/modules/path.js index 4a02898..b8614ac 100644 --- a/scripts/modules/path.js +++ b/scripts/modules/path.js @@ -27,6 +27,8 @@ function Path(rune) context.stroke(new Path2D(params.content)); context.closePath(); + if(!preview){ this.coordinates = []; this.last_pos = null; } + return 1, preview ? "preview" : "ok"; } @@ -91,16 +93,16 @@ function Path(rune) this.mouse_down = function(position) { - // ronin.terminal.input_element.value = "path."+ronin.terminal.method_name+" "+this.create_path(); - // ronin.terminal.input_element.value += "M"+position.render(); - ronin.terminal.passive(); + var line = "path.stroke "+this.create_path(); + line += "M"+position.render(); + ronin.terminal.update_active_line(line); } this.mouse_move = function(position) { - // ronin.terminal.input_element.value = "path."+ronin.terminal.method_name+" "+this.create_path(); - // ronin.terminal.input_element.value += "L"+position.render(); - ronin.terminal.passive(); + var line = "path.stroke "+this.create_path(); + line += "L"+position.render(); + ronin.terminal.update_active_line(line); } this.mouse_up = function(position) @@ -125,9 +127,8 @@ function Path(rune) } } - // ronin.terminal.input_element.value = "path."+ronin.terminal.method_name+" "+this.create_path(); + ronin.terminal.update_active_line("path.stroke "+this.create_path()); this.last_pos = position; - ronin.terminal.passive(); } this.key_escape = function() @@ -135,7 +136,6 @@ function Path(rune) if(this.layer){ this.layer.remove(this); } this.coordinates = []; this.last_pos = null; - // ronin.terminal.input_element.value = ""; ronin.terminal.passive(); } } \ No newline at end of file diff --git a/scripts/modules/terminal.js b/scripts/modules/terminal.js index 4066dd9..81b43b8 100644 --- a/scripts/modules/terminal.js +++ b/scripts/modules/terminal.js @@ -14,7 +14,6 @@ function Terminal(rune) this.add_method(new Method("save",["text"])); this.add_method(new Method("load",["path"])); - this.add_method(new Method("display",["mini/hide/full"])); // Module this.install = function(cmd) @@ -26,11 +25,10 @@ function Terminal(rune) this.element.appendChild(this.status_element); this.status_element.innerHTML = "Ready."; - this.textarea.value = "frame.select background\nframe.resize 400x400\nbrush:color #ff0000\nbrush.add_pointer 1,1\nbrush.add_pointer 2,2\nlayer.fill #A1A1A1\nrender.stencil #72dec2\ntype:size 50\ntype.write 50,150 \"RONIN\"\ntype:size 15\ntype.write 55,180 \"VER 0.1\"" + this.textarea.value = "" this.hint_element.innerHTML = ""; this.validation_timer(); - this.load("default.rin"); this.timer = 20; } @@ -56,7 +54,6 @@ function Terminal(rune) if(ronin.terminal.has_changed() == true){ ronin.terminal.run(); } - this.history = this.textarea.value; this.timer = 0; } @@ -74,7 +71,7 @@ function Terminal(rune) { var content = line; - if(content.trim() == ""){ return "~"; } + if(content.trim() == ""){ ronin.cursor.set_mode(ronin.brush); return "~"; } if(content.trim()[0] == "~"){ return "~"; } if(content.indexOf(".") > -1){ @@ -93,7 +90,7 @@ function Terminal(rune) var parameters = content.split(" "); parameters.shift(); var parameters = new Command(parameters); - if(id == 1){ ronin.cursor.set_mode(ronin[module_name]); } + ronin.cursor.set_mode(ronin[module_name]); if(ronin[module_name] && ronin[module_name][method_name]){ return ronin[module_name][method_name](parameters,id == 1 ? true : false);