Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit eb9890f

Browse files
committed
[[ ExtensionStandaloneSettings ]] Add helper functions to get ext standalone settings
1 parent d4b9f35 commit eb9890f

1 file changed

Lines changed: 51 additions & 13 deletions

File tree

Toolset/libraries/revidelibrary.8.livecodescript

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6485,31 +6485,69 @@ end __standaloneSettingsInfoFilename
64856485
function revIDEStandaloneSettings pStack, pSection
64866486
local tInfo
64876487
put revIDEStandaloneSettingsInfoOfSection(pSection) into tInfo
6488-
6489-
local tPropsA, tPropName
6490-
repeat for each element tGroup in tInfo
6491-
repeat for each element tProp in tGroup["proplist"]
6492-
put tProp["property_name"] into tPropName
6493-
put tProp into tPropsA[tGroup["label"]][tPropName]
6494-
put the cRevStandaloneSettings[tPropName] of pStack into tPropsA[tGroup["label"]][tPropName]["value"]
6495-
end repeat
6496-
end repeat
6497-
return tPropsA
6488+
6489+
return __revIDEStandaloneSettingsOfStackForExtension(pStack, tInfo)
64986490
end revIDEStandaloneSettings
64996491

65006492
function revIDEStandaloneSettingsInfoOfSection pSection
65016493
local tStandaloneDefinitionsPath
65026494
put revIDESpecialFolderPath("Standalone Settings Definitions") into tStandaloneDefinitionsPath
6503-
6495+
65046496
local tInfoA
65056497
put __propertyDataFromInfoFile(tStandaloneDefinitionsPath & slash & __standaloneSettingsInfoFilename()) into tInfoA
6506-
6498+
65076499
local tOrganisedA
65086500
put __organisePropertyInfo(tInfoA) into tOrganisedA
6509-
6501+
65106502
return __orderPropSubArray(tOrganisedA[pSection], true)
65116503
end revIDEStandaloneSettingsInfoOfSection
65126504

6505+
function revIDEStandaloneSettingsInfoOfExtension pKind
6506+
local tInfoA
6507+
put revIDEExtensionStandaloneSettingsInfo(pKind, true) into tInfoA
6508+
6509+
local tSectionList
6510+
-- At the moment all per-extension standalone settings are in
6511+
-- the 'basic' section
6512+
put __orderPropArray(tInfoA, "Basic") into tSectionList
6513+
return tSectionList[1]["grouplist"]
6514+
end revIDEStandaloneSettingsInfoOfExtension
6515+
6516+
function revIDEStandaloneSettingsOfExtension pStack, pKind
6517+
local tInfoA
6518+
put revIDEStandaloneSettingsInfoOfExtension(pKind) into tInfoA
6519+
6520+
return __revIDEStandaloneSettingsOfStackForExtension(pStack, tInfoA, pKind)
6521+
end revIDEStandaloneSettingsOfExtension
6522+
6523+
private function __revIDEStandaloneSettingsOfStackForExtension pStack, pInfoA, pExtension
6524+
local tSettings
6525+
if pExtension is not empty then
6526+
put the cRevStandaloneSettings[pExtension] of pStack into tSettings
6527+
else
6528+
put the customProperties["cRevStandaloneSettings"] of pStack into tSettings
6529+
end if
6530+
6531+
local tPropsA, tPropName
6532+
set the itemdelimiter to ";"
6533+
repeat for each element tGroup in pInfoA
6534+
repeat for each element tProp in tGroup["proplist"]
6535+
put tProp["property_name"] into tPropName
6536+
put tProp into tPropsA[tGroup["label"]][tPropName]
6537+
if the number of items in tPropName > 1 then
6538+
repeat for each item tRealProp in tPropName
6539+
put tSettings[tRealProp] into \
6540+
tPropsA[tGroup["label"]][tPropName]["value"][pStack][tRealProp]
6541+
end repeat
6542+
else
6543+
put tSettings[tPropName] into \
6544+
tPropsA[tGroup["label"]][tPropName]["value"][pStack]
6545+
end if
6546+
end repeat
6547+
end repeat
6548+
return tPropsA
6549+
end __revIDEStandaloneSettingsOfStackForExtension
6550+
65136551
function revIDEStandaloneSettingsInfo
65146552
local tStandaloneDefinitionsPath
65156553
put revIDESpecialFolderPath("Standalone Settings Definitions") into tStandaloneDefinitionsPath

0 commit comments

Comments
 (0)