Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Col. Phil Bilko on April 13, 2011, 08:20:30 AM

Title: [solved] Button that triggers Closing the App?
Post by: Col. Phil Bilko on April 13, 2011, 08:20:30 AM
Hello all;

How would I have a button once clicked to quit the app? I have the button setup, just having an issue with triggering this... All help would be appreciated.

Thanks in advance.

Bilko
Title: Re: Button that triggers Closing the App?
Post by: jeanfabre on April 13, 2011, 08:42:55 AM
Hi,

 I can't find any pre made actions for this. If there is then can someone point it?

 Meanwhile, I scripted one. You can get the code here http://hutonggames.com/playmakerforum/index.php?topic=113.0 (http://hutonggames.com/playmakerforum/index.php?topic=113.0)

1: In your project Panel, open Playmaker/Actions/
2: Create a new c# script
3: Rename it ApplicationQuit
4: copy the code from the link above
5: select your button fsm
6: Select the State that needs to quit the app
7: browse the actions under the GameLogic tab and select ApplicationQuit and add it to your State
8: now if you run, and reach that State, it will quit the application.

 If you have any questions, do not hesitate:)

Bye,

 Jean
Title: Re: Button that triggers Closing the App?
Post by: Col. Phil Bilko on April 13, 2011, 08:51:03 AM
PERFECT!!!!

Thanks ever so much! Works like a charm! (God I need to learn code hahaha)

Regards;

Bilko
Title: Re: Button that triggers Closing the App?
Post by: MaDDoX on April 13, 2011, 09:44:28 AM
Nice jeanfabre! Guys, if it isn't asking much, could we add all new actions to the proper section (http://hutonggames.com/playmakerforum/index.php?board=19.0) and just link to them in the questions that required them? That'd make things easier to find/maintain (in case some bug is found or you want to update the action) and tidier.

Thanks!
Title: Re: Button that triggers Closing the App?
Post by: jeanfabre on April 13, 2011, 10:25:31 AM
Done,

 I whish we had some better official wiki system, cause even if it goes in the right section, maintaining code base in a forum is just wrong anyway.. but yes, in the right section now :) Obviously, the team is really busy and can't really afford playing on all sides, so if they'd let us build up a proper code base and documentation as we discuss things, double win!

 Bye,

 Jean
Title: Re: Button that triggers Closing the App?
Post by: Alex Chouls on April 13, 2011, 04:35:47 PM
We're working on a public section on the playmaker wiki... should be up tonight!