Fixed various issues

This commit is contained in:
Devine Lu Linvega 2017-04-18 09:05:16 -10:00
parent e310644497
commit 2fa538af30
7 changed files with 29 additions and 26 deletions

View File

@ -9,9 +9,6 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium"
#frame { cursor:none;} #frame { cursor:none;}
#terminal { position: fixed;top: 0px;left: 0px;background: #000;width: 40vw;height: 100vh;overflow: hidden;} #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 { 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 { display: block; font-size:10px; line-height:25px; padding:0px 5px; color:#666;}
#terminal logs log .rune { color:white; } #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.inactive { color:#fff; }
#terminal #widget li.managed { color:#777; } #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 { display: inline; width:calc(100% - 30px); }
#terminal hint line .input { opacity:1; } #terminal hint line .input { opacity:1; }
#terminal hint line .status { position: absolute;right:30px; } #terminal hint line .status { position: absolute;right:30px; }
#terminal hint line .input .module { color: white; } #terminal hint line .input .module { background: #222; }
#terminal hint line .input .method { color: red; } #terminal hint line .input .method { background: #333; }
#terminal hint line .input .setting { color: #72dec2; } #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; }

5
presets/blank.rin Normal file
View File

@ -0,0 +1,5 @@
~ Blank
frame.resize 400x400
layer.fill #A1A1A1
brush:color #ff0000

View File

@ -31,4 +31,6 @@ starting_canvas.height = window.innerHeight - 300;
starting_canvas.width = parseInt(starting_canvas.width/40) * 40; starting_canvas.width = parseInt(starting_canvas.width/40) * 40;
starting_canvas.height = parseInt(starting_canvas.height/40) * 40; starting_canvas.height = parseInt(starting_canvas.height/40) * 40;
// ronin.terminal.load("default.rin");
ronin.terminal.load("blank.rin");
ronin.widget.update(); ronin.widget.update();

View File

@ -155,6 +155,7 @@ function Cursor(rune)
if(this.mode == mode){ return; } if(this.mode == mode){ return; }
this.mode = mode; this.mode = mode;
document.body.setAttribute("class",this.mode.constructor.name); document.body.setAttribute("class",this.mode.constructor.name);
ronin.widget.update();
} }
this.mouse_down = function(position) this.mouse_down = function(position)

View File

@ -16,9 +16,7 @@ function Frame(rune)
this.install = function() this.install = function()
{ {
this.blink(); this.blink();
var l = new Layer("background"); this.select(new Command(["background"]));
this.add_layer(l);
this.select_layer(l);
this.resize(new Command(["300x300"])); this.resize(new Command(["300x300"]));
} }

View File

@ -27,6 +27,8 @@ function Path(rune)
context.stroke(new Path2D(params.content)); context.stroke(new Path2D(params.content));
context.closePath(); context.closePath();
if(!preview){ this.coordinates = []; this.last_pos = null; }
return 1, preview ? "preview" : "ok"; return 1, preview ? "preview" : "ok";
} }
@ -91,16 +93,16 @@ function Path(rune)
this.mouse_down = function(position) this.mouse_down = function(position)
{ {
// ronin.terminal.input_element.value = "path."+ronin.terminal.method_name+" "+this.create_path(); var line = "path.stroke "+this.create_path();
// ronin.terminal.input_element.value += "M"+position.render(); line += "M"+position.render();
ronin.terminal.passive(); ronin.terminal.update_active_line(line);
} }
this.mouse_move = function(position) this.mouse_move = function(position)
{ {
// ronin.terminal.input_element.value = "path."+ronin.terminal.method_name+" "+this.create_path(); var line = "path.stroke "+this.create_path();
// ronin.terminal.input_element.value += "L"+position.render(); line += "L"+position.render();
ronin.terminal.passive(); ronin.terminal.update_active_line(line);
} }
this.mouse_up = function(position) 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; this.last_pos = position;
ronin.terminal.passive();
} }
this.key_escape = function() this.key_escape = function()
@ -135,7 +136,6 @@ function Path(rune)
if(this.layer){ this.layer.remove(this); } if(this.layer){ this.layer.remove(this); }
this.coordinates = []; this.coordinates = [];
this.last_pos = null; this.last_pos = null;
// ronin.terminal.input_element.value = "";
ronin.terminal.passive(); ronin.terminal.passive();
} }
} }

View File

@ -14,7 +14,6 @@ function Terminal(rune)
this.add_method(new Method("save",["text"])); this.add_method(new Method("save",["text"]));
this.add_method(new Method("load",["path"])); this.add_method(new Method("load",["path"]));
this.add_method(new Method("display",["mini/hide/full"]));
// Module // Module
this.install = function(cmd) this.install = function(cmd)
@ -26,11 +25,10 @@ function Terminal(rune)
this.element.appendChild(this.status_element); this.element.appendChild(this.status_element);
this.status_element.innerHTML = "Ready."; 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.hint_element.innerHTML = "";
this.validation_timer(); this.validation_timer();
this.load("default.rin");
this.timer = 20; this.timer = 20;
} }
@ -56,7 +54,6 @@ function Terminal(rune)
if(ronin.terminal.has_changed() == true){ if(ronin.terminal.has_changed() == true){
ronin.terminal.run(); ronin.terminal.run();
} }
this.history = this.textarea.value; this.history = this.textarea.value;
this.timer = 0; this.timer = 0;
} }
@ -74,7 +71,7 @@ function Terminal(rune)
{ {
var content = line; var content = line;
if(content.trim() == ""){ return "~"; } if(content.trim() == ""){ ronin.cursor.set_mode(ronin.brush); return "~"; }
if(content.trim()[0] == "~"){ return "~"; } if(content.trim()[0] == "~"){ return "~"; }
if(content.indexOf(".") > -1){ if(content.indexOf(".") > -1){
@ -93,7 +90,7 @@ function Terminal(rune)
var parameters = content.split(" "); parameters.shift(); var parameters = content.split(" "); parameters.shift();
var parameters = new Command(parameters); 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]){ if(ronin[module_name] && ronin[module_name][method_name]){
return ronin[module_name][method_name](parameters,id == 1 ? true : false); return ronin[module_name][method_name](parameters,id == 1 ? true : false);