Basic auto-complete functionality added. Just need to finish up with toke command memory and permission map system.
This commit is contained in:
parent
8f45048ab6
commit
23a71a5478
5 changed files with 132 additions and 20 deletions
|
|
@ -143,22 +143,56 @@ class commandPreprocessor{
|
|||
return foundEmote;
|
||||
}
|
||||
|
||||
getEmoteNames(){
|
||||
//Create an empty array to hold names
|
||||
let names = [];
|
||||
|
||||
//For every set of emotes
|
||||
for(let set of Object.keys(this.emotes)){
|
||||
//for every emote in the current set of emotes
|
||||
for(let emote of this.emotes[set]){
|
||||
//push the name of the emote to the name list
|
||||
names.push(emote.name);
|
||||
}
|
||||
}
|
||||
|
||||
//return our list of names
|
||||
return names;
|
||||
}
|
||||
|
||||
buildAutocompleteDictionary(){
|
||||
//This isn't complete, just a placeholder for now
|
||||
let dictionary = {
|
||||
tokes: [
|
||||
"toke"
|
||||
],
|
||||
serverCMD: [
|
||||
"whisper",
|
||||
"announce",
|
||||
"serverannounce",
|
||||
"clear",
|
||||
"kick"
|
||||
],
|
||||
localCMD:[
|
||||
"high"
|
||||
]
|
||||
tokes: {
|
||||
prefix: '!',
|
||||
postfix: '',
|
||||
cmds: [
|
||||
"toke"
|
||||
]
|
||||
},
|
||||
serverCMD: {
|
||||
prefix: '!',
|
||||
postfix: '',
|
||||
cmds: [
|
||||
"whisper",
|
||||
"announce",
|
||||
"serverannounce",
|
||||
"clear",
|
||||
"kick"
|
||||
]
|
||||
},
|
||||
localCMD:{
|
||||
prefix: '/',
|
||||
postfix: '',
|
||||
cmds: [
|
||||
"high"
|
||||
]
|
||||
},
|
||||
emotes:{
|
||||
prefix:'[',
|
||||
postfix:']',
|
||||
cmds: this.getEmoteNames()
|
||||
}
|
||||
};
|
||||
|
||||
return dictionary;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue