2019-08-10 21:37:10 +02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Text;
|
|
|
|
using Microsoft.Xna.Framework;
|
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
2019-12-31 14:08:13 +01:00
|
|
|
using MLEM.Extensions;
|
2019-08-10 21:37:10 +02:00
|
|
|
using MLEM.Font;
|
|
|
|
using MLEM.Textures;
|
|
|
|
|
|
|
|
namespace MLEM.Ui.Style {
|
|
|
|
public class UntexturedStyle : UiStyle {
|
|
|
|
|
|
|
|
public UntexturedStyle(SpriteBatch batch) {
|
2019-12-31 14:08:13 +01:00
|
|
|
this.SelectionIndicator = batch.GenerateTexture(Color.Transparent, Color.Red);
|
|
|
|
this.ButtonTexture = batch.GenerateTexture(Color.CadetBlue);
|
2019-08-10 21:37:10 +02:00
|
|
|
this.ButtonHoveredColor = Color.LightGray;
|
2020-01-15 17:05:28 +01:00
|
|
|
this.ButtonDisabledColor = Color.Gray;
|
2019-12-31 14:08:13 +01:00
|
|
|
this.PanelTexture = batch.GenerateTexture(Color.Gray);
|
|
|
|
this.TextFieldTexture = batch.GenerateTexture(Color.MediumBlue);
|
2019-08-10 21:37:10 +02:00
|
|
|
this.TextFieldHoveredColor = Color.LightGray;
|
2019-12-31 14:08:13 +01:00
|
|
|
this.ScrollBarBackground = batch.GenerateTexture(Color.LightBlue);
|
|
|
|
this.ScrollBarScrollerTexture = batch.GenerateTexture(Color.Blue);
|
|
|
|
this.CheckboxTexture = batch.GenerateTexture(Color.LightBlue);
|
2019-08-13 21:23:20 +02:00
|
|
|
this.CheckboxHoveredColor = Color.LightGray;
|
2019-12-31 14:08:13 +01:00
|
|
|
this.CheckboxCheckmark = batch.GenerateTexture(Color.Blue).Region;
|
|
|
|
this.RadioTexture = batch.GenerateTexture(Color.AliceBlue);
|
2019-08-13 21:23:20 +02:00
|
|
|
this.RadioHoveredColor = Color.LightGray;
|
2019-12-31 14:08:13 +01:00
|
|
|
this.RadioCheckmark = batch.GenerateTexture(Color.CornflowerBlue).Region;
|
|
|
|
this.TooltipBackground = batch.GenerateTexture(Color.Black * 0.65F, Color.Black * 0.65F);
|
|
|
|
this.TooltipOffset = new Vector2(2, 3);
|
|
|
|
this.ProgressBarTexture = batch.GenerateTexture(Color.RoyalBlue);
|
2019-09-10 23:28:25 +02:00
|
|
|
this.ProgressBarColor = Color.White;
|
2019-11-02 14:53:59 +01:00
|
|
|
this.ProgressBarProgressPadding = new Vector2(1);
|
2019-09-10 23:28:25 +02:00
|
|
|
this.ProgressBarProgressColor = Color.Red;
|
2019-08-10 21:37:10 +02:00
|
|
|
this.Font = new EmptyFont();
|
|
|
|
}
|
|
|
|
|
|
|
|
private class EmptyFont : IGenericFont {
|
|
|
|
|
2019-08-25 19:07:45 +02:00
|
|
|
public float LineHeight => 1;
|
|
|
|
|
2019-08-10 21:37:10 +02:00
|
|
|
public Vector2 MeasureString(string text) {
|
|
|
|
return Vector2.One;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector2 MeasureString(StringBuilder text) {
|
|
|
|
return Vector2.One;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawString(SpriteBatch batch, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawString(SpriteBatch batch, StringBuilder text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void DrawCenteredString(SpriteBatch batch, string text, Vector2 position, float scale, Color color, bool horizontal = true, bool vertical = false, float addedScale = 0) {
|
|
|
|
}
|
|
|
|
|
2019-08-25 19:07:45 +02:00
|
|
|
public string SplitString(string text, float width, float scale) {
|
|
|
|
return text;
|
2019-08-10 21:37:10 +02:00
|
|
|
}
|
|
|
|
|
2019-09-05 18:15:51 +02:00
|
|
|
public string TruncateString(string text, float width, float scale, bool fromBack = false) {
|
|
|
|
return text;
|
|
|
|
}
|
|
|
|
|
2019-08-10 21:37:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|