Comments (2)
Explanation
The NativeMenu.Next()
and NativeMenu.Previous()
methods are used to navigate to the Next or Previous items in a NativeMenu
. (Note: these methods are publicly callable, so if you call one of them in this situation the game hangs as well) Two methods works the exact same way other than one moves forwards and the other one moves backwards.
The Next and Previous item logic is ran inside a while loop:
- It peeks the next item by moving
nextIndex
forwards or backwards by one - we call it cursor. - If the cursor encounters a separator, it skips to the next item, and goes back to step 1.
- If the cursor goes beyond (before) all of the items, it returns to the beginning (end), and goes back to step 1.
- If the cursor hits the current item (if there are only one valid item, step 2 and 3 will cause cursor to eventually go back to the only valid item), the loop is broken and the method returns.
- If the cursor hits another item than the current item, the loop is broken and the method returns.
This way it works fine as long as the menu have at least one valid item among all items. However, when there is a menu consisted entirely of separators, as the logic is completely unaware about the menu is entirely consisted of separators, the code will keep going back and forth between step 1 and step 2, completely blocking the "game thread" and not allowing the game engine and other scripts to execute.
Hince, the game hangs, until the script ticking the offending menu is aborted.
from lemonui.
I'm aware of that. I just remembered to push the fix as it's already fixed on my local repo.
from lemonui.
Related Issues (20)
- Documentation inclusion HOT 2
- FixIndexIfRequired in NativeListItem<T> might set the index under zero and cause an exception
- Typo in parameter of NativeMenu constructor HOT 1
- When using gamepad games, the icons of InstructionalButtons are still keyboard keys.
- Timer Bar Objectives Bug
- Implement SET_TEXT_DROPSHADOW in ScaledText HOT 2
- ScaledAnim does not has an override for DrawSpecific(PointF, PointF)
- Newer .NET versions require PackageReadmeFile to be explicitly set
- SET_TEXT_DROPSHADOW does the same thing as SET_TEXT_DROP_SHADOW HOT 1
- Bruteforce Mini-Game - Lives are not restored after a restart HOT 1
- Clicking in an empty area in an empty menu will raise an exception
- BaseScaleform.Visible can't be overriden
- Version number HOT 3
- Add a Sound.PlayAt function
- Add NativeListItem.ItemAdded
- Temporary per-item instructional buttons
- Cursor flashes when switching from Parent to Child menu
- Can't set Menu.Name to Lower or Proper Case
- Horizontal Dropdown Menu
- Banner Images not Aligning with Menu HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemonui.