Giter Club home page Giter Club logo

guitoluaconverter's Introduction


Hi, I'm Lorenzo!, a passionate reverse engineer Full Stack Web Developer from Italy.

Languages and Tools:


guitoluaconverter's People

Contributors

hamtaro25565 avatar ik4os avatar spinnyspiwal avatar uniquadev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

guitoluaconverter's Issues

FontFace conversion problem and NumberSequenceKeypoint conversion failure

Hello, I am unable to figure out why FontFace is not converting properly and is causing me to have a meltdown when trying to patch this plugin.

I am converting my GUI to a Lua format but some fonts use the new format for font weight like semi-bold or extra-bold (https://create.roblox.com/docs/reference/engine/datatypes/Font) and it is not properly adding these properties and instead just commenting out the FontFace property and leaving incorrect formatting when running as a script.

-- G2L["12"]["FontFace"] = ;
G2L["12"]["Font"] = Enum.Font.Unknown; 

I have made an addition to the script which allows NumberSequenceKeypoint operate with UIGradient Transparency property field within core.lua, please see the code. If you feel it is good enough then you can push it to the plugin if you want.

-- transpile property to lua
local function TranspileValue(RawValue:any)
    local Value = '';
    local Type = typeof(RawValue);
    if Type == 'string' then
        Value = EncapsulateString(RawValue);
    elseif Type == 'number' or Type == 'boolean' or Type:match('^Enum') then
        Value = tostring(RawValue);
    -- %.3f format might be better
    elseif Type == 'Vector2' then
        Value = ('Vector2.new(%s, %s)'):format(
            RawValue.X, RawValue.Y
        );
    elseif Type == 'Vector3' then
        Value = ('Vector3.new(%s, %s, %s)'):format(
            RawValue.X, RawValue.Y, RawValue.Z
        );
    elseif Type == 'UDim2' then
        Value = ('UDim2.new(%s, %s, %s, %s)'):format(
            RawValue.X.Scale, RawValue.X.Offset,
            RawValue.Y.Scale, RawValue.Y.Offset
        );
    elseif Type == 'UDim' then
        Value = ('UDim.new(%s, %s)'):format(
            RawValue.Scale, RawValue.Offset
        );
    elseif Type == 'Rect' then
        Value = ('Rect.new(%s, %s, %s, %s)'):format(
            RawValue.Min.X, RawValue.Min.Y,
            RawValue.Max.X, RawValue.Max.Y
        );
    elseif Type == 'Color3' then
        -- convert rgb float value to decimal
        local R, G, B = math.ceil(RawValue.R * 255), math.ceil(RawValue.G * 255), math.ceil(RawValue.B * 255);
        Value = ('Color3.fromRGB(%s, %s, %s)'):format(
            R, G, B
        );
    elseif Type == "ColorSequence" then
        local Keypoints = '';
        for Idx, KeyPoint:ColorSequenceKeypoint in next, RawValue.Keypoints do
            Keypoints = Keypoints .. ('ColorSequenceKeypoint.new(%.3f, %s),'):format(
                KeyPoint.Time, TranspileValue(KeyPoint.Value)
            );
        end;
        -- remove last comma
        Keypoints = Keypoints:sub(1, -2);
		Value = ('ColorSequence.new{%s}'):format(Keypoints);


	elseif Type == "NumberSequence" then -- This will allow me to make UIGradients transparency keyframes work as intended
		-- Just stole code from above and adapted it lol
		local Keypoints = '';
		for Idx, KeyPoint:NumberSequenceKeypoint in next, RawValue.Keypoints do
			Keypoints = Keypoints .. ('NumberSequenceKeypoint.new(%.3f, %s),'):format(
				KeyPoint.Time, TranspileValue(KeyPoint.Value)
			);
		end;
		-- remove last comma
		Keypoints = Keypoints:sub(1, -2);
		Value = ('NumberSequence.new{%s}'):format(Keypoints);

	end
    return Value;
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.