New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize performance #69
Conversation
Closes Guad#12
|
I should have noticed Tanjitsu optimized performance for the shvdn3 branch in #68 before I made this PR... |
Taken from Guad#68
|
Disable certain controls would be a better idea. The default interaction menu seems to disable only the controls that prevent user from operating menus or cause slow mo. For example, the default interaction menu doesn't disable the |
|
Btw, why don't you introduce AppVeyor? This makes builds per commit, and you can let people use the builds with this. I use it for my scripts for SHVDN, and you can use it, too. |
UIMenu.cs
Outdated
|
|
||
| backgroundSize = Size > MaxItemsOnScreen + 1 ? new Size(431 + WidthOffset, 38 * (MaxItemsOnScreen + 1)) : new Size(431 + WidthOffset, 38 * Size); | ||
|
|
||
| if (!String.IsNullOrWhiteSpace(MenuItems[_activeItem % (MenuItems.Count)].Description)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a DivideByZeroException right here if MenuItems.Count is 0. You should move all item-size independent code to the top of the function and then return in the middle if there are no items.
|
As for AppVeyor, I doubt many people would use it. I'm waiting for SHV.NET 3.0 to release a final version but I have no idea when is that coming |
|
Now descriptions work well as before. |
|
@Tanjitsu Yeah I'll take care of that |
|
So, will you merge this PR if there are no problems? |
|
Yeah, sorry for the delay |
Closes #12
No need to call
Enum.GetValuesevery time...