Merging params with variables
This commit is contained in:
@@ -81,13 +81,13 @@ function Command(content)
|
||||
return null;
|
||||
}
|
||||
|
||||
this.variable = function(name)
|
||||
this.setting = function(name)
|
||||
{
|
||||
for (i = 0; i < this.content.length; i++) {
|
||||
if(this.content[i].indexOf("=") >= 0){
|
||||
var parts = this.content[i].split("=");
|
||||
if(this.content[i].indexOf(":") >= 0){
|
||||
var parts = this.content[i].split(":");
|
||||
if(parts[0] == name){
|
||||
return new Variable(parts[0],parts[1]);
|
||||
return new Setting(parts[0],parts[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,14 @@ starting_canvas.width = parseInt(starting_canvas.width/40) * 40;
|
||||
starting_canvas.height = parseInt(starting_canvas.height/40) * 40;
|
||||
|
||||
ronin.terminal.query("~ "+ronin.timestamp());
|
||||
ronin.terminal.query("@ "+starting_canvas.render());
|
||||
ronin.terminal.query("@ layer=Main");
|
||||
ronin.terminal.query("@ #ff0000");
|
||||
ronin.terminal.query("- 0,0");
|
||||
ronin.terminal.query("- 1,1");
|
||||
ronin.terminal.query("- 2,2");
|
||||
ronin.terminal.query("- #000000");
|
||||
ronin.terminal.query("@ size:"+starting_canvas.render());
|
||||
ronin.terminal.query("@ layer:Main");
|
||||
ronin.terminal.query("- color:#ff0000");
|
||||
// ronin.terminal.query("# fill=#ff0000");
|
||||
// ronin.terminal.query("- 0,0");
|
||||
// ronin.terminal.query("- 1,1");
|
||||
// ronin.terminal.query("- 2,2");
|
||||
|
||||
ronin.terminal.query("~ Ready.");
|
||||
|
||||
ronin.terminal.input_element.focus();
|
||||
|
||||
@@ -43,11 +43,11 @@ function Ronin()
|
||||
this.position_in_canvas = function(e)
|
||||
{
|
||||
var x = e.clientX;
|
||||
x -= (window.innerWidth - this.surface.size.width)/2;
|
||||
x -= parseInt(this.surface.element.style.marginLeft) + (this.surface.size.width/2);
|
||||
x -= (window.innerWidth - this.surface.settings["size"].width)/2;
|
||||
x -= parseInt(this.surface.element.style.marginLeft) + (this.surface.settings["size"].width/2);
|
||||
var y = e.clientY;
|
||||
y -= (window.innerHeight - this.surface.size.height)/2;
|
||||
y -= parseInt(this.surface.element.style.marginTop) + parseInt(this.surface.size.height/2);
|
||||
y -= (window.innerHeight - this.surface.settings["size"].height)/2;
|
||||
y -= parseInt(this.surface.element.style.marginTop) + parseInt(this.surface.settings["size"].height/2);
|
||||
return new Position(x,y);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ function Widget()
|
||||
|
||||
this.on_resize = function()
|
||||
{
|
||||
this.element.style.left = (window.innerWidth/2)-(ronin.surface.size.width/2);
|
||||
this.element.style.top = (window.innerHeight/2)+(ronin.surface.size.height/2)+20;
|
||||
this.element.style.width = ronin.surface.size.width+"px";
|
||||
this.element.style.left = (window.innerWidth/2)-(ronin.surface.settings["size"].width/2);
|
||||
this.element.style.top = (window.innerHeight/2)+(ronin.surface.settings["size"].height/2)+20;
|
||||
this.element.style.width = ronin.surface.settings["size"].width+"px";
|
||||
|
||||
this.update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user