Author Topic: Code Change Requests  (Read 7434 times)

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Code Change Requests
« on: January 07, 2013, 01:28:08 PM »
Since it appears that there is an impeding release of another new version of NGUI could I request some additional features to the NGUI so I don't have to keep changing it whenever I upgrade?

UISliderInspector
Could I request to change the following in the UISliderInspector file so that the slider steps is an int field instead of a slider? 

Replace this:
  1. void OnInspectorGUI() {
  2. ...
  3.     int steps = EditorGUILayout.Slider("Steps", slider.numberOfSteps, 0, 11);
  4. ...
  5. }
  6.  

With this?
  1. void OnInspectorGUI() {
  2. ...
  3.     int steps = EditorGUILayout.IntField("Steps", slider.numberOfSteps);
  4.     if(steps < 0) {
  5.         steps = 0;
  6.     }
  7. ...
  8. }
  9.  

UIInput
The other request is to change it so that the UIInput has a boolean toggle for allowing auto-correct on handheld devices.

  1. [AddComponentMenu("NGUI/UI/Input (Basic)")]
  2. public class UIInput : MonoBehaviour
  3. {
  4. ...
  5.         /// <summary>
  6.         /// The use auto correct function when on iOS/Android platforms
  7.         /// </summary>
  8.         public bool useAutoCorrect = false;
  9. ...
  10.  
  11.     public void OnSelect(bool isSelected) {
  12. ...
  13. #if UNITY_IPHONE || UNITY_ANDROID
  14.        if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
  15.        {
  16. #if UNITY_3_4
  17.               mKeyboard = iPhoneKeyboard.Open(mText, (iPhoneKeyboardType)((int)type), useAutoCorrect);
  18. #else
  19.               if (isPassword)
  20.               {
  21.                  mKeyboard = TouchScreenKeyboard.Open(mText, TouchScreenKeyboardType.Default, false, false, true);
  22.               }
  23.               else
  24.               {
  25.                  mKeyboard = TouchScreenKeyboard.Open(mText, (TouchScreenKeyboardType)((int)type), useAutoCorrect);
  26.               }
  27. #endif
  28. ...
  29.     }
  30. }
  31.  

That would be appreciated! Let me know if there is anything else you need.

Thanks!
« Last Edit: January 07, 2013, 01:32:31 PM by Ferazel »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Code Change Requests
« Reply #1 on: January 07, 2013, 03:38:07 PM »
2.2.7 went out 2 days ago, so you kind of missed the "impending release" :P

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: Code Change Requests
« Reply #2 on: January 07, 2013, 04:20:52 PM »
2.2.7 went out 2 days ago, so you kind of missed the "impending release" :P

Oh I thought the post that you posted here (http://www.tasharen.com/forum/index.php?topic=2702.0) today stated that there was a bug that would be fixed in an upcoming release. So I just thought I'd try to sneak these changes in as well in the next update.

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: Code Change Requests
« Reply #3 on: January 07, 2013, 04:25:29 PM »
+1 for the UISlider, a customizable value of steps will be great :) (I had to change hardly on code to add extra steps).

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: Code Change Requests
« Reply #4 on: January 23, 2013, 12:35:21 PM »
Sadness bump that these changes weren't included in 2.3.0

cayou

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 90
    • View Profile
Re: Code Change Requests
« Reply #5 on: January 23, 2013, 02:20:24 PM »
Yes...
And the support of movieTexture into clipped panels....  :P

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Code Change Requests
« Reply #6 on: January 23, 2013, 05:19:27 PM »
I don't like the steps change. 10 steps is already a lot. If you need more, create your own custom slider or don't use steps at all.

The auto-correct change... I'll add that in.

Ferazel

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 150
    • View Profile
Re: Code Change Requests
« Reply #7 on: January 24, 2013, 12:03:10 PM »
Well it's your UI solution (obviously), but my argument would be that imposing an artificial limit about how a slider will be used (when there is no apprent side effect) is a mistake. The slider where I wanted more than 10 steps is one that would encompass the entire height of the screen, therefore would have more than enough space to have distinct steps of a value. Regardless, it's not a huge change in the rare cases that the code, but just an annoyance every time we update.

Glad to see the auto-correct in there though. Naturally, it might only be visible in #if UNITY_IPHONE || UNITY_ANDROID, but I thought I read somewhere that conditionally compiled serialized script variables could lead to bad behavior so I didn't include that.

Thank you for your continued improvement and support of NGUI.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Code Change Requests
« Reply #8 on: January 24, 2013, 06:28:00 PM »
You can always use math on the retrieved sliderValue, resulting in steps. For example:
  1. float stepValue = Mathf.Round(myslider.sliderValue * 20f) / 20f;