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

    icy-zebra-52882

    07/16/2022, 11:39 AM
    is MessageBox meant to show an icon if one is provided?
  • i

    icy-zebra-52882

    07/16/2022, 11:40 AM
    and is Dialog meant to get its body text from
    .text
    ?
  • i

    icy-zebra-52882

    07/16/2022, 11:41 AM
    neither seem to be showing an icon I provide, and Dialog ignores any text I set in
    dialog.text
    (but
    dialog.title
    works fine)
  • b

    bright-gpu-74537

    07/16/2022, 11:41 AM
    So, its not possible to customize the messagebox icon - that said, i think its a nice addition, and yeah, i think messagebox.icon would be a nice fit
  • b

    bright-gpu-74537

    07/16/2022, 11:42 AM
    as for "dialog body" what do you mean? You mean messagebox?
  • i

    icy-zebra-52882

    07/16/2022, 11:42 AM
    as in the content of the dialogue, the body text

    https://plzlookat.mystupid.pictures/firefox_9pzzobL4ra.png▾

  • b

    bright-gpu-74537

    07/16/2022, 11:43 AM
    ok, so yeah, thats message box... usually i use "Dialogs.messageBox(...)", though i think constructing it yourself and setting icon and text manually are good additions - ill add them, doubt it will take long
  • i

    icy-zebra-52882

    07/16/2022, 11:44 AM
    I did think about using that convenience function, just that a lot of the things I have to set end up looking ugly and less readable for a lot of data
  • i

    icy-zebra-52882

    07/16/2022, 11:45 AM
    Copy code
    hx
    var dialogue = new MessageBox();
    dialogue.title = I18nHelper.instance.tr("editor/theme-switch-modal/title");
    dialogue.message = I18nHelper.instance.tr("editor/theme-switch-modal/message-body");
    dialogue.buttons = DialogButton.YES | DialogButton.NO;
    dialogue.customStyle.percentWidth = 60;
    dialogue.icon = "assets/images/editor/warning.png";
  • b

    bright-gpu-74537

    07/16/2022, 11:45 AM
    yeah, thats fair, but i also think your way of using it 100% valid, and expectations for .text and .icon are also valid (though its not how it works currently - but ill add it shortly)
  • i

    icy-zebra-52882

    07/16/2022, 11:46 AM
    I don't know where you get the energy to keep this up 😓
  • i

    icy-zebra-52882

    07/16/2022, 11:46 AM
    I'm lucky to add a dialogue box instead of reading through the existing code and giving up to play rhythm doctor
  • b

    bright-gpu-74537

    07/16/2022, 11:48 AM
    heh heh, well, i like improvements to the api - i tend to use haxeui in the specific kinda way, so its good to get feed back about how to improve little things like this (plus, it seems like 10 minute job)
  • i

    icy-zebra-52882

    07/16/2022, 11:48 AM
    10 minute job is always a plus
  • b

    bright-gpu-74537

    07/16/2022, 11:56 AM
    ok, latest haxeui-core
  • b

    bright-gpu-74537

    07/16/2022, 11:56 AM
    Copy code
    haxe
                var mb = new MessageBox();
                mb.text = "This message body was set via the .text property";
                mb.icon = "haxeui-core/styles/default/haxeui_small.png";
                mb.buttons = "Custom" | DialogButton.CANCEL;
                mb.show();
  • i

    icy-zebra-52882

    07/16/2022, 12:00 PM

    https://plzlookat.mystupid.pictures/hl_nbb4anSaPL.png▾

    looks beautiful
  • i

    icy-zebra-52882

    07/16/2022, 12:00 PM
    thank you again
  • b

    bright-gpu-74537

    07/16/2022, 12:00 PM
    np - its a nice (and super simple) change / addition
  • i

    icy-zebra-52882

    07/16/2022, 12:02 PM
    only other thing I can think of atm: for the dialogue buttons, you can currently use
    "custom text"
    like you did above or a
    DialogButton
    value, or
    "custom text" | DialogButton.value
  • i

    icy-zebra-52882

    07/16/2022, 12:02 PM
    is it possible to change the text displayed for those
    DialogButton
    values, for translation?
  • i

    icy-zebra-52882

    07/16/2022, 12:02 PM
    or to have two custom values instead of that
  • b

    bright-gpu-74537

    07/16/2022, 12:03 PM
    they should already be translated, no?
  • b

    bright-gpu-74537

    07/16/2022, 12:03 PM
    those strings (Cancel) come from a locale file
  • i

    icy-zebra-52882

    07/16/2022, 12:03 PM
    so it uses the system locale? or can you set the locale it uses manually?
  • i

    icy-zebra-52882

    07/16/2022, 12:03 PM
    for instance if I had a language select menu in-game
  • b

    bright-gpu-74537

    07/16/2022, 12:04 PM
    it tries to find the system locale, yeah, but you can also change it
  • i

    icy-zebra-52882

    07/16/2022, 12:04 PM
    where does it pull the locale from?
  • b

    bright-gpu-74537

    07/16/2022, 12:04 PM
    Copy code
    haxe
            LocaleManager.instance.language = "fr";
            showMessageBox.onClick = function(_) {
                var mb = new MessageBox();
                mb.text = "This message body was set via the .text property";
                mb.icon = "haxeui-core/styles/default/haxeui_small.png";
                mb.buttons = "Custom" | DialogButton.CANCEL;
                mb.show();
                
            }
  • b

    bright-gpu-74537

    07/16/2022, 12:05 PM
    you mean how does it detect it?
1...117111721173...1687Latest