Mountea-Framework/MounteaInventoryEquipment

UI Theme Helpers

pavlicekdominik opened this issue · 0 comments

ValidateThemeData

Purpose: Check that a given theme data asset includes all necessary resources and complies with expected structures.

Inputs:

  • UUITheme: The UI Theme data asset to validate.

Returns:

A boolean indicating whether the theme data is valid.

Pseudocode:

Function ValidateThemeData(UIThemeData) -> bool
    // Check if the UI theme data asset is not null
    If UIThemeData is null
        Return false

    // Check if the UI theme data asset has valid references/resources
    If not UIThemeData.Fonts.IsValid()
        Return false
    If not UIThemeData.Colors.IsValid()
        Return false
    If not UIThemeData.Textures.IsValid()
        Return false
    If not UIThemeData.Sounds.IsValid()
        Return false
    // ... Continue with other resources ...

    // If all checks pass, return true
    Return true
End Function

IsRuntimeThemeSwitchingAllowed

Purpose: Determine if the system permits theme changes while the game is running, which might be relevant for performance considerations or gameplay reasons.

Returns:

A boolean indicating if runtime theme switching is permitted.

Pseudocode:

Function IsRuntimeThemeSwitchingAllowed() -> bool
    // Define a boolean variable that dictates the ability to switch themes at runtime
    // This could be a setting from a configuration file or a global setting within the game
    bool allowRuntimeSwitching = GameSettings.AllowRuntimeThemeSwitching

    // Return the value of this setting
    Return allowRuntimeSwitching
End Function