diff --git a/sources/scripts/core/commander.js b/sources/scripts/core/commander.js index 25b40e9..7689c8b 100644 --- a/sources/scripts/core/commander.js +++ b/sources/scripts/core/commander.js @@ -23,8 +23,8 @@ function Commander() for(setting_id in q.settings){ var setting_value = q.settings[setting_id]; if(!ronin.modules[q.module].settings[setting_id]){ console.log("Missing setting",setting_id); return; } + ronin.modules[q.module].settings[setting_id] = setting_value; - console.log(ronin.modules[q.module]); } ronin.modules[q.module].routes = q.routes; diff --git a/sources/scripts/core/query.js b/sources/scripts/core/query.js index 92062bb..ae3f523 100644 --- a/sources/scripts/core/query.js +++ b/sources/scripts/core/query.js @@ -102,7 +102,7 @@ function Query(query_str = "") return {x:parseInt(unit_str.split(",")[0]),y:parseInt(unit_str.split(",")[1])}; } // Size - if(unit_str.indexOf("x") > -1){ + if(unit_str.indexOf("x") > -1 && !isNaN(unit_str.split("x")[0]) && !isNaN(unit_str.split("x")[1])){ return {width:parseInt(unit_str.split("x")[0]),height:parseInt(unit_str.split("x")[1])}; } // Float diff --git a/sources/scripts/modules/type.js b/sources/scripts/modules/type.js index 56b052a..e357a7a 100644 --- a/sources/scripts/modules/type.js +++ b/sources/scripts/modules/type.js @@ -2,7 +2,7 @@ function Type() { Module.call(this,"type"); - this.settings = {color:"#000000",font:"Arial",anchor:"center"} + this.settings = {color:"#000000",font:"Gotham Light",anchor:"center"} this.methods.write = new Method("write","text&x,y|WxH","Draw text",function(q){ @@ -10,8 +10,10 @@ function Type() var size = rect.height * 2 ronin.preview.clear(); + console.log(ronin.type.settings); + ronin.render.context().textAlign = ronin.type.settings.anchor; - ronin.render.context().font = size+"px "+ronin.type.settings.font; + ronin.render.context().font = size+"px "+ronin.type.settings.font.replace("+"," "); ronin.render.context().fillText(q[0].replace("+"," "),rect.x * 2,(rect.y * 2)+size); }) @@ -25,7 +27,7 @@ function Type() ronin.preview.clear(); ronin.preview.context().textAlign = this.settings.anchor; - ronin.preview.context().font = size+"px "+this.settings.font; + ronin.preview.context().font = size+"px "+this.settings.font.replace("+"," "); ronin.preview.context().fillText(q.methods.write[0].replace("+"," "),rect.x * 2,(rect.y * 2)+size); } } \ No newline at end of file