Merge pull request #34 from bombsquad-community/pro-unlocker

Add pro-unlocker
This commit is contained in:
Rikko 2022-09-18 17:08:15 +05:30 committed by GitHub
commit d5d053f6c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 0 deletions

View file

@ -183,6 +183,25 @@
"md5sum": "94f67a98a9faed0ece63674c84d40061" "md5sum": "94f67a98a9faed0ece63674c84d40061"
} }
} }
},
"pro_unlocker": {
"description": "Unlocks some pro-only features - custom colors, playlist maker, etc.",
"external_url": "",
"authors": [
{
"name": "Anonymous",
"email": "",
"discord": ""
}
],
"versions": {
"1.0.0": {
"api_version": 7,
"commit_sha": "41e239c",
"released_on": "18-09-2022",
"md5sum": "bbaee5f133b41d2eb53e3b726403a75e"
}
}
} }
} }
} }

View file

@ -0,0 +1,36 @@
# ba_meta require api 7
import _ba
import ba
def is_game_version_lower_than(version):
"""
Returns a boolean value indicating whether the current game
version is lower than the passed version. Useful for addressing
any breaking changes within game versions.
"""
game_version = tuple(map(int, ba.app.version.split(".")))
version = tuple(map(int, version.split(".")))
return game_version < version
if is_game_version_lower_than("1.7.7"):
original_get_purchased = _ba.get_purchased
else:
original_get_purchased = ba.internal.get_purchased
def get_purchased(item):
if item.startswith('characters.') or item.startswith('icons.'):
return original_get_purchased(item)
return True
# ba_meta export plugin
class Unlock(ba.Plugin):
def on_app_running(self):
ba.app.accounts_v1.have_pro = lambda: True
if is_game_version_lower_than("1.7.7"):
_ba.get_purchased = get_purchased
else:
ba.internal.get_purchased = get_purchased