From d5467ba2393d91d101cc37283f828ef5436cb3f5 Mon Sep 17 00:00:00 2001 From: SenjuZoro <69396975+SenjuZoro@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:50:14 +0200 Subject: [PATCH 1/2] Tag Animation code block Thanks to @itsre3 --- dist/ba_root/mods/spazmod/tag.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dist/ba_root/mods/spazmod/tag.py b/dist/ba_root/mods/spazmod/tag.py index 447db86..fbcc032 100644 --- a/dist/ba_root/mods/spazmod/tag.py +++ b/dist/ba_root/mods/spazmod/tag.py @@ -41,6 +41,7 @@ def addhp(node): class Tag(object): def __init__(self,owner=None,tag="somthing",col=(1,1,1)): self.node=owner + sett = setting.get_settings_data() mnode = ba.newnode('math', owner=self.node, attrs={ @@ -79,7 +80,16 @@ class Tag(object): 'h_align': 'center' }) mnode.connectattr('output', self.tag_text, 'position') - + if sett["enableTagAnimation"]: + ba.animate_array(node=self.tag_text, attr='color', size=3, keys={ + 0.2: (2,0,2), + 0.4: (2,2,0), + 0.6: (0,2,2), + 0.8: (2,0,2), + 1.0: (1,1,0), + 1.2: (0,1,1), + 1.4: (1,0,1) + }, loop=True) class Rank(object): def __init__(self,owner=None,rank=99): self.node=owner @@ -127,4 +137,4 @@ class HitPoint(object): def a(): self._Text.delete() m.delete() - self.timer = ba.Timer(100, ba.Call(a), timetype=ba.TimeType.SIM, timeformat=ba.TimeFormat.MILLISECONDS) \ No newline at end of file + self.timer = ba.Timer(100, ba.Call(a), timetype=ba.TimeType.SIM, timeformat=ba.TimeFormat.MILLISECONDS) From cee618278498372880330ab9dc5fa684a87a49bd Mon Sep 17 00:00:00 2001 From: Ayush Saini <36878972+imayushsaini@users.noreply.github.com> Date: Thu, 30 Jun 2022 01:03:09 +0530 Subject: [PATCH 2/2] updated tag.py --- dist/ba_root/mods/spazmod/tag.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/ba_root/mods/spazmod/tag.py b/dist/ba_root/mods/spazmod/tag.py index fbcc032..9682f05 100644 --- a/dist/ba_root/mods/spazmod/tag.py +++ b/dist/ba_root/mods/spazmod/tag.py @@ -1,6 +1,8 @@ from playersData import pdata import ba, setting +from stats import mystats +sett = setting.get_settings_data() def addtag(node,player): session_player=player.sessionplayer account_id=session_player.get_v1_account_id() @@ -22,7 +24,7 @@ def addtag(node,player): if tag: Tag(node,tag,col) -from stats import mystats + def addrank(node,player): session_player=player.sessionplayer account_id=session_player.get_v1_account_id() @@ -33,7 +35,6 @@ def addrank(node,player): def addhp(node): hp = node.hitpoints - _set = setting.get_settings_data() def showHP(): HitPoint(owner=node,prefix=str(int(hp)),position=(0,0.75,0),shad = 1.4) if hp: t = ba.Timer(100,ba.Call(showHP),repeat = True, timetype=ba.TimeType.SIM, timeformat=ba.TimeFormat.MILLISECONDS) @@ -41,7 +42,7 @@ def addhp(node): class Tag(object): def __init__(self,owner=None,tag="somthing",col=(1,1,1)): self.node=owner - sett = setting.get_settings_data() + mnode = ba.newnode('math', owner=self.node, attrs={ @@ -115,8 +116,7 @@ class Rank(object): class HitPoint(object): def __init__(self,position = (0,1.5,0),owner = None,prefix = 'ADMIN',shad = 1.2): - _set = setting.get_settings_data() - if not _set['enablehptag']: return + if not sett['enablehptag']: return self.position = position self.owner = owner m = ba.newnode('math', owner=self.owner, attrs={'input1': self.position, 'operation': 'add'})