Hide plugin menu if empty

This commit is contained in:
KatieFrogs 2022-02-22 17:43:27 +03:00
parent 7d818877f8
commit 7cf34cfb74
2 changed files with 10 additions and 1 deletions

View File

@ -151,6 +151,15 @@ class Plugins{
return input.slice(0, index) + insertedText + input.slice(index + searchString.length) return input.slice(0, index) + insertedText + input.slice(index + searchString.length)
} }
hasSettings(){
for(var i = 0; i < this.allPlugins.length; i++){
var plugin = this.allPlugins[i].plugin
if(plugin.loaded && (!plugin.hide || plugin.settings())){
return true
}
}
return false
}
getSettings(){ getSettings(){
var items = [] var items = []
for(var i = 0; i < this.allPlugins.length; i++){ for(var i = 0; i < this.allPlugins.length; i++){

View File

@ -161,7 +161,7 @@ class SongSelect{
category: strings.random category: strings.random
}) })
} }
if(plugins.allPlugins.length){ if(plugins.hasSettings()){
this.songs.push({ this.songs.push({
title: strings.plugins.title, title: strings.plugins.title,
skin: this.songSkin.plugins, skin: this.songSkin.plugins,