-
Notifications
You must be signed in to change notification settings - Fork 1
Improve two stage select #19
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
base: master
Are you sure you want to change the base?
Conversation
f084f9a to
f5002f3
Compare
f5002f3 to
001d091
Compare
|
@milogreg I'm not sure if this is a good idea, I'd like to hear your opinion. Modified the two-stage selection to allow the building window to be always visible. When a building is selected, it enters the Tmp state, which allows us to move the mouse out of the building window and then enter the Select Cell state. If the mouse enters the building window in Select Cell state, it will return to the Select Building state. |
|
This seems like a somewhat fragile strategy, and there are a few issues that I've run into when testing. These aren't necessarily all bugs, but they are areas where the UI feels incomplete:
You could definitely patch these issues, but I'd still be wary of going down this path. I've thought a bit about how GUI apps in general (not just In my mind, weaving complex dependencies between states to solve problems like this kind of defeats the purpose of abstraction, as it requires so much re-wiring every time requirements change. Practically speaking, you may just want to make the building window be its own menu like before, and commit to not having multi-component rendering in However, if you do want to explore the possibility of more complex multi-component GUIs built with Polystate, I'd propose creating a new library: PolyGUI. This library would solve the problem of multi-component rendering, and would generally simplify/standardize the conventions required to build a Polystate GUI app. PolyGUI could start out relatively lightweight, providing the following framework for interactions and rendering:
|
|
Thanks for your reply! I also thought this PR was too complicated and was still weighing whether it was worth it. First I will explain some things to you:
Two-stage selection requires you to select a building first. While you can zoom the viewport in the building selection window, you cannot manipulate the map. It would be more intuitive to restrict your mouse cursor to the build window.
Yes, Tmp has no status returned, this should be easy to add.
The main reason here is that A good solution is to introduce the concept of Here are some of my opinions, which may not be correct, you can correct me: I think what you mean is: building fully dynamic components, similar to traditional GUIs. However, I would say that building this pr using the traditional method is not necessarily simpler than the current implementation. This is because you have to deal with the occlusion relationship between the building selection window and the cell selection window. This will affect the rendering and selection events of the cell selection window. And there must also be something like Static construction makes everything depend on the type and becomes very intuitive. |
The difference between the component-based system I propose and the existing system is not whether it is static or dynamic. In fact, the component-based system is fully static and type-safe too! The area that the component-based system would help in is exactly what you mentioned: the occlusion relationship between the building selection window and the cell selection window. This is because of the component hierarchy, which would naturally define the 'layers' of the GUI, and route events (like clicking and mouse movement) through the layers, starting at the top. Now, my description of the component-based system didn't cover things like bounding boxes (which would allow for In essence, the goals of the component-based system are:
|
Some interesting improvements, just some exploration!