Closed ZiMMy closed 9 years ago
I've tested, everything works as it should.
This is unnecessary overcomplication:
c.ConsoleK1 = Enum.GetName(typeof(KeyCode), keyCode[0]);
So I thought there's no point in storing values in KeyCodes rather than strings.
ToString() returns string, of course.
The question is: why is there a Enum.GetName if you can say .ToString? But I'll try to implement it and my point was, that it could return the Integer as a String, for example 33. The KeyCode.Alpha0 reset is fixed. I did an if statement in the old saveKeys() but I'm now just setting the KeyCodes to the ones in the file.
Storing them as KeyCodes has to be done, because Unity's key names are different from the Enum names, and there's no method to get them from the Enums. As of that, we have to store the keycodes as String in the file, but need them as keycodes, so somewhere has to be a method to do that. I'll test the .ToString method, everything else is done.
Anyways, I have currently the problem that the KeySettings buttons are only useable once. If you reassign your console keys, and then want to do that again, without restarting Besiege, it doesn't work. There should be no reason for them to not work, so could you take a look? Maybe you'll find something.
Anyways, I have currently the problem that the KeySettings buttons are only useable once. If you reassign your console keys, and then want to do that again, without restarting Besiege, it doesn't work. There should be no reason for them to not work, so could you take a look? Maybe you'll find something.
This is exactly the bug this pull request fixes. Look at the content of the config after reassigning the console keys for example: after changing one key combination, everything is set to Alpha0 there.
Nevermind the last problem. Don't know why, but it works now. The .ToString works, so I don't know why where is a Enum.GetName method...but I'll implement .ToString
No, that wasn't it. I changed that before, no Alpha0 anywhere in the code...
I see. Commit your version then, I'll test.
Yeah, will do. For some reason, the Textfield that says "Please Press[...]" is displayed again each time you click the button. So there are multiple textfields above each other. I'll fix this and then commit
You just moved the System.Enum.GetName to another point and I don't know if it works, since the Enums are saved as Integers and if you say .ToString, does it get the String or the Integer? Also, the KeyCode.Alpha0 was to check if the Keys have changed. But I'm currently rewriting everything and will change it so the Defaults keys are there.