Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve ConfigValue([value]) to support lua_type(bool, string, number) #372

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

shewer
Copy link
Contributor

@shewer shewer commented Nov 1, 2024

便於 ConfigValue(lua_datatype) 初使化
ConfigValue([nil]).value = ""
ConfigValue([table| userdata]).value = "" with LOG(WARNING)
ConfigValue(true).value = "true"
CanfigValue([number|string]).value = 等同 tostring(value)

[0][./lua/selector.lua:33] → ConfigValue("aoeuao").value
"aoeuao"
[0][./lua/selector.lua:33] → ConfigValue(2).value
"2"
[0][./lua/selector.lua:33] → ConfigValue(2.33).value
"2.33"
[0][./lua/selector.lua:33] → ConfigValue(false).value
"false"
[0][./lua/selector.lua:33] → ConfigValue(true).value
"true"
[0][./lua/selector.lua:33] → ConfigValue(nil).value
""
[0][./lua/selector.lua:33] → ConfigValue().value
""
[0][./lua/selector.lua:33] → ConfigValue({}).value
W20241102 02:28:15.876928 129013982039616 types.cc:965] args #1 type error: table
""

@hchunhui hchunhui merged commit b210d0c into hchunhui:master Nov 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants