Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SourySK committed Apr 2, 2021
0 parents commit 1e126a5
Show file tree
Hide file tree
Showing 79 changed files with 1,342 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Visual Studio 2015 user specific files
.vs/
.idea/

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*.ipa

# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb

# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga

# Binary Files
Binaries/*
Plugins/*/Binaries/*

# Builds
Build/*

# Whitelist PakBlacklist-<BuildConfiguration>.txt files
!Build/*/
Build/*/**
!Build/*/PakBlacklist*.txt

# Don't ignore icon files in Build
!Build/**/*.ico

# Built data for maps
*_BuiltData.uasset

# Configuration files generated by the Editor
Saved/*

# Compiled source files for the engine to use
Intermediate/*
Plugins/*/Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*
*.user
Binary file added Build/Windows/Application.ico
Binary file not shown.
Empty file added Config/DefaultEditor.ini
Empty file.
37 changes: 37 additions & 0 deletions Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@


[/Script/EngineSettings.GameMapsSettings]
GameDefaultMap=/Game/Maps/L_NiagaraDemo.L_NiagaraDemo


EditorStartupMap=/Game/Maps/L_NiagaraDemo.L_NiagaraDemo

[/Script/HardwareTargeting.HardwareTargetingSettings]
TargetedHardwareClass=Desktop
AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum

[/Script/Engine.Engine]
+ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/NiagaraUI")
+ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/NiagaraUI")

[/Script/Engine.UserInterfaceSettings]
RenderFocusRule=NavigationOnly
HardwareCursors=()
SoftwareCursors=((Default, /Game/Blueprints/Widgets/WB_Cursor.WB_Cursor_C))
ApplicationScale=1.000000
UIScaleRule=ShortestSide
CustomScalingRuleClass=None
UIScaleCurve=(EditorCurveData=(Keys=((Time=480.000000,Value=0.444000),(Time=720.000000,Value=0.666000),(Time=1080.000000,Value=1.000000),(Time=8640.000000,Value=8.000000)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None)
bAllowHighDPIInGameMode=False
DesignScreenSize=(X=1920,Y=1080)
bLoadWidgetsOnDedicatedServer=True

[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
bPackageDataInsideApk=True

[/Script/LuminRuntimeSettings.LuminRuntimeSettings]
IconModelPath=(Path="")
IconPortalPath=(Path="")

16 changes: 16 additions & 0 deletions Config/DefaultGame.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=1471BD1F4F0189ED70E3EBA73914E154
CopyrightNotice="Copyright (c) 2021 Michal Smoleň "
LicensingTerms=MIT License
ProjectName=Niagara UI Demo
Description=Demo project for the Niagara UI Plugin

[StartupActions]
bAddPacks=True
InsertPack=(PackSource="StarterContent.upack",PackName="StarterContent")

[/Script/UnrealEd.ProjectPackagingSettings]
bSkipEditorContent=True

5 changes: 5 additions & 0 deletions Config/DefaultInput.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


[/Script/Engine.InputSettings]
DefaultViewportMouseLockMode=LockAlways

Binary file added Content/Blueprints/BP_GameMode.uasset
Binary file not shown.
Binary file added Content/Blueprints/Game/BP_GameMode.uasset
Binary file not shown.
Binary file added Content/Blueprints/Game/BP_HUD.uasset
Binary file not shown.
Binary file not shown.
Binary file added Content/Blueprints/WB_NiagaraDemo.uasset
Binary file not shown.
Binary file added Content/Blueprints/WB_NiagaraTest.uasset
Binary file not shown.
Binary file added Content/Blueprints/Widgets/WB_Cursor.uasset
Binary file not shown.
Binary file added Content/Blueprints/Widgets/WB_DemoButton.uasset
Binary file not shown.
Binary file added Content/Blueprints/Widgets/WB_NiagaraDemo.uasset
Binary file not shown.
Binary file added Content/Blueprints/Widgets/WB_Test.uasset
Binary file not shown.
Binary file added Content/Maps/L_NiagaraDemo.umap
Binary file not shown.
Binary file added Content/Materials/MI_Ball.uasset
Binary file not shown.
Binary file added Content/Materials/MI_Button.uasset
Binary file not shown.
Binary file added Content/Materials/M_FireOutline.uasset
Binary file not shown.
Binary file added Content/Materials/M_P_Basic.uasset
Binary file not shown.
Binary file added Content/Materials/M_P_Basic_Ribbon.uasset
Binary file not shown.
Binary file added Content/Materials/M_P_Diamond.uasset
Binary file not shown.
Binary file added Content/Materials/M_P_FakeLight.uasset
Binary file not shown.
Binary file added Content/Materials/M_P_Leaves.uasset
Binary file not shown.
Binary file added Content/Materials/M_P_Smoke.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Basic.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Basic_Ribbon.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Diamond.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_FakeLight.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Fire.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Glow.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Leaves.uasset
Binary file not shown.
Binary file added Content/Materials/M_UI_Smoke.uasset
Binary file not shown.
Binary file added Content/Particles/NS_BackgroundGrid.uasset
Binary file not shown.
Binary file added Content/Particles/NS_Burst.uasset
Binary file not shown.
Binary file added Content/Particles/NS_Button.uasset
Binary file not shown.
Binary file added Content/Particles/NS_CollisionDemo.uasset
Binary file not shown.
Binary file added Content/Particles/NS_Cursor.uasset
Binary file not shown.
Binary file added Content/Particles/NS_FireEmbers.uasset
Binary file not shown.
Binary file added Content/Particles/NS_FireEmbersIntro.uasset
Binary file not shown.
Binary file added Content/Particles/NS_Leaves.uasset
Binary file not shown.
Binary file added Content/Particles/NS_PerformanceTest.uasset
Binary file not shown.
Binary file added Content/Particles/NS_Plexus.uasset
Binary file not shown.
Binary file added Content/Particles/NS_Smoke.uasset
Binary file not shown.
Binary file added Content/Splash/EdSplash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Splash/Splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Content/Textures/Ball_basecolor.uasset
Binary file not shown.
Binary file added Content/Textures/T_ButtonMasks.uasset
Binary file not shown.
Binary file added Content/Textures/T_CursorMasks.uasset
Binary file not shown.
Binary file added Content/Textures/T_DiamondMask.uasset
Binary file not shown.
Binary file added Content/Textures/T_Leaves.uasset
Binary file not shown.
Binary file added Content/Textures/T_Noises.uasset
Binary file not shown.
Binary file added Content/Textures/T_Smoke.uasset
Binary file not shown.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Michal Smoleň

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Binary file added NiagaraUI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions NiagaraUI.uproject
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"FileVersion": 3,
"EngineAssociation": "4.26",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "NiagaraUI",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"Engine"
]
}
]
}
8 changes: 8 additions & 0 deletions Plugins/NiagaraUIRenderer/Config/FilterPlugin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[FilterPlugin]
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
;
; Examples:
; /README.txt
; /Extras/...
; /Binaries/ThirdParty/*.dll
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;

public class NiagaraUIRenderer : ModuleRules
{
public NiagaraUIRenderer(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;

PublicIncludePaths.AddRange(
new string[] {
// ... add public include paths required here ...
}
);


PrivateIncludePaths.AddRange(
new string[] {
// ... add other private include paths required here ...
}
);


PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"UMG",
// ... add other public dependencies that you statically link with here ...
}
);


PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"Niagara",
// ... add private dependencies that you statically link with here ...
}
);


DynamicallyLoadedModuleNames.AddRange(
new string[]
{
// ... add any modules that your module loads dynamically here ...
}
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "NiagaraSystemWidget.h"
#include "SNiagaraUISystemWidget.h"
#include "Materials/MaterialInterface.h"
#include "NiagaraUIActor.h"
#include "NiagaraUIComponent.h"

TSharedRef<SWidget> UNiagaraSystemWidget::RebuildWidget()
{
niagaraSlateWidget = SNew(SNiagaraUISystemWidget);

InitializeNiagaraUI();

return niagaraSlateWidget.ToSharedRef();
}

void UNiagaraSystemWidget::SynchronizeProperties()
{
Super::SynchronizeProperties();

if (!niagaraSlateWidget.IsValid())
{
return;
}

if (!NiagaraActor || !NiagaraComponent)
InitializeNiagaraUI();

}

void UNiagaraSystemWidget::ReleaseSlateResources(bool bReleaseChildren)
{
Super::ReleaseSlateResources(bReleaseChildren);

niagaraSlateWidget.Reset();

if (NiagaraActor)
NiagaraActor->Destroy();
}

#if WITH_EDITOR
const FText UNiagaraSystemWidget::GetPaletteCategory()
{
return NSLOCTEXT("NiagaraUIRenderer", "Palette Category", "Niagara");
}

void UNiagaraSystemWidget::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);

InitializeNiagaraUI();
}
#endif

void UNiagaraSystemWidget::InitializeNiagaraUI()
{
if (UWorld* World = GetWorld())
{
if (!World->PersistentLevel)
return;


if (!NiagaraActor)
{
FActorSpawnParameters spawnParams;
spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
NiagaraActor = World->SpawnActor<ANiagaraUIActor>(FVector::ZeroVector, FRotator::ZeroRotator, spawnParams);
}

NiagaraComponent = NiagaraActor->SpawnNewNiagaraUIComponent(NiagaraSystemReference, AutoActivate, ShowDebugSystemInWorld);

niagaraSlateWidget->SetNiagaraComponentReference(NiagaraComponent, FNiagaraWidgetProperties(&MaterialRemapList, AutoActivate, ShowDebugSystemInWorld, FakeDepthScale, FakeDepthScaleDistance));
}
}

void UNiagaraSystemWidget::ActivateSystem(bool Reset)
{
if (NiagaraComponent)
NiagaraComponent->Activate(Reset);
}

void UNiagaraSystemWidget::DeactivateSystem()
{
if (NiagaraComponent)
NiagaraComponent->Deactivate();
}

UNiagaraUIComponent* UNiagaraSystemWidget::GetNiagaraComponent()
{
return NiagaraComponent;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "NiagaraUIActor.h"
#include "NiagaraUIComponent.h"
#include "Components/SceneComponent.h"

PRAGMA_DISABLE_OPTIMIZATION

ANiagaraUIActor::ANiagaraUIActor()
{
if (!RootComponent)
RootComponent = CreateDefaultSubobject<USceneComponent>(USceneComponent::GetDefaultSceneRootVariableName());
}

UNiagaraUIComponent* ANiagaraUIActor::SpawnNewNiagaraUIComponent(UNiagaraSystem* NiagaraSystemTemplate, bool AutoActivate, bool ShowDebugSystem)
{
UNiagaraUIComponent* newComponent = NewObject<UNiagaraUIComponent>(this);

newComponent->SetupAttachment(RootComponent);
newComponent->SetAutoActivate(AutoActivate);
newComponent->SetHiddenInGame(!ShowDebugSystem);
newComponent->RegisterComponent();
newComponent->SetAsset(NiagaraSystemTemplate);
newComponent->SetAutoDestroy(false);

return newComponent;
}
PRAGMA_ENABLE_OPTIMIZATION
Loading

0 comments on commit 1e126a5

Please sign in to comment.