Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin (achievements_unlocker) #302

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions plugins/utilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,25 @@
}
}
},
"achievements_unlocker": {
"description": "Anlock All Achievements",
"external_url": "",
"authors": [
{
"name": "Yelllow",
"email": "im.yellow.dev@gmail.com",
"discord": "y.lw"
}
],
"versions": {
"1.0.0": {
"api_version": 8,
"commit_sha": "d51c10c",
"released_on": "11-09-2024",
"md5sum": "259d79e3c7e6fefc1ad6da82f50764ec"
}
}
},
"ultra_party_window": {
"description": "Ultra your party window with lots of features",
"external_url": "",
Expand Down
37 changes: 37 additions & 0 deletions plugins/utilities/achievements_unlocker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# BY Yelllow (dis : @y.lw)

import babase
import bauiv1 as bui
import bascenev1 as bs

ACHIEVEMENTS = bui.app.classic.ach.achievements


def unlock_all_achievements():
if bui.app.plus.get_v1_account_state() != 'signed_in':
return bui.screenmessage(bui.Lstr(resource='notSignedInErrorText'), color=(1, 0, 0))

UNLOCKED = False
for num, achievement in enumerate(ACHIEVEMENTS, start=1):
if not achievement.complete:
bui.app.plus.add_v1_account_transaction(
{'type': 'ACHIEVEMENT', 'name': achievement.name})
achievement.set_complete()
bui.screenmessage(f"- Unlocked ({achievement.name})", color=(1, 1, 0))
UNLOCKED = True

if UNLOCKED:
bui.screenmessage("Unlocked All Achievements !", color=(0, 1, 0))


def _have_pro():
return True

# ba_meta require api 8
# ba_meta export plugin


class ByYelllow(babase.Plugin):
def on_app_running(self) -> None:
bs.app.classic.accounts.have_pro = _have_pro
self.timer = bs.AppTimer(5, unlock_all_achievements)