Open thennothinghappened opened 7 months ago
Extra clarification as it was just brought up in discussion - I'd primarily like to see this treatment for these functions:
get_string/_async
get_integer/_async
show_question/_async
get_login_async
show_message/_async
I'm more on the fence about.
Finally, get_open/save_filename
has an argument either way:
After further discussion, I'm not really for this one so much at this point - but thinking to leave it open for the moment for others' opinions :)
I really like this idea personally, I have an extension which adds some of these functions back and ironically uses Dear ImGui just like you initially wanted, see my "FileDialogs" extension for download here if it interests you to ever try it: https://samuel-venable.itch.io/gamemaker-extension-collection And here's the C++ Source Code in case YoYoGames would be interested in forking it for use in GM itself officially: https://github.com/time-killer-games/libfiledialogs It's also very highly customizable.
As an added bonus my code works with both PNG and SVG icon themes on Linux. That means both GTK+ and Qt based Window Managers and Desktop Environments are supported out of the box, (though YYG only supports Ubuntu GNOME officially, so GTK+ would be preferred and if they maintained their own version of my code the Qt/KDE/SVG icon themes would either be removed or not accept bug reports at all). Just something for them to think about if they like the idea.
The functions supported by my code currently:
const char *show_message(const char *message);
const char *show_question(const char *message);
const char *show_question_ext(const char *message);
const char *get_string(const char *message, const char *value);
double get_number(const char *message, double value);
const char *get_open_filename(const char *filter, const char *fname);
const char *get_open_filename_ext(const char *filter, const char *fname, const char *dir, const char *title);
const char *get_open_filenames(const char *filter, const char *fname);
const char *get_open_filenames_ext(const char *filter, const char *fname, const char *dir, const char *title);
const char *get_save_filename(const char *filter, const char *fname);
const char *get_save_filename_ext(const char *filter, const char *fname, const char *dir, const char *title);
const char *get_directory(const char *dname);
const char *get_directory_alt(const char *capt, const char *root);
This adds the ability to select multiple files, and also select directories, with the addition of Linux to be supported, not just Windows and macOS. I intend to add something similar to get_login()
and also a color picker get_color()
. The reason I have show_message()
, show_question()
, and show_question_ext()
returning a string is because I prefer to have them return the text on the button label that was clicked, for clarity. YoYoGames is welcome to make these return an integer instead since that doesn't require as much overhead. It also supports localization of all text (maintained by the developer).
Is your feature request related to a problem?
The
get_*
family of functions primarily exist for debugging purposes - and they do that pretty well and pretty conveniently!However, being native, they all differ between OSes; some, such as
get_*_filename()
(see #3209) are not supported on Linux, or are patchy at best. These debug functions should be quick and easy to throw in and shouldn't lead to any more debugging or inconsistencies - they should just get the job done and do it well enough until its time for a proper UI.Currently, their inconsistency doesn't do that!
Describe the solution you'd like
GM's implementation of ImGui is definitely capable of serving these needs, and is already implemented across every platform bar the HTML5 runner (that I know of). Given the system is capable of it, I think it'd make perfect sense to move these functions to make use of it!
This would unify their look and functionality and hopefully mean less work on their maintenance thanks to not dealing with OS-specific dialog implementations.
Describe alternatives you've considered
The functions could alternatively see some work to get them more stable across all platforms. The biggest offender was mentioned earlier - see again #3209 about fixing
get_open/save_filename()
on Linux.Additional context
No response