home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Console AI script
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //3D Option Create func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void MSCommandOption_Create ()
- {
- var i32x id;
- //1 editbox + 1 text = 2 components
- SetComponentNumber(2);
-
- //2 is the Id of the font texture
- id = InitContainer(tFontArial);
- SetContainerText(id,"MS:");
- SetComponentPosition(id,8,32);
-
- //Create the edit box for commands
- oMSCommandOption.iEditCommand = InitEditBox(tFontArial,10);
- SetContainerStateFunc(oMSCommandOption.iEditCommand,TextButtonState);
- SetContainerText(oMSCommandOption.iEditCommand,"");
- SetComponentPosition(oMSCommandOption.iEditCommand,30,32);
- SetComponentSize(oMSCommandOption.iEditCommand,100,10);
- //Resize the event zone of the father
- AutoResize();
- }
-
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Option3D Event func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func i32x MSCommandOption_Event (i32x _iComponentID,i32x _iEvent)
- {
- if(_iComponentID == oMSCommandOption.iEditCommand)
- {
- if(_iEvent == GUI_COMPONENT_KEYDOWN )
- {
- if (GetLastKey() == VK_Return)
- {
- //mao debug send MS command instead of print
- print("MSCommand:");
-
- NetClient_SendMessage(g_oMenuServer.m_oServer,GetContainerText(oMSCommandOption.iEditCommand));
- println(GetContainerText(oMSCommandOption.iEditCommand));
- SetContainerText(oMSCommandOption.iEditCommand,"");
- }
- }
- }
- return 1;
- }
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //TeamPanel Init func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void InitMSCommandOption()
- {
- oMSCommandOption.oFunc.pcreate = MSCommandOption_Create;
- oMSCommandOption.oFunc.pevent = MSCommandOption_Event;
- }
-