Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Panakotta00 committed Aug 19, 2021
2 parents a975b36 + 235aa1c commit de147ad
Show file tree
Hide file tree
Showing 293 changed files with 2,397 additions and 794 deletions.
4 changes: 4 additions & 0 deletions Config/AccessTransformers.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[AccessTransformers]
Friend=(Class="AFGBuildableHologram", FriendClass="FFicsItNetworksModule")
Friend=(Class="AFGBuildableHologram", FriendClass="AFINNetworkCableHologram")
Friend=(Class="AFGHologram", FriendClass="AFINNetworkCableHologram")
Binary file modified Content/BC_Networks.uasset
Binary file not shown.
Binary file added Content/BSC_MicroControlPanelModules.uasset
Binary file not shown.
Binary file added Content/BSC_MicroControlPanels.uasset
Binary file not shown.
Binary file added Content/BSC_MicroUtils.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 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 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 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 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 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 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 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 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 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 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 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 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 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 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/Components/ModularPanel/Modules/ModuleScreen.uasset
Binary file not shown.
Binary file modified Content/Components/ModularPanel/Modules/ModuleTextDisplay.uasset
Binary file not shown.
Binary file modified Content/Components/ModularPanel/Modules/Module_RCO.uasset
Binary file not shown.
Binary file modified Content/Components/ModularPanel/Modules/Widget_TextDisplay.uasset
Binary file not shown.
Binary file modified Content/Components/Screen/Build_Screen.uasset
Binary file not shown.
Binary file modified Content/Computer/Modules/InternetCard/Desc_InternetCard.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/Computer/Modules/Screen/ScreenDriver.uasset
Binary file not shown.
Binary file modified Content/GameWorldModule.uasset
Binary file not shown.
Binary file added Content/Material/MM_RozeEmissiveButton.uasset
Binary file not shown.
Binary file added Content/Material/MM_RozeEmissiveIndicator.uasset
Binary file not shown.
Binary file added Content/Material/OpaqueEmissiveButton.uasset
Binary file not shown.
Binary file added Content/Material/Test.uasset
Binary file not shown.
Binary file added Content/Material/Textures/LabelReflection.uasset
Binary file not shown.
Binary file added Content/Material/Textures/PureColor-Blue.uasset
Binary file not shown.
Binary file added Content/Material/Textures/PureColor-Green.uasset
Binary file not shown.
Binary file not shown.
Binary file added Content/Material/Textures/PureColor-black.uasset
Binary file not shown.
Binary file added Content/Material/Textures/PureColor-cyan.uasset
Binary file not shown.
Binary file not shown.
Binary file added Content/Material/Textures/PureColor-red.uasset
Binary file not shown.
Binary file added Content/Material/Textures/PureColor-white.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Content/Material/WhiteWidgetBackground.uasset
Binary file not shown.
Binary file modified Content/Network/NetworkCable/NetworkCable.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/Network/NetworkPole/Mesh_NetworkPole.uasset
Binary file not shown.
Binary file modified Content/Network/NetworkPole/NetworkPole.uasset
Binary file not shown.
Binary file modified Content/Network/NetworkWallPlug/Mesh_NetworkWallPlug.uasset
Binary file not shown.
Binary file modified Content/Network/NetworkWallPlug/NetworkWallPlug.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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Content/Schematics/Icon_MicroControlPanel.uasset
Binary file not shown.
Binary file added Content/Schematics/MicroControlPanel.uasset
Binary file not shown.
Binary file modified Content/Schematics/ModularIO.uasset
Binary file not shown.
Binary file removed Content/Tutorial/FIN_Tutorial.uasset
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions DefaultFicsitNetworks.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
+ClassRedirects=(OldName="/Script/RozeFINAddons",NewName="/Script/FicsitNetwork", MatchSubstring=true)
+StructRedirects=(OldName="/Script/RozeFINAddons",NewName="/Script/FicsitNetwork", MatchSubstring=true)
10 changes: 5 additions & 5 deletions FicsItNetworks.uplugin
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"FileVersion": 3,
"Version": 0,
"VersionName": "0.2",
"SemVersion": "0.2.2",
"VersionName": "0.3",
"SemVersion": "0.3.0",
"FriendlyName": "FicsIt-Networks",
"Description": "Adds a computer network and programmable computers to the Game.",
"Category": "Modding",
"CreatedBy": "Panakotta00",
"CreatedByURL": "https://twitch.tv/panakotta00",
"CreatedBy": "Panakotta00, RosszEmber, Deantendo, Coffeediction, Roze, Raysh, Esper",
"CreatedByURL": "",
"DocsURL": "https://docs.ficsit.app/ficsit-networks/0.0.1/index.html",
"MarketplaceURL": "",
"SupportURL": "",
"SupportURL": "https://discord.gg/3VfZ6Da",
"CanContainContent": true,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You can find the detailed progress in the [project board](https://github.com/Cod

Contributors
============
- [Panakotta00](https://twitch.tv/panakotta00)
- [Panakotta00](https://panakotta00.massivebytes.net)
- [RosszEmber](https://www.deviantart.com/ronsemberg)
- Deantendo
- Coffeediction
Expand Down
60 changes: 60 additions & 0 deletions Source/FicsItNetworks/Components/FINCommandPointMesh.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include "FINCommandPointMesh.h"

#include <filesystem>
#include <fstream>
#include <sstream>


#include "IImageWrapper.h"
#include "IImageWrapperModule.h"
#include "Developer/TargetPlatform/Public/Interfaces/IAudioFormat.h"
#include "VorbisAudioInfo.h"
#include "FicsitNetworks/FicsItKernel/Processor/Lua/LuaStructs.h"



UTexture2D* UFINCommandPointMesh::LoadTextureFromFile(FString str)
{
FString fsp;
// TODO: Get UFGSaveSystem::GetSaveDirectoryPath() working
if (fsp.IsEmpty()) {
fsp = FPaths::Combine(FPlatformProcess::UserSettingsDir(), FApp::GetProjectName(), TEXT("Saved/") TEXT("SaveGames/"));
}

auto file = str + TEXT(".png");
auto path = std::filesystem::path(*file);

std::filesystem::path root = *fsp;
root /= "Computers/Icons";
std::filesystem::create_directories(root);
auto pathToFile = root / path;
pathToFile = std::filesystem::absolute(pathToFile);
auto ps = pathToFile.string();
if (ps.rfind(std::filesystem::absolute(root).string(), 0) != 0 || !std::filesystem::exists(pathToFile)) {
return nullptr;
}

FString fstrPath = UTF8_TO_TCHAR(ps.c_str());


FString pngfile = "myimage.png";
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
// Note: PNG format. Other formats are supported
TSharedPtr<IImageWrapper> ImageWrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);

TArray<uint8> RawFileData;
if (FFileHelper::LoadFileToArray(RawFileData, *pngfile))
{
if (ImageWrapper.IsValid() && ImageWrapper->SetCompressed(RawFileData.GetData(), RawFileData.Num()))
{
TArray<uint8> UncompressedBGRA;
// bool GetRaw(const ERGBFormat InFormat, int32 InBitDepth, TArray<uint8>& OutRawData)
if (ImageWrapper->GetRaw(ERGBFormat::BGRA, 8, UncompressedBGRA))
{
return UTexture2D::CreateTransient(ImageWrapper->GetWidth(), ImageWrapper->GetHeight(), PF_B8G8R8A8);
}
}
}

return nullptr;
}
94 changes: 94 additions & 0 deletions Source/FicsItNetworks/Components/FINCommandPointMesh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#pragma once

#include "FGColoredInstanceMeshProxy.h"
#include "Engine.h"

#include "FINCommandPointMesh.generated.h"


UCLASS(Blueprintable, meta = (BlueprintSpawnableComponent))
class UFINCommandPointMesh : public UFGColoredInstanceMeshProxy
{
GENERATED_BODY()

public:
UFUNCTION(BlueprintCallable)
UTexture2D* LoadTextureFromFile(FString str);
};


USTRUCT(Blueprintable)
struct FFINCommandLabelReferences {
GENERATED_BODY()

FFINCommandLabelReferences(UObject* reference, UObject* textReference, int index) : Reference(reference), TextObjectReference(textReference), Index(index) {}
FFINCommandLabelReferences() : Reference(nullptr), TextObjectReference(nullptr), Index(0) {}

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
int Index;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
UObject* Reference;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
UObject* TextObjectReference;

};

USTRUCT(Blueprintable)
struct FFINCommandLabelData {
GENERATED_BODY()

FFINCommandLabelData() : ImagePath(""), Text(""), TextColor(0,0,0,1), Vertical(false){}
FFINCommandLabelData(FString imagePath, FString text, FLinearColor textColor, bool vertical) : ImagePath(imagePath), Text(text), TextColor(textColor), Vertical(vertical){}

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
FString ImagePath;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
bool Vertical;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
FString Text;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
FLinearColor TextColor;

};

USTRUCT(Blueprintable)
struct FFINCommandLabelStructure
{
GENERATED_BODY()

FFINCommandLabelStructure(UObject* reference, int index, FString path, bool vertical, bool doUpdate, bool doUpdateText, FString text, FLinearColor color) : reference(reference), path(path), index(index), vertical(vertical), doUpdate(doUpdate), doUpdateText(doUpdateText), text(text), textColor(color) {}
FFINCommandLabelStructure() : reference(0), path(""), index(0), vertical(false), doUpdate(false), doUpdateText(false), text(""), textColor(0,0,0, 1) {}

UPROPERTY(EditAnywhere, BlueprintReadWrite)
UObject* reference;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
UObject* textObjectReference;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
FString path;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
int index;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
bool vertical;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool doUpdate;

UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool doUpdateText;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
FString text;

UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame)
FLinearColor textColor;

};
10 changes: 6 additions & 4 deletions Source/FicsItNetworks/Components/FINModuleScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,18 @@ void AFINModuleScreen::Tick(float DeltaSeconds) {
}

void AFINModuleScreen::BindGPU(const FFINNetworkTrace& gpu) {
if (gpu.GetUnderlyingPtr().IsValid()) check(gpu->GetClass()->ImplementsInterface(UFINGPUInterface::StaticClass()))
if (IsValid(gpu.GetUnderlyingPtr())) check(gpu->GetClass()->ImplementsInterface(UFINGPUInterface::StaticClass()))
if (!(GPU == gpu)) {
FFINNetworkTrace oldGPU = GPU;
GPU = FFINNetworkTrace();
if (oldGPU.GetUnderlyingPtr().IsValid()) Cast<IFINGPUInterface>(oldGPU.GetUnderlyingPtr().Get())->BindScreen(FFINNetworkTrace());
if (IsValid(oldGPU.GetUnderlyingPtr())) Cast<IFINGPUInterface>(oldGPU.GetUnderlyingPtr())->BindScreen(FFINNetworkTrace());
GPU = gpu;
if (gpu.GetUnderlyingPtr().IsValid()) Cast<IFINGPUInterface>(gpu.GetUnderlyingPtr().Get())->BindScreen(gpu / this);
if (IsValid(gpu.GetUnderlyingPtr())) Cast<IFINGPUInterface>(gpu.GetUnderlyingPtr())->BindScreen(gpu / this);
GPUPtr = GPU.Get();
}
NetMulti_OnGPUUpdate();
GetWorldTimerManager().SetTimerForNextTick([this]() {
NetMulti_OnGPUUpdate();
});
}

FFINNetworkTrace AFINModuleScreen::GetGPU() const {
Expand Down
12 changes: 7 additions & 5 deletions Source/FicsItNetworks/Components/FINScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,21 @@ bool AFINScreen::ShouldSave_Implementation() const {
}

void AFINScreen::BindGPU(const FFINNetworkTrace& gpu) {
if (gpu.GetUnderlyingPtr().IsValid()) check(gpu->GetClass()->ImplementsInterface(UFINGPUInterface::StaticClass()))
if (IsValid(gpu.GetUnderlyingPtr())) check(gpu->GetClass()->ImplementsInterface(UFINGPUInterface::StaticClass()))
if (GPU != gpu) {
FFINNetworkTrace oldGPU = GPU;
GPU = FFINNetworkTrace();
if (oldGPU.GetUnderlyingPtr().IsValid()) Cast<IFINGPUInterface>(oldGPU.GetUnderlyingPtr().Get())->BindScreen(FFINNetworkTrace());
if (IsValid(oldGPU.GetUnderlyingPtr())) Cast<IFINGPUInterface>(oldGPU.GetUnderlyingPtr())->BindScreen(FFINNetworkTrace());
GPU = gpu;
if (gpu.GetUnderlyingPtr().IsValid()) {
Cast<IFINGPUInterface>(gpu.GetUnderlyingPtr().Get())->BindScreen(gpu / this);
if (IsValid(gpu.GetUnderlyingPtr())) {
Cast<IFINGPUInterface>(gpu.GetUnderlyingPtr())->BindScreen(gpu / this);
}
bGPUChanged = true;
GPUPtr = GPU.Get();
}
NetMulti_OnGPUUpdate();
GetWorldTimerManager().SetTimerForNextTick([this]() {
NetMulti_OnGPUUpdate();
});
}

FFINNetworkTrace AFINScreen::GetGPU() const {
Expand Down
Loading

0 comments on commit de147ad

Please sign in to comment.