Merged linux changes, fixed first item in inventory not being loaded, fixed levels breaking if re-entering the same level

This commit is contained in:
Regalis
2015-11-19 16:29:13 +02:00
parent 118d60342a
commit f42cc78af3
23 changed files with 42 additions and 65 deletions
+2 -20
View File
@@ -417,14 +417,11 @@
<Content Include="Content\Items\Tools\extinguisher.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\explosives.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\explosives.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Items\Weapons\stunbaton.png">
<Content Include="Content\Items\Weapons\weapons.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Jobs.xml">
@@ -637,19 +634,10 @@
<Content Include="Content\Items\Tools\plasmacutter.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\harpoon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\spear.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\weapons.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
</Content>
<Content Include="Content\Items\Weapons\harpoongun.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Reactor\heatabsorber.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -701,9 +689,6 @@
<Content Include="Content\Items\Weapons\railgunloader.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Weapons\railgunshell.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Content\Items\Reactor\reactor.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -945,10 +930,7 @@
<None Include="Content\Items\Weapons\smack.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Weapons\stunbaton.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\Items\Weapons\stunGrenade.ogg">
<None Include="Content\Items\Weapons\stungrenade.ogg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Content\SmallFont.xnb">
+1 -1
View File
@@ -9,7 +9,7 @@
<ErrorReportUrlHistory />
<FallbackCulture>en-US</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
<ProjectView>ProjectFiles</ProjectView>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<PropertyGroup>
<ReferencePath>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 B

@@ -6,7 +6,7 @@
pickdistance="150"
price="100">
<Sprite texture="explosives.png" depth="0.8" sourcerect="0,0,16,7"/>
<Sprite texture="weapons.png" depth="0.8" sourcerect="112,0,16,7"/>
<Body width="16" height="7"/>
@@ -23,7 +23,7 @@
pickdistance="150"
price="50">
<Sprite texture="explosives.png" depth="0.8" sourcerect="0,7,16,9"/>
<Sprite texture="weapons.png" depth="0.8" sourcerect="112,7,16,9"/>
<Body width="16" height="9"/>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

+1 -1
View File
@@ -64,7 +64,7 @@
pickdistance="200"
price="100">
<Sprite texture ="railgunshell.png" depth ="0.5"/>
<Sprite texture="weapons.png" sourcerect="0,58,88,20" depth ="0.5"/>
<Body width="87" height="18"/>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 816 B

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

+6 -6
View File
@@ -7,7 +7,7 @@
pickthroughwalls="true"
price="50">
<Sprite texture ="spear.png" depth="0.55"/>
<Sprite texture="weapons.png" sourcerect="0,50,65,7" depth="0.55"/>
<Body width="64" height="5" density="20"/>
@@ -22,7 +22,7 @@
pickdistance="200"
price="500">
<Sprite texture ="harpoongun.png" depth="0.5"/>
<Sprite texture="weapons.png" sourcerect="0,25,98,25" depth="0.5"/>
<Body width="90" height="30" density="10"/>
@@ -47,12 +47,12 @@
price="200"
tags="smallitem">
<Sprite texture ="stungrenade.png" depth="0.5"/>
<Sprite texture="weapons.png" sourcerect="98,0,11,24"/>
<Body width="11" height="24" density="15" friction="0.8f"/>
<Throwable slots="Any,RightHand,LeftHand" holdpos="0,0" handle1="0,0" throwforce="4.0" aimpos="35,-10">
<StatusEffect type="OnUse" target="This" Condition="-100.0" delay="3.0" sound="Content/Items/Weapons/stunGrenade.ogg">
<StatusEffect type="OnUse" target="This" Condition="-100.0" delay="3.0" sound="Content/Items/Weapons/stungrenade.ogg">
<Explosion range="500" damage="5" stun="10" force="0.1"/>
</StatusEffect>
</Throwable>
@@ -64,7 +64,7 @@
pickdistance="150"
price="100">
<Sprite texture="stunbaton.png" sourcerect="0,12,77,23" depth="0.5"/>
<Sprite texture="weapons.png" sourcerect="20,0,77,23" depth="0.5"/>
<Body width="90" height="30" density="10"/>
@@ -88,7 +88,7 @@
tags="smallitem,loadable"
price="50">
<Sprite texture ="stunbaton.png" sourcerect="0,0,20,9" depth="0.8"/>
<Sprite texture="weapons.png" sourcerect="0,0,20,9" depth="0.8"/>
<Body width="20" height="9" density="15"/>
+1 -1
View File
@@ -394,7 +394,7 @@ namespace Barotrauma
{
for (ushort i = 0; i < Info.PickedItemIDs.Count; i++ )
{
if (i == 0) continue;
if (Info.PickedItemIDs[i] == 0) continue;
Item item = FindEntityByID(Info.PickedItemIDs[i]) as Item;
if (item == null) continue;
@@ -165,11 +165,18 @@ namespace EventInput
(int)Marshal.GetFunctionPointerForDelegate(hookProcDelegate));
hIMC = ImmGetContext(window.Handle);
#elif LINUX
window.TextInput += ReceiveInput;
#endif
initialized = true;
}
private static void ReceiveInput(object sender, TextInputEventArgs e)
{
OnCharEntered(e.Character);
}
public static void OnCharEntered(char character)
{
if (CharEntered != null) CharEntered(null, new CharacterEventArgs(character, 0));
+13
View File
@@ -54,6 +54,19 @@ namespace Barotrauma
get { return textBlock.TextColor; }
set { textBlock.TextColor = value; }
}
public override SpriteFont Font
{
get
{
return (textBlock==null) ? GUI.Font : textBlock.Font;
}
set
{
if (textBlock == null) return;
base.Font = value;
}
}
public string Text
{
+2
View File
@@ -101,6 +101,8 @@ namespace Barotrauma
{
Graphics = new GraphicsDeviceManager(this);
Window.Title = "Barotrauma";
Instance = this;
Config = new GameSettings("config.xml");
@@ -143,11 +143,13 @@ namespace Barotrauma
if (Level.Loaded.AtEndPosition)
{
endShiftButton.Text = "Enter " + Map.SelectedLocation.Name;
endShiftButton.Font = GUI.SmallFont;
endShiftButton.Draw(spriteBatch);
}
else if (Level.Loaded.AtStartPosition)
{
endShiftButton.Text = "Enter " + Map.CurrentLocation.Name;
endShiftButton.Font = GUI.SmallFont;
endShiftButton.Draw(spriteBatch);
}
-5
View File
@@ -582,11 +582,6 @@ namespace Barotrauma
if (body.LinearVelocity != Vector2.Zero && body.LinearVelocity.Length() > 1000.0f)
{
body.ResetDynamics();
if (body.SimPosition.Length() > 1000.0f)
{
Remove();
return;
}
}
body.ApplyForce(buoyancy - body.LinearVelocity * volume);
+3 -12
View File
@@ -1,4 +1,5 @@
using FarseerPhysics;
using FarseerPhysics;
using Microsoft.Xna.Framework;
using Barotrauma.Lights;
using System;
@@ -79,17 +80,7 @@ namespace Barotrauma
if (force == 0.0f && attack.Stun == 0.0f && attack.GetDamage(1.0f) == 0.0f) return;
Hull hull = Hull.FindHull(displayPosition);
foreach (Item item in Item.ItemList)
{
if (item.body == null || item.CurrentHull != hull) continue;
Vector2 dir = (item.SimPosition == simPosition) ? Rand.Vector(1.0f) : Vector2.Normalize(item.SimPosition - simPosition);
float distFactor = 1.0f - Vector2.Distance(item.SimPosition, simPosition) / attack.Range;
item.body.ApplyLinearImpulse(dir * distFactor * force);
}
//Hull hull = Hull.FindHull(displayPosition);
foreach (Character c in Character.CharacterList)
{
+2
View File
@@ -962,6 +962,8 @@ namespace Barotrauma
bodies.Clear();
bodies = null;
loaded = null;
//vertexBuffer.Dispose();
//vertexBuffer = null;
}
-17
View File
@@ -309,23 +309,6 @@ namespace Barotrauma
if (timeSinceClick < doubleClickDelay) doubleClicked = true;
timeSinceClick = 0.0;
}
#if LINUX
foreach (Keys key in keyboardState.GetPressedKeys())
{
if (!oldKeyboardState.IsKeyUp(key)) continue;
char Character = (char)key;
if (keyboardState.IsKeyUp(Keys.LeftShift) && keyboardState.IsKeyUp(Keys.RightShift))
{
Character = char.ToLower(Character);
}
EventInput.EventInput.OnCharEntered(Character);
}
#endif
}
}
}
Binary file not shown.