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

    bright-gpu-74537

    07/22/2022, 11:09 PM
    xml, should be xml, at least to me
  • b

    bright-gpu-74537

    07/22/2022, 11:09 PM
    shouldnt have logic, and "what about if?" in it... its just a mark up, just a "here, this is how things should be laid out" (in the context of haxeui)
  • b

    big-angle-82801

    07/22/2022, 11:11 PM
    So in your position would you just add the component via code?
  • b

    big-angle-82801

    07/22/2022, 11:12 PM
    (inside a conditional compilation block)
  • b

    bright-gpu-74537

    07/22/2022, 11:13 PM
    if its a very specific type compile type thing, then yeah, absolutely...
    Copy code
    haxe
    #if debug
    addComponent(new DebugWindow())
    #end
    Feels alot nicer than hacking xml (imo)
  • b

    big-angle-82801

    07/22/2022, 11:14 PM
    Maybe I should just create a separate dev branch 😅
  • b

    bright-gpu-74537

    07/22/2022, 11:14 PM
    even better, i mean, i guess when i really do these things, i tend to use factories
  • b

    bright-gpu-74537

    07/22/2022, 11:15 PM
    but i certainly never offload them to xml, that shit gets messy fast if you arent careful, better than code, but still, logic in xml (unless its some type of DSL) is a dangerous game (as always, imo)
  • b

    bright-gpu-74537

    07/22/2022, 11:19 PM
    Copy code
    xml
    <vbox>
        <button text="Test" if="debug" />
        <vbox if="debug">
            <label text="Some internal KPI" />
        </vbox>
        <vbox>
            <label text="Some KPI" />
        </vbox>
        <hbox>
            <button text="User Action" />
            <button text="User Action" />
            <button text="User Action" />
            <button text="User Action" />
            <button text="User Action" />
            <button text="Dev Action" if="imadeveloper" />
        </hbox>
    </vbox>
  • b

    bright-gpu-74537

    07/22/2022, 11:20 PM
    i see this type of stuff all the time, i and i hate it... haxeui will allow it - and there are times, maybe, i guess, possibly, where it makes sense... but oooofff
  • b

    bright-gpu-74537

    07/22/2022, 11:20 PM
    (btw, when i say "i see this all the time" i dont mean haxeui)
  • b

    big-angle-82801

    07/22/2022, 11:22 PM
    Yh, I do see why it's a bit dodgy, first time i saw if blocks in a lime xml I felt like I was never gonna look at lime the same again 😅
  • b

    big-angle-82801

    07/22/2022, 11:22 PM
    Or maybe it was hxcpp xmls 🤔
  • b

    bright-gpu-74537

    07/22/2022, 11:22 PM
    its just a nasty way to use markup
  • b

    bright-gpu-74537

    07/22/2022, 11:22 PM
    i would argue an abuse
  • b

    big-angle-82801

    07/22/2022, 11:23 PM
    but yh, honestly my problem is probably better solved if i create a dev branch, I really want to hide components that aren't ready yet to be in a release build
  • b

    bright-gpu-74537

    07/22/2022, 11:23 PM
    unless its a DSL (like, say, camel)
  • b

    bright-gpu-74537

    07/22/2022, 11:24 PM
    i dont really understand the branching thing either... its perfectly valid to have a debug ui and a release ui in the same app
  • b

    bright-gpu-74537

    07/22/2022, 11:24 PM
    ... ... just not defined in the xml
  • b

    big-angle-82801

    07/22/2022, 11:25 PM
    Perhaps 🤔
  • b

    big-angle-82801

    07/22/2022, 11:26 PM
    I guess then my best bet would be to split up my components into separate xmls
  • b

    big-angle-82801

    07/22/2022, 11:26 PM
    which i should probably do at this point anyway
  • b

    bright-gpu-74537

    07/22/2022, 11:26 PM
    if you think that you want to use an "if" then yeah, my guess is that you want to actually split up your mark ups
  • b

    bright-gpu-74537

    07/22/2022, 11:28 PM
    when it comes to ui markup, and specifically ui markup, i just think that it should be "heres the ui"... you can still be dynamic in that, but just not a great idea to be dynamic in the markup itself
  • b

    bright-gpu-74537

    07/22/2022, 11:28 PM
    unless what you are talking about is tiny, in which case, who cares - but in my exp. things can get out hand fast
  • b

    bright-gpu-74537

    07/22/2022, 11:29 PM
    what are you writing?
  • b

    bright-gpu-74537

    07/22/2022, 11:31 PM
    i guess what i mean is, what is your use for a conditional in xml?
  • b

    big-angle-82801

    07/22/2022, 11:32 PM
    I just have some buttons that bring up uis that aren't finished yet, so I wanted to have the button gone and the menu gone as well
  • b

    big-angle-82801

    07/22/2022, 11:33 PM
    but i found that it still existed if i inspected the elements in my browser (although they were hidden)
  • b

    bright-gpu-74537

    07/22/2022, 11:33 PM
    i guess, if its temp, you could use conditionals... but why not just use #ifs and be done with it?
1...118111821183...1687Latest