Asset - Extension Dialog Module (for Windows, macOS, and Ubuntu)

Discussion in 'Marketplace' started by Samuel Venable, Mar 14, 2018.

  1. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Version 8.2.0 Released!

    Just released the Linux re-write, added new functions, and updated both the extension and demo executable uploads on both stores.


    Here's what's new:
    • show_message_cancelable(str) same as show_message() but has a cancel button.
    • show_question_cancelable(str) same as show_question() but has a cancel button.
    • show_attempt(str) shows a special type of error message, that unlike show_error(), it does not provide a way to abort the application. Instead, it has a 'Retry' and a 'Cancel' button.
    • message_get_caption() returns a custom message caption that was previously set by the developer, if one was set. Otherwise, it will return an empty string.
    • message_set_caption(str) sets a custom message caption for the message, question, attempt, error, and input, and hidden input dialogs. Set str to an empty string to restore the default value, which is either the game window title, game executable name, or "Error" depending on the dialog type and platform in use.


    Button returned values:
    • 'X' close button may vary in return value.
    • 'Abort' aborts the app; no return value.
    • 'OK' and 'Yes' return 1.
    • 'No' and 'Retry' return 0.
    • 'Cancel' and 'Ignore' return -1.
     
    Last edited: Mar 19, 2019
  2. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Now available for $3.99 USD.
     
  3. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Hey y'all! Localization features are going to be in the works soon as the next top priority.

    New functions planned:
    • string l10n_get_language() returns the current language in use for dialog localization.
    • real l10n_set_language(string lang) sets the current language to use for dialog localization. Returns 1 on success and zero on failure. It will only fail if the lang argument specifies a misspelled or unsupported language string.
    Supported languages:
    • "lang_english_us"
    • "lang_english_uk"
    • "lang_spanish"
    • "lang_german"
    • "lang_portuguese"
    • "lang_chinese"
    • "lang_japanese"
    • "lang_russian"
    • "lang_ukrainian"
    And I think that's a good starting point for now. I'm opened to suggestions if your preferred language(s) to support are not listed here.
     
    Last edited: Mar 27, 2019
    fireday2 likes this.
  4. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Here's some important information that I forgot to address previously with asset's description.

    After showing a dialog you must clear the keyboard and mouse state since GameMaker Studio 2 doesn't do that on its own:
    Code:
    keyboard_clear(keyboard_lastkey);
    mouse_clear(mouse_lastbutton);
     
  5. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    I discovered a bug with the color picker dialog on Mac that I'm really surprised I haven't discovered sooner. Pressing the escape key will close the dialog, but the game window will remain frozen in a modal state, as if the dialog is still there. I haven't looked at my code for this in a while, but I'm pretty sure I know what the issue is and I'll have it sorted out most likely before the end of tomorrow. I have several people requesting me to make extensions for them and I really need to deliver on that as my next priority after I get this fixed. I would have gotten these things done a lot sooner if I weren't so busy these past couple days so I apologize.
     
    Last edited: Apr 20, 2019
  6. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    I fixed the bug mentioned in my previous comment with the Mac color picker functions. The update on all sites is now publicly available.
     
  7. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    It was brought to my attention that the latest K Desktop Environment is completey broken, so if you are using KDialog on Linux I strongly recommend switching to Zenity until the next KDE update that should hopefully address those issues is released. Note this is not a bug with my extension or KDialog but rather all of KDE. KDE developers are working hard to get everything working and back to normal again so please stay tuned to this topic, and I will let everyone know when I discover that update has arrived.
     
  8. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    I have updated my K Desktop Environment recently, and it appears the KDE Developers fixed it. KDialog should now be 100% usable again for everyone. My apologies for any inconvenience this former bug may have caused. I recommend updating your KDE install for these fixes to take place:
    Code:
    sudo apt-get install keditbookmarks kdialog
     
    Last edited: Jul 9, 2019
  9. VanillaFrog

    VanillaFrog Member

    Joined:
    Jun 22, 2016
    Posts:
    10
    Hi Samuel,

    Thank you for the great extension. Having a file browse window always on top is exactly what I was after.

    I do have a problem implementing this into an existing project that currently uses GMFileSystem to break the sandbox. Once you access a non-sandboxed file with GMFileSystem it would allow access to it using the original file path. For some reason, using your extension (get_open_filename_fmns) to browse for a file disables the non-sandboxed access given by GMFileSystem. Any file accessed prior to using get_open_filename_fmns is still accessible afterwards but anything added afterwards cant be accessed.

    Do you have any idea on how to work around this? Does the 'FileManager' extension come in to play here?

    Using GMS 1.4.9999
     
  10. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    I don't know much about that other extension, but I do know using File Manager you may copy files in and out of the sandbox directory to give them loading and saving access while in it. You can copy them to your sandbox directory using the built-in directory variable game_save_id which will return the sandbox location.

    Also, if you are ok with no longer having access to the directory browser functions, I updated the extension for 1.4 which mostly works except the directory browser functions now crash the game (Windows-only bug) and all functions using obsolete function names need to be renamed manually in the resource tree. Other than those several oddities of using GMS 1.4 it is still functional.

    If you want this update, which you might not because it sounds like you have an older version that doesn't have these issues, you may download it here:

    https://www.dropbox.com/sh/h1z7qmn2r7semj7/AABEdXp58KL_4YqN_M2v1JVea?dl=0

    However there are new functions in this version which you might want. Keep a backup of the older version before updating to see which one you prefer.

    If you upgrade to GMStudio 2.x at any point in time, please note all of the aforementioned bugs and issues are no longer present in 2.x, which is partially why I am only officially supporting GMStudio 2.x going foward with this extension.
     
  11. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Hey guys, the terminal command for installing KDialog has changed recently for all Ubuntu and Debian-based Linux distributions.

    The correct package install command is now:
    Code:
    sudo apt-get install keditbookmarks kdialog
    Cheers,
    Samuel
     
    Last edited: Jul 9, 2019
  12. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    dialogmodule_orig.png

    Updated the feature image. :)
     
  13. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Light.png Dark.png

    Something cool that I wasn't originally aware of about the KDialog Widget System, if your desktop environment is KDE, it will change visually according to whether you are using KDE's Light or Dark themes. On other desktop environments like Unity, GNOME, or XFCE, you will notice you only have the light theme as an option, as that is the default on non-KDE desktop environments. Zenity will always use the Light theme on OS's with KDE as the desktop environmemt.
     
    fireday2 and Lonewolff like this.
  14. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,161
    Nice, my brother!

    (Not even gonna ask what is in the red 'root' folder :p)
     
    Samuel Venable likes this.
  15. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    I made get_password() and get_passcode() on Windows look more appealing by using the "black circle" character rather than an asterisk. This update can be downloaded from the itch.io link in the OP. I have yet to upload it to the GameMaker Marketplace because their uploader built-in to GMS2 keeps on failing in the middle of the upload process. I'm going to submit a ticket to sort this out on their tracker soon. I'll be updating the screenshots soon to reflect these changes, and I already did so with the online docs - http://dialogmodule.weebly.com/ I'll let everyone know when the GM Marketplace gets this update. To apply the update simply replace the Windows DLL with the new one, and the source code ZIP as well optionally for those of you who want the new source. This update only effects the Windows version so nothing else needs replacing. :)

    get_password() - before update

    07_original.png

    get_password() - after update

    07.png

    get_passcode() - before update

    09_original.png

    get_passcode() - after update

    09.png
     
  16. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    This asset became corrupt on YoYo's servers since the last time I updated it. I uploaded a new version to fix it, as well as some general bug fixes and improvements have been added to the previously, non-corrupted, version. I hope everyone enjoys this update! :D
     
  17. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    There's something important everyone should know when using this extension on Linux - you need to check if zenity or kdialog is installed at runtime, depending on which one you use to create dialogs, because if they are not installed, the user will still be able to play your game, however no dialogs will be visible, so you will need in such a case to draw text to the game window an error explaining they need to install the missing dependencies.

    Here's an example code to do this:
    Code:
    // Draw Event
    if (widget_get_system() == "Zenity" && !file_exists("/usr/bin/zenity")) {
      draw_text(32, 32, "Error: Zenity is not installed! Required dialog boxes will not show. Install Zenity with: sudo apt-get install zenity");
    } else if (widget_get_system == "KDialog" && !file_exists("/usr/bin/kdialog")) {
      draw_text(32, 32, "Error: KDialog is not installed! Required dialog boxes will not show. Install KDialog with: sudo apt-get install kdialog");
    }
    You may create in your game options screen a setting the gamer can change to allow them to choose whether to use zenity or kdialog, if both are installed:
    Code:
    if (file_exists("/usr/bin/zenity") && file_exists("/usr/bin/kdialog")) {
      widget_allow_user_to_choose_system = true // when this is true, allow the option using your own code
    }
    Or, if you only want to use KDialog only when you are using a KDE Desktop Environment:
    Code:
    if (widget_get_system() == "Zenity") {
        if (environment_get_variable("XDG_CURRENT_DESKTOP") == "KDE")
            widget_set_system("KDialog");
    }
     
    Last edited: Jul 15, 2019
  18. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,242
    Updated the visual appearance of the macOS dialogs a bit. Some of them are now sheet modal, while others open in the center of the game window's position.

    [​IMG]

    Also an important note regarding this special update - please make sure you use this new function call at game start:
    Code:
    widget_set_owner(hwnd_main);
    This will ensure that the dialogs attach to your game window. Otherwise it might not attach to the correct window on your screen, (or in mac's case, attach to no window at all). This should only happen if your game window is not in focus above all other windows and you are not calling the function above with the specified argument.

    This function was always necessary on Windows and Linux to prevent that bug, I just haven't added it until now because I didn't find there to be many possible cases where the issue would end up happening regardless. On mac with the sheet modal additions, it became 100% necessary, so here you go, after all this time I did it. :D
     
    Last edited: Aug 24, 2019

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice