|
@@ -83,7 +83,10 @@ int OpenRaider::loadConfig(const char *config) {
|
83
|
83
|
|
84
|
84
|
char buffer[256];
|
85
|
85
|
while (fgets(buffer, 256, f) != NULL) {
|
86
|
|
- command(buffer);
|
|
86
|
+ int error = command(buffer);
|
|
87
|
+ if (error != 0) {
|
|
88
|
+ mConsole->print("Error Code: %d", error);
|
|
89
|
+ }
|
87
|
90
|
}
|
88
|
91
|
|
89
|
92
|
fclose(f);
|
|
@@ -132,14 +135,14 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
132
|
135
|
|
133
|
136
|
if (strcmp(command, "set") == 0) {
|
134
|
137
|
if (args->size() != 2) {
|
135
|
|
- mConsole->print("Invalid use of set-command ");
|
|
138
|
+ mConsole->print("Invalid use of set-command");
|
136
|
139
|
return -2;
|
137
|
140
|
} else {
|
138
|
141
|
return set(args->at(0), args->at(1));
|
139
|
142
|
}
|
140
|
143
|
} else if (strcmp(command, "bind") == 0) {
|
141
|
144
|
if (args->size() != 2) {
|
142
|
|
- mConsole->print("Invalid use of bind-command ");
|
|
145
|
+ mConsole->print("Invalid use of bind-command");
|
143
|
146
|
return -3;
|
144
|
147
|
} else {
|
145
|
148
|
return bind(args->at(0), args->at(1));
|
|
@@ -157,8 +160,8 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
|
157
|
160
|
} else if (args->size() == 1) {
|
158
|
161
|
return help(args->at(0));
|
159
|
162
|
} else {
|
160
|
|
- mConsole->print("Invalid use of help-command ");
|
161
|
|
- return -4;
|
|
163
|
+ mConsole->print("Invalid use of help-command");
|
|
164
|
+ return -5;
|
162
|
165
|
}
|
163
|
166
|
} else {
|
164
|
167
|
mConsole->print("Unknown command: %s ", command);
|
|
@@ -185,6 +188,8 @@ int OpenRaider::help(const char *cmd) {
|
185
|
188
|
mConsole->print(" volume BOOL");
|
186
|
189
|
mConsole->print(" mouse_x FLOAT");
|
187
|
190
|
mConsole->print(" mouse_y FLOAT");
|
|
191
|
+ mConsole->print("Enclose STRINGs with \"\"!");
|
|
192
|
+ mConsole->print("size expects a STRING in the specified format");
|
188
|
193
|
} else if (strcmp(cmd, "bind") == 0) {
|
189
|
194
|
mConsole->print("bind-Command Usage:");
|
190
|
195
|
mConsole->print(" bind ACTION KEY");
|
|
@@ -477,6 +482,12 @@ int OpenRaider::bind(ActionEvents action, const char *key) {
|
477
|
482
|
keyBindings[action] = space;
|
478
|
483
|
} else if (strcmp(tmp, "tab") == 0) {
|
479
|
484
|
keyBindings[action] = tab;
|
|
485
|
+ } else if (strcmp(tmp, "leftmouse") == 0) {
|
|
486
|
+ keyBindings[action] = leftmouse;
|
|
487
|
+ } else if (strcmp(tmp, "middlemouse") == 0) {
|
|
488
|
+ keyBindings[action] = middlemouse;
|
|
489
|
+ } else if (strcmp(tmp, "rightmouse") == 0) {
|
|
490
|
+ keyBindings[action] = rightmouse;
|
480
|
491
|
} else {
|
481
|
492
|
mConsole->print("bind-\"\"-Error: Unknown key (%s)", key);
|
482
|
493
|
delete [] tmp;
|
|
@@ -642,7 +653,7 @@ void OpenRaider::handleText(char *text, bool notFinished) {
|
642
|
653
|
}
|
643
|
654
|
}
|
644
|
655
|
|
645
|
|
-void OpenRaider::handleMouseClick(unsigned int x, unsigned int y, MouseButton button, bool released) {
|
|
656
|
+void OpenRaider::handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released) {
|
646
|
657
|
if (mMenu->isVisible()) {
|
647
|
658
|
mMenu->handleMouseClick(x, y, button, released);
|
648
|
659
|
}
|