public override bool HandlesKeyUp( Key key ) { if( key == game.Mapping( KeyBinding.PlayerList ) ) { if( playerList != null ) { playerList.Dispose(); playerList = null; return true; } } return false; }
public override bool HandlesKeyDown( Key key ) { if( key == game.Mapping( KeyBinding.PlayerList ) ) { if( playerList == null ) { if( game.Network.UsingExtPlayerList ) { playerList = new ExtPlayerListWidget( game, playerFont ); } else { playerList = new NormalPlayerListWidget( game, playerFont ); } playerList.Init(); playerList.MoveTo( playerList.X, game.Height / 4 ); } } if( chat.HandlesKeyDown( key ) ) { return true; } return hotbar.HandlesKeyDown( key ); }
public override bool HandlesKeyUp(Key key) { if (key == game.Mapping(KeyBind.PlayerList)) { if (playerList != null) { hadPlayerList = false; playerList.Dispose(); playerList = null; return(true); } } if (chat.HandlesAllInput) { return(true); } return(hotbar.HandlesKeyUp(key)); }
public override void Render(double delta) { if (game.HideGui) { return; } bool showMinimal = game.Gui.ActiveScreen.BlocksWorld; if (chat.HandlesAllInput && !game.PureClassic) { chat.RenderBackground(); } api.Texturing = true; if (!showMinimal) { hotbar.Render(delta); } chat.Render(delta); if (playerList != null && game.Gui.ActiveScreen == this) { playerList.Render(delta); // NOTE: Should usually be caught by KeyUp, but just in case. if (!game.IsKeyDown(KeyBind.PlayerList)) { playerList.Dispose(); playerList = null; } } if (playerList == null && !showMinimal) { DrawCrosshairs(); } api.Texturing = false; }
void OnNewMap( object sender, EventArgs e ) { if( playerList != null ) playerList.Dispose(); playerList = null; }
void CreatePlayerListWidget() { if( game.Network.UsingExtPlayerList ) { playerList = new ExtPlayerListWidget( game, playerFont ); } else { playerList = new NormalPlayerListWidget( game, playerFont ); } playerList.Init(); playerList.MoveTo( playerList.X, game.Height / 4 ); }
public override void Render( double delta ) { if( game.HideGui ) return; bool showMinimal = game.GetActiveScreen != this; if( chat.HandlesAllInput ) chat.RenderBackground(); graphicsApi.Texturing = true; chat.Render( delta ); if( !showMinimal ) RenderHotbar( delta ); //graphicsApi.BeginVbBatch( VertexFormat.Pos3fTex2fCol4b ); //graphicsApi.BindTexture( game.TerrainAtlas.TexId ); //IsometricBlockDrawer.Draw( game, (byte)Block.Brick, 30, game.Width - 50, game.Height - 20 ); if( playerList != null ) { playerList.Render( delta ); // NOTE: Should usually be caught by KeyUp, but just in case. if( !game.IsKeyDown( KeyBinding.PlayerList ) ) { playerList.Dispose(); playerList = null; } } graphicsApi.Texturing = false; if( playerList == null && !showMinimal ) DrawCrosshairs(); }