Custom GUI disappears after calling built-in GUI

Started by Rik Vargard, Fri 18/09/2020 16:47:45

Previous topic - Next topic

Rik Vargard

So I created my custom GUI and to test it I created a Game Load  button.

In the "Events" Tab I added the "btnLoad_OnClick" line in OnClick (I just copy/pasted that)

Now, in-game, on my intro screen, I click on my Load button and the RestoreGame GUI appears. But if I click to close it, it does close but my custom GUI is vanished.
AND also, I can now change the actions with the right click (the mouse icon I set is no more blocked) AND the Icon Bar who was set to invisible is now visible.

I noticed in the "btnLoad_OnClick" script the line : close_owning_gui(control);
So I duplicated it (btnLoad2) and removed the line but yeah, now my GUI is always visible and I can't click anywhere so I undid that after an ALT+F4

Any idea? Thanks!!  :)

Just in case, here the script in "room_load" :

Code: ags
function room_Load()
{
player.Transparency = 100;
//PlayVideo("AGSLogo01.ogv", eVideoSkipEscKey, 1);
//PlayVideo("EONIRIALogo01.ogv",eVideoSkipEscKey, 1);
//start_chan = aIntro01.Play();
//start_chan.Volume = 100;
gIconbar.Visible = false;
gStatusline.Visible = false;
mouse.ChangeModeGraphic(mouse.Mode, 2061);
gGui1.Visible = true;
}

Rik Vargard

So, I made a little 1 minute video of the problem I have here :

https://youtu.be/5ZuKHngt6w0

Well maybe there just isn't a solution for this problem and I have to find a workaround.
And I have been searching around, a lot, since my first post but I must be searching the wrong way... and also, I did come across some scripting but yeah, I'm a noob and reverse engineering didn't work :p

if you have a solution for all these problems in my intro room, let me know.

Otherwise, thank you for reading!  ;)

PS.: right now, I'll try something with two rooms, one just for the RestoreGame GUI with a button to go back to the main menu, let's see how that goes  :-D

Crimson Wizard

#2
Hello.

The script you've shown in the first post relates to the "room load" event, but what script is run when you click on Load button, and what script is run when you close the "restore game" dialog? If you hide the main menu, then you simply need to show it again after restore dialog is closed.

Rik Vargard

Quote from: Crimson Wizard on Mon 21/09/2020 17:58:47
Hello.

The script you've shown in the first post relates to the "room load" event, but what script is run when you click on Load button, and what script is run when you close the "restore game" dialog? If you hide the main menu, then you simply need to show it again after restore dialog is closed.

Oh boy, you just asked the right questions!
I was just copying the Events (and thus I had still the same scripts) so I had those problems all over the place.
Thanks to you I got the idea of duplicating the RestoreGame GUI and rename the related Events ans scripts and adapt them to my needs.

Thank you so much for your reply, you just made my day, big time!!  (nod) ;-D

Cheers!

SMF spam blocked by CleanTalk