https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    07/01/2019, 10:10 AM
    but presumably if (when) haxeui-flixel incorporates more naturally into flixel the issue would remain
  • b

    bright-gpu-74537

    07/01/2019, 10:11 AM
    ie, at the moment, without haxeui, a substate doesnt pause?
  • q

    quick-king-64105

    07/01/2019, 10:13 AM
    Well, it doesn't set
    active
    to false for the parent state, which had been the expectation many of my premises were based on. Why I'm too stupid to check such things is beyond me. 🤦 Anyway, what it does do is if you check the logic, only the substate really seems to get updated while it's open, while the parent just kinda sits there doing a lot of nothing. It's written so that it checks to see if there's a substate and then... if substate - update substate... if not substate, update self. Well, something like that, anyway. I'm not quite awake yet, and a maintainer could give much better than I could just glancing at it.
  • q

    quick-king-64105

    07/01/2019, 10:13 AM
    But I mean, that logic is pretty straightforward I think, especially if I can understand it and usually under the hood is as good as german to me.
  • q

    quick-king-64105

    07/01/2019, 10:14 AM
    ( No offense to any German friends about. )
  • b

    bright-gpu-74537

    07/01/2019, 10:14 AM
    right, so that makes sense also, the parent doesnt explicitly deactivate itself, but simply stops updating itself.
  • q

    quick-king-64105

    07/01/2019, 10:14 AM
    Right.
  • q

    quick-king-64105

    07/01/2019, 10:14 AM
    Or at least, that's how it looks.
  • b

    bright-gpu-74537

    07/01/2019, 10:14 AM
    gotcha
  • q

    quick-king-64105

    07/01/2019, 10:15 AM
    Ian, I'm not trying to be difficult, I'm just afraid of being wrong.
  • b

    bright-gpu-74537

    07/01/2019, 10:15 AM
    didnt think you were trying to be difficult... its good insight, and more than i have about anything in the flixel realm
  • q

    quick-king-64105

    07/01/2019, 10:23 AM
    Okay. I think looking at it cleanup is clean for substates.
  • q

    quick-king-64105

    07/01/2019, 10:25 AM
    The conditional worth interest for "do we want parent doing things right now?" seems to be:
    Copy code
    haxe
    if (persistentUpdate || subState == null)
    for the state itself. You can find this on line 171 in FlxState, as part of its logic for handling update checking around substates. Specific implementation from that note I don't know. But it appears that properly setting substates to null when they're closed is going on, and that would mean that check is the one we're interested in here.
  • q

    quick-king-64105

    07/01/2019, 10:25 AM
    blah word salad a bit, sorry.
  • q

    quick-king-64105

    07/01/2019, 10:40 AM
    ... I went ahead and threw what may be useful of those notes into an edit of issue 17 on the tracker.
  • b

    brave-kangaroo-30399

    07/01/2019, 11:03 AM
    I thought about it
  • b

    brave-kangaroo-30399

    07/01/2019, 11:04 AM
    Flixel doesn’t give any good way to do it
  • b

    brave-kangaroo-30399

    07/01/2019, 11:06 AM
    I don’t want to get into some recursive ā€œfind all objects that are children of the current stateā€ every single frame of mouse handling
  • b

    brave-kangaroo-30399

    07/01/2019, 11:06 AM
    So I need to think if the HaxeUI side gives me something useful
  • q

    quick-king-64105

    07/01/2019, 11:20 AM
    I looked at it, too, trying to find a workaround.
  • q

    quick-king-64105

    07/01/2019, 11:21 AM
    As you might imagine, I didn't find anything too clever 😦
  • q

    quick-king-64105

    07/01/2019, 11:21 AM
    Ideally haxeui would have a cutoff switch for event handling in a container (and its children) that "just works". Then we could leverage that pretty cheaply.
  • q

    quick-king-64105

    07/01/2019, 11:22 AM
    I hesitate to suggest that strongly enough to request it - I don't know how badly that would break or complicate haxeui's core.
  • q

    quick-king-64105

    07/01/2019, 11:23 AM
    There is something I'm puzzled about. If haxeui objects are normal backend objects, why are they not obeying flixel's update cycle? Does haxeui's toolkit maintain its own update thread alongside flixel?
  • q

    quick-king-64105

    07/01/2019, 11:41 AM
    In the meantime... 😦
  • q

    quick-king-64105

    07/01/2019, 11:41 AM
    Copy code
    haxe
        public function onClick_faq(ignored:UIEvent):Void
        {
            FlxG.log.add(this.doHxui);
            
            if (this.doHxui)
            {
                FlxG.log.add("Oops I did it again!");
                var faqSubstate:FAQSubstate = new FAQSubstate(0x80000000);
                openSubState(faqSubstate);
            }
        }
  • q

    quick-king-64105

    07/01/2019, 11:41 AM
    and...
  • q

    quick-king-64105

    07/01/2019, 11:43 AM
    Copy code
    haxe
    class FlxHaxeUiState extends FlxState
    {
        /**
         * Whether or not we should be doing Haxeui things.
         * 
         * It's expected this will be checked manually.
         */
        public var doHxui:Bool = true;
    
        override public function create():Void
        {
            // cut for brevity
        }
    
        override function openSubState(SubState:FlxSubState)
        {
            this.doHxui = false;
            super.openSubState(SubState);
        }
    
        override function closeSubState() 
        {
            this.doHxui = true;
            super.closeSubState();
        }
    }
  • q

    quick-king-64105

    07/01/2019, 11:44 AM
    I don't know if it works for haxeui-based substates and I don't want the struggle.
  • q

    quick-king-64105

    07/01/2019, 11:44 AM
    But it seems to work okay for non-haxeui substates.
1...737475...1687Latest