This plugin will only convert members that can be acessed and modified by regular context scripts
Since this just reads and casts properties, there will be a lot of redundant code that could be refactored. However, it does respect the default properties from Instance.new()
I already know how the Axes and Faces datatypes work, the issue is casting them back to a string that doesn’t become Axes.new(nil, nil, Enum.Axis.Z) or whatever
Even though the plugin itself generates redundant code, I’d still like to have my casting module output clean results.
There is an Enum called Enum.NormalId that you can use. Do something like this:
function toString(obj)
function choose(typeofaxis)
if typeofaxis == 'x' then
return "Enum.NormalId.Left, Enum.NormalId.Right"
elseif typeofaxis == 'y' then
return "Enum.NormalId.Top, Enum.NormalId.Bottom"
elseif typeofaxis == 'z' then
return "Enum.NormalId.Front, Enum.NormalId.Back"
end
end
local str = "Axes.new("
if obj['PROPERTYNAMETHATUSESAXES'].X then
str += choose('x') .. ","
end
if obj['PROPERTYNAMETHATUSESAXES'].Y then
str += choose('y') .. ","
end
if obj['PROPERTYNAMETHATUSESAXES'].Z then
str += choose('z')
end
if str:split("")[table.getn(str:split(""))] == "," then
str = str:gsub(".$", "")
end
return str .. ")"
end
-- Sorry for inconsistent use of quotes lol
If this is in reference to licensing concerns around the Fusion logo, name or brand assets, I’ve just added in a section on the Fusion website to address this
You’ve just made porting my guis to using Fusion literally 10 times faster, as I’ve recently took interest in Fusion since it just seemed interesting, I decided to thought about using Fusion in one of my games but converting the gui would be pain since I’m essentially recreating a gui except it’s now Luau code.