function Help(rune)
{
Module.call(this,rune);
this.view = document.createElement("div");
this.install = function(cmd)
{
console.log("Installing "+ronin.modules[this.rune].constructor.name);
this.view.setAttribute("id","help_view");
var html = "";
html += "
";
html += this.view_controls();
html += this.view_modules();
html += this.view_units();
html += this.view_presets();
this.view.innerHTML = "
"+html+"
";
ronin.element.appendChild(this.view);
}
this.on_resize = function()
{
this.view.style.left = (window.innerWidth/2)-(ronin.surface.size.width/2);
this.view.style.top = (window.innerHeight/2)+(ronin.surface.size.height/2)+20;
}
this.passive = function(cmd)
{
this.view.style.display = "block";
ronin.cursor.element.style.display = "none";
}
this.key_escape = function()
{
this.view.style.display = "none";
}
//
this.view_controls = function()
{
html = "Controls
";
html += "";
html += "- ctrl Draw Overlays
\n";
html += "- alt Drag Surface
\n";
html += "- shift Erase
\n";
html += "- shift+ctrl Eyedrop
\n";
html += "- shift+alt Move Layer
\n";
html += "
";
return ""+html+"
";
}
this.view_modules = function()
{
html = "Modules
";
html += "";
Object.keys(ronin.modules).forEach(function (key) {
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+" ";
}
html += "
\n";
});
html += "
";
html += "\n";
return ""+html+"
";
}
this.view_units = function()
{
html = "Units
\n\n";
html += "";
html += "- 5 value: 5
\n";
html += "- 5,7 position: 5x 7y
\n";
html += "- 7x9 rect: 5w 7h
\n";
html += "- #ff0000 color: red
\n";
html += "- 45' degree: 45/365
\n";
html += "- rate=10 variable: rate=10
\n";
html += "
";
html += "\n";
html += "Filters
\n\n";
html += "";
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+" ";
}
html += "
\n";
}
html += "
";
html += "\n";
return ""+html+"
";
}
this.view_presets = function()
{
html = "Presets
\n\n";
for(var key in ronin.modules["-"].collection){
html += ""+key+"
";
for(var name in ronin.modules["-"].collection[key]){
html += "- "+name+"
"
}
html += "
\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;
}
}