Pages: [1] 2
  Print  
Author Topic: Tiny File Dialogs for ENIGMA (Windows, Mac, and Linux)  (Read 545 times)
Offline (Male) time-killer-games
Posted on: March 30, 2018, 04:41:51 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Some users were having trouble getting GTK+ dialogs to work on Mac and Linux, so I decided to create a quick solution to this problem, based on "Tiny File Dialogs" from SourceForge.net, which was licensed under zlib.

Note: currently only works on Mac and Linux. Will update the code soon, so that it will work on Windows as well, out of the box.







As you can see from the screenshots, this extension is also available for GameMaker Studio. It works the same in both.

Here's the progress I've made with the Windows version; (I can't publish it until a certain bug is fixed with MinGW):



What you see in the Windows screenshots above, was actually made with Microsoft's compiler, which is why it works in GMStudio but not ENIGMA yet.

All of pre-Studio GameMaker and GameMaker Studio's dialog functions are mirrored with the *_tfd() suffix.

Download here:
[link removed] Note: This ENIGMA extension is now it's own Widget System and is shipped with ENIGMA.

Extract that zip under this directory:
"[YourEnigmaFolder]/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/"

Comes with an editable GM81 file and two Linux demo executables, (one for 32-bit and one for 64-bit).

To install all of your game's dependencies on Linux, along with the Linux dependencies that are needed to use this extension, use this terminal command:

Code: [Select]
sudo apt-get install g++ zlib1g-dev libglew-dev libglu1-mesa-dev libalure-dev libvorbisfile3 libvorbis-dev libdumb1-dev libbox2d-dev zenity
The only dependencies this modified version of Tiny File Dialogs uses are zenity and GTK, as far as I know.

Cheers.
Samuel
« Last Edit: September 08, 2018, 08:53:33 PM by time-killer-games » Logged
Offline (Male) hpg678
Reply #1 Posted on: March 30, 2018, 08:29:04 PM

Member
Location: Barbados
Joined: Mar 2017
Posts: 190

View Profile Email
I would like to add that there are two sample files; a gm81 file and a .exe file.  you can remove or copy them to your home folder and run them to see how it works.


Thanks for this!
Logged
Hugar
Offline (Male) time-killer-games
Reply #2 Posted on: March 31, 2018, 05:30:30 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
You're welcome! :D Updated the code to (hopefully) support Mac. I will announce Mac is supported once someone has verified that it now works.
« Last Edit: March 31, 2018, 05:32:06 PM by time-killer-games » Logged
Offline (Male) time-killer-games
Reply #3 Posted on: April 01, 2018, 09:40:52 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Added screenshots for the Linux and Windows version; (Windows version is not released yet due to a bug with MinGW).
Logged
Offline (Male) time-killer-games
Reply #4 Posted on: April 04, 2018, 11:26:24 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Just wanted to announce that I talked with Josh and there seems to be a good chance this will become the new default widget system for Linux and Mac. That way, it won't be an extension, but a part of the actual engine.  :smileycat:
Logged
Offline (Male) hpg678
Reply #5 Posted on: April 05, 2018, 03:40:00 AM

Member
Location: Barbados
Joined: Mar 2017
Posts: 190

View Profile Email
That's great TKG! I'm really happy for you. :clap: :clap: :dance: :dance:


I'd like to mention 2 things. First on my main machine, I've had some black bars present. 2nd the graphics looked 'bare' and some dialogs were in a terminal type shell interface; a far cry from your screen-shots.


This happened for quite while. However since I've installed Gnome3 as an alternative Windows Manager, the graphics have changed to be more similar to your screen-shots.


Maybe I was missing some libraries before. I'm not really sure. Just thought I should mention this.




The machine I'm testing on is
  • Lenovo Thinkcentre Desktop
  • 4GB DDr2 800Mhz Memory
  • 320Gb Hard Drive
  • MX16.1 OS with XFCE Window Manager
  • Embedded Video Graphics
« Last Edit: April 05, 2018, 06:07:17 AM by hpg678 » Logged
Hugar
Offline (Male) time-killer-games
Reply #6 Posted on: April 05, 2018, 03:06:41 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
@hpg678 It sounds like the issue was you didn't have any of the intended libraries installed on your original window manager. I'll contact the author of Tiny File Dialogs and see if he can tell me what specific libraries need to be installed.

It looks like that black on the game screen was because you tried dragging the dialogs - the same thing happens on Windows 7 with ENIGMA's default dialog system. As far as I know, there is no way around that, I'm sorry to say. Seems to be an issue with OpenGL and DirectX. On a newer OS like Windows 10 and Ubuntu 14.04 LTS this issue doesn't exist.

In any case, I added get_color_tfd(defcol) to the list of compatible functions. All that's left function-wise is show_error_tfd(str, abort).
« Last Edit: April 08, 2018, 03:28:05 PM by time-killer-games » Logged
Offline (Male) time-killer-games
Reply #7 Posted on: April 06, 2018, 03:44:51 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Added show_error_tfd(str, abort). All that's left to do now is support for file type filters in the 'open' and 'save as' dialogs.
Logged
Offline (Male) time-killer-games
Reply #8 Posted on: April 08, 2018, 03:21:39 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Special thanks to Josh for this one; I couldn't have done it without him! :D

Added single-file-filter support to Mac and Linux. For example, this works:

get_open_filename_tfd("Sprite Image Files|*.png;*.gif;*.jpg;*.jpeg", "sprite.png");

Multiple-file-filters aren't yet supported on Mac/Linux, so this won't work:

get_open_filename_tfd("PNG Image Files|*.png|GIF Image Files|*.gif|JPEG Image Files|*.jpg;*.jpeg", "sprite.png");

However, both of the above examples work on Windows, you should probably use the earlier example, so that it will work cross-platform. Multiple-file-filters will be added to Mac/Linux as soon as Josh and I figure out how to do that. Hopefully soon.
Logged
Offline (Male) hpg678
Reply #9 Posted on: April 09, 2018, 08:03:21 PM

Member
Location: Barbados
Joined: Mar 2017
Posts: 190

View Profile Email
it's as if both of you are reading my mind!


for my 'Linux Dancing' app, i want to give make the user the option of using their own sprite, so I was looking for a way to implement this with 'Tiny Dialogs'.....and lo and behold, here is what I was looking for.


WOW!


 :woop: :woop:



Logged
Hugar
Offline (Male) time-killer-games
Reply #10 Posted on: April 09, 2018, 08:16:59 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Awesome! I'm glad we could help! :D
Logged
Offline (Male) time-killer-games
Reply #11 Posted on: April 25, 2018, 07:16:09 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Hey, just wanted to let everyone know that I added a new Linux executable to the downloadable zip in the OP. Now there is one executable for 32-bit Linux and one for 64-bit Linux, to make it easier for you to test, standalone, without needing to start up LateralGM and all that jazz. :)

Note: It actually works better on 64-bit Linux because on 64-bit the dialogs actually keep focus over the game window. Since 32-bit Linux is dying, this is not that huge of a deal that it doesn't work as well on 32-bit.
« Last Edit: April 25, 2018, 07:18:18 PM by time-killer-games » Logged
Offline (Male) time-killer-games
Reply #12 Posted on: May 19, 2018, 07:37:02 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
BUGFIX: Inputbox no longer hides input like a password field when the second argument of get_string_tfd() is an empty string on Linux.
« Last Edit: May 19, 2018, 11:16:57 PM by time-killer-games » Logged
Offline (Male) time-killer-games
Reply #13 Posted on: May 24, 2018, 08:01:33 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Added two new functions!

Code: [Select]
// behaves the same as get_string_tfd(str, def); except input is hidden in the textfield (useful for password input).
get_password_tfd(str, def);

// behaves the same as get_integer_tfd(str, def); except input is hidden in the textfield (useful for passcode input).
get_passcode_tfd(str, def);

The second parameter, which is the default hidden string or integer to have in the textbox, is useful for a password or passcode "remember me" feature, similar to those found on website logins.
« Last Edit: May 24, 2018, 08:04:39 PM by time-killer-games » Logged
Offline (Male) time-killer-games
Reply #14 Posted on: May 31, 2018, 03:10:11 PM
Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1124

View Profile WWW Email
Thanks to cheeseboy, this extension now fully supports multiple file filters in the Open and Save As dialog functions!!! :D

With this very special update, please make sure zenity is installed for both yourself and for the end users who play your game:

Code: [Select]
sudo apt-get install zenity
« Last Edit: May 31, 2018, 03:12:09 PM by time-killer-games » Logged
Pages: [1] 2
  Print