[PLUGIN] Dialog Box

0 favourites
From the Asset Store
Template for a generic save / load system, fully documented in comments and video
  • Here's a new plugin which could be useful for some projects.

    It calls the prompt(), alert() and confirm() of the browser, that's why it can't be have the same look.

    For now, there's none ID parameter that can be assigned to each dialogs (especially for confirm & input dialogs), I'm working on it but you can use variables instead.

    Dialog Box

    Version: 1.0 (10th December 2011).

    Tried in Internet Explorer 9.0.3 / Opera 11.51 / Chrome 15.0.874 / Safari 5.1.2 (Is Cancel button clicked condition doesn't work since 5.1+) / Firefox 8.0 / Mobile Safari (iOS 4)

    Download DialogBox.rar

    ACTIONS.

    DIALOGS TYPE.

    Open an alert dialog(message)? Open an alert dialog. OK button

    Open an input dialog(message, input by default) ? Open an input dialog. OK & Cancel buttons.

    Open a confirm dialog(message) ? Open a confirmation dialog. OK & Cancel buttons.

    CONDITIONS.

    CONFIRM DIALOG.

    is OK button clicked ? Return true when the user clicked on OK button in the Confirm dialog.

    is Cancel button clicked ? Return true when the user clicked on Cancel button in the Confirm dialog.

    INPUT DIALOG.

    is OK button clicked ? Return true when the user clicked on OK button in the Input dialog.

    is Cancel button clicked ? Return true when the user clicked on Cancel button in the Input dialog. Doesn't work in Safari 5.1+

    is Input is empty ? Return true if the user doesn't input anything in the Input dialog.

    EXPRESSIONS.

    TEXT.

    getInputText? Return the text that the user wrote in the Input dialog.

    TODO List for this plugin.

    • Add ID to confirm and input dialogs.
    • Add customized non-system dialogs.
    • Try to solve the isCancelButtonClicked issue with Safari 5.1+.
    • A french version.

    Let me know your suggestions, requests and corrections (as about language) as well as any bug report.

    Enjoy

  • Nice~ C2 could be a html editor.

  • septeven

    For "input dialog":

    Might condition:"is OK button clicked" become a cf_trigger condition?

    So that it can be trigger once after clicking "OK".

  • rexrainbow

    I'll try to do this asap

  • septeven

    Sorry, I made a mistake again. This plugin can work fine if I put "is OK button clicked" after "input dialog"

    For example:

    + on start of layout: 
    [ul]
    	[li]input dialog[/li]
    [/ul]    + is ok botton clicked
        - do something

    So it does not need to change anything.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi ,

    How can we use this plug in type for Confirm box and alert boxes with return type.

    Thanks,

    M.Maheswar

  • maheswarreddy4

    Sorry but I don't really understand what are you saying...

  • Hi, I like the plgin. I couldn't get it working with Chrome(21.0.1180.79 m). But it worked just fine in Firefox(14.0.1). Also It would be nice to have custom buttons, and have more than two :)

  • Hey its not showing up. Try Alert and Confirm dialog box.

    Call it after both AJAX complete and fail calls, no show on the dialog boxes?

    Help please.

  • please provide a capx, the dialog box works correctly here

  • Your plugin is really cool, it just has a problem.

    The "Ok button clicked event" of the confirm dialog remains active on layout change. Let me explain:

    * You listen to the "Ok button clicked event"

    * Your action sends you to another layout.

    * At some moment you go back to the layout where the event got triggered.

    * Your action executes again on layout start

    Is like if the event stood still active when you go back to the layout where it were triggered.

    The solution is to simply make the "Ok button clicked event" a sub-event of the one that made the confirm dialog show up. That way, the event works as espected.

  • sounds good

  • JeyDotC Thank you for the tip about making it a sub-event instead. Worked like a charm since I was just stuck with this same dilemma and wondering how to get around it. Thanks!

  • Can someone reupload this plugin?

  • Can someone reupload this plugin?

    yadi.sk/d/soAutAz23HFtop

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)