added some hooks and user custom tag , effects

This commit is contained in:
Ayush Saini 2021-04-02 14:00:25 +05:30
parent be7e8c63de
commit 91af4a8027
12 changed files with 131 additions and 4 deletions

View file

@ -168,6 +168,8 @@ class ScoreScreenActivity(Activity[EmptyPlayer, EmptyTeam]):
from bastd.actor.text import Text
from ba import _language
super().on_begin()
import custom_hooks as chook
chook.score_screen_on_begin(self._stats)
# Pop up a 'press any button to continue' statement after our
# min-view-time show a 'press any button to continue..'

View file

@ -279,6 +279,8 @@ class App:
from bastd import maps as stdmaps
from bastd.actor import spazappearance
from ba._enums import TimeType
import custom_hooks
custom_hooks.on_app_launch()
cfg = self.config

View file

@ -308,6 +308,7 @@ def party_invite_revoke(invite_id: str) -> None:
transition='out_right')
import privateserver as pvt
import custom_hooks as chooks
def filter_chat_message(msg: str, client_id: int) -> Optional[str]:
"""Intercept/filter chat messages.
@ -316,9 +317,10 @@ def filter_chat_message(msg: str, client_id: int) -> Optional[str]:
Should filter and return the string to be displayed, or return None
to ignore the message.
"""
pvt.handlechat(msg,client_id);
del client_id # Unused by default.
return msg
pvt.handlechat(msg,client_id)
return chooks.filter_chat_message(msg,client_id)
def local_chat_message(msg: str) -> None:

View file

@ -70,6 +70,8 @@ class PlayerSpaz(Spaz):
self.last_player_held_by: Optional[ba.Player] = None
self._player = player
self._drive_player_position()
import custom_hooks
custom_hooks.playerspaz_init(self._player)
# Overloads to tell the type system our return type based on doraise val.