Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cyberarch/aip-197-sp-23-digital-classroom
  • cyberarch/cyberarchplugins
2 results
Show changes
Showing
with 635 additions and 0 deletions
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "Widgets/SCompoundWidget.h"
struct FBackgroundSettings;
class FDeferredCleanupSlateBrush;
/**
* Background widget
*/
class SBackgroundWidget : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SBackgroundWidget) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, const FBackgroundSettings& Settings);
private:
TSharedPtr<FDeferredCleanupSlateBrush> ImageBrush;
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingScreenLayout.h"
struct FALoadingScreenSettings;
struct FCenterLayoutSettings;
/**
* Center layout loading screen
*/
class SCenterLayout : public SLoadingScreenLayout
{
public:
SLATE_BEGIN_ARGS(SCenterLayout) {}
SLATE_END_ARGS()
/**
* Construct this widget
*/
void Construct(const FArguments& InArgs, const FALoadingScreenSettings& Settings, const FCenterLayoutSettings& LayoutSettings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingScreenLayout.h"
struct FALoadingScreenSettings;
struct FClassicLayoutSettings;
/**
* Classic layout loading screen
*/
class SClassicLayout : public SLoadingScreenLayout
{
public:
SLATE_BEGIN_ARGS(SClassicLayout) {}
SLATE_END_ARGS()
/**
* Construct this widget
*/
void Construct(const FArguments& InArgs, const FALoadingScreenSettings& Settings, const FClassicLayoutSettings& LayoutSettings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingScreenLayout.h"
struct FALoadingScreenSettings;
struct FDualSidebarLayoutSettings;
/**
* Dual Sidebar Layout
*/
class SDualSidebarLayout : public SLoadingScreenLayout
{
public:
SLATE_BEGIN_ARGS(SDualSidebarLayout) {}
SLATE_END_ARGS()
/**
* Construct this widget
*/
void Construct(const FArguments& InArgs, const FALoadingScreenSettings& Settings, const FDualSidebarLayoutSettings& LayoutSettings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingWidget.h"
struct FLoadingWidgetSettings;
/**
*
*/
class SHorizontalLoadingWidget : public SLoadingWidget
{
public:
SLATE_BEGIN_ARGS(SHorizontalLoadingWidget) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, const FLoadingWidgetSettings& Settings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingScreenLayout.h"
struct FALoadingScreenSettings;
struct FLetterboxLayoutSettings;
/**
* Letterbox layout loading screen
*/
class SLetterboxLayout : public SLoadingScreenLayout
{
public:
SLATE_BEGIN_ARGS(SLetterboxLayout) {}
SLATE_END_ARGS()
/**
* Construct this widget
*/
void Construct(const FArguments& InArgs, const FALoadingScreenSettings& Settings, const FLetterboxLayoutSettings& LayoutSettings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "Widgets/SCompoundWidget.h"
struct FLoadingCompleteTextSettings;
/**
*
*/
class SLoadingCompleteText : public SCompoundWidget
{
private:
// Complete text color
FLinearColor CompleteTextColor = FLinearColor::White;
// Complete text fade in or fade out animation
bool bCompleteTextReverseAnim = false;
// Complete text animation speed
float CompleteTextAnimationSpeed = 1.0f;
// Active timer registered flag
bool bIsActiveTimerRegistered = false;
public:
SLATE_BEGIN_ARGS(SLoadingCompleteText) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, const FLoadingCompleteTextSettings& CompleteTextSettings);
// Getter for text visibility
EVisibility GetLoadingCompleteTextVisibility() const;
// Getter for complete text color and opacity
FSlateColor GetLoadingCompleteTextColor() const;
/** Active timer event for animating the image sequence */
EActiveTimerReturnType AnimateText(double InCurrentTime, float InDeltaTime);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "Widgets/SCompoundWidget.h"
/**
* Loading screen base theme
*/
class SLoadingScreenLayout : public SCompoundWidget
{
public:
static float PointSizeToSlateUnits(float PointSize);
protected:
float GetDPIScale() const;
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "Widgets/SCompoundWidget.h"
#include "Widgets/Images/SThrobber.h"
#include "LoadingScreenSettings.h"
class FDeferredCleanupSlateBrush;
struct FLoadingWidgetSettings;
/**
* Loading Widget base class
*/
class SLoadingWidget : public SCompoundWidget
{
public:
// SWidgetOverrides
virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
/** Gets the combined value of the animation properties as a single SThrobber::EAnimation value. */
SThrobber::EAnimation GetThrobberAnimation(const FThrobberSettings& ThrobberSettings) const;
/** Construct loading icon*/
void ConstructLoadingIcon(const FLoadingWidgetSettings& Settings);
protected:
// Placeholder widgets
TSharedRef<SWidget> LoadingIcon = SNullWidget::NullWidget;
// Image slate brush list
TArray<TSharedPtr<FDeferredCleanupSlateBrush>> CleanupBrushList;
// Play image sequence in reverse
bool bPlayReverse = false;
// Current image sequence index
mutable int32 ImageIndex = 0;
// Current total delta time
mutable float TotalDeltaTime = 0.0f;
//Time in second to update the images, the smaller value the faster of the animation. A zero value will update the images every frame.
float Interval = 0.05f;
// Getter for text visibility
EVisibility GetLoadingWidgetVisibility() const;
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingScreenLayout.h"
struct FALoadingScreenSettings;
struct FSidebarLayoutSettings;
/**
* Sidebar layout loading screen
*/
class SSidebarLayout : public SLoadingScreenLayout
{
public:
SLATE_BEGIN_ARGS(SSidebarLayout) {}
SLATE_END_ARGS()
/**
* Construct this widget
*/
void Construct(const FArguments& InArgs, const FALoadingScreenSettings& Settings, const FSidebarLayoutSettings& LayoutSettings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "Widgets/SCompoundWidget.h"
struct FTipSettings;
/**
* Tip widget
*/
class STipWidget : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(STipWidget) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, const FTipSettings& Settings);
};
/************************************************************************************
* *
* Copyright (C) 2020 Truong Bui. *
* Website: https://github.com/truong-bui/AsyncLoadingScreen *
* Licensed under the MIT License. See 'LICENSE' file for full license information. *
* *
************************************************************************************/
#pragma once
#include "SLoadingWidget.h"
/**
*
*/
class SVerticalLoadingWidget : public SLoadingWidget
{
public:
SLATE_BEGIN_ARGS(SVerticalLoadingWidget) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, const FLoadingWidgetSettings& Settings);
};
# Visual Studio 2015 user specific files
.vs/
# 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/*
\ No newline at end of file
[FilterPlugin]
/Resources/
LICENSE
README.md
\ No newline at end of file
{
"FileVersion": 3,
"Version": 1,
"VersionName": "1.0",
"FriendlyName": "BlueprintWebsockets",
"Description": "A lightweight plugin that wraps the IWebSocket interface allowing you to connect to a WebSocket server directly in Blueprint",
"Category": "Other",
"CreatedBy": "Chris Ringenberg",
"CreatedByURL": "https://www.ringenberg.dev/",
"DocsURL": "https://docs.google.com/document/d/1EXeESlA3gbdMkv2n9b5hhK5mhQTMLh-9aGH3XV_pdYs/edit?usp=sharing",
"MarketplaceURL": "com.epicgames.launcher://ue/marketplace/product/4b5a7cbf6dda4b91878824a47104c596",
"SupportURL": "https://www.ringenberg.dev/contact",
"CanContainContent": false,
"EngineVersion": "5.3.0",
"IsBetaVersion": false,
"IsExperimentalVersion": false,
"Installed": true,
"Modules": [
{
"Name": "EasyWebsockets",
"Type": "Runtime",
"LoadingPhase": "Default",
"WhitelistPlatforms": [
"Win64"
]
}
]
}
\ No newline at end of file
MIT License
Copyright (c) 2022 Chris
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.
# BlueprintWebsockets
Simple Blueprint Websocket plugin for Unreal Engine 4
Unreal Engine 5 support
![image](https://user-images.githubusercontent.com/21158549/155652050-8efb4b20-ff9e-4666-bbe8-174ffbcca76c.png)
![image](https://user-images.githubusercontent.com/21158549/155652245-0049aacb-6cd4-47a6-a6cf-ff617f73b854.png)
Documentation: https://docs.google.com/document/d/1EXeESlA3gbdMkv2n9b5hhK5mhQTMLh-9aGH3XV_pdYs/edit?usp=sharing
Support Discord: https://discord.com/invite/W36D96gJqX
// Copyright 2022 Chris Ringenberg https://www.ringenberg.dev/
using UnrealBuildTool;
public class EasyWebsockets : ModuleRules
{
public EasyWebsockets(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"WebSockets"
}
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Engine",
"Slate",
"SlateCore"
}
);
PublicDefinitions.Add("WITH_WEBSOCKETS=1");
}
}
// Copyright 2022 Chris Ringenberg https://www.ringenberg.dev/
#include "EasyWebsockets.h"
#include "Modules/ModuleManager.h"
#include "WebSocketsModule.h"
#define LOCTEXT_NAMESPACE "FEasyWebsocketsModule"
void FEasyWebsocketsModule::StartupModule()
{
FModuleManager::LoadModuleChecked<FWebSocketsModule>("WebSockets");
// This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module
}
void FEasyWebsocketsModule::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
}
#undef LOCTEXT_NAMESPACE
IMPLEMENT_MODULE(FEasyWebsocketsModule, EasyWebsockets)
// Copyright 2022 Chris Ringenberg https://www.ringenberg.dev/
#include "Websocket.h"
#include "IWebSocket.h"
void UWebSocket::InitWebSocket(TSharedPtr<IWebSocket> InWebSocket)
{
InternalWebSocket = InWebSocket;
InternalWebSocket->OnConnected().AddUObject(this, &ThisClass::OnWebSocketConnected_Internal);
InternalWebSocket->OnConnectionError().AddUObject(this, &ThisClass::OnWebSocketConnectionError_Internal);
InternalWebSocket->OnClosed().AddUObject(this, &ThisClass::OnWebSocketClosed_Internal);
InternalWebSocket->OnMessage().AddUObject(this, &ThisClass::OnWebSocketMessageReceived_Internal);
InternalWebSocket->OnMessageSent().AddUObject(this, &ThisClass::OnWebSocketMessageSent_Internal);
}
void UWebSocket::Connect()
{
InternalWebSocket->Connect();
}
void UWebSocket::Close(int32 StatusCode, const FString& Reason)
{
InternalWebSocket->Close(StatusCode, Reason);
}
bool UWebSocket::IsConnected() const
{
return InternalWebSocket->IsConnected();
}
void UWebSocket::SendMessage(const FString& Message)
{
InternalWebSocket->Send(Message);
}
void UWebSocket::OnWebSocketConnected_Internal()
{
OnWebSocketConnected.Broadcast();
}
void UWebSocket::OnWebSocketConnectionError_Internal(const FString& Error)
{
OnWebSocketConnectionError.Broadcast(Error);
}
void UWebSocket::OnWebSocketClosed_Internal(int32 StatusCode, const FString& Reason, bool bWasClean)
{
OnWebSocketClosed.Broadcast(StatusCode, Reason, bWasClean);
}
void UWebSocket::OnWebSocketMessageReceived_Internal(const FString& Message)
{
OnWebSocketMessageReceived.Broadcast(Message);
}
void UWebSocket::OnWebSocketMessageSent_Internal(const FString& Message)
{
OnWebSocketMessageSent.Broadcast(Message);
}