Updates for the netcode refactor. (#69)

* Updates for the netcode refactor.

* Change HandsGui to control.

Why? No idea but drawing of it works again.

* Fix hand change sync.

* Update submodule
This commit is contained in:
Pieter-Jan Briers
2018-05-13 11:54:21 +02:00
committed by GitHub
parent 20cf3a6a9b
commit 85b4be3ff4
5 changed files with 15 additions and 32 deletions

View File

@@ -17,7 +17,7 @@ using SS14.Shared.Maths;
namespace Content.Client.UserInterface
{
public class HandsGui : HBoxContainer
public class HandsGui : Control
{
private static readonly Color _inactiveColor = new Color(90, 90, 90);
private const int BOX_SPACING = 1;

View File

@@ -30,6 +30,7 @@ namespace Content.Server.GameObjects
}
activeIndex = value;
Dirty();
}
}
@@ -107,6 +108,7 @@ namespace Content.Server.GameObjects
}
var slot = hands[index];
Dirty();
return slot.Insert(item.Owner);
}
@@ -153,6 +155,7 @@ namespace Content.Server.GameObjects
// TODO: The item should be dropped to the container our owner is in, if any.
var itemTransform = item.Owner.GetComponent<TransformComponent>();
itemTransform.LocalPosition = Owner.GetComponent<TransformComponent>().LocalPosition;
Dirty();
return true;
}
@@ -178,7 +181,7 @@ namespace Content.Server.GameObjects
var slot = ContainerManagerComponent.Create<ContainerSlot>(Name + "_" + index, Owner);
hands[index] = slot;
if(!orderedHands.Contains(index))
if (!orderedHands.Contains(index))
{
orderedHands.Add(index);
}
@@ -186,6 +189,7 @@ namespace Content.Server.GameObjects
{
ActiveIndex = index;
}
Dirty();
}
public void RemoveHand(string index)
@@ -210,6 +214,7 @@ namespace Content.Server.GameObjects
activeIndex = orderedHands[0];
}
}
Dirty();
}
public bool HasHand(string index)
@@ -247,7 +252,6 @@ namespace Content.Server.GameObjects
ActiveIndex = orderedHands[index];
}
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null, IComponent component = null)
{
base.HandleMessage(message, netChannel, component);
@@ -293,7 +297,7 @@ namespace Content.Server.GameObjects
break;
case BoundKeyFunctions.ActivateItemInHand:
var used = GetActiveHand?.Owner;
if(used != null)
if (used != null)
{
InteractionSystem.TryUseInteraction(Owner, used);
}

View File

@@ -45,7 +45,7 @@ namespace Content.Server.GameObjects
/// <returns></returns>
bool Remove(IEntity toremove)
{
if(storage.Remove(toremove))
if (storage.Remove(toremove))
{
StorageUsed -= toremove.GetComponent<StoreableComponent>().ObjectSize;
UpdateClientInventory();
@@ -61,7 +61,7 @@ namespace Content.Server.GameObjects
/// <returns></returns>
bool Insert(IEntity toinsert)
{
if(CanInsert(toinsert) && storage.Insert(toinsert))
if (CanInsert(toinsert) && storage.Insert(toinsert))
{
StorageUsed += toinsert.GetComponent<StoreableComponent>().ObjectSize;
UpdateClientInventory();
@@ -77,7 +77,7 @@ namespace Content.Server.GameObjects
/// <returns></returns>
bool CanInsert(IEntity toinsert)
{
if(toinsert.TryGetComponent(out StoreableComponent store))
if (toinsert.TryGetComponent(out StoreableComponent store))
{
if (store.ObjectSize <= (StorageCapacityMax - StorageUsed))
return true;
@@ -95,7 +95,7 @@ namespace Content.Server.GameObjects
{
var hands = user.GetComponent<HandsComponent>();
//Check that we can drop the item from our hands first otherwise we obviously cant put it inside
if(hands.Drop(hands.ActiveIndex))
if (hands.Drop(hands.ActiveIndex))
{
var inserted = Insert(attackwith);
if (inserted)

View File

@@ -40,8 +40,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Client", "engine\SS14.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Client.Godot", "engine\SS14.Client.Godot\SS14.Client.Godot.csproj", "{8AF31169-49B1-4A12-B8F4-2A0674A9E7CB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SS14.Shared.Bsdiff", "engine\SS14.Shared.Bsdiff\SS14.Shared.Bsdiff\SS14.Shared.Bsdiff.csproj", "{0E0723E8-D785-4F61-81F4-182A12BCAA52}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -235,24 +233,6 @@ Global
{8AF31169-49B1-4A12-B8F4-2A0674A9E7CB}.Tools|x64.Build.0 = Tools|Any CPU
{8AF31169-49B1-4A12-B8F4-2A0674A9E7CB}.Tools|x86.ActiveCfg = Tools|Any CPU
{8AF31169-49B1-4A12-B8F4-2A0674A9E7CB}.Tools|x86.Build.0 = Tools|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Debug|x64.ActiveCfg = Debug|x64
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Debug|x64.Build.0 = Debug|x64
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Debug|x86.ActiveCfg = Debug|x86
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Debug|x86.Build.0 = Debug|x86
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Release|Any CPU.Build.0 = Release|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Release|x64.ActiveCfg = Release|x64
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Release|x64.Build.0 = Release|x64
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Release|x86.ActiveCfg = Release|x86
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Release|x86.Build.0 = Release|x86
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Tools|Any CPU.ActiveCfg = Debug|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Tools|Any CPU.Build.0 = Debug|Any CPU
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Tools|x64.ActiveCfg = Debug|x64
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Tools|x64.Build.0 = Debug|x64
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Tools|x86.ActiveCfg = Debug|x86
{0E0723E8-D785-4F61-81F4-182A12BCAA52}.Tools|x86.Build.0 = Debug|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -265,7 +245,6 @@ Global
{C899FCA4-7037-4E49-ABC2-44DE72487110} = {3202E94D-E985-4181-9F69-F458A7F6574F}
{83429BD6-6358-4B18-BE51-401DF8EA2673} = {B01693E5-CF08-4DB7-8920-407F8D6603A1}
{8AF31169-49B1-4A12-B8F4-2A0674A9E7CB} = {B01693E5-CF08-4DB7-8920-407F8D6603A1}
{0E0723E8-D785-4F61-81F4-182A12BCAA52} = {B01693E5-CF08-4DB7-8920-407F8D6603A1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AA37ED9F-F8D6-468E-A101-658AD605B09A}

2
engine

Submodule engine updated: 1375da7f70...0a195fe3c7