Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Presario

Pages: [1]
1
I don't claim that my fix is perfect it is just workaround on windows for processing Right Alt key + A key.
In this situation unity produce Event with Event.modifiers set to EventModifiers.Alt and EventModifiers.Control ... which should be only EventModifiers.Alt (i assume this is a Unity bug) so it is recognized by UIInput as unintended Control + A which selects whole text and overits it with "ą" letter, so application of UIInput as chat input is quite problematic that entering "ą" will delete all you message.
Proposed fix tries to discover situation when Right Alt is held (of course it cannot distinguish between Control + Alt and Right Alt) and considers control as not held which is true in this situation because only Right Alt is held not a control.
If you don't find betted way, maybe better is to fix this in KayCode.A section like this:
  1. ...
  2.                         // Select all
  3.                         case KeyCode.A:
  4.                         {
  5.                                 if (ctrl && (ev.modifiers & EventModifiers.Alt) == 0)  /// <=====  added chack for ALT key not held
  6.                                 {
  7.                                         ev.Use();
  8.                                         mSelectionStart = 0;
  9.                                         mSelectionEnd = mValue.Length;
  10.                                         UpdateLabel();
  11.                                 }
  12.                                 return true;
  13.                         }
  14. ...
  15.  

2
Hi there,

Some time I'm getting a NullReferenceException at UIToggle.Set - UIToogle.cs:249 line, for example:
  1. NullReferenceException: Object reference not set to an instance of an object
  2. UIToggle.Set (Boolean state) (at Assets/Common/ThirdParty/NGUI/Scripts/Interaction/UIToggle.cs:249)
  3. UIToggle.set_value (Boolean value) (at Assets/Common/ThirdParty/NGUI/Scripts/Interaction/UIToggle.cs:98)
  4. ActivityController.Reset (Boolean show) (at Assets/Game/Scripts/ActivityController.cs:121)
  5. GameStateController+<Reset>c__Iterator44.MoveNext () (at Assets/Game/Scripts/GameStateController.cs:267)

The reson for that is from code below  aa @ UIToogle.cs:249 line  can be null some time
  1. ...
  2.                         // Play the checkmark animation
  3.                         if (activeAnimation != null)
  4.                         {
  5.                                 ActiveAnimation aa = ActiveAnimation.Play(activeAnimation, null,
  6.                                         state ? Direction.Forward : Direction.Reverse,
  7.                                         EnableCondition.IgnoreDisabledState,
  8.                                         DisableCondition.DoNotDisable);
  9.                                 if (instantTween || !NGUITools.GetActive(this)) aa.Finish(); /// <===== aa is null causing NullReferenceException
  10.                         }
  11. ...
  12.  

so fix is simple:
  1. ...
  2.                         // Play the checkmark animation
  3.                         if (activeAnimation != null)
  4.                         {
  5.                                 ActiveAnimation aa = ActiveAnimation.Play(activeAnimation, null,
  6.                                         state ? Direction.Forward : Direction.Reverse,
  7.                                         EnableCondition.IgnoreDisabledState,
  8.                                         DisableCondition.DoNotDisable);
  9.                                 if (aa != null && ( instantTween || !NGUITools.GetActive(this))) aa.Finish(); /// <=== added null check for aa
  10.                         }
  11. ...
  12.  


3
Hi there !

There is an UIInput bug on windows, probably related to Unity bug (?), which recognise Right Alt as Alt and Control. In result when User enters polish letter 'ą' (Right Alt + a) UIInput selects all content of input and overrides it with 'ą' letter which is obviously not intended.
To work around this issue I propose small change to UIInput::ProcessEvent method

  1. ...
  2.                 bool shift = ((ev.modifiers & EventModifiers.Shift) != 0);
  3. +               #if UNITY_STANDALONE_WIN
  4. +               if ( (ev.modifiers & EventModifiers.Alt) != 0 && (ev.modifiers & EventModifiers.Control) != 0  )
  5. +                       ctrl = false;
  6. +               #endif
  7. +
  8.                 switch (ev.keyCode)
  9.                 {
  10.                         case KeyCode.Backspace:
  11. ...
  12.  

Maybe there is better way to overcome this problem, but as workaround it works for me.
ArenMook, Can you include a fix in NGUI release which handles this issue correctly ?

Thanks !!!


Pages: [1]