more nonsense

This commit is contained in:
wonkyhonky2024
2025-05-09 16:02:07 +01:00
parent 38df8d5e81
commit c7d7856634
11 changed files with 90 additions and 64 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: false
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

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

@ -1,18 +1,17 @@
// 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 "MagicFloatInput.h" #include "MagicFloatInput.h"
void UMagicFloatInput::HandleOnTextCommitted(const FText& inText, ETextCommit::Type inCommitMethod) { void UMagicFloatInput::HandleOnTextCommitted(
if(inText.IsEmptyOrWhitespace()) { FText const & inText,
if(sourceInput != nullptr) { ETextCommit::Type inCommitMethod
SetText(sourceInput->GetText()); ) {
if (inText.IsEmptyOrWhitespace()) {
if (sourceInput != nullptr) {
SetText(sourceInput->GetText());
} else {
auto x = FCString::Atof(*inText.ToString());
SetText(FText::FromString(FString::Printf(TEXT("%.7f"), x)));
} }
} }
else {
auto x = FCString::Atof(*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,11 @@
// 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()));
}
}

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

@ -2,20 +2,22 @@
#pragma once #pragma once
#include "CoreMinimal.h"
#include "Components/EditableTextBox.h" #include "Components/EditableTextBox.h"
#include "CoreMinimal.h"
#include "MagicFloatInput.generated.h" #include "MagicFloatInput.generated.h"
/** /**
* *
*/ */
UCLASS() UCLASS()
class MYPROJECT_API UMagicFloatInput : public UEditableTextBox class MYPROJECT_API UMagicFloatInput : public UEditableTextBox {
{ GENERATED_BODY()
GENERATED_BODY()
void HandleOnTextCommitted(
void HandleOnTextCommitted(const FText& Text, ETextCommit::Type CommitMethod) override; FText const & Text,
ETextCommit::Type CommitMethod
UPROPERTY(EditAnywhere) ) override;
UEditableTextBox * sourceInput;
UPROPERTY(EditAnywhere)
UEditableTextBox * sourceInput;
}; };

View File

@ -2,17 +2,16 @@
#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(FText const & inText) override;
void HandleOnTextChanged(const FText& inText) override;
}; };

View File

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