add command line arguments

This commit is contained in:
Asraelite 2016-03-29 13:45:23 +01:00
parent 4f42723f4a
commit 1160466cf9
13 changed files with 129 additions and 7 deletions

View file

@ -64,3 +64,11 @@ body {
#gui #chat input:focus {
background-color: #eee;
}
#gui #weapons {
bottom: 0;
left: 50%;
transform: translate(-50%, 0);
}
#gui #weapons

View file

@ -0,0 +1,3 @@
# test {
ayy: 5;
}

View file

@ -4,7 +4,22 @@ class CommandProcessor {
}
run(command, arg) {
if (command == 'setname') this.setName(arg);
if (command == 'setname') {
this.setName(arg);
} else if (command == 'commands') {
game.gui.chat.addMessage({
type: 'server',
message: 'Available commands:<br /> ' +
'/setname [name]<br /> ' +
'/commands'
});
} else {
game.gui.chat.addMessage({
type: 'server',
message: 'Unrecognised command<br />' +
'Type /commands for a list'
});
}
}
setName(name) {

View file

4
public/stylus/test.css Normal file
View file

@ -0,0 +1,4 @@
# test {
ayy: 5;
b: 2;
}

3
public/stylus/test.styl Normal file
View file

@ -0,0 +1,3 @@
# test {
ayy: 5;
}

View file

@ -1,3 +1,6 @@
#chat.container
#chat-messages
input(type="text", maxLength="100")#chat-input
#weapons.container
#weapon-selection