Skip to content

Exposed Lua script properties through inspector#670

Merged
adriengivry merged 5 commits intomainfrom
feature/lua_inspector
Apr 9, 2026
Merged

Exposed Lua script properties through inspector#670
adriengivry merged 5 commits intomainfrom
feature/lua_inspector

Conversation

@adriengivry
Copy link
Copy Markdown
Member

@adriengivry adriengivry commented Apr 8, 2026

Description

This PR exposes all public (non _ prefixed) members in a script's lua table.

Properties are "locked" by default, so that when the default value changes in Lua, it's not overridden by the value set in the inspector.

Example script used:

---@class oui : Behaviour
local oui =
{
    name = "",
    foo = 0,
    yes = false,
    _private = "You cannot see me!"
}

function oui:OnStart()
    Debug.Log("Hello " .. self.name .. "!")
end

function oui:OnUpdate(deltaTime)
end

return oui

To-Do

  • Find a way to avoid serialization to override any future default value update in the script.

Related Issue(s)

Fixes #419

Review Guidance

Write here.

Screenshots/GIFs

image

Checklist

  • My code follows the project's code style guidelines
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes don't generate new warnings or errors

@adriengivry adriengivry self-assigned this Apr 8, 2026
@adriengivry adriengivry added the QoL Quality of Life : Something that can improve users productivity label Apr 8, 2026
@adriengivry adriengivry marked this pull request as ready for review April 8, 2026 23:30
@adriengivry adriengivry merged commit 4197675 into main Apr 9, 2026
6 checks passed
@adriengivry adriengivry deleted the feature/lua_inspector branch April 9, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QoL Quality of Life : Something that can improve users productivity

Development

Successfully merging this pull request may close these issues.

Expose Lua scripts table values in the inspector

1 participant