|
@@ -150,12 +150,72 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
150
|
150
|
}
|
151
|
151
|
} else if (strcmp(command, "quit") == 0) {
|
152
|
152
|
exit(0);
|
|
153
|
+ } else if (strcmp(command, "help") == 0) {
|
|
154
|
+ if (args->size() == 0) {
|
|
155
|
+ mConsole->print("Available commands:");
|
|
156
|
+ mConsole->print(" set");
|
|
157
|
+ mConsole->print(" bind");
|
|
158
|
+ mConsole->print(" help");
|
|
159
|
+ mConsole->print(" quit");
|
|
160
|
+ mConsole->print("Use help COMMAND to get additional info");
|
|
161
|
+ } else if (args->size() == 1) {
|
|
162
|
+ return help(args->at(0));
|
|
163
|
+ } else {
|
|
164
|
+ mConsole->print("Invalid use of help-command ");
|
|
165
|
+ printStringVector(args);
|
|
166
|
+ printf("\n");
|
|
167
|
+ return -4;
|
|
168
|
+ }
|
153
|
169
|
} else {
|
154
|
170
|
mConsole->print("Unknown command: %s ", command);
|
155
|
171
|
printStringVector(args);
|
156
|
172
|
printf("\n");
|
157
|
173
|
return -1;
|
158
|
174
|
}
|
|
175
|
+
|
|
176
|
+ return 0;
|
|
177
|
+}
|
|
178
|
+
|
|
179
|
+int OpenRaider::help(const char *cmd) {
|
|
180
|
+ if (strcmp(cmd, "set") == 0) {
|
|
181
|
+ mConsole->print("set-Command Usage:");
|
|
182
|
+ mConsole->print(" set VAR VAL");
|
|
183
|
+ mConsole->print("Available Variables:");
|
|
184
|
+ mConsole->print(" basedir STRING");
|
|
185
|
+ mConsole->print(" pakdir STRING");
|
|
186
|
+ mConsole->print(" audiodir STRING");
|
|
187
|
+ mConsole->print(" datadir STRING");
|
|
188
|
+ mConsole->print(" font STRING");
|
|
189
|
+ mConsole->print(" gldriver STRING");
|
|
190
|
+ mConsole->print(" size \"INTxINT\"");
|
|
191
|
+ mConsole->print(" fullscreen BOOL");
|
|
192
|
+ mConsole->print(" audio BOOL");
|
|
193
|
+ mConsole->print(" volume BOOL");
|
|
194
|
+ mConsole->print(" mouse_x FLOAT");
|
|
195
|
+ mConsole->print(" mouse_y FLOAT");
|
|
196
|
+ } else if (strcmp(cmd, "bind") == 0) {
|
|
197
|
+ mConsole->print("bind-Command Usage:");
|
|
198
|
+ mConsole->print(" bind ACTION KEY");
|
|
199
|
+ mConsole->print("Available Actions:");
|
|
200
|
+ mConsole->print(" menu");
|
|
201
|
+ mConsole->print(" console");
|
|
202
|
+ mConsole->print(" forward");
|
|
203
|
+ mConsole->print(" backward");
|
|
204
|
+ mConsole->print(" left");
|
|
205
|
+ mConsole->print(" right");
|
|
206
|
+ mConsole->print(" jump");
|
|
207
|
+ mConsole->print(" crouch");
|
|
208
|
+ mConsole->print(" use");
|
|
209
|
+ mConsole->print(" holster");
|
|
210
|
+ mConsole->print("Key-Format:");
|
|
211
|
+ mConsole->print(" 'a' or '1' for character/number keys");
|
|
212
|
+ mConsole->print(" \"leftctrl\" for symbols and special keys");
|
|
213
|
+ } else {
|
|
214
|
+ mConsole->print("No help available for %s", cmd);
|
|
215
|
+ return -1;
|
|
216
|
+ }
|
|
217
|
+
|
|
218
|
+ return 0;
|
159
|
219
|
}
|
160
|
220
|
|
161
|
221
|
char *OpenRaider::expandDirectoryNames(const char *s) {
|