Separate component style for item UIs + option to select the style in the item config files, removed a bunch of hard-coded UI element color changes

This commit is contained in:
Regalis
2017-04-10 18:11:23 +03:00
parent 34f0ae39b6
commit dc6ed7daf1
21 changed files with 98 additions and 84 deletions

View File

@@ -8,7 +8,6 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Barotrauma.Networking;
using System.IO;
using System.Globalization;
namespace Barotrauma.Items.Components
{
@@ -292,6 +291,8 @@ namespace Barotrauma.Items.Components
if (components[1].Contains(".")) rect.Y *= GameMain.GraphicsHeight;
if (components[2].Contains(".")) rect.Z *= GameMain.GraphicsWidth;
if (components[3].Contains(".")) rect.W *= GameMain.GraphicsHeight;
string style = ToolBox.GetAttributeString(subElement, "style", "");
Vector4 color = ToolBox.GetAttributeVector4(subElement, "color", Vector4.One);
@@ -307,9 +308,9 @@ namespace Barotrauma.Items.Components
}
guiFrame = new GUIFrame(
new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Z, (int)rect.W),
new Color(color.X, color.Y, color.Z) * color.W, alignment, "");
//guiFrame.Alpha = color.W;
new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Z, (int)rect.W),
new Color(color.X, color.Y, color.Z) * color.W,
alignment, style);
break;
case "sound":

View File

@@ -114,7 +114,7 @@ namespace Barotrauma.Items.Components
public override void DrawHUD(SpriteBatch spriteBatch, Character character)
{
GuiFrame.Draw(spriteBatch);
if (voltage < minVoltage && powerConsumption > 0.0f) return;
int radius = GuiFrame.Rect.Height / 2 - 30;