Surface resize is working again
This commit is contained in:
parent
8d7c25c489
commit
40aae14931
@ -32,7 +32,7 @@ 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("@ resize:"+starting_canvas.render());
|
||||
ronin.terminal.query("surface.resize "+starting_canvas.render());
|
||||
ronin.terminal.query("@ select:Main");
|
||||
ronin.terminal.query("- color=#ff0000");
|
||||
ronin.terminal.query("# fill=#ff0000");
|
||||
|
@ -80,13 +80,15 @@ function Module(rune)
|
||||
var method_name = content.split(" ")[0];
|
||||
|
||||
if(this.methods[method_name]){
|
||||
console.log(this.methods[method_name].params)
|
||||
s = this.methods[method_name].params;
|
||||
}
|
||||
else{
|
||||
for(method in this.methods){
|
||||
s += "."+method+"("+method_name+") ";
|
||||
}
|
||||
for(setting in this.settings){
|
||||
s += setting+"="+this.settings[setting].render()+" ";
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
@ -24,19 +24,18 @@ function Surface(rune)
|
||||
|
||||
this.resize = function(params)
|
||||
{
|
||||
var rect = new Rect(params[0]);
|
||||
this.settings["size"] = rect;
|
||||
this.settings["size"] = params.rect();
|
||||
|
||||
Object.keys(ronin.surface.layers).forEach(function (key) {
|
||||
ronin.surface.layers[key].resize(rect);
|
||||
ronin.surface.layers[key].resize(this.settings["size"]);
|
||||
});
|
||||
|
||||
ronin.surface.element.width = rect.width * 2;
|
||||
ronin.surface.element.height = rect.height * 2;
|
||||
ronin.surface.element.style.width = rect.width+"px";
|
||||
ronin.surface.element.style.height = rect.height+"px";
|
||||
ronin.surface.element.style.marginLeft = -(rect.width/2);
|
||||
ronin.surface.element.style.marginTop = -(rect.height/2);
|
||||
ronin.surface.element.width = this.settings["size"].width * 2;
|
||||
ronin.surface.element.height = this.settings["size"].height * 2;
|
||||
ronin.surface.element.style.width = this.settings["size"].width+"px";
|
||||
ronin.surface.element.style.height = this.settings["size"].height+"px";
|
||||
ronin.surface.element.style.marginLeft = -(this.settings["size"].width/2);
|
||||
ronin.surface.element.style.marginTop = -(this.settings["size"].height/2);
|
||||
|
||||
ronin.on_resize();
|
||||
ronin.terminal.log(new Log(this,"Resized Surface to "+this.settings["size"].render()));
|
||||
@ -98,6 +97,8 @@ function Surface(rune)
|
||||
|
||||
this.update_widget = function()
|
||||
{
|
||||
if(!this.active_layer){ return; }
|
||||
|
||||
var s = "";
|
||||
|
||||
s += "<span class='module'>";
|
||||
|
@ -92,27 +92,30 @@ function Terminal(rune)
|
||||
var module_name = content.indexOf(".") > -1 ? content.split(" ")[0].split(".")[0] : content.split(" ")[0];
|
||||
var method_name = content.indexOf(".") > -1 ? content.split(" ")[0].split(".")[1] : "default";
|
||||
|
||||
var parameters = content.split(" "); parameters.shift();
|
||||
var parameters = new Command(parameters);
|
||||
|
||||
if(ronin[module_name] && ronin[module_name][method_name]){
|
||||
ronin[module_name][method_name]();
|
||||
ronin[module_name][method_name](parameters);
|
||||
}
|
||||
else{
|
||||
ronin.terminal.log(new Log(ronin.terminal,"Unknown module"));
|
||||
}
|
||||
|
||||
var key = content[0];
|
||||
var cmd = new Command(content.substring(1).trim().split(" "));
|
||||
// var key = content[0];
|
||||
// var cmd = new Command(content.substring(1).trim().split(" "));
|
||||
|
||||
if(ronin.modules[key]){
|
||||
ronin.modules[key].update_settings(cmd);
|
||||
ronin.modules[key].run_methods(cmd);
|
||||
// ronin.modules[key].active(cmd);
|
||||
ronin.terminal.history.push(content);
|
||||
ronin.terminal.history_index = ronin.terminal.history.length-1;
|
||||
ronin.terminal.update_menu();
|
||||
}
|
||||
else{
|
||||
ronin.terminal.log(new Log(ronin.terminal,"Unknown module: "+key));
|
||||
}
|
||||
// if(ronin.modules[key]){
|
||||
// ronin.modules[key].update_settings(cmd);
|
||||
// ronin.modules[key].run_methods(cmd);
|
||||
// // ronin.modules[key].active(cmd);
|
||||
// ronin.terminal.history.push(content);
|
||||
// ronin.terminal.history_index = ronin.terminal.history.length-1;
|
||||
// ronin.terminal.update_menu();
|
||||
// }
|
||||
// else{
|
||||
// ronin.terminal.log(new Log(ronin.terminal,"Unknown module: "+key));
|
||||
// }
|
||||
}
|
||||
|
||||
// Hint
|
||||
|
Loading…
x
Reference in New Issue
Block a user