include ../unreal/prelude
import ../codegen/[gencppclass, models, ueemit]
# import ../unreal/bindings/[slate,slatecore, engine]
import std/[macros, sequtils, strutils, typetraits]
[x] Accept one parameter simple (bool)
[x] Accept one parameter pointer (no const)
[x] Accept multiple paramteres (only need testing)
[x] Const functions with return types
[x] Review super for the scenarios above
[x] Do the nim type maping (float->double float32->float etc)
[] return const ? (is there any function that needs it?)
[ ] multiple fields with the same type
[-] Skip vtable update for now (almost there)
[x] When adding a vfunction should reinstance the Actor
[x] Move into the gamedll (just import this actor from there)
[x] Generics params arity of one
[ ] Generics params arity of two (ie tmap)
[] Generic params arity + 1
[ ] When removing a function there is a linker issue for the already compiled.
- [ ] Detect the functions that change between compilations
- [ ] Detect all the files that uses the header and remove them so they get recompiled.
[ ] Investigate why tick doesnt work in native functions
uClass ANimBeginPlayOverrideActor of AActor:
(Blueprintable, BlueprintType)
updateVTableStatic[ANimBeginPlayOverrideActor](self.getClass())
UE_Warn "Native BeginPlay test 2"
proc postDuplicate(b : bool) =
UE_Warn "post duplicated called update !"
proc preEditChange(p : FPropertyPtr) : void =
UE_Warn "PreEditChange (9) " & p.getName()
UE_Warn "PostLoad called once"
proc isListedInSceneOutliner() : bool {. constcpp .} =
UE_Log "IsListedInSceneOutliner called in the parent. Reinstanced?"
proc getLifeSpan() : float32 {. constcpp .} =
UE_Log "GetLifeSpan called in the parent" & $self.super()
#virtual void PostRename( UObject* OldOuter, const FName OldName ) override;
proc postRename(oldOuter : UObjectPtr, oldName {.constcpp.} : FName) =
self.super(oldOuter, oldName)
UE_Warn "PostRename called !"
# virtual bool CanEditChange(const FProperty* InProperty) const;
proc canEditChange(inProperty {. constcpp .} : FPropertyPtr) : bool {. constcpp .} =
# UE_Log "CanEditChange called in the parent updated 1"
# virtual bool EditorCanAttachTo(const AActor* InParent, FText& OutReason) const;
proc editorCanAttachTo(inParent {. constcpp .} : AActorPtr, outReason : var FText) : bool {. constcpp .} =
UE_Log "EditorCanAttachTo called in the parent"
self.super(inParent, outReason)
# virtual void EditorApplyMirror(const FVector& MirrorScale, const FVector& PivotLocation);
proc editorApplyMirror(mirrorScale {. constcpp .} : var FVector, pivotLocation {. constcpp .} : var FVector) =
self.super(mirrorScale, pivotLocation)
UE_Warn "EditorApplyMirror called !"
# virtual void GetLifetimeReplicatedProps( TArray< class FLifetimeProperty > & OutLifetimeProps ) const;
proc getLifetimeReplicatedProps(outLifetimeProps : var TArray[FLifetimeProperty]) {.constcpp.} =
self.super(outLifetimeProps)
UE_Warn "GetLifetimeReplicatedProps called !"
proc getCustomIconName() : FName {. constcpp .} =
# UE_Log "GetCustomIconName called in the parent"
uClass ANimBeginPlayOverrideActorChild of ANimBeginPlayOverrideActor:
(Blueprintable, BlueprintType)
primaryActorTick.bCanEverTick = true
primaryActorTick.bStartWithTickEnabled = true;
UE_Warn "Native BeginPlay called in the child!"
proc isListedInSceneOutliner() : bool {. constcpp .} =
UE_Log "IsListedInSceneOutliner called in the child"
proc canEditChange(inProperty {. constcpp .} : FPropertyPtr) : bool {. constcpp .} =
UE_Log "CanEditChange called in the child updated 1"