Maximum Categories

More
6 years 5 months ago #2557 by 71M
Maximum Categories was created by 71M
Hi,

Is it possible to have more than 32 categories?
Looking at the code, I don't see how that's possible.

Cheers,
Tim

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #2558 by Frank
Replied by Frank on topic Maximum Categories
Hi,
I2 Localization doesn't constrain the number of categories you have. Categories are just extracted from the term's name (e.g. Tutorial/Title). So, there can be as many categories as terms.

Said that, the Term's list in the Language Source inspector, uses a unity GUI.MaskField which only allows 32bits. That breaks the filtering of terms in that list as soon as you have more than 32 categories.
However, if you filter by "everything", you can still have more than 32 categories. And ALL categories are shown as a popup tree when selecting terms in the Localize inspector. You just wont be able to filter in the Term's list, even thought all of the term will show the correct category tag.

I have a task to fix this issue with the MaskField (i.e. use my own custom Mask selection), but it seems that there is always a feature that takes priority. Now that Plurals are done, and I'm finishing the Extended Input Specialization, I will finally get to those smaller fixes!

Please, give your vote here to allow me prioritize it better:
trello.com/c/V3x0W7LP/8-allow-editing-more-than-32-categories

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 following user(s) said Thank You: 71M

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #2560 by 71M
Replied by 71M on topic Maximum Categories
Thank you for the quick response!

I'll bear that in mind when working with a large number of categories.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #2784 by 71M
Replied by 71M on topic Maximum Categories
We started hitting the 32 category limit so I went ahead and modified the term filter code, might be useful to others.
void OnGUI_SelectedCategories()
{
	if ( mParsedCategories.Count == 0 )
		return;

	if ( GUILayout.Button( new GUIContent( "Filter" ), "toolbarbutton" ) )
	{
		var menu = new GenericMenu();

		menu.AddItem( new GUIContent( "Everything" ), false, () =>
		{
			mSelectedCategories.Clear();
			mSelectedCategories.AddRange( mParsedCategories );
			ScheduleUpdateTermsToShowInList();
		} );
		menu.AddItem( new GUIContent( "Nothing" ), false, () =>
		{
			mSelectedCategories.Clear();
			ScheduleUpdateTermsToShowInList();
		} );

		foreach ( var category in mParsedCategories )
		{
			menu.AddItem( new GUIContent( category ), mSelectedCategories.Contains( category ), () =>
			{
				if ( mSelectedCategories.Contains( category ) )
				{
					mSelectedCategories.Remove( category );
				}
				else
				{
					mSelectedCategories.Add( category );
				}
				ScheduleUpdateTermsToShowInList();
			} );
		}

		menu.ShowAsContext();
	}
}

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #2786 by Frank
Replied by Frank on topic Maximum Categories
Thanks a lot for looking into this!
I like your approach a lot, will 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

Please Log in or Create an account to join the conversation.

Time to create page: 0.139 seconds
Template by JoomlaShine