v0.13.0.11

This commit is contained in:
Juan Pablo Arce
2021-04-22 13:11:21 -03:00
parent 245b48c3a3
commit dde6212577
52 changed files with 3196 additions and 3507 deletions
@@ -77,6 +77,12 @@ namespace Barotrauma
return RectTransform.IsParentOf(component.RectTransform, recursive);
}
public bool IsChildOf(GUIComponent component, bool recursive = true)
{
if (component == null) { return false; }
return RectTransform.IsChildOf(component.RectTransform, recursive);
}
public virtual void RemoveChild(GUIComponent child)
{
if (child == null) { return; }
@@ -640,6 +640,12 @@ namespace Barotrauma
return children.Contains(rectT) || (recursive && children.Any(c => c.IsParentOf(rectT)));
}
public bool IsChildOf(RectTransform rectT, bool recursive = true)
{
if (Parent == null) { return false; }
return Parent == rectT || (recursive && Parent.IsChildOf(rectT));
}
public void ClearChildren()
{
children.ForEachMod(c => c.Parent = null);
@@ -1290,7 +1290,8 @@ namespace Barotrauma
WasCommandInterfaceDisabledThisUpdate = false;
if (PlayerInput.KeyDown(InputType.Command) && (GUI.KeyboardDispatcher.Subscriber == null || GUI.KeyboardDispatcher.Subscriber == crewList) &&
if (PlayerInput.KeyDown(InputType.Command) &&
(GUI.KeyboardDispatcher.Subscriber == null || (GUI.KeyboardDispatcher.Subscriber is GUIComponent component && (component == crewList || component.IsChildOf(crewList)))) &&
commandFrame == null && !clicklessSelectionActive && CanIssueOrders && !(GameMain.GameSession?.Campaign?.ShowCampaignUI ?? false))
{
if (PlayerInput.KeyDown(Keys.LeftShift) || PlayerInput.KeyDown(Keys.RightShift))
@@ -540,15 +540,16 @@ namespace Barotrauma.Items.Components
if (ShowProjectileIndicator)
{
Point slotSize = (Inventory.SlotSpriteSmall.size * Inventory.UIScale).ToPoint();
int spacing = 5;
Point spacing = new Point(GUI.IntScale(5), GUI.IntScale(20));
int slotsPerRow = Math.Min(availableAmmo.Count, 6);
int totalWidth = slotSize.X * slotsPerRow + spacing * (slotsPerRow - 1);
Point invSlotPos = new Point(GameMain.GraphicsWidth / 2 - totalWidth / 2, powerIndicator.Rect.Y - (int)(75 * GUI.Scale));
int totalWidth = slotSize.X * slotsPerRow + spacing.X * (slotsPerRow - 1);
int rows = (int)Math.Ceiling(availableAmmo.Count / (float)slotsPerRow);
Point invSlotPos = new Point(GameMain.GraphicsWidth / 2 - totalWidth / 2, powerIndicator.Rect.Y - (slotSize.Y + spacing.Y) * rows);
for (int i = 0; i < availableAmmo.Count; i++)
{
// TODO: Optimize? Creates multiple new objects per frame?
Inventory.DrawSlot(spriteBatch, null,
new VisualSlot(new Rectangle(invSlotPos + new Point((i % slotsPerRow) * (slotSize.X + spacing), (int)Math.Floor(i / (float)slotsPerRow) * (slotSize.Y + spacing)), slotSize)),
new VisualSlot(new Rectangle(invSlotPos + new Point((i % slotsPerRow) * (slotSize.X + spacing.X), (int)Math.Floor(i / (float)slotsPerRow) * (slotSize.Y + spacing.Y)), slotSize)),
availableAmmo[i], -1, true);
}
if (flashNoAmmo)
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.1300.0.10</Version>
<Version>0.13.0.11</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
+1 -1
View File
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.1300.0.10</Version>
<Version>0.13.0.11</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
@@ -61,9 +61,3 @@
/processorParam:DebugMode=Auto
/build:watershader.fx
#begin grainshader.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:grainshader.fx
@@ -61,9 +61,3 @@
/processorParam:DebugMode=Auto
/build:watershader_opengl.fx
#begin grainshader_opengl.fx
/importer:EffectImporter
/processor:EffectProcessor
/processorParam:DebugMode=Auto
/build:grainshader_opengl.fx
@@ -1,28 +0,0 @@
// vim:ft=hlsl
//float4 baseColor;
float seed;
float nrand(float2 uv)
{
return frac(sin(dot(uv, float2(12.9898, 78.233) * seed)) * 43758.5453);
}
float4 grain(float4 position : SV_POSITION, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 baseColor = { 1, 1, 1, 0.25 };
float4 color = baseColor * nrand(texCoord);
float2 center = { 0.5, 0.5 };
float2 diff = texCoord - center;
float alpha = diff.x * diff.x + diff.y * diff.y;
color.a = alpha;
return clr * color;
}
technique Grain
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_1 grain();
}
}
@@ -1,28 +0,0 @@
// vim:ft=hlsl
//float4 baseColor;
float seed;
float nrand(float2 uv)
{
return frac(sin(dot(uv, float2(12.9898, 78.233) * seed)) * 43758.5453);
}
float4 grain(float4 position : SV_POSITION, float4 clr : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 baseColor = { 1, 1, 1, 0.25 };
float4 color = baseColor * nrand(texCoord);
float2 center = { 0.5, 0.5 };
float2 diff = texCoord - center;
float alpha = diff.x * diff.x + diff.y * diff.y;
color.a = alpha;
return clr * color;
}
technique Grain
{
pass Pass1
{
PixelShader = compile ps_3_0 grain();
}
}
@@ -26,8 +26,6 @@ sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }
Texture2D xLosTexture;
sampler LosSampler = sampler_state { Texture = <xLosTexture>; };
float xLosAlpha;
float4 xColor;
float4 mainPS(VertexShaderOutput input) : COLOR0
@@ -41,7 +39,7 @@ float4 mainPS(VertexShaderOutput input) : COLOR0
sampleColor.r * xColor.r,
sampleColor.g * xColor.g,
sampleColor.b * xColor.b,
obscureAmount * xLosAlpha);
obscureAmount);
return outColor;
}
@@ -26,8 +26,6 @@ sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }
Texture xLosTexture;
sampler LosSampler = sampler_state { Texture = <xLosTexture>; };
float xLosAlpha;
float4 xColor;
float4 mainPS(VertexShaderOutput input) : COLOR0
@@ -41,7 +39,7 @@ float4 mainPS(VertexShaderOutput input) : COLOR0
sampleColor.r * xColor.r,
sampleColor.g * xColor.g,
sampleColor.b * xColor.b,
obscureAmount * xLosAlpha);
obscureAmount);
return outColor;
}
@@ -6,7 +6,7 @@
<RootNamespace>Barotrauma</RootNamespace>
<Authors>FakeFish, Undertow Games</Authors>
<Product>Barotrauma</Product>
<Version>0.1300.0.10</Version>
<Version>0.13.0.11</Version>
<Copyright>Copyright © FakeFish 2018-2020</Copyright>
<Platforms>AnyCPU;x64</Platforms>
<AssemblyName>Barotrauma</AssemblyName>
+62 -62
View File
@@ -1,62 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
</windowsSettings>
</application>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
</windowsSettings>
</application>
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>