Species Component (#130)
* Fix this fug oksure Creates the initial species component, damage states, and threshold templates and hooks them into the damageable component * More rebase fixes * test * Pre future rebase * Please * Lol * Lol2 * SHADERS * Update Engine * yml file * Fix an initialization issue, injects dependencies * Fix error in loading shaders * Makes a master character ui controller component added upon client attachment to entity and remove upon client detachment from entity * Fixes just about everytrhing * Address PJB's comments * geeze * Make overlays work in worldspace instead of screen space and not cover user interfaces * update submodule
This commit is contained in:
committed by
Pieter-Jan Briers
parent
b8becf4a56
commit
37df61113e
@@ -1,4 +1,5 @@
|
||||
using Content.Client.GameObjects;
|
||||
using Content.Client.GameObjects.Components.Actor;
|
||||
using Content.Client.GameObjects.Components.Clothing;
|
||||
using Content.Client.GameObjects.Components.Construction;
|
||||
using Content.Client.GameObjects.Components.Power;
|
||||
@@ -15,11 +16,13 @@ using SS14.Client;
|
||||
using SS14.Client.Interfaces;
|
||||
using SS14.Client.Interfaces.Graphics.Overlays;
|
||||
using SS14.Client.Interfaces.Input;
|
||||
using SS14.Client.Player;
|
||||
using SS14.Client.Utility;
|
||||
using SS14.Shared.ContentPack;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Prototypes;
|
||||
using System;
|
||||
|
||||
namespace Content.Client
|
||||
{
|
||||
@@ -34,7 +37,6 @@ namespace Content.Client
|
||||
var prototypes = IoCManager.Resolve<IPrototypeManager>();
|
||||
|
||||
factory.RegisterIgnore("Interactable");
|
||||
factory.RegisterIgnore("Damageable");
|
||||
factory.RegisterIgnore("Destructible");
|
||||
factory.RegisterIgnore("Temperature");
|
||||
factory.RegisterIgnore("PowerTransfer");
|
||||
@@ -68,15 +70,22 @@ namespace Content.Client
|
||||
factory.Register<ConstructorComponent>();
|
||||
factory.Register<ConstructionGhostComponent>();
|
||||
factory.Register<IconSmoothComponent>();
|
||||
factory.Register<DamageableComponent>();
|
||||
factory.Register<ClothingComponent>();
|
||||
factory.Register<ItemComponent>();
|
||||
|
||||
factory.RegisterReference<ClothingComponent, ItemComponent>();
|
||||
|
||||
factory.Register<SpeciesUI>();
|
||||
factory.Register<CharacterInterface>();
|
||||
|
||||
factory.RegisterIgnore("Construction");
|
||||
factory.RegisterIgnore("Apc");
|
||||
factory.RegisterIgnore("Door");
|
||||
factory.RegisterIgnore("PoweredLight");
|
||||
factory.RegisterIgnore("Smes");
|
||||
factory.RegisterIgnore("Powercell");
|
||||
factory.RegisterIgnore("HandheldLight");
|
||||
|
||||
prototypes.RegisterIgnore("material");
|
||||
|
||||
@@ -87,6 +96,43 @@ namespace Content.Client
|
||||
IoCManager.BuildGraph();
|
||||
|
||||
IoCManager.Resolve<IParallaxManager>().LoadParallax();
|
||||
IoCManager.Resolve<IBaseClient>().PlayerJoinedServer += SubscribePlayerAttachmentEvents;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subscribe events to the player manager after the player manager is set up
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
public void SubscribePlayerAttachmentEvents(object sender, EventArgs args)
|
||||
{
|
||||
IoCManager.Resolve<IPlayerManager>().LocalPlayer.EntityAttached += AttachPlayerToEntity;
|
||||
IoCManager.Resolve<IPlayerManager>().LocalPlayer.EntityDetached += DetachPlayerFromEntity;
|
||||
AttachPlayerToEntity(IoCManager.Resolve<IPlayerManager>().LocalPlayer, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add the character interface master which combines all character interfaces into one window
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
public void AttachPlayerToEntity(object sender, EventArgs args)
|
||||
{
|
||||
var localplayer = (LocalPlayer)sender;
|
||||
|
||||
localplayer.ControlledEntity?.AddComponent<CharacterInterface>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove the character interface master from this entity now that we have detached ourselves from it
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="args"></param>
|
||||
public void DetachPlayerFromEntity(object sender, EventArgs args)
|
||||
{
|
||||
var localplayer = (LocalPlayer)sender;
|
||||
//Wont work atm, controlled entity gets nulled before this event fires
|
||||
localplayer.ControlledEntity?.RemoveComponent<CharacterInterface>();
|
||||
}
|
||||
|
||||
public override void PostInit()
|
||||
|
||||
Reference in New Issue
Block a user