mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
Make GenerateLevel menu description widgets match indention.
This commit is contained in:
parent
ff9de47b1f
commit
b9368a8a62
@ -205,9 +205,9 @@ namespace ClassicalSharp.Gui {
|
||||
currentAction = MenuInputWidget.Create(
|
||||
game, 0, 80, 600, 30, "", Anchor.Centre, Anchor.Centre,
|
||||
regularFont, titleFont, new StringValidator( 64 ) );
|
||||
currentMoreInputLabel = TextWidget.Create(
|
||||
game, -170, 110, "Keep input bar open:",
|
||||
Anchor.Centre, Anchor.Centre, textFont );
|
||||
currentMoreInputLabel = ChatTextWidget.Create(
|
||||
game, -150, 110, "Keep input bar open:",
|
||||
Anchor.Centre, Anchor.Centre, titleFont );
|
||||
|
||||
if( curHotkey.Text == null ) curHotkey.Text = "";
|
||||
currentAction.SetText( curHotkey.Text );
|
||||
|
@ -56,7 +56,7 @@ namespace ClassicalSharp.Gui {
|
||||
public override void Init() {
|
||||
game.Keyboard.KeyRepeat = true;
|
||||
base.Init();
|
||||
labelFont = new Font( game.FontName, 15, FontStyle.Regular );
|
||||
labelFont = new Font( game.FontName, 16, FontStyle.Regular );
|
||||
titleFont = new Font( game.FontName, 16, FontStyle.Bold );
|
||||
regularFont = new Font( game.FontName, 16, FontStyle.Regular );
|
||||
|
||||
@ -92,8 +92,12 @@ namespace ClassicalSharp.Gui {
|
||||
}
|
||||
|
||||
TextWidget MakeLabel( int x, int y, string text ) {
|
||||
return TextWidget.Create( game, x, y, text,
|
||||
TextWidget widget = ChatTextWidget.Create( game, x, y, text,
|
||||
Anchor.Centre, Anchor.Centre, labelFont );
|
||||
int start = game.Width / 2 - 110;
|
||||
widget.MoveTo( start - widget.Width, widget.Y );
|
||||
widget.Colour = new FastColour( 224, 224, 224 );
|
||||
return widget;
|
||||
}
|
||||
|
||||
public override void OnResize( int oldWidth, int oldHeight, int width, int height ) {
|
||||
|
@ -140,7 +140,8 @@ namespace ClassicalSharp.Gui {
|
||||
|
||||
void MakeDescWidget( string text ) {
|
||||
DisposeDescWidget();
|
||||
descWidget = TextWidget.Create( game, 0, 90, text, Anchor.Centre, Anchor.Centre, regularFont );
|
||||
descWidget = ChatTextWidget.Create( game, 0, 90, text,
|
||||
Anchor.Centre, Anchor.Centre, regularFont );
|
||||
}
|
||||
|
||||
void DisposeDescWidget() {
|
||||
|
@ -39,7 +39,7 @@ namespace ClassicalSharp {
|
||||
|
||||
public void Render( IGraphicsApi graphics ) {
|
||||
graphics.BindTexture( ID );
|
||||
graphics.Draw2DTexture( ref this );
|
||||
graphics.Draw2DTexture( ref this, FastColour.White );
|
||||
}
|
||||
|
||||
public void Render( IGraphicsApi graphics, FastColour colour ) {
|
||||
|
@ -62,7 +62,7 @@ namespace ClassicalSharp.Gui {
|
||||
|
||||
selTex.ID = texId;
|
||||
selTex.X1 = (int)(x - selBlockSize / 2);
|
||||
api.Draw2DTexture( ref selTex );
|
||||
api.Draw2DTexture( ref selTex, FastColour.White );
|
||||
}
|
||||
|
||||
public override void Dispose() { }
|
||||
|
@ -65,8 +65,7 @@ namespace ClassicalSharp.Gui {
|
||||
activeCol = new FastColour( 255, 255, 160 ),
|
||||
disabledCol = new FastColour( 160, 160, 160 );
|
||||
public override void Render( double delta ) {
|
||||
if( !texture.IsValid )
|
||||
return;
|
||||
if( !texture.IsValid ) return;
|
||||
Texture backTex = Active ? selectedTex : shadowTex;
|
||||
if( Disabled ) backTex = disabledTex;
|
||||
|
||||
|
@ -25,8 +25,9 @@ namespace ClassicalSharp.Gui {
|
||||
public int XOffset = 0, YOffset = 0;
|
||||
protected int defaultHeight;
|
||||
protected internal Font font;
|
||||
public bool ReducePadding;
|
||||
|
||||
public bool ReducePadding;
|
||||
public FastColour Colour = FastColour.White;
|
||||
public bool IsValid { get { return texture.IsValid; } }
|
||||
|
||||
public override void Init() {
|
||||
@ -62,7 +63,7 @@ namespace ClassicalSharp.Gui {
|
||||
|
||||
public override void Render( double delta ) {
|
||||
if( texture.IsValid )
|
||||
texture.Render( api );
|
||||
texture.Render( api, Colour );
|
||||
}
|
||||
|
||||
public override void Dispose() {
|
||||
|
@ -293,10 +293,6 @@ namespace ClassicalSharp.GraphicsAPI {
|
||||
vertices[index++] = new VertexP3fT2fC4b( x1, y2, 0, uv.U1, uv.V2, FastColour.White );
|
||||
}
|
||||
|
||||
public void Draw2DTexture( ref Texture tex ) {
|
||||
Draw2DTexture( ref tex, FastColour.White );
|
||||
}
|
||||
|
||||
/// <summary> Updates the various matrix stacks and properties so that the graphics API state
|
||||
/// is suitable for rendering 2D quads and other 2D graphics to. </summary>
|
||||
public void Mode2D( float width, float height, bool setFog ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user