From 8d0f52bccb878355fcbbac09e0fa1748696f1293 Mon Sep 17 00:00:00 2001 From: Djalim Simaila Date: Sun, 19 Nov 2023 19:40:33 +0100 Subject: [PATCH] added journal to game, still needs fonts and navigation --- .editorconfig | 0 .vsconfig | 13 ++ Content/ThirdPerson/Input/IMC_Default.uasset | 4 +- Content/ToggleJournal.uasset | 3 + Content/part1--5/BP_JournalWidget.uasset | 3 + Content/part1--5/JournalWidget_BPP.uasset | 3 + .../characterBP/gunCharacter_BP.uasset | 4 +- Content/part1/partie1.umap | 4 +- SURREALISM.uproject | 11 ++ Source/SURREALISM.Target.cs | 16 +++ Source/SURREALISM/Item.cpp | 53 ++++++++ Source/SURREALISM/Item.h | 47 +++++++ Source/SURREALISM/JournalPage.cpp | 75 +++++++++++ Source/SURREALISM/JournalPage.h | 45 +++++++ Source/SURREALISM/JournalWidget.cpp | 118 ++++++++++++++++++ Source/SURREALISM/JournalWidget.h | 68 ++++++++++ Source/SURREALISM/MyActor.cpp | 27 ++++ Source/SURREALISM/MyActor.h | 26 ++++ Source/SURREALISM/Private/MyUserWidget.cpp | 5 + Source/SURREALISM/Public/MyUserWidget.h | 17 +++ Source/SURREALISM/SURREALISM.Build.cs | 23 ++++ Source/SURREALISM/SURREALISM.cpp | 6 + Source/SURREALISM/SURREALISM.h | 6 + Source/SURREALISM/utils_functions.cpp | 9 ++ Source/SURREALISM/utils_functions.h | 15 +++ Source/SURREALISMEditor.Target.cs | 15 +++ 26 files changed, 610 insertions(+), 6 deletions(-) create mode 100644 .editorconfig create mode 100644 .vsconfig create mode 100644 Content/ToggleJournal.uasset create mode 100644 Content/part1--5/BP_JournalWidget.uasset create mode 100644 Content/part1--5/JournalWidget_BPP.uasset create mode 100644 Source/SURREALISM.Target.cs create mode 100644 Source/SURREALISM/Item.cpp create mode 100644 Source/SURREALISM/Item.h create mode 100644 Source/SURREALISM/JournalPage.cpp create mode 100644 Source/SURREALISM/JournalPage.h create mode 100644 Source/SURREALISM/JournalWidget.cpp create mode 100644 Source/SURREALISM/JournalWidget.h create mode 100644 Source/SURREALISM/MyActor.cpp create mode 100644 Source/SURREALISM/MyActor.h create mode 100644 Source/SURREALISM/Private/MyUserWidget.cpp create mode 100644 Source/SURREALISM/Public/MyUserWidget.h create mode 100644 Source/SURREALISM/SURREALISM.Build.cs create mode 100644 Source/SURREALISM/SURREALISM.cpp create mode 100644 Source/SURREALISM/SURREALISM.h create mode 100644 Source/SURREALISM/utils_functions.cpp create mode 100644 Source/SURREALISM/utils_functions.h create mode 100644 Source/SURREALISMEditor.Target.cs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e69de29 diff --git a/.vsconfig b/.vsconfig new file mode 100644 index 0000000..1a9d718 --- /dev/null +++ b/.vsconfig @@ -0,0 +1,13 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.Net.Component.4.6.2.TargetingPack", + "Microsoft.VisualStudio.Component.VC.14.36.17.6.x86.x64", + "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + "Microsoft.VisualStudio.Component.Windows10SDK.22000", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.VisualStudio.Workload.NativeDesktop", + "Microsoft.VisualStudio.Workload.NativeGame" + ] +} diff --git a/Content/ThirdPerson/Input/IMC_Default.uasset b/Content/ThirdPerson/Input/IMC_Default.uasset index 37d151d..441d27b 100644 --- a/Content/ThirdPerson/Input/IMC_Default.uasset +++ b/Content/ThirdPerson/Input/IMC_Default.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d6824b71a77ce94cf35cf794ec6a93547bffaec16def121a0372098f80406a36 -size 17367 +oid sha256:3f136cccd965604250c6a34ff2650d64bf8502cefccb1b86339b02a0dd23cfb2 +size 19611 diff --git a/Content/ToggleJournal.uasset b/Content/ToggleJournal.uasset new file mode 100644 index 0000000..7e5a781 --- /dev/null +++ b/Content/ToggleJournal.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a80129bd42d5f82b21075bf3ffb609e41e70abc33cfac738f09a9c93a876eb52 +size 1332 diff --git a/Content/part1--5/BP_JournalWidget.uasset b/Content/part1--5/BP_JournalWidget.uasset new file mode 100644 index 0000000..57dcc70 --- /dev/null +++ b/Content/part1--5/BP_JournalWidget.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13cf95eb1cf1957ccbc593029645c6f1a2cf900cf6ad7e7f3e1ef101d44523ca +size 142142 diff --git a/Content/part1--5/JournalWidget_BPP.uasset b/Content/part1--5/JournalWidget_BPP.uasset new file mode 100644 index 0000000..ff7a706 --- /dev/null +++ b/Content/part1--5/JournalWidget_BPP.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3728ff503ec67aa0abc2264d6c5f59099fb8e293c7e12952ff5c19ad7b152087 +size 217753 diff --git a/Content/part1--5/characterBP/gunCharacter_BP.uasset b/Content/part1--5/characterBP/gunCharacter_BP.uasset index baede8c..a355ac8 100644 --- a/Content/part1--5/characterBP/gunCharacter_BP.uasset +++ b/Content/part1--5/characterBP/gunCharacter_BP.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21a5bf14cd905f1256fbdcd1c42a156859cc9550711f457974dcc241e37d4821 -size 543421 +oid sha256:1af9c3400c6668100654742329cb8bf5e0f37d187eb3e44d2122c8fe76739a8f +size 594785 diff --git a/Content/part1/partie1.umap b/Content/part1/partie1.umap index cc5f113..394b3a6 100644 --- a/Content/part1/partie1.umap +++ b/Content/part1/partie1.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f0016627c66d3aa94c6a40aa7ae9bb719c64e3b1fedfb68c1c55429d18131558 -size 290477 +oid sha256:c02a8980300390cf8b9dd0a83e9300c04c6f3b3cb7e9e4962a3139d0988343ae +size 292211 diff --git a/SURREALISM.uproject b/SURREALISM.uproject index 76b176b..b43143b 100644 --- a/SURREALISM.uproject +++ b/SURREALISM.uproject @@ -3,6 +3,17 @@ "EngineAssociation": "5.3", "Category": "", "Description": "", + "Modules": [ + { + "Name": "SURREALISM", + "Type": "Runtime", + "LoadingPhase": "Default", + "AdditionalDependencies": [ + "Engine", + "UMG" + ] + } + ], "Plugins": [ { "Name": "ModelingToolsEditorMode", diff --git a/Source/SURREALISM.Target.cs b/Source/SURREALISM.Target.cs new file mode 100644 index 0000000..ad6e315 --- /dev/null +++ b/Source/SURREALISM.Target.cs @@ -0,0 +1,16 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class SURREALISMTarget : TargetRules +{ + public SURREALISMTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + DefaultBuildSettings = BuildSettingsVersion.V4; + IncludeOrderVersion = EngineIncludeOrderVersion.Latest; + + ExtraModuleNames.AddRange( new string[] { "SURREALISM" } ); + } +} diff --git a/Source/SURREALISM/Item.cpp b/Source/SURREALISM/Item.cpp new file mode 100644 index 0000000..4628859 --- /dev/null +++ b/Source/SURREALISM/Item.cpp @@ -0,0 +1,53 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "Item.h" +#include "JournalWidget.h" +#include "Kismet/GameplayStatics.h" + + +// Sets default values +AItem::AItem() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = false; + +} + +// Called when the game starts or when spawned +void AItem::BeginPlay() +{ + Super::BeginPlay(); +} + +// Called every frame +void AItem::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); +} + +FString AItem::get_item_name(){ + return item_name; +} + +FString AItem::get_item_description(){ + return item_description; +} + +void AItem::set_item_name(FString new_name){ + item_name = new_name; +} + +void AItem::set_item_description(FString new_description){ + item_description = new_description; +} + +void AItem::send_item_to_journal(){ + TArray FoundActors; + UGameplayStatics::GetAllActorsOfClass(GetWorld(), UJournalWidget::StaticClass(), FoundActors); + if (FoundActors.Num() > 0){ + UJournalWidget* journal_widget = Cast(FoundActors[0]); + journal_widget->add_to_journal(item_name, item_description); + } + +} \ No newline at end of file diff --git a/Source/SURREALISM/Item.h b/Source/SURREALISM/Item.h new file mode 100644 index 0000000..eb91828 --- /dev/null +++ b/Source/SURREALISM/Item.h @@ -0,0 +1,47 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "Item.generated.h" + +UCLASS(Blueprintable) +class SURREALISM_API AItem : public AActor +{ + GENERATED_BODY() + +public: + // Sets default values for this actor's properties + AItem(); + +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void Tick(float DeltaTime) override; + + UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Item") + FString item_name = "Item name"; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Item") + FString item_description = "Item description"; + + UFUNCTION(BlueprintCallable,CallInEditor , Category = "Item") + FString get_item_name(); + + UFUNCTION(BlueprintCallable,CallInEditor, Category = "Item") + FString get_item_description(); + + UFUNCTION(BlueprintCallable,CallInEditor, Category = "Item") + void set_item_name(FString new_name); + + UFUNCTION(BlueprintCallable,CallInEditor, Category = "Item") + void set_item_description(FString new_description); + + UFUNCTION(BlueprintCallable,CallInEditor, Category = "Item") + void send_item_to_journal(); + +}; diff --git a/Source/SURREALISM/JournalPage.cpp b/Source/SURREALISM/JournalPage.cpp new file mode 100644 index 0000000..e27e831 --- /dev/null +++ b/Source/SURREALISM/JournalPage.cpp @@ -0,0 +1,75 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "JournalPage.h" +#include "utils_functions.h" + +UJournalPage::UJournalPage() +{ + max_page_entries = 10; + page_entries = TArray(); + +} + +void UJournalPage::add_entry(FString entry_name, FString entry_description) +{ + if (page_entries.Num() < max_page_entries) + { + FJournalEntry entry; + entry.entry_name = entry_name; + entry.entry_description = entry_description; + page_entries.Add(entry); + } + return; +} + +void UJournalPage::remove_entry(FString entry_name) +{ + for (int i = 0; i < page_entries.Num(); i++) + { + if (page_entries[i].entry_name == entry_name) + { + page_entries.RemoveAt(i); + return; + } + + } + return; +} + +TArray UJournalPage::get_all_entries_names() +{ + TArray entries_names; + for (const auto& entry : page_entries) + { + entries_names.Add(entry.entry_name); + } + return entries_names; +} + +TArray UJournalPage::get_all_entries_descriptions() +{ + TArray entries_descriptions; + for (const auto& entry : page_entries) + { + entries_descriptions.Add(entry.entry_description); + } + return entries_descriptions; +} + +FString UJournalPage::get_entry_description(FString entry_name) +{ + for (const auto& entry : page_entries) + { + if (entry.entry_name == entry_name) + { + return entry.entry_description; + } + } + return FString("No description found"); +} + +int UJournalPage::get_number_of_entries() +{ + return page_entries.Num(); +} \ No newline at end of file diff --git a/Source/SURREALISM/JournalPage.h b/Source/SURREALISM/JournalPage.h new file mode 100644 index 0000000..0b55520 --- /dev/null +++ b/Source/SURREALISM/JournalPage.h @@ -0,0 +1,45 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "JournalPage.generated.h" + +USTRUCT(BlueprintType) +struct FJournalEntry +{ + GENERATED_BODY() + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + FString entry_name; + FString entry_description; +}; + +/** + * + */ +UCLASS() +class SURREALISM_API UJournalPage : public UObject +{ + GENERATED_BODY() +public: + UJournalPage(); + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + TArray page_entries; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + int32 max_page_entries; + + void add_entry(FString entry_name, FString entry_description); + void remove_entry(FString entry_name); + + TArray get_all_entries_names(); + TArray get_all_entries_descriptions(); + int32 get_number_of_entries(); + + FString get_entry_description(FString entry_name); + + + +}; diff --git a/Source/SURREALISM/JournalWidget.cpp b/Source/SURREALISM/JournalWidget.cpp new file mode 100644 index 0000000..4af64ca --- /dev/null +++ b/Source/SURREALISM/JournalWidget.cpp @@ -0,0 +1,118 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "JournalWidget.h" +#include "JournalPage.h" +#include "utils_functions.h" + + +void UJournalWidget::NativeConstruct() +{ + Super::NativeConstruct(); + //UJournalPage* page = NewObject(); + //journal_pages.Add(page); + //current_number_of_pages = journal_pages.Num(); + //current_page_number = 0; +} + + +void UJournalWidget::next_page() +{ + if (current_page_number + 1 < max_pages) + { + current_page_number++; + } +} + +void UJournalWidget::previous_page() +{ + if (current_page_number - 1 >= 0) + { + current_page_number--; + } +} + +void UJournalWidget::go_to_page(int page_number) +{ + current_page_number = page_number; +} + +void UJournalWidget::remove_page(int page_number) +{ + if (page_number < current_number_of_pages) + { + journal_pages.RemoveAt(page_number); + current_number_of_pages = journal_pages.Num(); + } +} + +TArray UJournalWidget::get_current_page_entries_names() +{ + if (current_page_number < current_number_of_pages) + { + return journal_pages[current_page_number]->get_all_entries_names(); + } + return TArray(); +} + +FString UJournalWidget::get_entry_description(FString entry_name) +{ + if (current_page_number < current_number_of_pages) + { + return journal_pages[current_page_number]->get_entry_description(entry_name); + } + return FString(); +} + +void UJournalWidget::clear_journal() +{ + journal_pages.Empty(); + UJournalPage page = UJournalPage(); + journal_pages.Add(&page); + current_number_of_pages = journal_pages.Num(); +} + +void UJournalWidget::add_to_journal(FString item_name, FString item_description) +{ + for (int i = 0; i < current_number_of_pages; i++) + { + if (journal_pages[i]->get_number_of_entries() < journal_pages[i]->max_page_entries) + { + //utils_functions::debug_print("added item to page"); + journal_pages[i]->add_entry(item_name, item_description); + return; + } + } + UJournalPage* page = NewObject(); + page->add_entry(item_name, item_description); + journal_pages.Add(page); + current_number_of_pages = journal_pages.Num(); + return; +} + +void UJournalWidget::print_current_page() +{ + if (current_page_number < current_number_of_pages) + { + for (FString entry_name : journal_pages[current_page_number]->get_all_entries_names()) + { + utils_functions::debug_print(TCHAR_TO_ANSI(*entry_name)); + FString entry_description = journal_pages[current_page_number]->get_entry_description(entry_name); + utils_functions::debug_print(TCHAR_TO_ANSI(*entry_description)); + } + } + return; +} + +int UJournalWidget::add_page() +{ + UJournalPage* page = NewObject(); + journal_pages.Add(page); + current_number_of_pages = journal_pages.Num(); + return current_number_of_pages; +} + +int UJournalWidget::get_current_page_number() +{ + return current_page_number; +} \ No newline at end of file diff --git a/Source/SURREALISM/JournalWidget.h b/Source/SURREALISM/JournalWidget.h new file mode 100644 index 0000000..b6484b8 --- /dev/null +++ b/Source/SURREALISM/JournalWidget.h @@ -0,0 +1,68 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "JournalPage.h" +#include "JournalWidget.generated.h" + + +/** + * + */ +UCLASS(Blueprintable) +class SURREALISM_API UJournalWidget : public UUserWidget +{ + GENERATED_BODY() + + public: + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + TArray journal_pages; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + int max_pages = 10; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + int current_number_of_pages = 0; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Journal") + int current_page_number = 0; + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void next_page(); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void previous_page(); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void go_to_page(int page_number); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void remove_page(int page_number); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + TArray get_current_page_entries_names(); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + FString get_entry_description(FString entry_name); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + int add_page(); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void add_to_journal(FString item_name, FString item_description); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void clear_journal(); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + void print_current_page(); + + UFUNCTION(BlueprintCallable, CallInEditor, Category = "Journal") + int get_current_page_number(); + + virtual void NativeConstruct() override; + +}; diff --git a/Source/SURREALISM/MyActor.cpp b/Source/SURREALISM/MyActor.cpp new file mode 100644 index 0000000..d4a22d8 --- /dev/null +++ b/Source/SURREALISM/MyActor.cpp @@ -0,0 +1,27 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "MyActor.h" + +// Sets default values +AMyActor::AMyActor() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = true; + +} + +// Called when the game starts or when spawned +void AMyActor::BeginPlay() +{ + Super::BeginPlay(); + +} + +// Called every frame +void AMyActor::Tick(float DeltaTime) +{ + Super::Tick(DeltaTime); + +} + diff --git a/Source/SURREALISM/MyActor.h b/Source/SURREALISM/MyActor.h new file mode 100644 index 0000000..9730bf3 --- /dev/null +++ b/Source/SURREALISM/MyActor.h @@ -0,0 +1,26 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" +#include "MyActor.generated.h" + +UCLASS() +class SURREALISM_API AMyActor : public AActor +{ + GENERATED_BODY() + +public: + // Sets default values for this actor's properties + AMyActor(); + +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void Tick(float DeltaTime) override; + +}; diff --git a/Source/SURREALISM/Private/MyUserWidget.cpp b/Source/SURREALISM/Private/MyUserWidget.cpp new file mode 100644 index 0000000..74371b9 --- /dev/null +++ b/Source/SURREALISM/Private/MyUserWidget.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "MyUserWidget.h" + diff --git a/Source/SURREALISM/Public/MyUserWidget.h b/Source/SURREALISM/Public/MyUserWidget.h new file mode 100644 index 0000000..75e5a13 --- /dev/null +++ b/Source/SURREALISM/Public/MyUserWidget.h @@ -0,0 +1,17 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Blueprint/UserWidget.h" +#include "MyUserWidget.generated.h" + +/** + * + */ +UCLASS() +class SURREALISM_API UMyUserWidget : public UUserWidget +{ + GENERATED_BODY() + +}; diff --git a/Source/SURREALISM/SURREALISM.Build.cs b/Source/SURREALISM/SURREALISM.Build.cs new file mode 100644 index 0000000..f8bf7b5 --- /dev/null +++ b/Source/SURREALISM/SURREALISM.Build.cs @@ -0,0 +1,23 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; + +public class SURREALISM : ModuleRules +{ + public SURREALISM(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); + + PrivateDependencyModuleNames.AddRange(new string[] { }); + + // Uncomment if you are using Slate UI + // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); + + // Uncomment if you are using online features + // PrivateDependencyModuleNames.Add("OnlineSubsystem"); + + // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true + } +} diff --git a/Source/SURREALISM/SURREALISM.cpp b/Source/SURREALISM/SURREALISM.cpp new file mode 100644 index 0000000..94004f1 --- /dev/null +++ b/Source/SURREALISM/SURREALISM.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "SURREALISM.h" +#include "Modules/ModuleManager.h" + +IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, SURREALISM, "SURREALISM" ); diff --git a/Source/SURREALISM/SURREALISM.h b/Source/SURREALISM/SURREALISM.h new file mode 100644 index 0000000..90aad9e --- /dev/null +++ b/Source/SURREALISM/SURREALISM.h @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + diff --git a/Source/SURREALISM/utils_functions.cpp b/Source/SURREALISM/utils_functions.cpp new file mode 100644 index 0000000..b6e46a9 --- /dev/null +++ b/Source/SURREALISM/utils_functions.cpp @@ -0,0 +1,9 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "utils_functions.h" + +void utils_functions::debug_print(const char* str, float duration) +{ + if (GEngine)GEngine->AddOnScreenDebugMessage(-1, duration, FColor::Red, FString(str)); +} \ No newline at end of file diff --git a/Source/SURREALISM/utils_functions.h b/Source/SURREALISM/utils_functions.h new file mode 100644 index 0000000..8c02fdc --- /dev/null +++ b/Source/SURREALISM/utils_functions.h @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" + +/** + * + */ +class SURREALISM_API utils_functions +{ +public: + +static void debug_print(const char*, float duration = 5.f); +}; diff --git a/Source/SURREALISMEditor.Target.cs b/Source/SURREALISMEditor.Target.cs new file mode 100644 index 0000000..0f8c3a6 --- /dev/null +++ b/Source/SURREALISMEditor.Target.cs @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class SURREALISMEditorTarget : TargetRules +{ + public SURREALISMEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + DefaultBuildSettings = BuildSettingsVersion.V4; + + ExtraModuleNames.AddRange( new string[] { "SURREALISM" } ); + } +}