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

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 mirrored with the *_tfg() suffix. The only functions that don't work 100% like GM are the "open" and "save as" file dialogs, which the filter argument unfinished, only one file filter can be displayed; (these problems are only present on Unix-based ports of the extension, therefore it works 100% as it should on the Windows version).

Download here:
https://www.dropbox.com/sh/jop1gdpd4d7qvy6/AACSfG7nFYYVBKq68tr0zBcea?dl=0

Extract that zip under this directory:
"[YourEnigmaFolder]/enigma-dev/ENIGMAsystem/SHELL/Universal_System/Extensions/"
« Last Edit: April 08, 2018, 03:25:29 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: 151

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

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: 151

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

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: 151

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
Member
Location: Virginia Beach
Joined: Jan 2013
Posts: 1092

View Profile WWW Email
Awesome! I'm glad we could help! :D
Logged
Pages: [1]
  Print