Exemple #1
0
		internal override ScreenChoices ProcessScreen( VoxelGameEnvironment GameEnv )
		{
			if( GameEnv.page_up != page_id )
			{
				GameEnv.page_up = page_id;
				GameEnv.GuiManager.RemoveAllFrames();

				if( Frame_Loading == null )
				{
					Frame_Loading = new FontFrame();
					Frame_Loading.SetDisplayText( "LOADING..." );
					Frame_Loading.Font = GameEnv.menu_font;// SetStyle( GameEnv.TileSetStyles.GetStyle( 1 ) );
					Frame_Loading.FontSize = ( 2.0f / 10 );
					Vector2 Loading_Size;
					Frame_Loading.GetTextDisplaySize( out Loading_Size );
					Frame_Loading.SetPosition(  1-Loading_Size.X / 2.0f, 1-Loading_Size.Y / 2.0f );
					Frame_Loading.SetSize( Loading_Size.X + 1.0f, Loading_Size.Y );
					Frame_Loading.TextureNum = TextureID.OldFont;

					LoadProgress = new ProgressBar();
					LoadProgress.SetPosition( 0.5f, 0.5f );
					LoadProgress.SetSize( 1.0f, 0.2f );
				}

				//TitleBackground.AddFrame(&Frame_PlayGame);
				GameEnv.GuiManager.AddFrame( Frame_Loading );
				GameEnv.GuiManager.AddFrame( LoadProgress );
			}
			LoadProgress.SetCompletion( GameEnv.start_percent );
			return ( ScreenChoices.NONE );
		}
Exemple #2
0
		internal override ScreenChoices ProcessScreen( VoxelGameEnvironment GameEnv )
		{
			if( GameEnv.page_up != page_id )
			{
				GameEnv.page_up = page_id;
				GameEnv.GuiManager.RemoveAllFrames();
				if( Frame_Connecting == null )
				{
					Frame_Connecting = new FontFrame();
					Frame_Connecting.Text = "Connecting...";
					Frame_Connecting.Font = GameEnv.menu_font;
					Frame_Connecting.FontSize = ( 2.0f / 10 );
					Frame_Connecting.SetPosition( 1 - Frame_Connecting.Dimensions.Size.X / 2.0f
												, 1 - Frame_Connecting.Dimensions.Size.Y / 2.0f );
				}

				if( Frame_ProgressBar == null )
				{
					Frame_ProgressBar = new ProgressBar();
					Frame_ProgressBar.SetPosition( 0.5f, 0.5f );
					Frame_ProgressBar.SetSize( 1.0f, 0.2f );
					Frame_ProgressBar.SetCompletion( 50 );
				}

				GameEnv.GuiManager.AddFrame( Frame_Connecting );
				Frame_Connecting.AddFrame( Frame_ProgressBar );

			}
			if( GameEnv.Master_Server_Connection.PercentToFail == 100 )
				return ScreenChoices.CHOICE_RETURN;
			if( GameEnv.Master_Server_Connection.Connected )
				return ScreenChoices.SELECT_SERVER;
			Frame_ProgressBar.SetCompletion( GameEnv.Master_Server_Connection.PercentToFail );

			return ResultCode;
		}