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:
@@ -14,6 +14,6 @@
|
||||
</Holdable>
|
||||
|
||||
<Label canbeselected = "true">
|
||||
<GuiFrame rect="0,0,0.4,0.4" alignment="Center" color="0.0,0.0,0.0,0.8"/>
|
||||
<GuiFrame rect="0,0,0.4,0.4" alignment="Center" style="ItemUI"/>
|
||||
</Label>
|
||||
</Item>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<PowerTransfer canbeselected = "true">
|
||||
<StatusEffect type="InWater" target="This" condition="-0.5"/>
|
||||
<GuiFrame rect="0,0,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,350,160" alignment="Center" style="ItemUI"/>
|
||||
</PowerTransfer>
|
||||
|
||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||
@@ -46,7 +46,7 @@
|
||||
<Sprite texture ="battery.png" depth="0.8"/>
|
||||
|
||||
<PowerContainer capacity="2000.0" maxrechargespeed="500.0" maxoutput="1000.0" canbeselected = "true">
|
||||
<GuiFrame rect="0,-100,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,-100,350,160" alignment="Center" style="ItemUI"/>
|
||||
<StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/>
|
||||
</PowerContainer>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<Sprite texture ="supercapacitor.png" depth="0.8"/>
|
||||
|
||||
<PowerContainer capacity="20.0" maxrechargespeed="20.0" maxoutput="2000000.0" canbeselected = "true">
|
||||
<GuiFrame rect="0,0,0.3,0.3" alignment="Center" color="0.0,0.0,0.0,0.8"/>
|
||||
<GuiFrame rect="0,0,0.3,0.3" alignment="Center" style="ItemUI"/>
|
||||
</PowerContainer>
|
||||
|
||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
<Sprite texture="signalcomp.png" depth="0.8" sourcerect="48,16,16,16"/>
|
||||
|
||||
<RelayComponent canbeselected = "true">
|
||||
<GuiFrame rect="0,0,200,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,200,160" alignment="Center" style="ItemUI"/>
|
||||
</RelayComponent>
|
||||
|
||||
<fixrequirement name="Reset fuse">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<Engine minvoltage="0.5" powerconsumption="2000.0" maxforce="2000" canbeselected = "true">
|
||||
<StatusEffect type="InWater" target="This" condition="-2.0"/>
|
||||
<GuiFrame rect="0,0,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,350,160" alignment="Center" style="ItemUI"/>
|
||||
<sound file="engine.ogg" type="OnActive" range="3000.0" volume="CurrentVolume" loop="true"/>
|
||||
</Engine>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</fixrequirement>
|
||||
|
||||
<Engine minvoltage="0.5" powerconsumption="500.0" maxforce="300" canbeselected = "true">
|
||||
<GuiFrame rect="0,0,350,160" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,350,160" alignment="Center" style="ItemUI"/>
|
||||
<sound file="engine.ogg" type="OnActive" range="3000.0" volume="CurrentVolume" loop="true"/>
|
||||
</Engine>
|
||||
|
||||
@@ -72,12 +72,12 @@
|
||||
|
||||
<Steering minvoltage="0.5" canbeselected = "true" powerconsumption="10">
|
||||
<StatusEffect type="InWater" target="This" condition="-1.0"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" style="ItemUI"/>
|
||||
</Steering>
|
||||
|
||||
<Radar canbeselected = "true" powerconsumption="100">
|
||||
<sound file="radarPing.ogg" type="OnUse" range="4000.0"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.0"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" style="ItemUI" color="0.0,0.0,0.0,0.0"/>
|
||||
<PingCircle texture="Content/Items/Engine/pingCircle.png" origin="0.5,0.5"/>
|
||||
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
||||
</Radar>
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
<Radar canbeselected = "true" powerconsumption="100">
|
||||
<StatusEffect type="InWater" target="This" condition="-1.0"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" style="ItemUI"/>
|
||||
<PingCircle texture="Content/Items/Engine/pingCircle.png" origin="0.5,0.5"/>
|
||||
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
||||
</Radar>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<Fabricator canbeselected = "true" powerconsumption="500.0">
|
||||
|
||||
<GuiFrame rect="0,0,600,400" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,600,400" alignment="Center" style="ItemUI"/>
|
||||
|
||||
<sound file="fabricator.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
<Fabricator canbeselected = "true" powerconsumption="100.0">
|
||||
|
||||
<GuiFrame rect="0,0,600,400" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,600,400" alignment="Center" style="ItemUI"/>
|
||||
|
||||
<sound file="fabricator.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
<Deconstructor canbeselected = "true" powerconsumption="500.0">
|
||||
<sound file="deconstructor.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||
|
||||
<GuiFrame rect="0,0,300,200" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,300,200" alignment="Center" style="ItemUI"/>
|
||||
</Deconstructor>
|
||||
|
||||
<ConnectionPanel selectkey="Action" canbeselected = "true">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
|
||||
|
||||
<MiniMap MinVoltage="0.5" PowerConsumption="100" canbeselected = "true">
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.8"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" style="ItemUI"/>
|
||||
</MiniMap>
|
||||
|
||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<Sprite texture ="pump.png" depth="0.8"/>
|
||||
|
||||
<Pump canbeselected = "true" maxflow="500" PowerConsumption="300.0" MinVoltage="0.3">
|
||||
<GuiFrame rect="0,0,330,145" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,330,145" alignment="Center" style="ItemUI"/>
|
||||
<sound file="pump.ogg" type="OnActive" range="800.0" volume="CurrFlow" volumemultiplier="0.01" loop="true"/>
|
||||
</Pump>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<Sprite texture ="smallpump.png" depth="0.8" sourcerect="0,0,64,48"/>
|
||||
|
||||
<Pump canbeselected = "true" maxflow="100" PowerConsumption="60.0" MinVoltage="0.3">
|
||||
<GuiFrame rect="0,0,330,145" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,330,145" alignment="Center" style="ItemUI"/>
|
||||
<sound file="pump.ogg" type="OnActive" range="500.0" volume="CurrFlow" volumemultiplier="0.01" loop="true"/>
|
||||
</Pump>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<Sprite texture = "reactor.png" sourcerect="0,0,321,192" depth="0.8"/>
|
||||
|
||||
<Reactor canbeselected = "true">
|
||||
<GuiFrame rect="0,0,760,460" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,760,460" alignment="Center" style="ItemUI"/>
|
||||
<StatusEffect type="InWater" target="This" Temperature="-500.0"/>
|
||||
<StatusEffect type="OnActive" target="Contained" targetnames="Fuel Rod, Heat Absorber, Temperature Control Circuit" Condition="-0.1" />
|
||||
<sound file="reactor.ogg" type="OnActive" range="2000.0" volume="FissionRate" volumemultiplier="0.02" loop="true"/>
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
<Radar range="6000.0" powerconsumption="10" drawhudwhenequipped="true" detectsubmarinewalls="true">
|
||||
<StatusEffect type="OnUse" target="Contained" Condition="-1.0" disabledeltatime="true"/>
|
||||
<sound file="Content/Items/Engine/radarPing.ogg" type="OnUse" range="1000.0"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" color="0.0,0.0,0.0,0.6"/>
|
||||
<GuiFrame rect="0,0,0.5,0.5" alignment="Center" style="ItemUI"/>
|
||||
<PingCircle texture="Content/Items/Engine/pingCircle.png" origin="0.5,0.5"/>
|
||||
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
||||
</Radar>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 400 KiB |
@@ -114,6 +114,17 @@
|
||||
</GUIFrame>
|
||||
</GUIListBox>
|
||||
|
||||
<ListBoxElement
|
||||
textcolor="0.5, 0.55, 0.6, 1.0"
|
||||
color="0.0,0.0,0.0,0.0"
|
||||
hovercolor="1.0,1.0,1.0,1.0"
|
||||
selectedcolor="1.0,1.0,1.0,1.0"
|
||||
padding="5.0, 5.0, 5.0, 5.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" state="Hover" sourcerect ="474, 544, 266, 52" slice="480, 552, 731, 584"/>
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" state="Selected" sourcerect ="474, 544, 266, 52" slice="480, 552, 731, 584"/>
|
||||
</ListBoxElement>
|
||||
|
||||
<GUIScrollBar>
|
||||
<GUIFrame
|
||||
color="1.0,1.0,1.0,1.0"
|
||||
@@ -196,7 +207,7 @@
|
||||
hovercolor="1.0,1.0,1.0,1.0"
|
||||
selectedcolor="1.0,1.0,1.0,1.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" sourcerect ="28, 430, 875, 49" slice="43,436,888,472"/>
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" tile="false" sourcerect ="28, 430, 875, 49"/>
|
||||
</GUIFrame>
|
||||
|
||||
<Slider
|
||||
@@ -205,8 +216,16 @@
|
||||
selectedcolor="1.0,1.0,1.0,1.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" tile="false" sourcerect ="0, 276, 859, 37"/>
|
||||
</Slider>
|
||||
|
||||
</Slider>
|
||||
</GUIProgressBar>
|
||||
|
||||
<ItemUI
|
||||
padding="40.0,40.0,40.0,40.0"
|
||||
color="1.0,1.0,1.0,1.0"
|
||||
hovercolor="1.0,1.0,1.0,1.0"
|
||||
selectedcolor="1.0,1.0,1.0,1.0">
|
||||
|
||||
<Sprite texture="Content/UI/UI_Atlas.png" size="0.0, 0.0" sourcerect ="32, 541, 420, 454" slice="87,576,430,960"/>
|
||||
</ItemUI>
|
||||
|
||||
</style>
|
||||
@@ -52,7 +52,7 @@ namespace Barotrauma
|
||||
|
||||
private void CreateGUIFrame()
|
||||
{
|
||||
frame = new GUIFrame(Rectangle.Empty, Color.Black * 0.6f);
|
||||
frame = new GUIFrame(Rectangle.Empty, Color.Black * 0.6f, null);
|
||||
frame.Padding = new Vector4(200.0f, 100.0f, 200.0f, 100.0f);
|
||||
|
||||
GUIButton closeButton = new GUIButton(new Rectangle(0, 50, 100, 20), "Close", Alignment.BottomCenter, "", frame);
|
||||
@@ -110,12 +110,12 @@ namespace Barotrauma
|
||||
|
||||
private GUIButton CreateOrderButton(Rectangle rect, Order order, bool createSymbol = true)
|
||||
{
|
||||
var orderButton = new GUIButton(rect, order.Name, Color.Black * 0.7f, Alignment.TopCenter, Alignment.Center, null, frame);
|
||||
var orderButton = new GUIButton(rect, order.Name, null, Alignment.TopCenter, Alignment.Center, "GUITextBox", frame);
|
||||
orderButton.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
orderButton.TextColor = Color.White;
|
||||
/*orderButton.TextColor = Color.White;
|
||||
orderButton.Color = Color.Black * 0.5f;
|
||||
orderButton.HoverColor = Color.LightGray * 0.5f;
|
||||
orderButton.OutlineColor = Color.LightGray * 0.8f;
|
||||
orderButton.OutlineColor = Color.LightGray * 0.8f;*/
|
||||
orderButton.UserData = order;
|
||||
orderButton.OnClicked = SetOrder;
|
||||
|
||||
@@ -169,15 +169,15 @@ namespace Barotrauma
|
||||
int x = startX + (150 + spacing) * (i % Math.Min(charactersPerRow, aliveCharacters.Count));
|
||||
int y = (105 + spacing)*((int)Math.Floor((double)i / charactersPerRow));
|
||||
|
||||
GUIButton characterButton = new GUIButton(new Rectangle(x+75, y, 150, 40), "", Color.Black, Alignment.TopCenter, null, frame);
|
||||
GUIButton characterButton = new GUIButton(new Rectangle(x+75, y, 150, 40), "", null, Alignment.TopCenter, "GUITextBox", frame);
|
||||
|
||||
characterButton.UserData = character;
|
||||
characterButton.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
|
||||
characterButton.Color = Character.Controlled == character ? Color.Gold * 0.2f : Color.Black * 0.5f;
|
||||
characterButton.HoverColor = Color.LightGray * 0.5f;
|
||||
characterButton.Color = Character.Controlled == character ? Color.Gold : Color.White;
|
||||
/*characterButton.HoverColor = Color.LightGray * 0.5f;
|
||||
characterButton.SelectedColor = Color.Gold * 0.6f;
|
||||
characterButton.OutlineColor = Color.LightGray * 0.8f;
|
||||
characterButton.OutlineColor = Color.LightGray * 0.8f;*/
|
||||
|
||||
characterFrameBottom = Math.Max(characterFrameBottom, characterButton.Rect.Bottom);
|
||||
|
||||
@@ -187,9 +187,9 @@ namespace Barotrauma
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(40, 0, 0, 25),
|
||||
name,
|
||||
Color.Transparent, Color.White,
|
||||
Color.Transparent, null,
|
||||
Alignment.Left, Alignment.Left,
|
||||
null, characterButton, false);
|
||||
"", characterButton, false);
|
||||
textBlock.Font = GUI.SmallFont;
|
||||
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
||||
|
||||
@@ -259,8 +259,8 @@ namespace Barotrauma
|
||||
var existingOrder = characterFrame.children.Find(c => c.UserData is Order);
|
||||
if (existingOrder != null) characterFrame.RemoveChild(existingOrder);
|
||||
|
||||
var orderFrame = new GUIFrame(new Rectangle(-5, characterFrame.Rect.Height, characterFrame.Rect.Width, 30 + order.Options.Length * 15), null, characterFrame);
|
||||
orderFrame.OutlineColor = Color.LightGray * 0.5f;
|
||||
var orderFrame = new GUIFrame(new Rectangle(-5, characterFrame.Rect.Height, characterFrame.Rect.Width, 30 + order.Options.Length * 15), "InnerFrame", characterFrame);
|
||||
/*orderFrame.OutlineColor = Color.LightGray * 0.5f;*/
|
||||
orderFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
orderFrame.UserData = order;
|
||||
|
||||
@@ -269,18 +269,14 @@ namespace Barotrauma
|
||||
img.Color = order.Color;
|
||||
img.CanBeFocused = false;
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 20), order.DoingText, "", Alignment.TopLeft, Alignment.TopCenter, orderFrame);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
new GUITextBlock(new Rectangle(img.Rect.Width, 0, 0, 20), order.DoingText, "", Alignment.TopLeft, Alignment.CenterLeft, orderFrame);
|
||||
|
||||
var optionList = new GUIListBox(new Rectangle(0, 20, 0, 80), Color.Transparent, null, orderFrame);
|
||||
optionList.UserData = order;
|
||||
|
||||
for (int i = 0; i < order.Options.Length; i++ )
|
||||
{
|
||||
var optionBox = new GUITextBlock(new Rectangle(0, 0, 0, 15), order.Options[i], "", optionList);
|
||||
var optionBox = new GUITextBlock(new Rectangle(0, 0, 0, 15), order.Options[i], "", Alignment.TopLeft, Alignment.CenterLeft, optionList);
|
||||
optionBox.Font = GUI.SmallFont;
|
||||
optionBox.UserData = order.Options[i];
|
||||
|
||||
|
||||
@@ -254,14 +254,9 @@ namespace Barotrauma
|
||||
|
||||
public GUIFrame CreateCharacterFrame(GUIComponent parent, string text, object userData)
|
||||
{
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, null, parent);
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 0, 40), Color.Transparent, "ListBoxElement", parent);
|
||||
frame.UserData = userData;
|
||||
frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
frame.HoverColor = Color.LightGray * 0.5f;
|
||||
frame.SelectedColor = Color.Gold * 0.5f;
|
||||
|
||||
// string name = character.Info.Name.Replace(' ', '\n');
|
||||
|
||||
|
||||
GUITextBlock textBlock = new GUITextBlock(
|
||||
new Rectangle(40, 0, 0, 25),
|
||||
text,
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Barotrauma
|
||||
scrollBar.IsHorizontal = isHorizontal;
|
||||
|
||||
frame = new GUIFrame(Rectangle.Empty, style, this);
|
||||
GUI.Style.Apply(frame, "", this);
|
||||
if (style != null) GUI.Style.Apply(frame, style, this);
|
||||
|
||||
UpdateScrollBarSize();
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Barotrauma
|
||||
frame = new GUIFrame(new Rectangle(0, 0, 0, 0), null, this);
|
||||
GUI.Style.Apply(frame, "", this);
|
||||
|
||||
slider = new GUIFrame(new Rectangle(0, 0, 0, 0), null, this);
|
||||
slider = new GUIFrame(new Rectangle(0, 0, 0, 0), null);
|
||||
GUI.Style.Apply(slider, "Slider", this);
|
||||
|
||||
this.barSize = barSize;
|
||||
@@ -95,7 +95,30 @@ namespace Barotrauma
|
||||
|
||||
DrawChildren(spriteBatch);
|
||||
|
||||
//GUI.DrawRectangle(spriteBatch, rect, color * (color.A / 255.0f), true);
|
||||
Color currColor = color;
|
||||
if (state == ComponentState.Selected) currColor = selectedColor;
|
||||
if (state == ComponentState.Hover) currColor = hoverColor;
|
||||
|
||||
if (slider.sprites != null && slider.sprites[state].Count > 0)
|
||||
{
|
||||
foreach (UISprite uiSprite in slider.sprites[state])
|
||||
{
|
||||
if (uiSprite.Tile)
|
||||
{
|
||||
uiSprite.Sprite.DrawTiled(spriteBatch, slider.Rect.Location.ToVector2(), slider.Rect.Size.ToVector2(), currColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
spriteBatch.Draw(uiSprite.Sprite.Texture,
|
||||
slider.Rect, new Rectangle(
|
||||
uiSprite.Sprite.SourceRect.X,
|
||||
uiSprite.Sprite.SourceRect.Y,
|
||||
(int)(uiSprite.Sprite.SourceRect.Width * (isHorizontal ? barSize : 1.0f)),
|
||||
(int)(uiSprite.Sprite.SourceRect.Height * (isHorizontal ? 1.0f : barSize))),
|
||||
currColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Barotrauma
|
||||
characterInfos = new List<CharacterInfo>();
|
||||
|
||||
guiFrame = new GUIFrame(new Rectangle(0, 50, 150, 450), Color.Transparent);
|
||||
guiFrame.Padding = Vector4.One * 5.0f;
|
||||
|
||||
listBox = new GUIListBox(new Rectangle(45, 30, 150, 0), Color.Transparent, null, guiFrame);
|
||||
listBox.ScrollBarEnabled = false;
|
||||
@@ -128,33 +129,14 @@ namespace Barotrauma
|
||||
{
|
||||
commander.UpdateCharacters();
|
||||
}
|
||||
|
||||
|
||||
|
||||
character.Info.CreateCharacterFrame(listBox, character.Info.Name.Replace(' ', '\n'), character);
|
||||
|
||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 40, 40), Color.Transparent, null, orderListBox);
|
||||
frame.UserData = character;
|
||||
//frame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||
frame.HoverColor = Color.LightGray * 0.5f;
|
||||
frame.SelectedColor = Color.Gold * 0.5f;
|
||||
GUIFrame orderFrame = new GUIFrame(new Rectangle(0, 0, 40, 40), Color.Transparent, "ListBoxElement", orderListBox);
|
||||
orderFrame.UserData = character;
|
||||
|
||||
var ai = character.AIController as HumanAIController;
|
||||
SetCharacterOrder(character, ai.CurrentOrder);
|
||||
|
||||
|
||||
|
||||
//string name = character.Info.Name.Replace(' ', '\n');
|
||||
|
||||
//GUITextBlock textBlock = new GUITextBlock(
|
||||
// new Rectangle(40, 0, 0, 25),
|
||||
// name,
|
||||
// Color.Transparent, Color.White,
|
||||
// Alignment.Left, Alignment.Left,
|
||||
// null, frame, false);
|
||||
//textBlock.Font = GUI.SmallFont;
|
||||
//textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
||||
|
||||
//new GUIImage(new Rectangle(-10, -5, 0, 0), character.AnimController.Limbs[0].sprite, Alignment.Left, frame);
|
||||
}
|
||||
|
||||
public void AddToGUIUpdateList()
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Barotrauma
|
||||
|
||||
CargoManager = new CargoManager();
|
||||
|
||||
endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", Alignment.TopLeft, "");
|
||||
endShiftButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End shift", null, Alignment.TopLeft, Alignment.Center, "");
|
||||
endShiftButton.Font = GUI.SmallFont;
|
||||
endShiftButton.OnClicked = TryEndShift;
|
||||
|
||||
|
||||
@@ -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":
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -657,10 +657,8 @@ namespace Barotrauma
|
||||
|
||||
highlightedListBox = new GUIListBox(
|
||||
new Rectangle((int)PlayerInput.MousePosition.X+15, (int)PlayerInput.MousePosition.Y+15, 150, highlightedEntities.Count * 15),
|
||||
null, Alignment.TopLeft, "", null, false);
|
||||
|
||||
highlightedListBox.Color = Color.Black * 0.6f;
|
||||
|
||||
null, Alignment.TopLeft, "GUIToolTip", null, false);
|
||||
|
||||
foreach (MapEntity entity in highlightedEntities)
|
||||
{
|
||||
var textBlock = new GUITextBlock(
|
||||
|
||||
@@ -1340,8 +1340,8 @@ namespace Barotrauma.Networking
|
||||
|
||||
clientInfo = new GUIFrame(new Rectangle(0, 0, 180, 0), Color.Transparent, Alignment.TopRight, null, clientNameBox);
|
||||
clientInfo.UserData = client.FileStreamSender;
|
||||
new GUIProgressBar(new Rectangle(0, 4, 160, clientInfo.Rect.Height - 8), Color.Green, "", 0.0f, Alignment.Left, clientInfo).IsHorizontal = true;
|
||||
new GUITextBlock(new Rectangle(0, 2, 160, 0), "", "", Alignment.TopLeft, Alignment.Left | Alignment.CenterY, clientInfo, true, GUI.SmallFont);
|
||||
new GUIProgressBar(new Rectangle(0, 4, 160, clientInfo.Rect.Height - 8), Color.White, "", 0.0f, Alignment.Left, clientInfo).IsHorizontal = true;
|
||||
new GUITextBlock(new Rectangle(0, 2, 160, 0), "", "", Alignment.Center, Alignment.Center, clientInfo, true, GUI.SmallFont);
|
||||
|
||||
var cancelButton = new GUIButton(new Rectangle(20, 0, 14, 0), "X", Alignment.Right, "", clientInfo);
|
||||
cancelButton.OnClicked = (GUIButton button, object userdata) =>
|
||||
|
||||
Reference in New Issue
Block a user