diff --git a/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset b/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset index 273671b..db489ef 100644 --- a/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset +++ b/Content/FirstPerson/Blueprints/BP_FirstPersonCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c570471499a3d269513bf5ac95944005b6a08f8694450a2021128a499e29d7c6 -size 103477 +oid sha256:566fff4acdb242779a20254ceb0328059280986a4c3aa3769ca6c16099a7a5af +size 131933 diff --git a/Content/FirstPerson/Blueprints/BP_FirstPersonGameMode.uasset b/Content/FirstPerson/Blueprints/BP_FirstPersonGameMode.uasset index 58cafed..d58baa4 100644 --- a/Content/FirstPerson/Blueprints/BP_FirstPersonGameMode.uasset +++ b/Content/FirstPerson/Blueprints/BP_FirstPersonGameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5eb303af596f72665f16645cbcfa9de29ae7c7f282adf8a473e09897884dcd39 -size 15682 +oid sha256:166ea24087ac6be27e6a27ee29d71b0c48a04a2399590b3e74e01cb804f65fc3 +size 15958 diff --git a/Content/LinacLab/MyMyUserWidget.uasset b/Content/LinacLab/MyMyUserWidget.uasset index 3b4338d..06d6a00 100644 --- a/Content/LinacLab/MyMyUserWidget.uasset +++ b/Content/LinacLab/MyMyUserWidget.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e929e1f2ea2224dfae1c86c94be15ebdf4c70d42ec78f3598b8a66b76f636c1 -size 63832 +oid sha256:0fae9c691d1cf5a5ef965a6edf951f613d51b607b1701b4261f37915f15fc588 +size 75490 diff --git a/Content/LinacLab/vt100_Blueprint.uasset b/Content/LinacLab/vt100_Blueprint.uasset index bf3e850..073c0a6 100644 --- a/Content/LinacLab/vt100_Blueprint.uasset +++ b/Content/LinacLab/vt100_Blueprint.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7047af39513bbe41f034d152e902d20fcdfd961871b72f3952327766a3a48cb0 -size 32033 +oid sha256:f79fe1a96b4caf366685f54b2d022bc4800634ff8c32df8795cf5c30139cc733 +size 32411 diff --git a/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/4/WJ/ZO5YPDSQ83WFH5A5AA6TXE.uasset b/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/4/WJ/ZO5YPDSQ83WFH5A5AA6TXE.uasset index 5ce9667..e020906 100644 --- a/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/4/WJ/ZO5YPDSQ83WFH5A5AA6TXE.uasset +++ b/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/4/WJ/ZO5YPDSQ83WFH5A5AA6TXE.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8279fcf21126d7adde4925ecb597c33f0c25e008b61e5572225f1993e1c7e4b3 -size 5051 +oid sha256:962fb4e4a682f17d8ec636350d0f7b5a04b6523d4922ccb0d382424a8d50a15f +size 5401 diff --git a/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/5/LP/XAMT9TY97Y43GQC2BE17H1.uasset b/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/5/LP/XAMT9TY97Y43GQC2BE17H1.uasset new file mode 100644 index 0000000..0acd24e --- /dev/null +++ b/Content/__ExternalActors__/FirstPerson/Maps/FirstPersonMap/5/LP/XAMT9TY97Y43GQC2BE17H1.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ef114bed02e43a3ad139e57cda1fe824ba9d26e02ea43dbe77e4e6bd0be4bc +size 3745 diff --git a/MyProject.uproject b/MyProject.uproject index ed5a51b..e2d0733 100644 --- a/MyProject.uproject +++ b/MyProject.uproject @@ -9,7 +9,8 @@ "Type": "Runtime", "LoadingPhase": "Default", "AdditionalDependencies": [ - "UMG" + "UMG", + "Engine" ] } ], diff --git a/Source/MyProject/Private/ModeInputTextBox.cpp b/Source/MyProject/Private/ModeInputTextBox.cpp new file mode 100644 index 0000000..6566108 --- /dev/null +++ b/Source/MyProject/Private/ModeInputTextBox.cpp @@ -0,0 +1,12 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "ModeInputTextBox.h" + +void UModeInputTextBox::HandleOnTextChanged(const FText& inText) { + + auto & s = inText.ToString(); + auto lastChar = s.LeftChop(1); + lastChar.ToUpperInline(); + SetText(FText::FromString(lastChar)); +} \ No newline at end of file diff --git a/Source/MyProject/Private/MyPlayerState.cpp b/Source/MyProject/Private/MyPlayerState.cpp new file mode 100644 index 0000000..00bda13 --- /dev/null +++ b/Source/MyProject/Private/MyPlayerState.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "MyPlayerState.h" + diff --git a/Source/MyProject/Private/MyUserWidget.cpp b/Source/MyProject/Private/MyUserWidget.cpp index c8a2c9c..a6ae046 100644 --- a/Source/MyProject/Private/MyUserWidget.cpp +++ b/Source/MyProject/Private/MyUserWidget.cpp @@ -2,8 +2,12 @@ #include "MyUserWidget.h" +#include void UMyUserWidget::NativeOnInitialized() { + auto ps = StaticCast(GetOwningPlayerState()); + if (ps == nullptr) + return; + opIdTextBlock->SetText(FText::FromString(ps->GetPlayerName())); - OpIdTextBlock->SetText(FText::FromString("testo6667")); } \ No newline at end of file diff --git a/Source/MyProject/Public/ModeInputTextBox.h b/Source/MyProject/Public/ModeInputTextBox.h new file mode 100644 index 0000000..458e75e --- /dev/null +++ b/Source/MyProject/Public/ModeInputTextBox.h @@ -0,0 +1,18 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "Components/EditableTextBox.h" +#include "ModeInputTextBox.generated.h" + +/** + * + */ +UCLASS() +class MYPROJECT_API UModeInputTextBox : public UEditableTextBox +{ + GENERATED_BODY() + + void HandleOnTextChanged(const FText& inText) override; +}; diff --git a/Source/MyProject/Public/MyPlayerState.h b/Source/MyProject/Public/MyPlayerState.h new file mode 100644 index 0000000..750e515 --- /dev/null +++ b/Source/MyProject/Public/MyPlayerState.h @@ -0,0 +1,17 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/PlayerState.h" +#include "MyPlayerState.generated.h" + +/** + * + */ +UCLASS() +class MYPROJECT_API AMyPlayerState : public APlayerState +{ + GENERATED_BODY() + +}; diff --git a/Source/MyProject/Public/MyUserWidget.h b/Source/MyProject/Public/MyUserWidget.h index 6ee8229..aa5d37f 100644 --- a/Source/MyProject/Public/MyUserWidget.h +++ b/Source/MyProject/Public/MyUserWidget.h @@ -17,6 +17,7 @@ class MYPROJECT_API UMyUserWidget : public UUserWidget GENERATED_BODY() UPROPERTY(meta=(BindWidget)) - UTextBlock * OpIdTextBlock; + UTextBlock * opIdTextBlock; + void NativeOnInitialized() override; };