Best practice to export a GUI?

Started by Monsieur OUXX, Tue 11/02/2014 13:19:44

Previous topic - Next topic

Monsieur OUXX

Every now and then I want to share a module that also relies on a GUI.

Problem is : the action scripts bound to that GUI (e.g. : "click on that button") are placed automatically in the global script by AGS.

Question: Are those bits of code supposed to be exported alongside the GUI, into the .guf file? I think not, but couldn't find a definitive answer.

If they don't get exported, I'll just write a little module to detect the clicks in a GUI that only relies on GetAtMouseXY and repeatedly_execute_always. This way, not one line of code gets out of the module.
 

Monsieur OUXX

Could I just have a confirmation that exporting a GUI is not meant to also export the bound code in the global script?
 

Ghost

#2
I did export GUIs every now and then since back in 2.72 days. The code always was exported too, and when importing, placed in GlobalScript. Hope that helps :-\

Monsieur OUXX

Quote from: Ghost on Wed 12/02/2014 09:55:01
I did export GUIs every now and then since back in 2.72 days. The code always was exported too, and when importing, placed in GlobalScript. Hope that helps :-\

Well that's weird, I did the test myself, and the code didn't travel. And I'm probably not the only one, because in some modules/GUIs I've seen readme's like : "if the buttons don't work, then add this to your global script..."

Crimson Wizard? What is this wizardry?
 

Crimson Wizard

Quote from: Monsieur OUXX on Wed 12/02/2014 17:09:44
Crimson Wizard? What is this wizardry?
Lol, why me? I know nothing about gui export stuff :tongue:.
You all have more experience using AGS actually.

Well, I can tell that AGS exports: GUI properties, All sprites used on gui (literally... binary data in XML (wtf)), and also all 256 palette entries, regardless of game colour depth. BTW the latter may take more space than all the rest summed up (if the gui background sprite is lo-res).
I don't see if any trace of script being exported anywhere.

Monsieur OUXX

Maybe that got removed with 3.x and never re-introduced afterwards?
 

Ghost

That is possible. I definitely had code travelling in 2.x, I remember that.

SMF spam blocked by CleanTalk