Game Development Community

Gui's

by Chris Sargent · in Torque Game Engine · 09/22/2008 (2:25 pm) · 1 replies

I posted this under the gui section and then noticed that, it was under art public and as i'm not sure how much access the public area has i'm reposting here hehe.

I'm working on modifying the starter.fps gui so I can learn the basics to eventually create my own gui.

I was looking at the startmission.gui in the gui editor. I am unclear on where / how the textbox in the guiscrollctrl is populated with the names of the mission.

I see under this there is a guitextlistctrl defined. I have looked here and see that it sets up the basics of the text box area. Under this is the Guitextlistctrl. This uses SM_Missionlist as a Name (the name section right next to the apply button).

How/where does the text get populated into the text area?

I've tried looking on TDN under gui's after selecting TGE but almost every link sends me to a resource for TGB gui's.

Actually after going through the startmission.gui again I believe this is what is populating the text area:

//----------------------------------------
function startMissionGui::onWake()
{
   SM_missionList.clear();
   %i = 0;
   for(%file = findFirstFile($Server::MissionFileSpec); %file !$= ""; %file = findNextFile($Server::MissionFileSpec))  
      if (strStr(%file, "/CVS/") == -1)
         SM_missionList.addRow(%i++, getMissionDisplayName(%file) @ "\t" @ %file );
   SM_missionList.sort(0);
   SM_missionList.setSelectedRow(0);
   SM_missionList.scrollVisible(0);
}   


//----------------------------------------

If this is in fact what is doing this could someone please give me a quick rundown on how this is working as i've not moved on to learning my scripting yet.

Thank you again

#1
09/22/2008 (2:30 pm)
This is what i'm thinking.

the function startMissionGui::onWake() runs this function when the start menu gui is loaded.

Once it starts, it sets the SM_missionList (textarray ?) to 0 / clear. Then the for statements reads in and populates the array with available missions.


However, i'm not clear on the varialbes in the for statement.