function Help(rune) { Module.call(this,rune); this.view = document.createElement("div"); this.active = function(cmd) { s = "hello"; lines = []; // Modules // TODO: Have the modules return their own help string lines.push("Modules: "); Object.keys(ronin.modules).forEach(function (key) { html = ""; var parameters = ""; html += ""+key+" "+ronin.modules[key].constructor.name+" "; for (i = 0; i < ronin.modules[key].parameters.length; i++) { html += ""+ronin.modules[key].parameters[i].name+" "; } lines.push(html); }); // Filters lines.push("Filters: "); for(var filter in ronin.modules["%"].collection){ html = filter+" "; for (i = 0; i < ronin.modules["%"].collection[filter].parameters.length; i++) { html += ""+ronin.modules["%"].collection[filter].parameters[i].name+" "; } lines.push(html); } // Controls lines.push("Controls: "); lines.push("ctrl Draw Overlays\n"); lines.push("alt Drag Surface\n"); lines.push("shift Erase\n"); lines.push("shift+ctrl Eyedrop\n"); lines.push("shift+alt Move Layer\n"); // Units lines.push("Units: "); var units = [new Value(), new Position(), new Rect(), new Color(), new Angle(), new Variable(), new Bang()] for(key in units){ lines.push(units[key].render()); } // Print for(line in lines){ ronin.terminal.log(new Log(this,lines[line])); } } // this.view_units = function() { html = "

Units

\n\n"; html += ""; html += "\n"; html += "\n"; return "
"+html+"
"; } this.view_presets = function() { html = "

Presets

\n\n"; for(var key in ronin.modules["-"].collection){ html += "

"+key+"

\n"; } return "
"+html+"
"; } function pad(s,length) { if(!s){ return s; } var new_string = s; while(new_string.length < length){ new_string += " "; } return new_string; } }