Script
What script are you submitting a feature request for?
Example :
local Toggles = {}
local Sliders = {}
local Textboxes = {}
local ConfigName = "Test"
local function saveConfig(cfgName)
if isfile(string.format("%s.json",cfgName)) then
local Config = game:GetService("HttpService"):JSONDecode(readfile(string.format("%s.json",cfgName)))
local Data = {}
table.foreach(Toggles,function(i,v)
Data[i] = v:GetState()
end)
table.foreach(Sliders,function(i,v)
Data[i] = v.Value
end)
table.foreach(Textboxes,function(i,v)
Data[i] = v:GetText()
end)
table.foreach(Data,function(x,y)
warn(x,y)
end)
writefile(string.format("%s.json",cfgName), game:GetService("HttpService"):JSONEncode(Data))
else
writefile(string.format("%s.json",cfgName), game:GetService("HttpService"):JSONEncode({}))
local Config = game:GetService("HttpService"):JSONDecode(readfile(string.format("%s.json",cfgName)))
local Data = {}
table.foreach(Toggles,function(i,v)
Data[i] = v:GetState()
end)
table.foreach(Sliders,function(i,v)
Data[i] = v.Value
end)
table.foreach(Textboxes,function(i,v)
Data[i] = v:GetText()
end)
table.foreach(Data,function(x,y)
warn(x,y)
end)
writefile(string.format("%s.json",cfgName), game:GetService("HttpService"):JSONEncode(Data))
end
end
local function loadConfig(cfgName)
if isfile(string.format("%s.json",cfgName)) then
local Config = game:GetService("HttpService"):JSONDecode(readfile(string.format("%s.json",cfgName)))
table.foreach(Config,function(i,v)
if typeof(v) == "boolean" then
Toggles[i]:SetState(v)
end
end)
end
end
Since its not added yet each time i want to create a toggle/textbox/slider i say
Text = "Text Box",
Callback = function(value)
print(value)
end,
Type = "Default",
ClearOnFocus = false
})
or
Text = "Slider",
Callback = function(value)
Sliders["Slider"].Value = value
print("Enabled:", value)
end,
Min = 0,
Max = 123789,
Def = 0
})```
or
```Toggles["Toggle"] = MainTab.Toggle({
Text = "Toggle",
Callback = function(value)
print("Enabled:", value)
end,
Enabled = true
})
I was unable to complete like loading the config for sliders or textboxes (because its not added as a method and rewriting the source would take too much work due to you probably updating it (because of the notify system))
Script
What script are you submitting a feature request for?
[Material Remake UI (Incredible UI you've created.)]
[Adding Config saving and loading]
Example :
Since its not added yet each time i want to create a toggle/textbox/slider i say
or
I was unable to complete like loading the config for sliders or textboxes (because its not added as a method and rewriting the source would take too much work due to you probably updating it (because of the notify system))