Merge pull request #104 from bombsquad-community/invisible-none-type-models

Allow invisible models
This commit is contained in:
Rikko 2023-01-22 15:36:09 +05:30 committed by GitHub
commit d72bdbcc5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

View file

@ -651,6 +651,25 @@
"md5sum": "cc1738b0326c9679453bdf1489ded483"
}
}
},
"allow_invisible_models": {
"description": "Changing model to None will make it invisible instead of raising an exception.",
"external_url": "",
"authors": [
{
"name": "Rikko",
"email": "rikkolovescats@proton.me",
"discord": "Rikko#7383"
}
],
"versions": {
"1.0.0": {
"api_version": 7,
"commit_sha": "3221b3a",
"released_on": "22-01-2023",
"md5sum": "24913c665d05c3056c8ba390fe88155e"
}
}
}
}
}

View file

@ -0,0 +1,15 @@
# ba_meta require api 7
import ba
original_getmodel = ba.getmodel
def get_model_gracefully(model):
if model is not None:
return original_getmodel(model)
# ba_meta export plugin
class Main(ba.Plugin):
def on_app_running(self):
ba.getmodel = get_model_gracefully