shdwcat / YUI

YUI - A UI system for GMS2
MIT License
48 stars 4 forks source link

Significant Layout Changes Causing Crashes #87

Closed BlueDemonTR closed 3 weeks ago

BlueDemonTR commented 2 months ago

I have the following component: ` - type: scrollbox size: { w: stretch, max_h: 210 } content: type: panel elements:

            - type: panel
              visible: @showEffectList
              elements: @effects
              template: 
                type: button
                  size: { w: stretch } 
                  on_click: @@ e => @onClick()
                  content:
                    type: text
                      scribble: true
                      text: @trigger
            - type: panel
              visible: @showEffect
              elements:
                - type: button
                  visible: @showHideEffect
                  background: #FF0000
                  on_click: @@ e => @hideEffect()
                  content:
                    type: text
                      text: Back
                - type: advanced_text
                  text_array: @shownEffectText`

Which allows me to create the following list of buttons, which is created by the panel whose elements are @effects image When pressed it sets @showEffectList to false and sets @showEffect to true Then I can hover over another card to set @showEffectList to true, @showEffect to false and change @effects

How I can produce is error is that image I set @effects to an array with 3 elements Click one of the buttons which hides the 3 elements image Then if I cause the @effects array to turn into an array with 1 element which causes the crash

BlueDemonTR commented 2 months ago

Found a way to reproduce it, on the example project go in order: Hide -> One

[Uploading Sandbox.zip…]()