Browse Source
- Visual Studio Code debug launch configuration now has standalone options - I fucked with various options in order to get the standalone game client working. Event Driven Loader is now disabled, Anonymous Usage Data is now disabled (this is more because I didn't want to wait for it at shutdown), and Oculus and SteamVR are disabled - Added some Input Bindings for controlling Standalone game client which are not yet hooked up - Did some work on getting a player HUD set up. At the moment it doesn't do anything - Added GalavantUnreal command for pausing/resuming Galavant tick (Gameplay time) - Commented my Slate High DPI hack and moved it into a command instead. This hack broke cooking and packaging - Hooked GalavantUnreal update into Gameplay time system for pausing etc. - Added CharacterManager. The idea is that this system will manage things like setting ragdoll etc. on Unreal ACharacters. It doesn't do anything yetmaster

24 changed files with 377 additions and 45 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,104 @@ |
|||
#include "GalavantUnreal.h" |
|||
|
|||
#include "CharacterManager.hpp" |
|||
|
|||
#include "game/agent/AgentComponentManager.hpp" |
|||
|
|||
#include "ActorEntityManagement.h" |
|||
|
|||
namespace CharacterManager |
|||
{ |
|||
struct CharacterManager |
|||
{ |
|||
gv::EntityList Subscribers; |
|||
|
|||
typedef std::vector<TWeakObjectPtr<ACharacter>> CharacterList; |
|||
CharacterList Characters; |
|||
}; |
|||
|
|||
static CharacterManager s_Characters; |
|||
|
|||
// void UnsubscribeEntities(const gv::EntityList& entitiesToUnsubscribe)
|
|||
// {
|
|||
// // TODO: Why did I make this callback thing if I just copy paste ComponentManager
|
|||
// // UnsubscribeEntities? This is dumb
|
|||
// if (!entities.empty())
|
|||
// {
|
|||
// // Copy for modification
|
|||
// EntityList entitiesToUnsubscribe;
|
|||
// EntityListAppendList(entitiesToUnsubscribe, entities);
|
|||
|
|||
// // Make sure they're actually subscribed
|
|||
// EntityListRemoveUniqueEntitiesInSuspect(Subscribers, entitiesToUnsubscribe);
|
|||
|
|||
// if (!entitiesToUnsubscribe.empty())
|
|||
// {
|
|||
// UnsubscribeEntitiesInternal(entitiesToUnsubscribe);
|
|||
|
|||
// // Remove from subscribers
|
|||
// EntityListRemoveNonUniqueEntitiesInSuspect(entitiesToUnsubscribe, Subscribers);
|
|||
|
|||
// LOGD << "Manager "
|
|||
// << " unsubscribed " << entitiesToUnsubscribe.size() << " entities";
|
|||
// }
|
|||
// }
|
|||
|
|||
// UnsubscribeEntities(Subscribers, UnsubscribeEntitiesInternal);
|
|||
// }
|
|||
|
|||
void Update(float deltaTime) |
|||
{ |
|||
gv::AgentConsciousStateList subscriberConsciousStates; |
|||
|
|||
gv::g_AgentComponentManager.GetAgentConsciousStates(s_Characters.Subscribers, |
|||
subscriberConsciousStates); |
|||
|
|||
for (TWeakObjectPtr<ACharacter>& character : s_Characters.Characters) |
|||
{ |
|||
if (character.IsValid()) |
|||
{ |
|||
} |
|||
else |
|||
character = nullptr; |
|||
} |
|||
} |
|||
|
|||
TWeakObjectPtr<ACharacter> CreateCharacterForEntity( |
|||
UWorld* world, TSubclassOf<ACharacter> characterType, gv::Entity entity, |
|||
const gv::Position& position, ActorEntityManager::TrackActorLifetimeCallback callback) |
|||
{ |
|||
if (!world) |
|||
return nullptr; |
|||
|
|||
/*gv::EntityListIterator findIt = std::find(s_Characters.Subscribers.begin(), s_Characters.Subscribers.end(), entity);
|
|||
|
|||
TWeakObjectPtr<ACharacter>* entityAssociatedCharacter = nullptr; |
|||
|
|||
if (findIt != s_Characters.Subscribers.end()) |
|||
{ |
|||
for (TWeakObjectPtr<ACharacter>* character : s_Characters.Characters) |
|||
{ |
|||
if (character->IsValid()) |
|||
{ |
|||
if ((*character)->Entity == entity) |
|||
return character; |
|||
else |
|||
{ |
|||
entityAssociatedCharacter = character; |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
}*/ |
|||
|
|||
TWeakObjectPtr<ACharacter> newCharacter = ActorEntityManager::CreateActorForEntity<ACharacter>( |
|||
world, characterType, entity, position, callback); |
|||
|
|||
/*if (entityAssociatedCharacter)
|
|||
find |
|||
|
|||
newCharacter*/ |
|||
|
|||
return newCharacter; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
#pragma once |
|||
|
|||
#include "ActorEntityManagement.h" |
|||
|
|||
#include "entityComponentSystem/EntityTypes.hpp" |
|||
#include "entityComponentSystem/EntityComponentManager.hpp" |
|||
#include "world/Position.hpp" |
|||
|
|||
// Character Manager - Handle Unreal Characters (movement, animation, ragdoll, etc.)
|
|||
|
|||
namespace CharacterManager |
|||
{ |
|||
void Update(float deltaTime); |
|||
|
|||
// void UnsubscribeEntities(const gv::EntityList& entitiesToUnsubscribe);
|
|||
|
|||
TWeakObjectPtr<ACharacter> CreateCharacterForEntity( |
|||
UWorld* world, TSubclassOf<ACharacter> characterType, gv::Entity entity, |
|||
const gv::Position& position, ActorEntityManager::TrackActorLifetimeCallback callback); |
|||
} |
Loading…
Reference in new issue