Henry00IS / ShapeEditor

2D Shape Editor for Unity Editor to create complex 3D meshes out of 2D shapes with RealtimeCSG support.
MIT License
102 stars 9 forks source link

2 small QOL features for GUITextbox #27

Closed Gawidev closed 2 years ago

Gawidev commented 2 years ago

Auto select all text on focus + Update Every Input. Taken from Blender/Unity/RCSG, and set up for easily turning on and off to your content, possibly even depending on future user preferences. Currently only enabled on Bottom Toolbar text fields (angle, snap, zoom). Also fixed an incorrect summary param description + made Keypad Enter work the same as Enter.

Henry00IS commented 2 years ago

Unfortunately as discussed this introduces several problems.

Math equations can no longer be typed and are immediately applied. The user can no longer position the caret manually (for example with a second click). It's no longer possible to scroll the view left and right using the mouse because the caret is broken.

The numpad enter key and incorrect summary param description are a nice find though. You can make a separate PR for that if you like, that way you get credited.

Gawidev commented 2 years ago

Okay, since I had added KeyPad.Return to update the value, I find no good reason to keep trying to add the autoUpdateValue thing since it isn't possible in a clean manner given the current design purpose of the GUITextBox. Also took a second to try out RMB for autoSelectAll and realized it perfectly fit the purpose I was trying to achieve without actually adding many changes. Now there should only be added functionality in this PR rather than attempts at functional changes to already existing code.

Henry00IS commented 2 years ago

I pushed a small modification, great idea using the right mouse button for this purpose. Thank you for this!