I'm trying to make the UI for resource management functionalities, which are also what makes up most of the game I planned to make. However, I'm a bit lost on how exactly to do it.
I'm not sure of all the stuff this will imply, but I could think of these:
- A manager (the game class itself, probably, containing a stack of all the in-game screens)
- A container (a screen, if you will, containing an amount of Panels (screen parts))
- Panels (like viewports, in a way, containing any of the stuff below)
- Buttons (multi-purpose, with a Sprite icon - much like the ones here above the forum post editing box)
- Text Buttons (with a label - I wonder if they could double as clickable dialogue responses)
- Text Boxes (NPC dialogue, item descriptions, story telling, etc)
- Lists (containing non-clickable Text Buttons as indices (for stock items lists), or clickable Text Buttons (for dialogue choices), or even mini-panels (a third type of button) with a mix of elements (for example, an NPC list, and each index with a name and some stats and a mini-portrait))
- Portraits (containing a large image of an character - to exist alongside/inside a player/NPC inspection panel)
Now, I don't really know if I can extend those functionalities like that (text button -> dialogue choice, etc). I don't know how to plan to implement all this, in terms of polymorphism and inheritance, interfaces, etc. I did this once in raw c++ in a console app, but I didn't finish it, so I never knew if it would work in the end.
I'm using c++/SFML now, but I'm more interested in understanding this conceptually (or in pseudocode). If I understand it in that way, I'll probably manage to implement it on my own.
What classes could I have and which could derive from which, and which could have versatile functionality, is what I'm trying to figure out. Also trying to figure out the way to repeat less code. Any help or suggestions or ideas, or whatever, would be greatly appreciated.