Advice for the backend of more complicated UI elements?
Posted: 05 Jul 2023, 11:07
Right now, my GUI is quite straightforward. I have my main game xaml, and its data context is a GameViewModel that stores things like a list of the EntityViewModel of every entity that wants to be displayed in the UI. I basically have 0 code-behind, which helps when it comes to mocking in C# for VS Blend vs C++ on my side.
What I'm not sure how to structure is more complicated UI elements that are not simply entities to be drawn using an items control. For example, upon some user input to start some order in a strategy game like clicking on the ground, then having a radial menu that has some kind of state, i.e. a multi-stage input, maybe a certain radial option brings out a slider to control something, but another radial option changes it in another way, and so on. I just don't quite get how that should be structured in terms of where the "state" lives; it's not exactly "view model" material right? Feels like it's UI-specific state, but as that gets more complicated I'm just not sure if that's right.
Same as with orders; I want to visualize them in the world using UI. Think of it like visualizing the start and end of each spline in a movement path, as well as having nodes along it to depict certain unit states that may change. It's a bunch of UI "stuff" but not strictly about entities and their components, so it falls outside my EntityViewModel setup, which is really the only way I have to build the UI atm. Would you just stick these in another list on the GameView, then draw with some kind of items control like the entities? Is everything just a list of view models with items controls?
Sorry this is a bit vague; I'm just grasping into the void, still new to this.
What I'm not sure how to structure is more complicated UI elements that are not simply entities to be drawn using an items control. For example, upon some user input to start some order in a strategy game like clicking on the ground, then having a radial menu that has some kind of state, i.e. a multi-stage input, maybe a certain radial option brings out a slider to control something, but another radial option changes it in another way, and so on. I just don't quite get how that should be structured in terms of where the "state" lives; it's not exactly "view model" material right? Feels like it's UI-specific state, but as that gets more complicated I'm just not sure if that's right.
Same as with orders; I want to visualize them in the world using UI. Think of it like visualizing the start and end of each spline in a movement path, as well as having nodes along it to depict certain unit states that may change. It's a bunch of UI "stuff" but not strictly about entities and their components, so it falls outside my EntityViewModel setup, which is really the only way I have to build the UI atm. Would you just stick these in another list on the GameView, then draw with some kind of items control like the entities? Is everything just a list of view models with items controls?
Sorry this is a bit vague; I'm just grasping into the void, still new to this.