Update config tab on ui library
This commit is contained in:
+14
-14
@@ -2238,7 +2238,7 @@
|
|||||||
ignore_key = options.ignore or false,
|
ignore_key = options.ignore or false,
|
||||||
|
|
||||||
key = options.key or nil,
|
key = options.key or nil,
|
||||||
mode = options.mode or "toggle",
|
mode = options.mode or "Toggle",
|
||||||
active = options.default or false,
|
active = options.default or false,
|
||||||
|
|
||||||
hold_instances = {},
|
hold_instances = {},
|
||||||
@@ -2435,7 +2435,7 @@
|
|||||||
cfg.key = input.key or "..."
|
cfg.key = input.key or "..."
|
||||||
|
|
||||||
cfg.mode = input.mode or "Toggle"
|
cfg.mode = input.mode or "Toggle"
|
||||||
cfg.set_mode(input.mode)
|
cfg.set_mode(cfg.mode)
|
||||||
|
|
||||||
if input.active then
|
if input.active then
|
||||||
cfg.active = input.active
|
cfg.active = input.active
|
||||||
@@ -2582,17 +2582,17 @@
|
|||||||
|
|
||||||
function library:init_config(window)
|
function library:init_config(window)
|
||||||
local textbox;
|
local textbox;
|
||||||
local main = window:tab({name = "Configs"})
|
local main = window:tab({name = "configs"})
|
||||||
local section = main:column({}):section({name = "Settings", size = 1, default = true})
|
local section = main:column({}):section({name = "settings", size = 1, default = true})
|
||||||
config_holder = section:dropdown({name = "Configs", options = {"Report", "This", "Error", "To", "Finobe"}, callback = function(option) if textbox then textbox.set(option) end end, flag = "config_name_list"}); library:update_config_list()
|
config_holder = section:dropdown({name = "configs", options = {"report", "this", "error", "to", "dev"}, callback = function(option) if textbox then textbox.set(option) end end, flag = "config_name_list"}); library:update_config_list()
|
||||||
textbox = section:textbox({name = "Config name:", flag = "config_name_text"})
|
textbox = section:textbox({name = "config name:", flag = "config_name_text"})
|
||||||
section:button({name = "Save", callback = function() writefile(library:config_path(flags["config_name_text"]), library:get_config()) library:update_config_list() end})
|
section:button({name = "save", callback = function() writefile(library:config_path(flags["config_name_text"]), library:get_config()) library:update_config_list() end})
|
||||||
section:button({name = "Load", callback = function() library:load_config(readfile(library:config_path(flags["config_name_text"]))) library:update_config_list() end})
|
section:button({name = "load", callback = function() library:load_config(readfile(library:config_path(flags["config_name_text"]))) library:update_config_list() end})
|
||||||
section:button({name = "Delete", callback = function() delfile(library:config_path(flags["config_name_text"])) library:update_config_list() end})
|
section:button({name = "delete", callback = function() delfile(library:config_path(flags["config_name_text"])) library:update_config_list() end})
|
||||||
|
|
||||||
local section = main:column({}):section({name = "Other", size = 1, default = true})
|
local section = main:column({}):section({name = "other", size = 1, default = true})
|
||||||
section:keybind({name = "Menu bind", callback = function(bool) window.toggle_menu(bool) end, default = true})
|
section:keybind({name = "menu bind", callback = function(bool) window.toggle_menu(bool) end, default = true})
|
||||||
section:colorpicker({name = "Gradient 1", callback = function(color)
|
section:colorpicker({name = "gradient 1", callback = function(color)
|
||||||
library:update_theme("1", color)
|
library:update_theme("1", color)
|
||||||
|
|
||||||
library.gradient.Color = rgbseq{
|
library.gradient.Color = rgbseq{
|
||||||
@@ -2607,7 +2607,7 @@
|
|||||||
rgbkey(1, themes.preset["3"]),
|
rgbkey(1, themes.preset["3"]),
|
||||||
};
|
};
|
||||||
end, color = themes.preset["1"]})
|
end, color = themes.preset["1"]})
|
||||||
section:colorpicker({name = "Gradient 2", callback = function(color)
|
section:colorpicker({name = "gradient 2", callback = function(color)
|
||||||
library:update_theme("2", color)
|
library:update_theme("2", color)
|
||||||
|
|
||||||
library.gradient.Color = rgbseq{
|
library.gradient.Color = rgbseq{
|
||||||
@@ -2622,7 +2622,7 @@
|
|||||||
rgbkey(1, themes.preset["3"]),
|
rgbkey(1, themes.preset["3"]),
|
||||||
};
|
};
|
||||||
end, color = themes.preset["2"]})
|
end, color = themes.preset["2"]})
|
||||||
section:colorpicker({name = "Gradient 3", callback = function(color)
|
section:colorpicker({name = "gradient 3", callback = function(color)
|
||||||
library:update_theme("3", color)
|
library:update_theme("3", color)
|
||||||
|
|
||||||
library.gradient.Color = rgbseq{
|
library.gradient.Color = rgbseq{
|
||||||
|
|||||||
Reference in New Issue
Block a user