1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Fabian 'x3n' Landau |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #include "CorePrereqs.h" |
---|
30 | |
---|
31 | #include "OrxonoxClass.h" |
---|
32 | #include "InputBuffer.h" |
---|
33 | #include "OutputBuffer.h" |
---|
34 | |
---|
35 | namespace orxonox |
---|
36 | { |
---|
37 | Shell::Shell() |
---|
38 | { |
---|
39 | this->inputBuffer_.registerListener(this, &Shell::inputChanged, true); |
---|
40 | this->inputBuffer_.registerListener(this, &Shell::execute, '\r', false); |
---|
41 | this->inputBuffer_.registerListener(this, &Shell::hintandcomplete, '\t', true); |
---|
42 | this->inputBuffer_.registerListener(this, &Shell::clear, '§', true); |
---|
43 | this->inputBuffer_.registerListener(this, &Shell::backspace, '\b', true); |
---|
44 | this->inputBuffer_.registerListener(this, &Shell::exit, (char)27, true); |
---|
45 | this->inputBuffer_.registerListener(this, &Shell::cursor_right, OIS::KC_RIGHT); |
---|
46 | this->inputBuffer_.registerListener(this, &Shell::cursor_left, OIS::KC_LEFT); |
---|
47 | this->inputBuffer_.registerListener(this, &Shell::history_up, OIS::KC_UP); |
---|
48 | this->inputBuffer_.registerListener(this, &Shell::history_down, OIS::KC_DOWN); |
---|
49 | this->inputBuffer_.registerListener(this, &Shell::scroll_up, OIS::KC_PGUP); |
---|
50 | this->inputBuffer_.registerListener(this, &Shell::scroll_down, OIS::KC_PGDOWN); |
---|
51 | } |
---|
52 | |
---|
53 | Shell& Shell::getInstance() |
---|
54 | { |
---|
55 | static instance Shell; |
---|
56 | return instance; |
---|
57 | } |
---|
58 | |
---|
59 | void Shell::setConfigValues() |
---|
60 | |
---|
61 | void Shell::outputChanged() |
---|
62 | void Shell::inputChanged() |
---|
63 | void Shell::execute() |
---|
64 | void Shell::hintandcomplete() |
---|
65 | void Shell::backspace() |
---|
66 | void Shell::clear() |
---|
67 | void Shell::cursor_right() |
---|
68 | void Shell::cursor_left() |
---|
69 | void Shell::history_up() |
---|
70 | void Shell::history_down() |
---|
71 | void Shell::scroll_up() |
---|
72 | void Shell::scroll_down() |
---|
73 | void Shell::exit() |
---|
74 | } |
---|