Merge remote-tracking branch 'barotrauma/master' into new-netcode

# Conflicts:
#	Subsurface/Properties/AssemblyInfo.cs
#	Subsurface/Source/Characters/AI/EnemyAIController.cs
#	Subsurface/Source/Characters/AICharacter.cs
#	Subsurface/Source/Characters/Character.cs
#	Subsurface/Source/Items/Components/Signal/Connection.cs
#	Subsurface/Source/Items/Item.cs
#	Subsurface/Source/Map/Structure.cs
#	Subsurface/Source/Networking/GameClient.cs
#	Subsurface/Source/Networking/GameServer.cs
#	Subsurface/Source/Screens/NetLobbyScreen.cs
This commit is contained in:
juanjp600
2016-11-05 18:18:20 -03:00
57 changed files with 454 additions and 362 deletions

View File

@@ -124,7 +124,7 @@ namespace Barotrauma
public int CountChildren
{
get { return children.Count(); }
get { return children.Count; }
}
public virtual Color Color

View File

@@ -412,38 +412,14 @@ namespace Barotrauma
//base.Draw(spriteBatch);
frame.Draw(spriteBatch);
//GUI.DrawRectangle(spriteBatch, rect, color*alpha, true);
int x = rect.X, y = rect.Y;
if (!scrollBarHidden)
{
scrollBar.Draw(spriteBatch);
if (scrollBar.IsHorizontal)
{
x -= (int)((totalSize - rect.Width) * scrollBar.BarScroll);
}
else
{
y -= (int)((totalSize - rect.Height) * scrollBar.BarScroll);
}
}
if (!scrollBarHidden) scrollBar.Draw(spriteBatch);
for (int i = 0; i < children.Count; i++)
{
GUIComponent child = children[i];
if (child == frame || !child.Visible) continue;
if (scrollBar.IsHorizontal)
{
x += child.Rect.Width + spacing;
}
else
{
y += child.Rect.Height + spacing;
}
if (scrollBar.IsHorizontal)
{
if (child.Rect.Right < rect.X) continue;
@@ -451,7 +427,6 @@ namespace Barotrauma
if (child.Rect.X < rect.X && child.Rect.Right >= rect.X)
{
x = rect.X;
continue;
}
}
@@ -462,7 +437,6 @@ namespace Barotrauma
if (child.Rect.Y < rect.Y && child.Rect.Y + child.Rect.Height >= rect.Y)
{
y = rect.Y;
continue;
}
}

View File

@@ -169,26 +169,16 @@ namespace Barotrauma
private void MoveButton()
{
//if (!enabled) return false;
//if (barSize == 1.0f) return false;
int newX = bar.Rect.X - frame.Rect.X, newY = bar.Rect.Y - frame.Rect.Y;
float moveAmount;
if (isHorizontal)
{
moveAmount = PlayerInput.MouseSpeed.X;
barScroll += moveAmount / (frame.Rect.Width - bar.Rect.Width);
//newX = Math.Min(Math.Max(newX + moveAmount, 0), frame.Rect.Width - bar.Rect.Width);
//barScroll = (float)newX / ((float)frame.Rect.Width - (float)bar.Rect.Width);
}
else
{
moveAmount = PlayerInput.MouseSpeed.Y;
barScroll += moveAmount / (frame.Rect.Height - bar.Rect.Height);
//newY = Math.Min(Math.Max(newY+moveAmount, 0), frame.Rect.Height - bar.Rect.Height);
//barScroll = (float)newY / ((float)frame.Rect.Height - (float)bar.Rect.Height);
}
BarScroll = barScroll;