Compare commits

...

7 Commits

Author SHA1 Message Date
8e1b4928a9 float trash 2025-05-09 22:20:42 +01:00
a28e6869f0 hng 2025-05-09 16:31:08 +01:00
4045ee4707 hng 2025-05-09 16:18:28 +01:00
c7d7856634 more nonsense 2025-05-09 16:02:07 +01:00
38df8d5e81 bla 2025-05-09 15:32:49 +01:00
d582b938fa fix colors in therac ui widget; start working on magical floats 2025-05-08 22:20:44 +01:00
c3b9b82935 tidy up and wrap 3d widget interaction 2025-05-08 21:25:16 +01:00
20 changed files with 189 additions and 54 deletions

25
.clang-format Normal file
View File

@ -0,0 +1,25 @@
---
BasedOnStyle: LLVM
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCompound: true
PadOperators: false
AlignEscapedNewlines: Left
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortEnumsOnASingleLine: false
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakConstructorInitializers: BeforeComma
InsertNewlineAtEOF: true
KeepEmptyLinesAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: true
PackConstructorInitializers: Never
PointerAlignment: Middle
QualifierAlignment: Right
ShortNamespaceLines: 0

13
.clang-tidy Normal file
View File

@ -0,0 +1,13 @@
---
Checks: "*
,-llvmlibc*
,-*readability-braces-around-statements
,-hicpp-braces-around-statements
,-readability-identifier-length
,-fuchsia-default-arguments*
,-*-non-private-member-variables-in-classes
,-fuchsia-trailing-return
,-altera-unroll-loops"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: file

3
.gitignore vendored
View File

@ -11,4 +11,5 @@ Saved
*.sln *.sln
*.suo *.suo
*.xcodeproj *.xcodeproj
*.xcworkspace *.xcworkspace
.cache

View File

@ -1,3 +1,4 @@
/.cache
/.git /.git
/.vscode /.vscode
/Content /Content

Binary file not shown.

Binary file not shown.

BIN
Content/LinacLab/MyMyUserWidget.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/LinacLab/vt100_Blueprint.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -3,4 +3,4 @@
#include "MyProject.h" #include "MyProject.h"
#include "Modules/ModuleManager.h" #include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, MyProject, "MyProject" ); IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, MyProject, "MyProject");

View File

@ -0,0 +1,18 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "MagicFloatInput.h"
void UMagicFloatInput::HandleOnTextCommitted(
FText const & inText,
ETextCommit::Type inCommitMethod
) {
double x = 0.0;
if (inText.IsEmptyOrWhitespace()) {
if (sourceInput != nullptr) {
x = FCString::Atod(*sourceInput->GetText().ToString());
}
} else
x = FCString::Atod(*inText.ToString());
SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
}

View File

@ -1,12 +1,10 @@
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "ModeInputTextBox.h" #include "ModeInputTextBox.h"
void UModeInputTextBox::HandleOnTextChanged(const FText& inText) { void UModeInputTextBox::HandleOnTextChanged(FText const & inText) {
auto & s = inText.ToString();
auto & s = inText.ToString(); auto lastChar = s.LeftChop(1);
auto lastChar = s.LeftChop(1); lastChar.ToUpperInline();
lastChar.ToUpperInline(); SetText(FText::FromString(lastChar));
SetText(FText::FromString(lastChar)); }
}

View File

@ -1,5 +1,4 @@
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "MyPlayerState.h" #include "MyPlayerState.h"

View File

@ -1,13 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "MyUserWidget.h" #include "MyUserWidget.h"
#include <MyPlayerState.h> #include <MyPlayerState.h>
void UMyUserWidget::NativeOnInitialized() { void UMyUserWidget::NativeOnInitialized() {
auto ps = StaticCast<AMyPlayerState *>(GetOwningPlayerState()); auto ps = StaticCast<AMyPlayerState *>(GetOwningPlayerState());
if (ps == nullptr) if (ps == nullptr)
return; return;
opIdTextBlock->SetText(FText::FromString(ps->GetPlayerName())); opIdTextBlock->SetText(FText::FromString(ps->GetPlayerName()));
UTextBlock * arcaneNumbers[9] = {
} URM_TextBlock,
MU_TextBlock,
Time_TextBlock,
GR_TextBlock,
CR_TextBlock,
ColX_TextBlock,
ColY_TextBlock,
WR_TextBlock,
AN_TextBlock
};
for (auto * n : arcaneNumbers) {
auto x = FCString::Atod(*n->GetText().ToString());
n->SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
}
}

View File

@ -1,12 +1,7 @@
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "TheracAdapter.h" #include "TheracAdapter.h"
TheracAdapter::TheracAdapter() TheracAdapter::TheracAdapter() {}
{
}
TheracAdapter::~TheracAdapter() TheracAdapter::~TheracAdapter() {}
{
}

View File

@ -0,0 +1,5 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "VerifierTextBlock.h"

View File

@ -0,0 +1,25 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Components/EditableTextBox.h"
#include "CoreMinimal.h"
#include <Components/TextBlock.h>
#include "MagicFloatInput.generated.h"
/**
*
*/
UCLASS()
class MYPROJECT_API UMagicFloatInput : public UEditableTextBox {
GENERATED_BODY()
void HandleOnTextCommitted(
FText const & Text,
ETextCommit::Type CommitMethod
) override;
UPROPERTY(EditAnywhere)
UTextBlock * sourceInput;
};

View File

@ -2,17 +2,17 @@
#pragma once #pragma once
#include "CoreMinimal.h"
#include "Components/EditableTextBox.h" #include "Components/EditableTextBox.h"
#include "CoreMinimal.h"
#include "ModeInputTextBox.generated.h" #include "ModeInputTextBox.generated.h"
/** /**
* *
*/ */
UCLASS() UCLASS()
class MYPROJECT_API UModeInputTextBox : public UEditableTextBox class MYPROJECT_API UModeInputTextBox : public UEditableTextBox {
{
GENERATED_BODY() GENERATED_BODY()
void HandleOnTextChanged(const FText& inText) override; void HandleOnTextChanged(FText const & inText) override;
}; };

View File

@ -7,11 +7,10 @@
#include "MyPlayerState.generated.h" #include "MyPlayerState.generated.h"
/** /**
* *
*/ */
UCLASS() UCLASS()
class MYPROJECT_API AMyPlayerState : public APlayerState class MYPROJECT_API AMyPlayerState : public APlayerState {
{
GENERATED_BODY() GENERATED_BODY()
}; };

View File

@ -2,22 +2,48 @@
#pragma once #pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h" #include "Blueprint/UserWidget.h"
#include "CoreMinimal.h"
#include <Components/TextBlock.h> #include <Components/TextBlock.h>
#include "MyUserWidget.generated.h" #include "MyUserWidget.generated.h"
/** /**
* *
*/ */
UCLASS() UCLASS()
class MYPROJECT_API UMyUserWidget : public UUserWidget class MYPROJECT_API UMyUserWidget : public UUserWidget {
{
GENERATED_BODY()
UPROPERTY(meta=(BindWidget)) GENERATED_BODY()
UTextBlock * opIdTextBlock;
UPROPERTY(meta = (BindWidget))
void NativeOnInitialized() override; UTextBlock * opIdTextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * URM_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * MU_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * Time_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * GR_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * CR_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * ColX_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * ColY_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * WR_TextBlock;
UPROPERTY(meta = (BindWidget))
UTextBlock * AN_TextBlock;
void NativeOnInitialized() override;
}; };

View File

@ -0,0 +1,17 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/TextBlock.h"
#include "VerifierTextBlock.generated.h"
/**
*
*/
UCLASS()
class MYPROJECT_API UVerifierTextBlock : public UTextBlock
{
GENERATED_BODY()
};