feat(test): add real UE 5.8 RunLuaTests commandlet, Lua.RunTests command, and fix UnLua .d.ts math/UObject bugs
This commit is contained in:
1 parent
3dd61c32a9
commit
96e3f0d009
29 files changed
+1417
-134
No files matched your search
@@ -281,7 +281,7 @@ local function CreateMockTArray()
|
||||
local i = 0
|
||||
while i < #data do
|
||||
if data[i + 1] == item then
|
||||
return 0
|
||||
return i + 1
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
@@ -566,27 +566,47 @@ local function CreateMockFVector(x, y, z)
|
||||
end,
|
||||
Add = function(self, other)
|
||||
if type(other) == "number" then
|
||||
return CreateMockFVector(self.X + other, self.Y + other, self.Z + other)
|
||||
self.X = self.X + other
|
||||
self.Y = self.Y + other
|
||||
self.Z = self.Z + other
|
||||
else
|
||||
self.X = self.X + other.X
|
||||
self.Y = self.Y + other.Y
|
||||
self.Z = self.Z + other.Z
|
||||
end
|
||||
return CreateMockFVector(self.X + other.X, self.Y + other.Y, self.Z + other.Z)
|
||||
end,
|
||||
Sub = function(self, other)
|
||||
if type(other) == "number" then
|
||||
return CreateMockFVector(self.X - other, self.Y - other, self.Z - other)
|
||||
self.X = self.X - other
|
||||
self.Y = self.Y - other
|
||||
self.Z = self.Z - other
|
||||
else
|
||||
self.X = self.X - other.X
|
||||
self.Y = self.Y - other.Y
|
||||
self.Z = self.Z - other.Z
|
||||
end
|
||||
return CreateMockFVector(self.X - other.X, self.Y - other.Y, self.Z - other.Z)
|
||||
end,
|
||||
Mul = function(self, other)
|
||||
if type(other) == "number" then
|
||||
return CreateMockFVector(self.X * other, self.Y * other, self.Z * other)
|
||||
self.X = self.X * other
|
||||
self.Y = self.Y * other
|
||||
self.Z = self.Z * other
|
||||
else
|
||||
self.X = self.X * other.X
|
||||
self.Y = self.Y * other.Y
|
||||
self.Z = self.Z * other.Z
|
||||
end
|
||||
return CreateMockFVector(self.X * other.X, self.Y * other.Y, self.Z * other.Z)
|
||||
end,
|
||||
Div = function(self, other)
|
||||
if type(other) == "number" then
|
||||
return CreateMockFVector(self.X / other, self.Y / other, self.Z / other)
|
||||
self.X = self.X / other
|
||||
self.Y = self.Y / other
|
||||
self.Z = self.Z / other
|
||||
else
|
||||
self.X = self.X / other.X
|
||||
self.Y = self.Y / other.Y
|
||||
self.Z = self.Z / other.Z
|
||||
end
|
||||
return CreateMockFVector(self.X / other.X, self.Y / other.Y, self.Z / other.Z)
|
||||
end,
|
||||
Dot = function(self, other)
|
||||
return self.X * other.X + self.Y * other.Y + self.Z * other.Z
|
||||
@@ -880,8 +900,8 @@ function ____exports.InstallIfNeeded()
|
||||
Normal = CreateMockFVector(0, 0, 1)
|
||||
} end,
|
||||
FActorSpawnParameters = function() return {Name = "", bNoFail = false, SpawnCollisionHandlingOverride = 0} end,
|
||||
FWeakObjectPtr = function()
|
||||
local refObj = nil
|
||||
FWeakObjectPtr = function(initialObj)
|
||||
local refObj = initialObj
|
||||
return {
|
||||
Set = function(self, o)
|
||||
refObj = o
|
||||
@@ -1050,6 +1070,9 @@ function ____exports.InstallIfNeeded()
|
||||
hit.Distance = dist * 0.5
|
||||
hit.Location = CreateMockFVector((startVec.X + endVec.X) * 0.5, (startVec.Y + endVec.Y) * 0.5, (startVec.Z + endVec.Z) * 0.5)
|
||||
hit.ImpactPoint = hit.Location
|
||||
if outHit ~= nil then
|
||||
return bHit, nil
|
||||
end
|
||||
return bHit, hit
|
||||
end
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user