Skip to content
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

Merged
merged 6 commits into from Sep 3, 2017
Merged

Optimize performance #69

merged 6 commits into from Sep 3, 2017

Conversation

kagikn
Copy link
Contributor

@kagikn kagikn commented Aug 22, 2017

Closes #12
No need to call Enum.GetValues every time...

@kagikn
Copy link
Contributor Author

kagikn commented Aug 22, 2017

I should have noticed Tanjitsu optimized performance for the shvdn3 branch in #68 before I made this PR...
OK, will make more commits for optimization.

@kagikn
Copy link
Contributor Author

kagikn commented Aug 22, 2017

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 VehicleBikeWings control.

@kagikn
Copy link
Contributor Author

kagikn commented Aug 22, 2017

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))
Copy link
Owner

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.

@Guad Guad mentioned this pull request Aug 22, 2017
@Guad
Copy link
Owner

Guad commented Aug 22, 2017

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

@kagikn
Copy link
Contributor Author

kagikn commented Aug 23, 2017

Now descriptions work well as before.
I have no idea when SHVDN v3 will come, too.
And one more thing, I'm sorry if I bothered you with AppVeyor.

@Tanjitsu
Copy link

@Guad with this being Master, i guess we will need to duplicate this into the shvdn3 once its ready ?

@kagikn at the start of the Draw Method. You can remove

Point safe = GetSafezoneBounds();

It is being done in DrawCalculations :)

@Guad
Copy link
Owner

Guad commented Aug 23, 2017

@Tanjitsu Yeah I'll take care of that

@kagikn
Copy link
Contributor Author

kagikn commented Sep 3, 2017

So, will you merge this PR if there are no problems?

@Guad Guad merged commit 0f7dbd2 into Guad:master Sep 3, 2017
@Guad
Copy link
Owner

Guad commented Sep 3, 2017

Yeah, sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants