Use the original classic inventory table colours.

This commit is contained in:
UnknownShadow200 2016-05-26 17:03:05 +10:00
parent 9061063b1e
commit f15f0134c1
3 changed files with 18 additions and 6 deletions

View File

@ -31,14 +31,16 @@ namespace ClassicalSharp.Gui {
int TableWidth { get { return blocksPerRow * blockSize + 10 + 10; } }
int TableHeight { get { return Math.Min( rows, maxRows ) * blockSize + 10 + 30; } }
static FastColour normBackCol = new FastColour( 30, 30, 30, 200 );
static FastColour classicBackCol = new FastColour( 48, 48, 96, 192 );
// These were sourced by taking a screenshot of vanilla
// Then using paint to extract the colour components
// Then using wolfram alpha to solve the glblendfunc equation
static FastColour topCol = new FastColour( 34, 34, 34, 168 );
static FastColour bottomCol = new FastColour( 57, 57, 104, 202 );
static VertexP3fT2fC4b[] vertices = new VertexP3fT2fC4b[8 * 10 * (4 * 4)];
int vb;
public override void Render( double delta ) {
FastColour backCol = game.ClassicMode ? classicBackCol : normBackCol;
api.Draw2DQuad( TableX, TableY, TableWidth, TableHeight, backCol );
api.Draw2DQuad( TableX, TableY, TableWidth, TableHeight, topCol, bottomCol );
if( rows > maxRows )
DrawScrollbar();
api.Texturing = true;

View File

@ -81,7 +81,6 @@ namespace ClassicalSharp {
void MakeMap() {
for( int i = 0; i < map.Length; i++ )
map[i] = (Block)i;
if( !game.ClassicMode ) return;
// First row
map[(byte)Block.Dirt] = Block.Cobblestone;

View File

@ -253,7 +253,8 @@ namespace ClassicalSharp.GraphicsAPI {
internal VertexP3fC4b[] quadVerts = new VertexP3fC4b[4];
internal int quadVb;
public virtual void Draw2DQuad( float x, float y, float width, float height, FastColour col ) {
public virtual void Draw2DQuad( float x, float y, float width, float height,
FastColour col ) {
quadVerts[0] = new VertexP3fC4b( x, y, 0, col );
quadVerts[1] = new VertexP3fC4b( x + width, y, 0, col );
quadVerts[2] = new VertexP3fC4b( x + width, y + height, 0, col );
@ -262,6 +263,16 @@ namespace ClassicalSharp.GraphicsAPI {
UpdateDynamicIndexedVb( DrawMode.Triangles, quadVb, quadVerts, 4, 6 );
}
public virtual void Draw2DQuad( float x, float y, float width, float height,
FastColour topCol, FastColour bottomCol ) {
quadVerts[0] = new VertexP3fC4b( x, y, 0, topCol );
quadVerts[1] = new VertexP3fC4b( x + width, y, 0, topCol );
quadVerts[2] = new VertexP3fC4b( x + width, y + height, 0, bottomCol );
quadVerts[3] = new VertexP3fC4b( x, y + height, 0, bottomCol );
SetBatchFormat( VertexFormat.P3fC4b );
UpdateDynamicIndexedVb( DrawMode.Triangles, quadVb, quadVerts, 4, 6 );
}
internal VertexP3fT2fC4b[] texVerts = new VertexP3fT2fC4b[4];
internal int texVb;
public virtual void Draw2DTexture( ref Texture tex, FastColour col ) {