Welcome, Guest
Username: Password: Remember me

TOPIC: Consider adding TermsPopup patch to future release

Consider adding TermsPopup patch to future release 4 months 5 days ago #2377

  • michael
  • michael's Avatar
  • Offline
  • New Member
  • Posts: 1
  • Karma: 0
First off, thanks for providing source code to developers! I2 Localization rocks!

I updated the TermsPopup attribute by allowing it to accept an optional "filter" parameter, and updated the associated PropertyDrawer to support the filtering. See the attached patch file for details.

By default, everything operates as used to. When adding a filter to the attribute, the contents of the popup exclude any terms that do not match the filter.

For example, the following allows the popup to only include terms containing "/Help/".
[TermsPopup("/Help/")]
public string message;



I also wrapped the GUI control with EditorGUI.BeginProperty and EditorGUI.EndProperty calls, so that the Popup is handled correctly by the Inspector. Note in the following image how the Message property label is drawn using the bold font, because it differs from the prefab. It also features a tooltip. Neither of these occur without the patch.



Thanks!

The patch should be attached to this post. It can also be found here: TermsPopup patch

Use the v2 patch. The original patch includes a file that had line endings changed from Win to Unix, so the entire file appeared changed. The v2 patch only includes actual changes.
Attachments:
Last Edit: 4 months 5 days ago by michael. Reason: Updated the images.
The administrator has disabled public write access.

Consider adding TermsPopup patch to future release 4 months 4 days ago #2379

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 915
  • Thank you received: 196
  • Karma: 58
Hi,
Thanks a lot for the suggestion!!
I will review the patch and add it to the next release.

Thanks!
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The administrator has disabled public write access.
Time to create page: 0.310 seconds
Colors