Fast epic toggle | Merge pull request #343 from imAnesYt

Added Fast epic toggle
This commit is contained in:
Loup 2025-03-02 23:44:36 +05:30 committed by GitHub
commit 1e3eda36ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 69 additions and 0 deletions

View file

@ -1731,6 +1731,25 @@
"md5sum": "472846d138af954b8b8085975d016a7c"
}
}
},
"fast_epic_toggle": {
"description": "Switch between Epic/Fast mode easier in-game!",
"external_url": "",
"authors": [
{
"name": "imAnesYT",
"email": "",
"discord": "v4_y"
}
],
"versions": {
"1.0.0": {
"api_version": 9,
"commit_sha": "541828a",
"released_on": "02-03-2025",
"md5sum": "756c221489a0759ff8f509cc22a2a823"
}
}
}
}
}

View file

@ -0,0 +1,50 @@
# ba_meta require api 9
import babase
import bauiv1 as bui
import bauiv1lib.party
import bascenev1 as bs
class FastEpicSwitcher(bauiv1lib.party.PartyWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Fast Mode Button
self._fast_btn = bui.buttonwidget(
parent=self._root_widget,
size=(150, 60),
scale=0.7,
label='Fast Mode',
button_type='square',
position=(self._width - 62, self._height - 80),
on_activate_call=self._set_fast_mode
)
# Epic Mode Button
self._epic_btn = bui.buttonwidget(
parent=self._root_widget,
size=(150, 60),
scale=0.7,
label='Epic Mode',
button_type='square',
position=(self._width - 62, self._height - 150),
on_activate_call=self._set_epic_mode
)
def _set_fast_mode(self):
"""Set the game to Fast Mode."""
bs.get_foreground_host_activity().globalsnode.slow_motion = 0.5 # Fast Mode
bui.screenmessage("Switched to Fast Mode", color=(0, 1, 0))
def _set_epic_mode(self):
"""Set the game to Epic Mode."""
bs.get_foreground_host_activity().globalsnode.slow_motion = 1.0 # Epic Mode (Slow)
bui.screenmessage("Switched to Epic Mode!", color=(0, 1, 0))
# ba_meta export plugin
class ByANES(babase.Plugin):
def __init__(self):
bauiv1lib.party.PartyWindow = FastEpicSwitcher