I’m having serious questions about what is the best method to handle/create ui’s, rn i have my inventory done, but the inventory widget handle all widget communication related to player inventory(split stack, slot, dropzone, item inspector) and i start to ask myself which method would be the more scalable, make every widget independent and use a localplayer subsystem to be the UI manager, create all widgets in this subsystem and just use delegates to communicate among these widgets, making each widget independent, or keep what i’m doing, which is keep the inventory UI handling everything, which one would be better? Or exist better ways to do that? I know about common ui and will start to learn it, but rn i’m trying to understand the basic first
Watch this video. i made a similar solution for myself, but i came to the conclusion that need use common ui. Basic ui elements very restricted. For example common ui have styles and you can easy change text font for all ui elements. Change font for basic elements it’s literally hell.
yeah, i’m having plans to use common ui, but righ know i wanna make my inventory a plugin, so i want to handle ui with basic methods to be generic and reusable
Think of your inputs that open/close UIs. Like Esc removing current active widget(Dialog, Shop, Quest Log, Inventory, Pause Menu). Cutscenes that hides all widgets and unhide them after. It’s more of a design flow.
On programmer side, is it easy to get your inventory ref to call functions that manage other widgets? How would an actor in the world access your inventory? Can a function close down all widgets and opens another?
Your inventory can be a parent widgets to all its related sub widgets. Hitting esc would close down the 1 top layer. But if player hit quest log, the common UI flow is to close down inventory widget and its sub widgets, then open Quest log widget.
Be aware subsystem persist like GameInstance. If your game loads between levels. Your widgets that are referenced in subsystem wouldn’t get destroyed. That can be good if your gameplay stays between levels. But you have to manually clean up when exiting each session.
I made a component in my custom HUD class that manage active widgets and HUD. NPCs can get playerController->HUD and call functions there. My widgets have interface function for something common like Esc to close its sub widgets.