GUIStyle logic changes: instead of having a predetermined GUIComponentStyle for each type of GUIComponent, any GUIComponent can use any style. The GUIComponent constructors take the name of the style as a parameter, and if no style is specified, the default style for the GUIComponent in question will be used.
This commit is contained in:
@@ -308,7 +308,7 @@ 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, GUI.Style);
|
||||
new Color(color.X, color.Y, color.Z) * color.W, alignment, "");
|
||||
//guiFrame.Alpha = color.W;
|
||||
|
||||
break;
|
||||
|
||||
@@ -22,9 +22,9 @@ namespace Barotrauma.Items.Components
|
||||
public Deconstructor(Item item, XElement element)
|
||||
: base(item, element)
|
||||
{
|
||||
progressBar = new GUIProgressBar(new Rectangle(0,0,200,20), Color.Green, GUI.Style, 0.0f, Alignment.BottomCenter, GuiFrame);
|
||||
progressBar = new GUIProgressBar(new Rectangle(0,0,200,20), Color.Green, "", 0.0f, Alignment.BottomCenter, GuiFrame);
|
||||
|
||||
activateButton = new GUIButton(new Rectangle(0, 0, 200, 20), "Deconstruct", Alignment.TopCenter, GUI.Style, GuiFrame);
|
||||
activateButton = new GUIButton(new Rectangle(0, 0, 200, 20), "Deconstruct", Alignment.TopCenter, "", GuiFrame);
|
||||
activateButton.OnClicked = ToggleActive;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
IsActive = true;
|
||||
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30, 30), "-", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30, 30), "-", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
targetForce -= 1.0f;
|
||||
@@ -58,7 +58,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
targetForce += 1.0f;
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
GuiFrame.Padding = new Vector4(20.0f, 20.0f, 20.0f, 20.0f);
|
||||
|
||||
itemList = new GUIListBox(new Rectangle(0,0,GuiFrame.Rect.Width/2-20,0), GUI.Style, GuiFrame);
|
||||
itemList = new GUIListBox(new Rectangle(0,0,GuiFrame.Rect.Width/2-20,0), "", GuiFrame);
|
||||
itemList.OnSelected = SelectItem;
|
||||
|
||||
foreach (FabricableItem fi in fabricableItems)
|
||||
@@ -158,7 +158,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
selectedItemFrame.Padding = new Vector4(10.0f, 10.0f, 10.0f, 10.0f);
|
||||
|
||||
progressBar = new GUIProgressBar(new Rectangle(0, 0, 0, 20), Color.Green, GUI.Style, 0.0f, Alignment.BottomCenter, selectedItemFrame);
|
||||
progressBar = new GUIProgressBar(new Rectangle(0, 0, 0, 20), Color.Green, "", 0.0f, Alignment.BottomCenter, selectedItemFrame);
|
||||
progressBar.IsHorizontal = true;
|
||||
|
||||
if (targetItem.TargetItem.sprite != null)
|
||||
@@ -184,7 +184,7 @@ namespace Barotrauma.Items.Components
|
||||
var description = new GUITextBlock(
|
||||
new Rectangle(0, y, 0, 0),
|
||||
targetItem.TargetItem.Description,
|
||||
GUI.Style, Alignment.TopLeft, Alignment.TopLeft,
|
||||
"", Alignment.TopLeft, Alignment.TopLeft,
|
||||
selectedItemFrame, true, GUI.SmallFont);
|
||||
|
||||
y += description.Rect.Height + 10;
|
||||
@@ -228,7 +228,7 @@ namespace Barotrauma.Items.Components
|
||||
Alignment.TopLeft, null,
|
||||
selectedItemFrame);
|
||||
|
||||
activateButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, GUI.Style, selectedItemFrame);
|
||||
activateButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, "", selectedItemFrame);
|
||||
activateButton.OnClicked = StartButtonClicked;
|
||||
activateButton.UserData = targetItem;
|
||||
activateButton.Enabled = false;
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
var button = new GUIButton(new Rectangle(160, 40, 35, 30), "OUT", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(160, 40, 35, 30), "OUT", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
FlowPercentage -= 10.0f;
|
||||
@@ -88,7 +88,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(210, 40, 35, 30), "IN", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(210, 40, 35, 30), "IN", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
FlowPercentage += 10.0f;
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
IsActive = true;
|
||||
|
||||
var button = new GUIButton(new Rectangle(410, 70, 40, 40), "-", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(410, 70, 40, 40), "-", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -170,7 +170,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(460, 70, 40,40), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(460, 70, 40,40), "+", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -182,7 +182,7 @@ namespace Barotrauma.Items.Components
|
||||
autoTempTickBox = new GUITickBox(new Rectangle(410, 170, 20, 20), "Automatic temperature control", Alignment.TopLeft, GuiFrame);
|
||||
autoTempTickBox.OnSelected = ToggleAutoTemp;
|
||||
|
||||
button = new GUIButton(new Rectangle(210, 290, 40, 40), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(210, 290, 40, 40), "+", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -191,7 +191,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(210, 340, 40, 40), "-", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(210, 340, 40, 40), "-", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -200,7 +200,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(500, 290, 40, 40), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(500, 290, 40, 40), "+", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
@@ -209,7 +209,7 @@ namespace Barotrauma.Items.Components
|
||||
return false;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(500, 340, 40, 40), "-", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(500, 340, 40, 40), "-", "", GuiFrame);
|
||||
button.OnPressed = () =>
|
||||
{
|
||||
unsentChanges = true;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
if (canBeSelected)
|
||||
{
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30,30), "-", GUI.Style, GuiFrame);
|
||||
var button = new GUIButton(new Rectangle(160, 50, 30,30), "-", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed - maxRechargeSpeed * 0.1f, 0.0f);
|
||||
@@ -93,7 +93,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
};
|
||||
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", GUI.Style, GuiFrame);
|
||||
button = new GUIButton(new Rectangle(200, 50, 30, 30), "+", "", GuiFrame);
|
||||
button.OnClicked = (GUIButton btn, object obj) =>
|
||||
{
|
||||
RechargeSpeed = Math.Max(rechargeSpeed + maxRechargeSpeed * 0.1f, 0.0f);
|
||||
|
||||
Reference in New Issue
Block a user