Skip to content

Allow conditional tooltip rendering #114

@andrew-vos

Description

@andrew-vos

Would be good to have tooltip rendering conditional? I have it set up like that:

      content:
        type: panel
        layout: canvas
        alignment: { h: center }
        elements:
          - type: switch
            switch_on: ~ui_ingame_heroes_active_hero_visible(@id)
            cases:
              true:
                type: image
                visible: 
                sprite: @small_icon
                tooltip: @@  ~ui_ingame_heroes_active_hero_visible(@id) then @description else undefined
                tooltip_placement: left_top
                scale: 0.5
                size: { h: stretch, w: stretch }

                animate:
                  on_visible:
                    xoffset:
                        type: curve
                        curve: curveCubic // this built in curve smoothly goes from 0 to 1 halfway through, and then smoothly back to 0
                        from: 800
                        to: 0
                        duration: 600
                  on_unloading:
                    xoffset:
                        type: curve
                        curve: curveCubic // this built in curve smoothly goes from 0 to 1 halfway through, and then smoothly back to 0
                        from: 0
                        to: 800
                        duration: 600

but even when it's undefined there's a small little empty square rendered

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions