Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Panakotta00 committed Mar 17, 2020
2 parents e33a1e8 + 9d46d8b commit c3b4ec6
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 5 deletions.
Binary file modified Content/LightItUp/Lamps/-Shared/LampMenu/GroupEntry.uasset
Binary file not shown.
Binary file modified Content/LightItUp/Lamps/-Shared/LampMenu/LampInteraction.uasset
Binary file not shown.
Binary file modified Content/LightItUp/Lamps/-Shared/LampMenu/Textures/AddGroup.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/LightItUp/Lamps/ConstructionLight/ConstructionLight.uasset
Binary file not shown.
Binary file modified Content/LightItUp/Lamps/PortableLight/PortableLamp.uasset
Binary file not shown.
12 changes: 7 additions & 5 deletions Source/LightItUp/LampSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ bool ULampSubsystemRCO::SetGroup_Validate(ALampSubsystem* subsys, const FString&
}

void ULampSubsystemRCO::RemoveGroup_Implementation(ALampSubsystem* subsys, const FString& groupName) {
if (groupName == DefaultLampGroup || groupName.Len() < 1) return;
auto group = subsys->Groups.FindByKey(groupName);
subsys->Groups.Remove(*group);
subsys->ForceNetUpdate();
Expand All @@ -49,21 +50,22 @@ bool ALampSubsystem::ShouldSave_Implementation() const {
return true;
}

void ALampSubsystem::BeginPlay() {
Super::BeginPlay();
}

void ALampSubsystem::OnGroupsChanged() {
bool hard = Groups.Num() != LastGroupCount;
if (hard) LastGroupCount = Groups.Num();
OnGroupChanged.Broadcast(hard);
}

ALampSubsystem::ALampSubsystem() {
if (!Groups.Contains(DefaultLampGroup)) Groups.Add({DefaultLampGroup, AUTO});
bReplicates = true;
}

void ALampSubsystem::BeginPlay() {
Super::BeginPlay();
if (!Groups.Contains(FString(DefaultLampGroup))) Groups.Add({DefaultLampGroup, AUTO});
if (FLampGroup* group = Groups.FindByKey(TEXT(""))) Groups.Remove(*group);
}

ALampSubsystem * ALampSubsystem::Get(UWorld* world) {
TArray<AActor*> subsystems;
UGameplayStatics::GetAllActorsOfClass(world, ALampSubsystem::StaticClass(), subsystems);
Expand Down

0 comments on commit c3b4ec6

Please sign in to comment.