Improved Hint()

This commit is contained in:
Devine Lu Linvega
2017-03-27 23:53:56 -07:00
parent 3844a79de9
commit 86310ae73f
3 changed files with 36 additions and 15 deletions

View File

@@ -4,11 +4,32 @@ function Default(rune)
this.hint = function()
{
var s = "";
if(ronin.terminal.input_element.value == ""){
var s = "";
for(module in ronin.modules){
s += ronin.modules[module].constructor.name+" ";
}
return s;
}
//
var candidates = [];
for(module in ronin.modules){
s += ronin.modules[module].constructor.name+" ";
for(method in ronin.modules[module].methods){
candidates.push(module.toLowerCase()+"."+method);
}
}
var s = "";
for(candidate in candidates){
if(candidates[candidate].indexOf(ronin.terminal.input_element.value) > -1){
s += candidates[candidate]+" ";
}
}
return s;
}

View File

@@ -10,7 +10,7 @@ function Module(rune)
this.install = function()
{
console.log("Installing "+ronin.modules[this.rune].constructor.name);
// console.log("Installing "+ronin.modules[this.rune].constructor.name);
}
this.context = function()