mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 22:07:34 +00:00
Fix: cannot set config to false
This commit is contained in:
parent
f65141800f
commit
3a2ee67a39
|
@ -86,7 +86,7 @@ function gmInte.openConfigMenu(data)
|
||||||
["description"] = gmInte.getTranslation("admin.maintenance_description", "Activate or deactivate maintenance mode."),
|
["description"] = gmInte.getTranslation("admin.maintenance_description", "Activate or deactivate maintenance mode."),
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
["value"] = function(setting, value) return value end,
|
["value"] = function(setting, value) return value end,
|
||||||
["onEdit"] = function(setting, value) saveConfig(setting, gmInte.getTranslation("admin.enabled", "Enabled") && true || false) end,
|
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||||
["category"] = gmInte.getTranslation("admin.main", "Main")
|
["category"] = gmInte.getTranslation("admin.main", "Main")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -114,7 +114,7 @@ function gmInte.openConfigMenu(data)
|
||||||
["description"] = gmInte.getTranslation("admin.filter_on_ban_description", "Block players banned on the discord server."),
|
["description"] = gmInte.getTranslation("admin.filter_on_ban_description", "Block players banned on the discord server."),
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
["value"] = function(setting, value) return value end,
|
["value"] = function(setting, value) return value end,
|
||||||
["onEdit"] = function(setting, value) saveConfig(setting, gmInte.getTranslation("admin.enabled", "Enabled") && true || false) end,
|
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||||
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
["category"] = gmInte.getTranslation("admin.trust_safety", "Trust & Safety")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ function gmInte.openConfigMenu(data)
|
||||||
["description"] = gmInte.getTranslation("admin.force_player_link_description", "Force player verification."),
|
["description"] = gmInte.getTranslation("admin.force_player_link_description", "Force player verification."),
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
["value"] = function(setting, value) return value end,
|
["value"] = function(setting, value) return value end,
|
||||||
["onEdit"] = function(setting, value) saveConfig(setting, gmInte.getTranslation("admin.enabled", "Enabled") && true || false) end,
|
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||||
["category"] = gmInte.getTranslation("admin.main", "Main")
|
["category"] = gmInte.getTranslation("admin.main", "Main")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -143,7 +143,7 @@ function gmInte.openConfigMenu(data)
|
||||||
["type"] = "checkbox",
|
["type"] = "checkbox",
|
||||||
["value"] = function(setting, value) return value end,
|
["value"] = function(setting, value) return value end,
|
||||||
["position"] = 1,
|
["position"] = 1,
|
||||||
["onEdit"] = function(setting, value) saveConfig(setting, value == gmInte.getTranslation("admin.enabled", "Enabled") && true || false) end,
|
["onEdit"] = function(setting, value) saveConfig(setting, value) end,
|
||||||
["category"] = gmInte.getTranslation("admin.advanced", "Advanced")
|
["category"] = gmInte.getTranslation("admin.advanced", "Advanced")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -281,7 +281,7 @@ function gmInte.openConfigMenu(data)
|
||||||
input:SetText(actualConfig.value(actualConfig.id, data[actualConfig.id]) && gmInte.getTranslation("admin.enabled", "Enabled") || gmInte.getTranslation("admin.disabled", "Disabled"))
|
input:SetText(actualConfig.value(actualConfig.id, data[actualConfig.id]) && gmInte.getTranslation("admin.enabled", "Enabled") || gmInte.getTranslation("admin.disabled", "Disabled"))
|
||||||
input.OnSelect = function(self, index, value)
|
input.OnSelect = function(self, index, value)
|
||||||
if actualConfig.restart then needRestart = true end
|
if actualConfig.restart then needRestart = true end
|
||||||
actualConfig.onEdit(actualConfig.id, value)
|
actualConfig.onEdit(actualConfig.id, value == gmInte.getTranslation("admin.enabled", "Enabled") && true || false)
|
||||||
end
|
end
|
||||||
elseif actualConfig.type == "combo" then
|
elseif actualConfig.type == "combo" then
|
||||||
input = vgui.Create("DComboBox", panel)
|
input = vgui.Create("DComboBox", panel)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user