review comments
This commit is contained in:
parent
7426c4475e
commit
2bf95356dc
@ -1 +1 @@
|
|||||||
{"acknowledgedUpgradeVersions":[],"optionPanel":{"cardLanguage":3,"playAreaSnapTags":true,"showAttachmentHelper":false,"showChaosBagManager":false,"showCleanUpHelper":false,"showCustomPlaymatImages":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showSearchAssistant":[],"showTitleSplash":true,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true}}
|
{"acknowledgedUpgradeVersions":[],"optionPanel":{"cardLanguage":"English","playAreaSnapTags":true,"showAttachmentHelper":false,"showChaosBagManager":false,"showCleanUpHelper":false,"showCustomPlaymatImages":false,"showCYOA":false,"showDisplacementTool":false,"showDrawButton":false,"showHandHelper":[],"showSearchAssistant":[],"showTitleSplash":true,"showTokenArranger":false,"useClueClickers":false,"useSnapTags":true}}
|
||||||
|
@ -46,25 +46,14 @@ local SOURCE_REPO = 'https://raw.githubusercontent.com/chr1z93/loadable-objects/
|
|||||||
local library, requestObj, modMeta, notificationVisible
|
local library, requestObj, modMeta, notificationVisible
|
||||||
local acknowledgedUpgradeVersions = {}
|
local acknowledgedUpgradeVersions = {}
|
||||||
|
|
||||||
-- language selection
|
local LANGUAGES = {
|
||||||
local LANGUAGE_CODES = {
|
{ code = "zh_CN", name = "简体中文" },
|
||||||
"zh_CN", -- 简体中文
|
{ code = "zh_TW", name = "繁體中文" },
|
||||||
"zh_TW", -- 繁體中文
|
{ code = "de", name = "Deutsch" },
|
||||||
"de", -- Deutsch
|
{ code = "en", name = "English" },
|
||||||
"en", -- English
|
{ code = "es", name = "Español" },
|
||||||
"es", -- Español
|
{ code = "fr", name = "Français" },
|
||||||
"fr", -- Français
|
{ code = "it", name = "Italiano" }
|
||||||
"it" -- Italiano
|
|
||||||
}
|
|
||||||
|
|
||||||
local LANGUAGE_NAMES = {
|
|
||||||
"简体中文",
|
|
||||||
"繁體中文",
|
|
||||||
"Deutsch",
|
|
||||||
"English",
|
|
||||||
"Español",
|
|
||||||
"Français",
|
|
||||||
"Italiano"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
@ -861,19 +850,29 @@ end
|
|||||||
|
|
||||||
-- called by the language selection dropdown
|
-- called by the language selection dropdown
|
||||||
function languageSelected(_, selectedIndex, id)
|
function languageSelected(_, selectedIndex, id)
|
||||||
optionPanel[id] = tonumber(selectedIndex)
|
optionPanel[id] = LANGUAGES[tonumber(selectedIndex) + 1].name
|
||||||
|
end
|
||||||
|
|
||||||
|
function returnLanguageId(name)
|
||||||
|
for index, tbl in ipairs(LANGUAGES) do
|
||||||
|
for key, value in pairs(tbl) do
|
||||||
|
if key == "name" and value == name then
|
||||||
|
return index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- sets the option panel to the correct state (corresponding to 'optionPanel')
|
-- sets the option panel to the correct state (corresponding to 'optionPanel')
|
||||||
function updateOptionPanelState()
|
function updateOptionPanelState()
|
||||||
for id, enabled in pairs(optionPanel) do
|
for id, optionValue in pairs(optionPanel) do
|
||||||
if (type(enabled) == "boolean" and enabled)
|
if id == "cardLanguage" and type(optionValue) == "string" then
|
||||||
or (type(enabled) == "string" and enabled)
|
local dropdownId = returnLanguageId(optionValue) - 1
|
||||||
or (type(enabled) == "table" and #enabled ~= 0) then
|
UI.setAttribute(id, "value", dropdownId)
|
||||||
|
elseif (type(optionValue) == "boolean" and optionValue)
|
||||||
|
or (type(optionValue) == "string" and optionValue)
|
||||||
|
or (type(optionValue) == "table" and #optionValue ~= 0) then
|
||||||
UI.setAttribute(id, "isOn", true)
|
UI.setAttribute(id, "isOn", true)
|
||||||
-- hard-coded updating of the language selection dropdown
|
|
||||||
elseif id == "cardLanguage" and type(enabled) == "number" then
|
|
||||||
UI.setAttribute(id, "value", enabled)
|
|
||||||
else
|
else
|
||||||
UI.setAttribute(id, "isOn", "False")
|
UI.setAttribute(id, "isOn", "False")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user