home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 51
/
PCGamer51_17Demos.iso
/
games
/
CM
/
CyclingManagerDemoCangas.exe
/
CyclingManagerDemo
/
scripts
/
common
/
intro
/
page_intro.cnc
next >
Wrap
Text File
|
2001-06-08
|
5KB
|
144 lines
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
// Object_Intro Create Func
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Object_Intro_Create ()
{
var frame fFrame1,fFrame2;
var i32x i,id,x,y;
oObject_Intro.pthis = GetParserComponent();
SetComponentNumber(16);
// Video
id = InitContainer(tVideo512_256);
SetContainerScale(id,800.0/256.0,400.0/256.0);
SetComponentPosition(id,0,100);
// Black Border
id = InitContainer(t_Common_Color_White);
SetContainerSize(id,800,100);
SetContainerColor(id,c_Black);
id = InitContainer(t_Common_Color_White);
SetContainerSize(id,800,100);
SetContainerColor(id,c_Black);
SetComponentPosition(id,0,500);
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
// Object_Intro Event func
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func i32x Object_Intro_Event (i32x _iComponentID,i32x _iEvent)
{
if (_iComponentID == -1)
{
if(_iEvent == GUI_COMPONENT_REFRESH )
{
if( (oObject_Intro.m_bIsRunning) && (oObject_Intro.m_bExit == false))
{
// Check video finish
if(IsVideoEnded())
{
oObject_Intro.m_bIsRunning = false;
oObject_Intro.m_bExit = true;
StopVideo();
// debug : special demo
//special looprun
if((G_iDemoVersion)||(G_iLoopRunVersion))
{
LogueOffline(1,0);
}
else
{
if (g_oGameConfig.m_iInternet==0)
{
LoadPage(PAGE_SINGLE);
}
else
{
// ** internet **
LoadPage(PAGE_MULTI);
}
}
}
}
else
{
if(oObject_Intro.m_bExit == false)
{
RunVideo();
oObject_Intro.m_bIsRunning = true;
}
}
}
}
return 1;
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
// Object_Intro Constructor
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func i32x Object_Intro_Constructor ()
{
#checkpoint intro constructor
// init video
InitVideo(tVideo512_256,"./Gui/LogoCyanide_l.avi");
oObject_Intro.m_bIsRunning = false;
oObject_Intro.m_bExit = false;
// create page
oObject_Intro.m_iIntroID = InitObject("Object_Intro",oObject_Intro.oFunc.pcreate,oObject_Intro.oFunc.pevent);
SetStackEvents(oObject_Intro.m_iIntroID,GUI_Char|GUI_KeyDown|GUI_Refresh);
SetRefreshState(oObject_Intro.m_iIntroID,16,0);
return oObject_Intro.m_iIntroID;
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//Destructor
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Object_Intro_Destructor ()
{
#checkpoint page intro destructor
if(oObject_Intro.m_bIsRunning)
{
oObject_Intro.m_bIsRunning = false;
oObject_Intro.m_bExit = true;
StopVideo();
}
UninitVideo();
DeleteComponent(oObject_Intro.m_iIntroID);
//ReleaseTexture(tVideo512_256);
// Init mouse
InitMouse(tMouse);
ShowMouse();
}
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
//Main Window Init member
//----------------------------------------------------------------------------------------------------------------//
//----------------------------------------------------------------------------------------------------------------//
func void Object_Intro_InitMembers ()
{
oObject_Intro.szName = "Object_Intro";
oObject_Intro.oFunc.pcreate = Object_Intro_Create;
oObject_Intro.oFunc.pevent = Object_Intro_Event;
}