https://linen.dev logo
Join Discord
Powered by
# ceramic
  • a

    ambitious-knife-25690

    03/04/2023, 9:44 AM
    I can't recall why I have this in handleAddComponent
  • b

    bright-gpu-74537

    03/04/2023, 9:44 AM
    remove it and see if its all the same, you shouldnt need to check anything like that tbh
  • b

    bright-gpu-74537

    03/04/2023, 9:45 AM
    add a component to the "screen" and its the root, handleAddComponent is called on a component, so by definition you know its parent (ie, the instance where its called)
  • b

    bright-gpu-74537

    03/04/2023, 9:46 AM
    Copy code
    haxe
        private override function handleAddComponent(child:Component):Component {
            // "this" is the parent component
            return child;
        }
  • a

    ambitious-knife-25690

    03/04/2023, 9:48 AM
    current test case is a basic switch atm because I think if I fix the switch a lot of my other issues get fixed as well
  • a

    ambitious-knife-25690

    03/04/2023, 9:48 AM
    wonder if this is related 🤔
  • b

    bright-gpu-74537

    03/04/2023, 9:49 AM
    is the GH repo up to date?
  • b

    bright-gpu-74537

    03/04/2023, 9:49 AM
    (so i can read it)
  • a

    ambitious-knife-25690

    03/04/2023, 9:50 AM
    pretty much yeah
  • a

    ambitious-knife-25690

    03/04/2023, 9:50 AM
    it is the best version i have atm
  • a

    ambitious-knife-25690

    03/04/2023, 9:50 AM
    all my local changes are experiments trying to solve annoying bugs
  • b

    bright-gpu-74537

    03/04/2023, 9:50 AM
    Copy code
    haxe
            if (this.parentComponent == null && !this.addedRoot) {
                App.app.scenes.main.add(this.visual);
                this.addedRoot = true;
            }
    this defo seems un-needed
  • a

    ambitious-knife-25690

    03/04/2023, 9:51 AM
    i just tested with notifications and removing it seems to have no effect
  • b

    bright-gpu-74537

    03/04/2023, 9:51 AM
    i dont think it ever runs because i dont think parentComponent is (or can be) null in that call
  • a

    ambitious-knife-25690

    03/04/2023, 9:52 AM
    oh it defo runs
  • a

    ambitious-knife-25690

    03/04/2023, 9:52 AM
    2 secs
  • b

    bright-gpu-74537

    03/04/2023, 9:52 AM
    ok, so maybe parentComponent is set after that call... but either way, you shouldnt need to have that check / special logic
  • b

    bright-gpu-74537

    03/04/2023, 9:53 AM
    oh, sorry "this.parentComponent"... gotcha
  • a

    ambitious-knife-25690

    03/04/2023, 9:53 AM
    ahhh, maybe that's why i thought i needed at one time
  • b

    bright-gpu-74537

    03/04/2023, 9:53 AM
    either way... i dont think you should have it
  • b

    bright-gpu-74537

    03/04/2023, 9:53 AM
    this.parentComponent can be null... i thought "child.parentComponent" for some reason
  • a

    ambitious-knife-25690

    03/04/2023, 9:53 AM
    i do have to use pcomponent in some places and if it is null it causes crashes
  • b

    bright-gpu-74537

    03/04/2023, 9:55 AM
    a root component can have a null parentComponent... but the child cant... so i misunderstood... anyways, its irrelevant, i dont see why you need to add the component to the "scene" when adding a child to it
  • a

    ambitious-knife-25690

    03/04/2023, 9:55 AM
    i think you're right
  • a

    ambitious-knife-25690

    03/04/2023, 9:55 AM
    i've tried on 2/3 test cases and I have no issues
  • a

    ambitious-knife-25690

    03/04/2023, 9:56 AM
    maybe I changed multiple things at one point and miscorrelated this as being relevant 😂
  • b

    bright-gpu-74537

    03/04/2023, 9:56 AM
    yeah, likely... probably there from the start before you did the screen thing or something
  • a

    ambitious-knife-25690

    03/04/2023, 9:57 AM
    yeah, i'll keep it out for now and keep it in mind
  • a

    ambitious-knife-25690

    03/04/2023, 9:57 AM
    doesn't seem to have an obvious negative effect
  • a

    ambitious-knife-25690

    03/04/2023, 9:58 AM
    thanks!
1...939495...124Latest