mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Add files via upload
This commit is contained in:
parent
8e3a2fb83f
commit
e2275337e1
1 changed files with 62 additions and 0 deletions
62
plugins/utilities/z_hold_party_text_z.py
Normal file
62
plugins/utilities/z_hold_party_text_z.py
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
# ba_meta require api 9
|
||||||
|
|
||||||
|
"""
|
||||||
|
by shailesh
|
||||||
|
discord: shailesh_gabu_11/ShailesH
|
||||||
|
|
||||||
|
Function:
|
||||||
|
Holds text message of party window's text field.
|
||||||
|
|
||||||
|
Logic:
|
||||||
|
store text whenever party window close.
|
||||||
|
Then whenever it's open, edit text field with stored text.
|
||||||
|
|
||||||
|
Query:
|
||||||
|
Why is there 'z' at first and last in file name?
|
||||||
|
first 'z' reason >
|
||||||
|
because want to compile this file at last.
|
||||||
|
so this plugin can be compatible with other party window plugins.
|
||||||
|
last 'z' reason >
|
||||||
|
Nothing... for decoration purpose.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
# Ballistica API.
|
||||||
|
import bauiv1 as bui
|
||||||
|
|
||||||
|
# Ballistica Libraries.
|
||||||
|
from bauiv1lib.party import PartyWindow
|
||||||
|
|
||||||
|
|
||||||
|
# ba_meta export plugin
|
||||||
|
class plg(bui.Plugin):
|
||||||
|
""" Our plugin type for the game """
|
||||||
|
|
||||||
|
# The party window text field's text; that to be hold.
|
||||||
|
text: str = ""
|
||||||
|
|
||||||
|
# we gonna use decorators cause we need make this mod compatible with others.
|
||||||
|
def new_init(func: function) -> function:
|
||||||
|
|
||||||
|
def wrapper(*args, **kwargs) -> None:
|
||||||
|
# original code.
|
||||||
|
func(*args, **kwargs)
|
||||||
|
# Editing...
|
||||||
|
bui.textwidget(edit=args[0]._text_field, text=plg.text)
|
||||||
|
|
||||||
|
return wrapper
|
||||||
|
# wrapping new code.
|
||||||
|
PartyWindow.__init__ = new_init(PartyWindow.__init__)
|
||||||
|
|
||||||
|
def new_close(func: function) -> function:
|
||||||
|
|
||||||
|
def wrapper(*args, **kwargs) -> None:
|
||||||
|
# storing...
|
||||||
|
plg.text = bui.textwidget(query=args[0]._text_field))
|
||||||
|
# original code.
|
||||||
|
func(*args, **kwargs)
|
||||||
|
|
||||||
|
return wrapper
|
||||||
|
# wrapping new code.
|
||||||
|
PartyWindow.close = new_close(PartyWindow.close)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue