TrenchBroom / TrenchBroom

Cross-Platform Level Editor
kristianduske.com/trenchbroom
GNU General Public License v3.0
1.88k stars 224 forks source link

Identifying decimal separators from system locale #2228

Closed E5rael closed 5 years ago

E5rael commented 5 years ago

I have a system, which uses commas as decimal separators. So, quite often, when I copy coordinates from outside Trenchbroom, I have to fix the commas to points after pasting, which is rather annoying. Would it be possible to have Trenchbroom identify the decimal separator from the system and correct things to use points?

For example, if the system has comma as the separator and you've copied a string of 0,5 15 15 and then pasted it, say, to a value field of an entity's key, Trenchbroom would autocorrect it to 0.5 15 15. But if the copied string also has letters in it, e.g. After traveling 3,5 kilometers to the base, you were intercepted by a group of hungry shamblers then Trenchbroom wouldn't autocorrect the commas.

Another example, that doesn't involve copying/pasting, would be if the user inputs coordinates with the numpad. In a system with comma set as the decimal separator, pressing the numpad del key will produce a comma instead of a point, so maybe have Trenchbroom autocorrect your coordinates to use points instead of commas after inputting the field and pressing enter, or something?

And to provide the user with absolute control over the input, all this autocorrection could be made optional in the options menu.

kduske commented 5 years ago

TB assumes US notation with dots for commas. I'd rather not get in the business of auto detecting such things.