mirror of
https://github.com/imayushsaini/Bombsquad-Ballistica-Modded-Server.git
synced 2025-10-20 00:00:39 +00:00
added text on map
This commit is contained in:
parent
91af4a8027
commit
bfb5dd8ec3
7 changed files with 91 additions and 4 deletions
2
dist/ba_data/python/ba/_map.py
vendored
2
dist/ba_data/python/ba/_map.py
vendored
|
|
@ -210,6 +210,8 @@ class Map(Actor):
|
|||
# Set various globals.
|
||||
gnode = _ba.getactivity().globalsnode
|
||||
import ba
|
||||
from tools import textonmap
|
||||
textonmap.textonmap()
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
5
dist/ba_root/mods/custom_hooks.py
vendored
5
dist/ba_root/mods/custom_hooks.py
vendored
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
|
||||
def filter_chat_message(msg,client_id):
|
||||
from chatHandle import handlechat
|
||||
|
||||
return msg
|
||||
return handlechat.filter_chat_message(msg,client_id)
|
||||
|
||||
def on_app_launch():
|
||||
#something
|
||||
|
|
@ -13,4 +14,4 @@ def score_screen_on_begin(_stats):
|
|||
|
||||
def playerspaz_init(player):
|
||||
#add tag,rank,effect
|
||||
|
||||
|
||||
|
|
|
|||
8
dist/ba_root/mods/setting.json
vendored
8
dist/ba_root/mods/setting.json
vendored
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"textonmap":
|
||||
{
|
||||
"top watermark":"Welcome to server \n ip 192.168.0.1",
|
||||
"bottom left watermark":"join discord for fun",
|
||||
"center highlights":["message 1","message 2","message 3"]
|
||||
}
|
||||
}
|
||||
20
dist/ba_root/mods/setting.py
vendored
20
dist/ba_root/mods/setting.py
vendored
|
|
@ -1 +1,19 @@
|
|||
# Released under the MIT License. See LICENSE for details.
|
||||
# Released under the MIT License. See LICENSE for details.
|
||||
|
||||
|
||||
settings={}
|
||||
|
||||
def get_setting():
|
||||
global settings
|
||||
if settings=={}:
|
||||
f=open("setting.json","r")
|
||||
dat=json.loads(f.read())
|
||||
settings=dat
|
||||
f.close()
|
||||
return settings
|
||||
|
||||
def commit():
|
||||
global settings
|
||||
f=open("setting.json",'w')
|
||||
json.dump(setting,f,indent=4)
|
||||
f.close()
|
||||
Binary file not shown.
Binary file not shown.
60
dist/ba_root/mods/tools/textonmap.py
vendored
60
dist/ba_root/mods/tools/textonmap.py
vendored
|
|
@ -1 +1,59 @@
|
|||
# Released under the MIT License. See LICENSE for details.
|
||||
# Released under the MIT License. See LICENSE for details.
|
||||
|
||||
#TODO need to set coordinates of text node , move timer values to settings.json
|
||||
from ba._enums import TimeType
|
||||
import ba
|
||||
import setting
|
||||
class textonmap:
|
||||
def __init__(self):
|
||||
self.index=0;
|
||||
_textonmap=setting.get_setting()['textonmap']
|
||||
self.highlights=_textonmap['center highlights']
|
||||
left=_textonmap['bottom left watermark']
|
||||
top=_textonmap['top watermark']
|
||||
|
||||
self.timerr=ba.Timer(8,self.highlights,repeat=True)
|
||||
|
||||
self.left_watermark(left)
|
||||
self.top_message(top)
|
||||
|
||||
|
||||
def highlights(self):
|
||||
hg=_ba.newnode('text',
|
||||
attrs={
|
||||
'text': self.highlights[self.index],
|
||||
|
||||
'flatness': 1.0,
|
||||
'h_align': 'center',
|
||||
'v_attach':'bottom',
|
||||
'scale':1,
|
||||
'position':(0,138),
|
||||
'color':(1,1,1)
|
||||
})
|
||||
self.delt=ba.Timer(7,hg.delete)
|
||||
self.index=int((self.index+1)%len(self.highlights))
|
||||
|
||||
def left_watermark(self,text):
|
||||
hg=_ba.newnode('text',
|
||||
attrs={
|
||||
'text': text,
|
||||
|
||||
'flatness': 1.0,
|
||||
'h_align': 'left',
|
||||
'v_attach':'bottom',
|
||||
'scale':1,
|
||||
'position':(0,138),
|
||||
'color':(1,1,1)
|
||||
})
|
||||
def top_message(self,text):
|
||||
txt=_ba.newnode('text',
|
||||
attrs={
|
||||
'text': text,
|
||||
|
||||
'flatness': 1.0,
|
||||
'h_align': 'center',
|
||||
'v_attach':'top',
|
||||
'scale':1,
|
||||
'position':(0,138),
|
||||
'color':(1,1,1)
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue