Upbolt / Hydroxide

Lua runtime introspection and network capturing tool for games on the Roblox engine.
The Unlicense
380 stars 155 forks source link

Settings system #3

Closed Kan18 closed 4 years ago

Kan18 commented 4 years ago

This adds a "settings" system to Hydroxide. The user can pass a table, as an argument, to the init.lua function. Currently, this table only lets the user configure if Hydroxide loads from the web and what branch it should load from, but the settings table is put in the "oh" global table so other files other than init.lua can access it. This also adds the second argument to loadstring() (chunk names) for easier debugging of Hydroxide. ^ example showing chunk names: https://gyazo.com/b7b8c64cd2ef1ca9cb34ddc4badfd059 Script used to test this:

local branch = "Kan18/Hydroxide/revision"

local function importAsset(asset)
    return loadstring(game:HttpGetAsync(
        "https://raw.githubusercontent.com/"..branch.."/"..asset..".lua"
    ))
end

importAsset("init")({
    branch = branch,
    web = true
})

importAsset("ui/main")()

Alternate version of above script that loads from disk:

loadfile("Hydroxide/init.lua")({
    web = false
})

loadfile("Hydroxide/ui/main.lua")()