From a51eddeb2fbc88753c2e93fdf4bc5cb4b59c499f Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 28 Sep 2017 15:01:17 +1300 Subject: [PATCH] Improved help --- sources/scripts/core/hint.js | 15 +++++++++++++-- sources/scripts/modules/frame.js | 2 +- sources/scripts/modules/io.js | 2 +- sources/scripts/modules/magnet.js | 2 +- sources/scripts/modules/path.js | 2 +- sources/scripts/ronin.js | 1 + 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/sources/scripts/core/hint.js b/sources/scripts/core/hint.js index 1d43f4a..9227d5f 100644 --- a/sources/scripts/core/hint.js +++ b/sources/scripts/core/hint.js @@ -15,9 +15,20 @@ function Hint() for(module_id in ronin.modules){ var module = ronin.modules[module_id]; - html += module.hint()+" "; + html += module_id+" "; + } + + var target_module = ronin.commander.query().module; + + if(ronin.commander.input_el.value == ""){ + this.el.innerHTML = html; + } + else if(ronin.modules[target_module]){ + this.el.innerHTML = this.pad(ronin.commander.input_el.value)+ronin.modules[target_module].hint(); + } + else{ + this.el.innerHTML = this.pad(ronin.commander.input_el.value)+" > Idle." } - this.el.innerHTML = this.pad(ronin.commander.input_el.value)+(ronin.commander.input_el.value == "" ? html : ""); } this.pad = function(input) diff --git a/sources/scripts/modules/frame.js b/sources/scripts/modules/frame.js index 32f8a35..2f52d84 100644 --- a/sources/scripts/modules/frame.js +++ b/sources/scripts/modules/frame.js @@ -1,6 +1,6 @@ function Frame() { - Module.call(this,"frame"); + Module.call(this,"frame","Manager for the canvas size"); this.settings = {width:400,height:400}; diff --git a/sources/scripts/modules/io.js b/sources/scripts/modules/io.js index f923ac5..543a484 100644 --- a/sources/scripts/modules/io.js +++ b/sources/scripts/modules/io.js @@ -1,6 +1,6 @@ function IO() { - Module.call(this,"io"); + Module.call(this,"io","File import/export tools."); this.settings = {anchor:{x:0,y:0,width:0,height:0}}; diff --git a/sources/scripts/modules/magnet.js b/sources/scripts/modules/magnet.js index bf93a49..415ccb7 100644 --- a/sources/scripts/modules/magnet.js +++ b/sources/scripts/modules/magnet.js @@ -1,6 +1,6 @@ function Magnet() { - Module.call(this,"magnet","Cursor magnetisation settings."); + Module.call(this,"magnet","Cursor magnetisation settings, changes are reflected on the grid layer."); this.settings = {size:0,step:4}; diff --git a/sources/scripts/modules/path.js b/sources/scripts/modules/path.js index b88916e..cda8de7 100644 --- a/sources/scripts/modules/path.js +++ b/sources/scripts/modules/path.js @@ -1,6 +1,6 @@ function Path() { - Module.call(this,"path"); + Module.call(this,"path","Trace lines and to draw shapes."); this.settings = {thickness:30,color:"black",cap:"square"}; diff --git a/sources/scripts/ronin.js b/sources/scripts/ronin.js index 01c130b..311fac6 100644 --- a/sources/scripts/ronin.js +++ b/sources/scripts/ronin.js @@ -73,6 +73,7 @@ function Ronin() this.guide.update(); this.cursor.update(); this.preview.update(); + this.commander.update(); // this.commander.input_el.value = "io import:~/Desktop/test.png anchor=$"; // this.commander.input_el.value = "path stroke:$+";