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>
|
</Holdable>
|
||||||
|
|
||||||
<Label canbeselected = "true">
|
<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>
|
</Label>
|
||||||
</Item>
|
</Item>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<PowerTransfer canbeselected = "true">
|
<PowerTransfer canbeselected = "true">
|
||||||
<StatusEffect type="InWater" target="This" condition="-0.5"/>
|
<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>
|
</PowerTransfer>
|
||||||
|
|
||||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<Sprite texture ="battery.png" depth="0.8"/>
|
<Sprite texture ="battery.png" depth="0.8"/>
|
||||||
|
|
||||||
<PowerContainer capacity="2000.0" maxrechargespeed="500.0" maxoutput="1000.0" canbeselected = "true">
|
<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"/>
|
<StatusEffect type="OnActive" target="Contained" targetnames="loadable" Condition="2.0"/>
|
||||||
</PowerContainer>
|
</PowerContainer>
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<Sprite texture ="supercapacitor.png" depth="0.8"/>
|
<Sprite texture ="supercapacitor.png" depth="0.8"/>
|
||||||
|
|
||||||
<PowerContainer capacity="20.0" maxrechargespeed="20.0" maxoutput="2000000.0" canbeselected = "true">
|
<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>
|
</PowerContainer>
|
||||||
|
|
||||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||||
|
|||||||
@@ -224,7 +224,7 @@
|
|||||||
<Sprite texture="signalcomp.png" depth="0.8" sourcerect="48,16,16,16"/>
|
<Sprite texture="signalcomp.png" depth="0.8" sourcerect="48,16,16,16"/>
|
||||||
|
|
||||||
<RelayComponent canbeselected = "true">
|
<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>
|
</RelayComponent>
|
||||||
|
|
||||||
<fixrequirement name="Reset fuse">
|
<fixrequirement name="Reset fuse">
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<Engine minvoltage="0.5" powerconsumption="2000.0" maxforce="2000" canbeselected = "true">
|
<Engine minvoltage="0.5" powerconsumption="2000.0" maxforce="2000" canbeselected = "true">
|
||||||
<StatusEffect type="InWater" target="This" condition="-2.0"/>
|
<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"/>
|
<sound file="engine.ogg" type="OnActive" range="3000.0" volume="CurrentVolume" loop="true"/>
|
||||||
</Engine>
|
</Engine>
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</fixrequirement>
|
</fixrequirement>
|
||||||
|
|
||||||
<Engine minvoltage="0.5" powerconsumption="500.0" maxforce="300" canbeselected = "true">
|
<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"/>
|
<sound file="engine.ogg" type="OnActive" range="3000.0" volume="CurrentVolume" loop="true"/>
|
||||||
</Engine>
|
</Engine>
|
||||||
|
|
||||||
@@ -72,12 +72,12 @@
|
|||||||
|
|
||||||
<Steering minvoltage="0.5" canbeselected = "true" powerconsumption="10">
|
<Steering minvoltage="0.5" canbeselected = "true" powerconsumption="10">
|
||||||
<StatusEffect type="InWater" target="This" condition="-1.0"/>
|
<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>
|
</Steering>
|
||||||
|
|
||||||
<Radar canbeselected = "true" powerconsumption="100">
|
<Radar canbeselected = "true" powerconsumption="100">
|
||||||
<sound file="radarPing.ogg" type="OnUse" range="4000.0"/>
|
<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"/>
|
<PingCircle texture="Content/Items/Engine/pingCircle.png" origin="0.5,0.5"/>
|
||||||
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
||||||
</Radar>
|
</Radar>
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
<Radar canbeselected = "true" powerconsumption="100">
|
<Radar canbeselected = "true" powerconsumption="100">
|
||||||
<StatusEffect type="InWater" target="This" condition="-1.0"/>
|
<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"/>
|
<PingCircle texture="Content/Items/Engine/pingCircle.png" origin="0.5,0.5"/>
|
||||||
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
||||||
</Radar>
|
</Radar>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<Fabricator canbeselected = "true" powerconsumption="500.0">
|
<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"/>
|
<sound file="fabricator.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
<Fabricator canbeselected = "true" powerconsumption="100.0">
|
<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"/>
|
<sound file="fabricator.ogg" type="OnActive" range="1000.0" loop="true"/>
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
<Deconstructor canbeselected = "true" powerconsumption="500.0">
|
<Deconstructor canbeselected = "true" powerconsumption="500.0">
|
||||||
<sound file="deconstructor.ogg" type="OnActive" range="1000.0" loop="true"/>
|
<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>
|
</Deconstructor>
|
||||||
|
|
||||||
<ConnectionPanel selectkey="Action" canbeselected = "true">
|
<ConnectionPanel selectkey="Action" canbeselected = "true">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
|
<Sprite texture="Content/Items/machines.png" depth="0.8" sourcerect="64,0,64,128"/>
|
||||||
|
|
||||||
<MiniMap MinVoltage="0.5" PowerConsumption="100" canbeselected = "true">
|
<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>
|
</MiniMap>
|
||||||
|
|
||||||
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
<ConnectionPanel selectkey="Action" canbeselected = "true" msg="Rewire [Screwdriver]">
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<Sprite texture ="pump.png" depth="0.8"/>
|
<Sprite texture ="pump.png" depth="0.8"/>
|
||||||
|
|
||||||
<Pump canbeselected = "true" maxflow="500" PowerConsumption="300.0" MinVoltage="0.3">
|
<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"/>
|
<sound file="pump.ogg" type="OnActive" range="800.0" volume="CurrFlow" volumemultiplier="0.01" loop="true"/>
|
||||||
</Pump>
|
</Pump>
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<Sprite texture ="smallpump.png" depth="0.8" sourcerect="0,0,64,48"/>
|
<Sprite texture ="smallpump.png" depth="0.8" sourcerect="0,0,64,48"/>
|
||||||
|
|
||||||
<Pump canbeselected = "true" maxflow="100" PowerConsumption="60.0" MinVoltage="0.3">
|
<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"/>
|
<sound file="pump.ogg" type="OnActive" range="500.0" volume="CurrFlow" volumemultiplier="0.01" loop="true"/>
|
||||||
</Pump>
|
</Pump>
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<Sprite texture = "reactor.png" sourcerect="0,0,321,192" depth="0.8"/>
|
<Sprite texture = "reactor.png" sourcerect="0,0,321,192" depth="0.8"/>
|
||||||
|
|
||||||
<Reactor canbeselected = "true">
|
<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="InWater" target="This" Temperature="-500.0"/>
|
||||||
<StatusEffect type="OnActive" target="Contained" targetnames="Fuel Rod, Heat Absorber, Temperature Control Circuit" Condition="-0.1" />
|
<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"/>
|
<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">
|
<Radar range="6000.0" powerconsumption="10" drawhudwhenequipped="true" detectsubmarinewalls="true">
|
||||||
<StatusEffect type="OnUse" target="Contained" Condition="-1.0" disabledeltatime="true"/>
|
<StatusEffect type="OnUse" target="Contained" Condition="-1.0" disabledeltatime="true"/>
|
||||||
<sound file="Content/Items/Engine/radarPing.ogg" type="OnUse" range="1000.0"/>
|
<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"/>
|
<PingCircle texture="Content/Items/Engine/pingCircle.png" origin="0.5,0.5"/>
|
||||||
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
<ScreenOverlay texture="Content/Items/Engine/radarOverlay.png" origin="0.5,0.5"/>
|
||||||
</Radar>
|
</Radar>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 400 KiB |
@@ -114,6 +114,17 @@
|
|||||||
</GUIFrame>
|
</GUIFrame>
|
||||||
</GUIListBox>
|
</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>
|
<GUIScrollBar>
|
||||||
<GUIFrame
|
<GUIFrame
|
||||||
color="1.0,1.0,1.0,1.0"
|
color="1.0,1.0,1.0,1.0"
|
||||||
@@ -196,7 +207,7 @@
|
|||||||
hovercolor="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">
|
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>
|
</GUIFrame>
|
||||||
|
|
||||||
<Slider
|
<Slider
|
||||||
@@ -206,7 +217,15 @@
|
|||||||
|
|
||||||
<Sprite texture="Content/UI/UI_Atlas.png" tile="false" sourcerect ="0, 276, 859, 37"/>
|
<Sprite texture="Content/UI/UI_Atlas.png" tile="false" sourcerect ="0, 276, 859, 37"/>
|
||||||
</Slider>
|
</Slider>
|
||||||
|
|
||||||
</GUIProgressBar>
|
</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>
|
</style>
|
||||||
@@ -52,7 +52,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
private void CreateGUIFrame()
|
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);
|
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);
|
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)
|
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.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.Color = Color.Black * 0.5f;
|
||||||
orderButton.HoverColor = Color.LightGray * 0.5f;
|
orderButton.HoverColor = Color.LightGray * 0.5f;
|
||||||
orderButton.OutlineColor = Color.LightGray * 0.8f;
|
orderButton.OutlineColor = Color.LightGray * 0.8f;*/
|
||||||
orderButton.UserData = order;
|
orderButton.UserData = order;
|
||||||
orderButton.OnClicked = SetOrder;
|
orderButton.OnClicked = SetOrder;
|
||||||
|
|
||||||
@@ -169,15 +169,15 @@ namespace Barotrauma
|
|||||||
int x = startX + (150 + spacing) * (i % Math.Min(charactersPerRow, aliveCharacters.Count));
|
int x = startX + (150 + spacing) * (i % Math.Min(charactersPerRow, aliveCharacters.Count));
|
||||||
int y = (105 + spacing)*((int)Math.Floor((double)i / charactersPerRow));
|
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.UserData = character;
|
||||||
characterButton.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
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.Color = Character.Controlled == character ? Color.Gold : Color.White;
|
||||||
characterButton.HoverColor = Color.LightGray * 0.5f;
|
/*characterButton.HoverColor = Color.LightGray * 0.5f;
|
||||||
characterButton.SelectedColor = Color.Gold * 0.6f;
|
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);
|
characterFrameBottom = Math.Max(characterFrameBottom, characterButton.Rect.Bottom);
|
||||||
|
|
||||||
@@ -187,9 +187,9 @@ namespace Barotrauma
|
|||||||
GUITextBlock textBlock = new GUITextBlock(
|
GUITextBlock textBlock = new GUITextBlock(
|
||||||
new Rectangle(40, 0, 0, 25),
|
new Rectangle(40, 0, 0, 25),
|
||||||
name,
|
name,
|
||||||
Color.Transparent, Color.White,
|
Color.Transparent, null,
|
||||||
Alignment.Left, Alignment.Left,
|
Alignment.Left, Alignment.Left,
|
||||||
null, characterButton, false);
|
"", characterButton, false);
|
||||||
textBlock.Font = GUI.SmallFont;
|
textBlock.Font = GUI.SmallFont;
|
||||||
textBlock.Padding = new Vector4(5.0f, 0.0f, 5.0f, 0.0f);
|
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);
|
var existingOrder = characterFrame.children.Find(c => c.UserData is Order);
|
||||||
if (existingOrder != null) characterFrame.RemoveChild(existingOrder);
|
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);
|
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.OutlineColor = Color.LightGray * 0.5f;*/
|
||||||
orderFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
orderFrame.Padding = new Vector4(5.0f, 5.0f, 5.0f, 5.0f);
|
||||||
orderFrame.UserData = order;
|
orderFrame.UserData = order;
|
||||||
|
|
||||||
@@ -269,18 +269,14 @@ namespace Barotrauma
|
|||||||
img.Color = order.Color;
|
img.Color = order.Color;
|
||||||
img.CanBeFocused = false;
|
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);
|
var optionList = new GUIListBox(new Rectangle(0, 20, 0, 80), Color.Transparent, null, orderFrame);
|
||||||
optionList.UserData = order;
|
optionList.UserData = order;
|
||||||
|
|
||||||
for (int i = 0; i < order.Options.Length; i++ )
|
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.Font = GUI.SmallFont;
|
||||||
optionBox.UserData = order.Options[i];
|
optionBox.UserData = order.Options[i];
|
||||||
|
|
||||||
|
|||||||
@@ -254,13 +254,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public GUIFrame CreateCharacterFrame(GUIComponent parent, string text, object userData)
|
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.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(
|
GUITextBlock textBlock = new GUITextBlock(
|
||||||
new Rectangle(40, 0, 0, 25),
|
new Rectangle(40, 0, 0, 25),
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace Barotrauma
|
|||||||
scrollBar.IsHorizontal = isHorizontal;
|
scrollBar.IsHorizontal = isHorizontal;
|
||||||
|
|
||||||
frame = new GUIFrame(Rectangle.Empty, style, this);
|
frame = new GUIFrame(Rectangle.Empty, style, this);
|
||||||
GUI.Style.Apply(frame, "", this);
|
if (style != null) GUI.Style.Apply(frame, style, this);
|
||||||
|
|
||||||
UpdateScrollBarSize();
|
UpdateScrollBarSize();
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace Barotrauma
|
|||||||
frame = new GUIFrame(new Rectangle(0, 0, 0, 0), null, this);
|
frame = new GUIFrame(new Rectangle(0, 0, 0, 0), null, this);
|
||||||
GUI.Style.Apply(frame, "", 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);
|
GUI.Style.Apply(slider, "Slider", this);
|
||||||
|
|
||||||
this.barSize = barSize;
|
this.barSize = barSize;
|
||||||
@@ -95,7 +95,30 @@ namespace Barotrauma
|
|||||||
|
|
||||||
DrawChildren(spriteBatch);
|
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>();
|
characterInfos = new List<CharacterInfo>();
|
||||||
|
|
||||||
guiFrame = new GUIFrame(new Rectangle(0, 50, 150, 450), Color.Transparent);
|
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 = new GUIListBox(new Rectangle(45, 30, 150, 0), Color.Transparent, null, guiFrame);
|
||||||
listBox.ScrollBarEnabled = false;
|
listBox.ScrollBarEnabled = false;
|
||||||
@@ -129,32 +130,13 @@ namespace Barotrauma
|
|||||||
commander.UpdateCharacters();
|
commander.UpdateCharacters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
character.Info.CreateCharacterFrame(listBox, character.Info.Name.Replace(' ', '\n'), character);
|
character.Info.CreateCharacterFrame(listBox, character.Info.Name.Replace(' ', '\n'), character);
|
||||||
|
|
||||||
GUIFrame frame = new GUIFrame(new Rectangle(0, 0, 40, 40), Color.Transparent, null, orderListBox);
|
GUIFrame orderFrame = new GUIFrame(new Rectangle(0, 0, 40, 40), Color.Transparent, "ListBoxElement", orderListBox);
|
||||||
frame.UserData = character;
|
orderFrame.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;
|
|
||||||
|
|
||||||
var ai = character.AIController as HumanAIController;
|
var ai = character.AIController as HumanAIController;
|
||||||
SetCharacterOrder(character, ai.CurrentOrder);
|
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()
|
public void AddToGUIUpdateList()
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
CargoManager = new CargoManager();
|
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.Font = GUI.SmallFont;
|
||||||
endShiftButton.OnClicked = TryEndShift;
|
endShiftButton.OnClicked = TryEndShift;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using Microsoft.Xna.Framework;
|
|||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Barotrauma.Networking;
|
using Barotrauma.Networking;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Barotrauma.Items.Components
|
namespace Barotrauma.Items.Components
|
||||||
{
|
{
|
||||||
@@ -293,6 +292,8 @@ namespace Barotrauma.Items.Components
|
|||||||
if (components[2].Contains(".")) rect.Z *= GameMain.GraphicsWidth;
|
if (components[2].Contains(".")) rect.Z *= GameMain.GraphicsWidth;
|
||||||
if (components[3].Contains(".")) rect.W *= GameMain.GraphicsHeight;
|
if (components[3].Contains(".")) rect.W *= GameMain.GraphicsHeight;
|
||||||
|
|
||||||
|
string style = ToolBox.GetAttributeString(subElement, "style", "");
|
||||||
|
|
||||||
Vector4 color = ToolBox.GetAttributeVector4(subElement, "color", Vector4.One);
|
Vector4 color = ToolBox.GetAttributeVector4(subElement, "color", Vector4.One);
|
||||||
|
|
||||||
Alignment alignment = Alignment.Center;
|
Alignment alignment = Alignment.Center;
|
||||||
@@ -308,8 +309,8 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
guiFrame = new GUIFrame(
|
guiFrame = new GUIFrame(
|
||||||
new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Z, (int)rect.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, "");
|
new Color(color.X, color.Y, color.Z) * color.W,
|
||||||
//guiFrame.Alpha = color.W;
|
alignment, style);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "sound":
|
case "sound":
|
||||||
|
|||||||
@@ -657,9 +657,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
highlightedListBox = new GUIListBox(
|
highlightedListBox = new GUIListBox(
|
||||||
new Rectangle((int)PlayerInput.MousePosition.X+15, (int)PlayerInput.MousePosition.Y+15, 150, highlightedEntities.Count * 15),
|
new Rectangle((int)PlayerInput.MousePosition.X+15, (int)PlayerInput.MousePosition.Y+15, 150, highlightedEntities.Count * 15),
|
||||||
null, Alignment.TopLeft, "", null, false);
|
null, Alignment.TopLeft, "GUIToolTip", null, false);
|
||||||
|
|
||||||
highlightedListBox.Color = Color.Black * 0.6f;
|
|
||||||
|
|
||||||
foreach (MapEntity entity in highlightedEntities)
|
foreach (MapEntity entity in highlightedEntities)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1340,8 +1340,8 @@ namespace Barotrauma.Networking
|
|||||||
|
|
||||||
clientInfo = new GUIFrame(new Rectangle(0, 0, 180, 0), Color.Transparent, Alignment.TopRight, null, clientNameBox);
|
clientInfo = new GUIFrame(new Rectangle(0, 0, 180, 0), Color.Transparent, Alignment.TopRight, null, clientNameBox);
|
||||||
clientInfo.UserData = client.FileStreamSender;
|
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 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.TopLeft, Alignment.Left | Alignment.CenterY, clientInfo, true, GUI.SmallFont);
|
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);
|
var cancelButton = new GUIButton(new Rectangle(20, 0, 14, 0), "X", Alignment.Right, "", clientInfo);
|
||||||
cancelButton.OnClicked = (GUIButton button, object userdata) =>
|
cancelButton.OnClicked = (GUIButton button, object userdata) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user