Persona UI, Its A Lot Of Work

So it’s been about a month and I felt it was about time I updated you’ll on the progress so far. I’m still working on the UI setups at the moment as they are required for the rest of the project to really function. Have been hoping between this project and another on and off all month. So I’ve only actually worked on this for about 10 or so days this month but the progress is worth showing.

Menu Management

With the amount of UI there is to do I needed to make a menu system that would let me switch between different menus with ease. Before I had a manager class that did this on context, but that was getting really messy really quickly. Instead of continuing with the messy setup I decided to refactoring it into something more useable.

The new setup is entirely static and is called in the displays logic for the active menu. The active menu then controls what buttons open what displays and runs the logic to open the new one and close the current if needed. Using an interface to keep it simple. So far this solution is proving to work quite well. Though I imagine I will, have to come back to it at some point and make further adjustments. An example of the new menu controller API in use to close one display & open another:

// API - uses type to open/close menus, with each being registered on the scene opening. 
// MenuController.OpenMenuCloseThis<TOpenMenuType, TCloseMenuType>();
// Below would switch from the skill select UI on the active persona to the detailed persona view display. 
MenuController.OpenMenuCloseThis<ViewPersonaDisplayController, SelectPersonaSkillDisplay>();

Persona Inspect

This is by far the most complex display in the entire project. But so far it’s not going too badly. I’ve managed to get then reveal mostly working and sorted a setup to show the active persona’s data. But there is still a long way to go. One of the challenges of this UI is the fact that it changes each time it’s opened or modified. With boxes randomly changing sizes etc. I have a feeling I’m going to need to work more on the UI polygon script to make it more reliable for all the use cases that are gonna crop up in the future.

P5R

My Version So Far

Some other bits include a popup description display that appears when inspecting the persona skills. I have setup a mockup for this display on the UI which works, but it needs to actually populate with data and appear still which it currently doesn’t. The other main progress is the stat level bars, these are a tad annoying as the actual “fill” is not set the actual value due to the background needing to take up more space than the fill. Currently I have the background taking the actual space while the fill uses a reduced size. But I still want to see if I can get it to update without needing such a workaround. There still a lot to-do on this display but I’m hoping to get it functionally working by the next update.

Data

In my last post I went over some of the data stuff I was working on with Google sheets, this is still an ongoing task with instant kill, healing and some passive skills still to work out and implementation for. Its tricky as a lot of these skills are very specific and working out a generic structure to store the data is proving tricky. But I am hoping to have the data done by the next update or two as it will be needed before I get fully into the gameplay and move implementation. I did fix a few issues here where data wasn’t updating object in the project, but I did some refactoring here and there to make the implementation on the dev side a bit easier. Most notable was the battle stats, so “Str, Ma, En, Ag, Lu”. The main change was to change the data from a struct to a class and to store all the data in a custom SerializableDictionary instead of individual values for ease of access. With getter/setter methods to access specific values by stat type. The code now looking like this:

/// <summary>
/// A container class to hold a persona's battle stats.
/// </summary>
[Serializable]
public class BattleStats
{
    /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
    |   Fields
    ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */
    
    [SerializeField] private SerializableDictionary<PersonaBattleStat, int> stats;
    
    /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
    |   Constructors
    ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

    /// <summary>
    /// Makes a blank battle stats class.
    /// </summary>
    public BattleStats() { }


    /// <summary>
    /// Makes a new battle stats data with the dictionary entered.
    /// </summary>
    /// <param name="data">The data to set.</param>
    public BattleStats(SerializableDictionary<PersonaBattleStat, int> data)
    {
        stats = data;
    }
        
    /* ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
    |   Methods
    ───────────────────────────────────────────────────────────────────────────────────────────────────────────── */

    /// <summary>
    /// Gets the stat of the type entered.
    /// </summary>
    /// <param name="statType">The stat to get.</param>
    /// <returns>The stat value.</returns>
    public int GetStat(PersonaBattleStat statType)
    {
        if (stats.ContainsKey(statType))
        {
            return stats[statType];
        }
        
        return -1;
    }


    /// <summary>
    /// Sets the stat to the entered value.
    /// </summary>
    /// <param name="statType">The stat to edit.</param>
    /// <param name="value">The value to set to.</param>
    public void SetStat(PersonaBattleStat statType, int value)
    {
        if (!stats.ContainsKey(statType)) return;
        stats[statType] = value;
    }
}

Misc

In the last post I also covered affinities and their display. I mentioned i wasn’t going to do the two versions. Well I’ve changed my mind on that and now plan to implement the extended boxes in the future. The display just looks really off without the background behind the text. So expect an update on that soon. Otherwise progress is good and I’m pretty happy with how the project is going so far. Even played a little P5R to get some reference material and had to stop myself playing xD

That’s about it for this update, see you all in the next one.