I love how ORK's UI simplifies a lot of the setup/transitions between menus. However it becomes difficult to use when the menu layout becomes too complex. I think in this case I need to set up my own menu, but I'm not sure what's the best way to do so. I still want to use ORK to handle the display part of the menu (and use it to keep track of the currently selected Combatant), but I want to define all the text fields and content in the prefab.

How do I connect those UI content with data? Is there an ORK component that can fetch the data and put it in there? Or maybe schematics? Or do I need to write a script to do so (if so, can I still access the current Combatant somehow)?
  • edited March 8
    Depends on the data - generally, you can mix your UI box prefabs with HUD components. E.g. the HUD Menu Shop User (Content Provider) component will fetch the current user of an open menu or shop and use it as content provider for other HUD components (e.g. to display status values, equipment or abilities of the combatant).

    You can also create custom menu parts by extending from the BaseMenuPart class - I'd recommend checking out the code for the available menu parts for that. You don't need to change the source code to add new stuff like that, just having the script in your Unity project will make it available.

    There is also the Spawn UI Prefab node in schematics to spawn a prefab on one of the UI layers to e.g. add your completely custom UI. This could be used in the menu screen's open schematic to add your UI when the menu is opened.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited March 9
    My problem is that I'm not sure where's the best place to draw a line - here's what I'm writing myself, and there's what I'll let ORK handle for me. What if I need to allow the player to select different things in my custom UI?

    1. I use the Menu List menu part to display all the menus and let ORK handles navigation.
    2. For each menu itself, I want to use a custom prefab with UI elements already laid out. Should I make this a UI Box?
    3. I have a bunch of buttons, text, and images. I now know how to populate these, but how do I handle input controls? How to select the first button?

    I'm guessing custom menu part is the way to go, what classes are good examples to look at for this case? From the classes I've looked at, most menu parts are programmatically creating the UI for the content, but instead I need to connect to existing UI components in the prefab.
    Post edited by Flying_Banana on
  • Can you maybe show an image of your custom UI? That'll get us a better understanding of what you want to connect :)

    Generally, the UI box prefabs can also be set up with pre-placed inputs (e.g. choice buttons) if you want them in a special layout.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Sure, here's something concrete:

    image

    The player can assign unused attribute points to the primary stats above, which would also show a preview to the changes to secondary stats below. The player can select (using arrow keys) each stat to view a tooltip and breakdown of base + bonus values. Talents would just be special abilities.

    I'm very interested in pre-placed inputs, that would simplify the workflow immensely!
  • Pre-placed input might be the best course, at least for the status value stuff (having the 3 buttons on top and the status list below all selectable).

    You can easily add them to your UI box prefab. If you use the scene hierarchy context menu to add a choice button on a UI box or it's child objects, it'll automatically be added as a pre-placed input.
    Or manually, e.g. adding a prefab to your UI box prefab, you just need to click on Add Placed Input in the UI box component's inspector (Input Settings) and select the button's input component (e.g. just dragging the game object on the field).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.