@@ -37,6 +37,13 @@ function runCommand(/** @type {string} */ command, /** @type {any} */ argument)
37
37
* @property {string } [value]
38
38
*/
39
39
40
+ /**
41
+ * @typedef {Object } AccessType
42
+ * @property {boolean } [platform] true if this setting is set with a platform/arch/compiler suffix.
43
+ * @property {boolean } [subscope] true if this setting is inside a config or build config.
44
+ * @property {string } [desc] Human readable description (suffix)
45
+ */
46
+
40
47
/**
41
48
* @param {string } label
42
49
* @param {InputOptions | undefined } options
@@ -540,12 +547,12 @@ function hideResetButton(setting) {
540
547
541
548
/**
542
549
* @param {HTMLElement } setting
543
- * @param {[boolean, boolean, string] | undefined } usedAccess
550
+ * @param {AccessType | undefined } usedAccess
544
551
*/
545
552
function makeSetInLabel ( setting , usedAccess ) {
546
553
let label = getLabelElement ( setting ) ;
547
554
let modifiedHint = label ?. querySelector ( ".modified-hint a" ) ;
548
- if ( usedAccess && usedAccess [ 2 ] && label ) {
555
+ if ( usedAccess && usedAccess . desc && label ) {
549
556
if ( ! modifiedHint ) {
550
557
let hint = document . createElement ( "span" ) ;
551
558
hint . className = "modified-hint" ;
@@ -573,9 +580,9 @@ function makeSetInLabel(setting, usedAccess) {
573
580
return false ;
574
581
} ) ;
575
582
}
576
- modifiedHint . textContent = usedAccess [ 2 ] ;
577
- modifiedHint . setAttribute ( "data-prefix" , usedAccess [ 1 ] ? "true" : "false" ) ;
578
- modifiedHint . setAttribute ( "data-suffix" , usedAccess [ 0 ] ? "true" : "false" ) ;
583
+ modifiedHint . textContent = usedAccess . desc ;
584
+ modifiedHint . setAttribute ( "data-prefix" , usedAccess . subscope ? "true" : "false" ) ;
585
+ modifiedHint . setAttribute ( "data-suffix" , usedAccess . platform ? "true" : "false" ) ;
579
586
} else {
580
587
modifiedHint ?. parentElement ?. parentElement ?. removeChild ( modifiedHint . parentElement ) ;
581
588
}
@@ -640,7 +647,7 @@ function ready() {
640
647
641
648
let suffixDisabled = ! hasSuffixMembers ;
642
649
let overridesDisabled = ! hasOverride ;
643
-
650
+
644
651
if ( overridesDisabled )
645
652
overridesSelector . classList . add ( "effectless" ) ;
646
653
else
@@ -729,16 +736,23 @@ function loadJsonIntoUI() {
729
736
let type = setting . getAttribute ( "json-type" ) ;
730
737
let strValue = setting . getAttribute ( "json-value" ) ;
731
738
let configPath = undefined ;
739
+ /**
740
+ * @type {AccessType | undefined }
741
+ */
732
742
let usedAccess = undefined ;
733
743
/**
734
- * @type {[boolean, boolean, string] [] }
744
+ * @type {AccessType [] }
735
745
*/
736
746
const accessTries = [
737
747
[ true , true , "" ] , // in current config/override with platform suffix
738
748
[ false , true , "all platforms" ] , // in current config/override without platform suffix
739
749
[ true , false , "Base" ] , // in global scope with platform suffix
740
750
[ false , false , "Base with all platforms" ] , // in global scope without platform suffix
741
- ] ;
751
+ ] . map ( v => ( {
752
+ platform : /** @type {boolean } */ ( v [ 0 ] ) ,
753
+ subscope : /** @type {boolean } */ ( v [ 1 ] ) ,
754
+ desc : /** @type {string } */ ( v [ 2 ] )
755
+ } ) ;
742
756
accessTries . forEach ( access => {
743
757
if ( configPath ) return ;
744
758
let resolved = makePath ( setting , path , access [ 0 ] , access [ 1 ] ) ;
0 commit comments