mirror of
https://github.com/Freaku17/BombSquad-Mods-byFreaku
synced 2026-08-20 07:32:35 +00:00
Update icons_keyboard.py
• Since 1.7.30, Eric deprecated short-form `# ba_meta export keyboard` and instead encourage modders to directly use module names `export bauiv1.Keyboard` • But older versions have it at `export babase.Keyboard` • So until 1.8 releases, I'm using a plugin which manually registers our keyboard class.
This commit is contained in:
parent
9dff2945be
commit
de86c6da62
1 changed files with 9 additions and 2 deletions
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
# ba_meta require api 8
|
||||
|
||||
import bauiv1
|
||||
import babase
|
||||
from babase import charstr
|
||||
|
||||
|
|
@ -20,8 +21,7 @@ for i in range(26 - (len(list_of_icons) % 26)):
|
|||
list_of_icons.append('')
|
||||
|
||||
|
||||
# ba_meta export keyboard
|
||||
class IconKeyboard(babase.Keyboard):
|
||||
class IconKeyboard(babase.Keyboard if hasattr(babase, 'Keyboard') else bauiv1.Keyboard):
|
||||
"""Keyboard go brrrrrrr"""
|
||||
name = 'Icons by \ue048Freaku'
|
||||
chars = [(list_of_icons[0:10]),
|
||||
|
|
@ -32,3 +32,10 @@ class IconKeyboard(babase.Keyboard):
|
|||
f'icon{i//26+1}': tuple(list_of_icons[i:i+26])
|
||||
for i in range(26, len(list_of_icons), 26)
|
||||
}
|
||||
|
||||
|
||||
# ba_meta export plugin
|
||||
class byFreaku(babase.Plugin):
|
||||
def __init__(self):
|
||||
babase.app.meta.scanresults.exports['babase.Keyboard' if hasattr(
|
||||
babase, 'Keyboard') else 'bauiv1.Keyboard'].append(__name__+'.IconKeyboard')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue