Fixed various issues
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"]));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user