Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: viktor on Tue 05/01/2021 14:12:39

Title: (SOLVED) Title screen open Load GUI
Post by: viktor on Tue 05/01/2021 14:12:39
Hy.

I'm making my title screen with all the options before you start. I'm making it as a room with hotspots. One hotspot is the load "button". Oh, and I'm using the Tumbleweed template.

I used this code:
Code (ags) Select
function hLoad_AnyClick()
{
gLoad.Visible=true;
}


But when the GUI pops up, all the windows are empty, even though there should be save files in it. And if you click on any of the windows, the game crashes.
Title: Re: Title screen open Load GUI
Post by: Crimson Wizard on Tue 05/01/2021 14:19:27
Is "gLoad" a gui from template or your own? I'd assume that Thumbleweed has its own code to fill in GUI lists, and you have to call some function instead of displaying GUI yourself. Perhaps, look how their original global script handles this (or maybe something is in their documentation).

In general, list boxes don't really do anything automatically, you need to fill them with a script command, either by manually adding items, or calling ListBox.FillSaveGameList() or ListBox.FillDirList().

Quote from: viktor on Tue 05/01/2021 14:12:39And if you click on any of the windows, the game crashes.

Please always include any messages displayed with the crash, that makes it possible to diagnose a problem.
Title: Re: Title screen open Load GUI
Post by: Khris on Tue 05/01/2021 16:12:59
Not easy to find but you're supposed to call
Code (ags) Select
  CustomLoad.ShowLoadDialog();

Similar commands can be found for  CustomSave.*  and  OptionsGui.*.
Title: Re: Title screen open Load GUI
Post by: viktor on Tue 05/01/2021 17:58:33
Quote from: Khris on Tue 05/01/2021 16:12:59
Not easy to find but you're supposed to call
Code (ags) Select
  CustomLoad.ShowLoadDialog();

Similar commands can be found for  CustomSave.*  and  OptionsGui.*.

That did it, thank you :)