File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
packages/userscript/source/ui Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -25,18 +25,17 @@ export class ResourcesSettingsUi extends SettingsPanel<ResourcesSettings> {
25
25
} ) ,
26
26
} ) ;
27
27
28
- // Disable checkbox. Resource control is always active.
29
- //this.readOnly = true;
30
-
31
28
// Add all the current resources
29
+ const preparedResources : Array < [ ResourcesSettingsItem , string ] > = Object . values (
30
+ this . setting . resources
31
+ ) . map ( resource => [
32
+ resource ,
33
+ ucfirst ( this . _host . engine . i18n ( `$resources.${ resource . resource } .title` ) ) ,
34
+ ] ) ;
35
+
32
36
this . _resources = [ ] ;
33
- for ( const setting of Object . values ( this . setting . resources ) ) {
34
- this . _resources . push (
35
- this . _makeResourceSetting (
36
- ucfirst ( this . _host . engine . i18n ( `$resources.${ setting . resource } .title` ) ) ,
37
- setting
38
- )
39
- ) ;
37
+ for ( const [ setting , title ] of preparedResources . sort ( ( a , b ) => a [ 1 ] . localeCompare ( b [ 1 ] ) ) ) {
38
+ this . _resources . push ( this . _makeResourceSetting ( title , setting ) ) ;
40
39
}
41
40
const listResource = new SettingsList ( this . _host ) ;
42
41
listResource . addChildren ( this . _resources ) ;
You can’t perform that action at this time.
0 commit comments