From 8868902bb75efa1593c180511ae36f340ddc8557 Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Tue, 4 Oct 2022 13:47:59 +0530 Subject: [PATCH 1/9] Added disable button --- plugins/utilities/mood_light.py | 103 ++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 32 deletions(-) diff --git a/plugins/utilities/mood_light.py b/plugins/utilities/mood_light.py index 496aefe..b987043 100644 --- a/plugins/utilities/mood_light.py +++ b/plugins/utilities/mood_light.py @@ -2,8 +2,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, cast -import ba -import _ba +import ba,_ba import random from ba._map import Map from bastd import mainmenu @@ -21,11 +20,19 @@ def Print(arg1, arg2="", arg3=""): try: - Ldefault, Udefault = ba.app.config.get("moodlightingSettings") + Ldefault, Udefault=ba.app.config.get("moodlightingSettings") except: - ba.app.config["moodlightingSettings"] = (15, 20) - Ldefault, Udefault = ba.app.config.get("moodlightingSettings") - Print("settings up moodlight") + ba.app.config["moodlightingSettings"]=(15,20) + Ldefault, Udefault=ba.app.config.get("moodlightingSettings") + Print("settings up moodlight") + Print("Type ml in chat or use plugin manager to access settings") + +try: + loop=ba.app.config.get("moodlightEnabled") +except: + ba.app.config["moodlightEnabled"]=True + ba.app.config.commit() + class SettingWindow(ba.Window): @@ -95,6 +102,15 @@ class SettingWindow(ba.Window): v_align="center", text="Mood light settings", color=(0, 1, 0)) + + self.enable_button=ba.buttonwidget( + parent=self._root_widget, + position=(100, 470), + size=(90, 70), + scale=1.5, + color=(1,0,0) if loop else (0,1,0), + label="DISABLE" if loop else "ENABLE", + on_activate_call=self.on_enableButton_press) increase_button = ba.buttonwidget( parent=self._root_widget, @@ -172,8 +188,7 @@ class SettingWindow(ba.Window): scale=2, color=(1, 0.2, 0.2), extra_touch_border_scale=5, - on_activate_call=self.close, - button_type="square") + on_activate_call=self.close) save_button = ba.buttonwidget( parent=self._root_widget, @@ -181,14 +196,29 @@ class SettingWindow(ba.Window): size=(90, 70), scale=1.5, label="SAVE", - button_type="square", - on_activate_call=self.save_settings) + on_activate_call=self.save_settings) ba.textwidget(edit=self.upper_text, on_activate_call=ba.Call(self.on_text_click, "upper")) ba.textwidget(edit=self.lower_text, on_activate_call=ba.Call(self.on_text_click, "lower")) - + + def on_enableButton_press(self): + global loop + loop=ba.app.config.get("moodlightEnabled") + if loop: + loop=False + label="ENABLE" + color=(0,1,0) + elif not loop: + loop=True + label="DISABLE" + color=(1,0,0) + + ba.app.config["moodlightEnabled"]=loop + ba.app.config.commit() + ba.buttonwidget(edit=self.enable_button,label=label,color=color) + def save_settings(self): - ba.app.config["moodlightingSettings"] = (Ldefault, Udefault) + ba.app.config["moodlightingSettings"]=(Ldefault,Udefault) ba.app.config.commit() Print("settings saved") self.close() @@ -196,24 +226,20 @@ class SettingWindow(ba.Window): def close(self): ba.containerwidget(edit=self._root_widget, transition="out_right",) - Map._old_init = Map.__init__ - -def new_chat_message(msg: Union[str, ba.Lstr], clients: Sequence[int] = None, sender_override: str = None): +def new_chat_message(msg: Union[str, ba.Lstr], clients:Sequence[int] = None, sender_override: str = None): old_fcm(msg, clients, sender_override) if msg == 'ml': try: - Ldefault, Udefault = ba.app.config.get("moodlightingSettings") + Ldefault, Udefault=ba.app.config.get("moodlightingSettings") SettingWindow() - _ba.chatmessage("Mood light settings opened") + _ba.chatmessage("Mood light settings opened") except Exception as err: Print(err) - old_fcm = _ba.chatmessage _ba.chatmessage = new_chat_message -_ba.set_party_icon_always_visible(True) # ba_meta export plugin @@ -221,30 +247,43 @@ _ba.set_party_icon_always_visible(True) class moodlight(ba.Plugin): def __init__(self): pass - + def on_app_running(self): try: + _ba.show_progress_bar() + pass except Exception as err: Print(err) - def on_plugin_manager_prompt(self): + def on_plugin_manager_prompt(self):#called by plugin manager SettingWindow() def _new_init(self, vr_overlay_offset: Optional[Sequence[float]] = None) -> None: self._old_init(vr_overlay_offset) - in_game = not isinstance(_ba.get_foreground_host_session(), mainmenu.MainMenuSession) + in_game = not isinstance(_ba.get_foreground_host_session(), mainmenu.MainMenuSession) if not in_game: return - + gnode = _ba.getactivity().globalsnode - - def changetint(): - Range = (random.randrange(Ldefault, Udefault)/10, random.randrange(Ldefault, - Udefault)/10, random.randrange(Ldefault, Udefault)/10) - ba.animate_array(gnode, 'tint', 3, { - 0.0: gnode.tint, - 1.0: Range - }) - _ba.timer(0.3, changetint, repeat=True) + default_tint=(1.100000023841858, 1.0, 0.8999999761581421) + transition_duration=1.0#for future improvements + + def changetint(): + if loop: + Range = (random.randrange(Ldefault, Udefault)/10, random.randrange(Ldefault, + Udefault)/10, random.randrange(Ldefault, Udefault)/10) + ba.animate_array(gnode, 'tint', 3 ,{ + 0.0: gnode.tint, + transition_duration: Range + }) + else: + global timer + timer=None + ba.animate_array(gnode,"tint",3, {0.0:gnode.tint,0.4:default_tint}) + + global timer + timer=ba.Timer(0.3, changetint, repeat=True) + Map.__init__ = _new_init + From cd9658c4dd836ac12c5ff779360260b3f5368580 Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Tue, 4 Oct 2022 22:41:05 +0530 Subject: [PATCH 2/9] Quality of life improvements --- plugins/utilities/mood_light.py | 154 +++++++++++++++++++------------- 1 file changed, 90 insertions(+), 64 deletions(-) diff --git a/plugins/utilities/mood_light.py b/plugins/utilities/mood_light.py index b987043..7807d51 100644 --- a/plugins/utilities/mood_light.py +++ b/plugins/utilities/mood_light.py @@ -1,6 +1,8 @@ # ba_meta require api 7 from __future__ import annotations from typing import TYPE_CHECKING, cast +if TYPE_CHECKING: + from typing import Any, Sequence, Callable, List, Dict, Tuple, Optional, Union import ba,_ba import random @@ -9,14 +11,31 @@ from bastd import mainmenu from bastd.ui.party import PartyWindow from bastd.gameutils import SharedObjects from time import sleep -if TYPE_CHECKING: - from typing import Any, Sequence, Callable, List, Dict, Tuple, Optional, Union -# mood light plugin by ʟօʊքɢǟʀօʊ +"""mood light plugin by ʟօʊքɢǟʀօʊ +type ml in chat or use plugin manager to open settings""" +def Print(*args): + out=" ".join(args) + ba.screenmessage(out) -def Print(arg1, arg2="", arg3=""): - ba.screenmessage(str(arg1)+str(arg2)+str(arg3)) +def cprint(*args): + out="\n".join(args) + _ba.chatmessage(out) +# +#class printerr:#for debugging +# #def __init__(self): +# global errcounter +# errcounter=1 +# def __enter__(self): +# _ba.chatmessage("executing") +# +# def __exit__(self, exc_type, exc_value, exc_tb): +# cprint(exc_type, exc_value, exc_tb) +# if not(exc_type==None): +# cprint(exc_type, exc_value, exc_tb) +# else: +# cprint("Executed sucessfully","No error") try: @@ -32,6 +51,7 @@ try: except: ba.app.config["moodlightEnabled"]=True ba.app.config.commit() + loop=True @@ -98,6 +118,7 @@ class SettingWindow(ba.Window): size=(200, 100), position=(150, 550), scale=2, + selectable=False, h_align="center", v_align="center", text="Mood light settings", @@ -111,24 +132,26 @@ class SettingWindow(ba.Window): color=(1,0,0) if loop else (0,1,0), label="DISABLE" if loop else "ENABLE", on_activate_call=self.on_enableButton_press) - - increase_button = ba.buttonwidget( + + + save_button = ba.buttonwidget( parent=self._root_widget, - position=(600, 100), - size=(5, 1), - scale=3.5, - extra_touch_border_scale=2.5, - icon=ba.gettexture("upButton"), - on_activate_call=self.increase_limit) - - decrease_button = ba.buttonwidget( + position=(520, 470), + size=(90, 70), + scale=1.5, + label="SAVE", + on_activate_call=self.save_settings) + + self.close_button = ba.buttonwidget( parent=self._root_widget, - position=(100, 100), - size=(5, 1), - scale=3.5, - extra_touch_border_scale=2.5, - icon=ba.gettexture("downButton"), - on_activate_call=self.decrease_limit) + position=(550, 590), + size=(35, 35), + icon=ba.gettexture("crossOut"), + icon_color=(1, 0.2, 0.2), + scale=2, + color=(1, 0.2, 0.2), + extra_touch_border_scale=5, + on_activate_call=self.close) self.lower_text = ba.textwidget( parent=self._root_widget, @@ -169,6 +192,24 @@ class SettingWindow(ba.Window): h_align="center", v_align="center", text="Limit brightness") + + decrease_button = ba.buttonwidget( + parent=self._root_widget, + position=(100, 100), + size=(5, 1), + scale=3.5, + extra_touch_border_scale=2.5, + icon=ba.gettexture("downButton"), + on_activate_call=self.decrease_limit) + + increase_button = ba.buttonwidget( + parent=self._root_widget, + position=(600, 100), + size=(5, 1), + scale=3.5, + extra_touch_border_scale=2.5, + icon=ba.gettexture("upButton"), + on_activate_call=self.increase_limit) self.warn_text = ba.textwidget( parent=self._root_widget, @@ -177,27 +218,18 @@ class SettingWindow(ba.Window): position=(150, 300), h_align="center", v_align="center", - maxwidth=600) - - self.close_button = ba.buttonwidget( - parent=self._root_widget, - position=(550, 590), - size=(35, 35), - icon=ba.gettexture("crossOut"), - icon_color=(1, 0.2, 0.2), - scale=2, - color=(1, 0.2, 0.2), - extra_touch_border_scale=5, - on_activate_call=self.close) - - save_button = ba.buttonwidget( - parent=self._root_widget, - position=(520, 470), - size=(90, 70), - scale=1.5, - label="SAVE", - on_activate_call=self.save_settings) + maxwidth=600) +#++++++++++++++++for keyboard navigation++++++++++++++++ + ba.widget(edit=self.enable_button,up_widget=decrease_button,down_widget=self.lower_text,left_widget=save_button,right_widget=save_button) + ba.widget(edit=save_button,up_widget=self.close_button,down_widget=self.upper_text,left_widget=self.enable_button,right_widget=self.enable_button) + ba.widget(edit=self.close_button,up_widget=increase_button,down_widget=save_button,left_widget=self.enable_button,right_widget=save_button) + ba.widget(edit=self.lower_text,up_widget=self.enable_button,down_widget=decrease_button,left_widget=self.upper_text,right_widget=self.upper_text) + ba.widget(edit=self.upper_text,up_widget=save_button,down_widget=increase_button,left_widget=self.lower_text,right_widget=self.lower_text) + ba.widget(edit=decrease_button,up_widget=self.lower_text,down_widget=self.enable_button,left_widget=increase_button,right_widget=increase_button) + ba.widget(edit=increase_button,up_widget=self.upper_text,down_widget=self.close_button,left_widget=decrease_button,right_widget=decrease_button) +#-------------------------------------------------------------------------------------------------- + ba.textwidget(edit=self.upper_text, on_activate_call=ba.Call(self.on_text_click, "upper")) ba.textwidget(edit=self.lower_text, on_activate_call=ba.Call(self.on_text_click, "lower")) @@ -210,9 +242,9 @@ class SettingWindow(ba.Window): color=(0,1,0) elif not loop: loop=True - label="DISABLE" + label="DISABLE" color=(1,0,0) - + Print("Restart level to enable") ba.app.config["moodlightEnabled"]=loop ba.app.config.commit() ba.buttonwidget(edit=self.enable_button,label=label,color=color) @@ -226,39 +258,33 @@ class SettingWindow(ba.Window): def close(self): ba.containerwidget(edit=self._root_widget, transition="out_right",) -Map._old_init = Map.__init__ - def new_chat_message(msg: Union[str, ba.Lstr], clients:Sequence[int] = None, sender_override: str = None): - old_fcm(msg, clients, sender_override) - if msg == 'ml': - try: - Ldefault, Udefault=ba.app.config.get("moodlightingSettings") - SettingWindow() - _ba.chatmessage("Mood light settings opened") - except Exception as err: - Print(err) - + old_fcm(msg, clients, sender_override) + if msg == 'ml': + try: + Ldefault, Udefault=ba.app.config.get("moodlightingSettings") + SettingWindow() + cprint("Mood light settings opened") + except Exception as err: + Print(err) + old_fcm = _ba.chatmessage _ba.chatmessage = new_chat_message - +_ba.set_party_icon_always_visible(True) +Map._old_init = Map.__init__ + # ba_meta export plugin - class moodlight(ba.Plugin): def __init__(self): pass def on_app_running(self): - try: _ba.show_progress_bar() - pass - except Exception as err: - Print(err) - def on_plugin_manager_prompt(self):#called by plugin manager - SettingWindow() - + SettingWindow() + def _new_init(self, vr_overlay_offset: Optional[Sequence[float]] = None) -> None: self._old_init(vr_overlay_offset) in_game = not isinstance(_ba.get_foreground_host_session(), mainmenu.MainMenuSession) @@ -269,7 +295,7 @@ class moodlight(ba.Plugin): default_tint=(1.100000023841858, 1.0, 0.8999999761581421) transition_duration=1.0#for future improvements - def changetint(): + def changetint(): if loop: Range = (random.randrange(Ldefault, Udefault)/10, random.randrange(Ldefault, Udefault)/10, random.randrange(Ldefault, Udefault)/10) From 96a71b57a8c53ced2e1b139fd6ec10b9a8785055 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 6 Oct 2022 05:40:50 +0000 Subject: [PATCH 3/9] [ci] auto-format --- plugins/utilities/mood_light.py | 192 +++++++++++++++++--------------- 1 file changed, 101 insertions(+), 91 deletions(-) diff --git a/plugins/utilities/mood_light.py b/plugins/utilities/mood_light.py index 7807d51..3eb8527 100644 --- a/plugins/utilities/mood_light.py +++ b/plugins/utilities/mood_light.py @@ -4,7 +4,8 @@ from typing import TYPE_CHECKING, cast if TYPE_CHECKING: from typing import Any, Sequence, Callable, List, Dict, Tuple, Optional, Union -import ba,_ba +import ba +import _ba import random from ba._map import Map from bastd import mainmenu @@ -15,44 +16,45 @@ from time import sleep """mood light plugin by ʟօʊքɢǟʀօʊ type ml in chat or use plugin manager to open settings""" + def Print(*args): - out=" ".join(args) + out = " ".join(args) ba.screenmessage(out) + def cprint(*args): - out="\n".join(args) + out = "\n".join(args) _ba.chatmessage(out) -# -#class printerr:#for debugging +# +# class printerr:#for debugging # #def __init__(self): # global errcounter # errcounter=1 # def __enter__(self): # _ba.chatmessage("executing") -# +# # def __exit__(self, exc_type, exc_value, exc_tb): -# cprint(exc_type, exc_value, exc_tb) +# cprint(exc_type, exc_value, exc_tb) # if not(exc_type==None): -# cprint(exc_type, exc_value, exc_tb) +# cprint(exc_type, exc_value, exc_tb) # else: # cprint("Executed sucessfully","No error") try: - Ldefault, Udefault=ba.app.config.get("moodlightingSettings") + Ldefault, Udefault = ba.app.config.get("moodlightingSettings") except: - ba.app.config["moodlightingSettings"]=(15,20) - Ldefault, Udefault=ba.app.config.get("moodlightingSettings") - Print("settings up moodlight") - Print("Type ml in chat or use plugin manager to access settings") + ba.app.config["moodlightingSettings"] = (15, 20) + Ldefault, Udefault = ba.app.config.get("moodlightingSettings") + Print("settings up moodlight") + Print("Type ml in chat or use plugin manager to access settings") try: - loop=ba.app.config.get("moodlightEnabled") + loop = ba.app.config.get("moodlightEnabled") except: - ba.app.config["moodlightEnabled"]=True + ba.app.config["moodlightEnabled"] = True ba.app.config.commit() - loop=True - + loop = True class SettingWindow(ba.Window): @@ -123,25 +125,24 @@ class SettingWindow(ba.Window): v_align="center", text="Mood light settings", color=(0, 1, 0)) - - self.enable_button=ba.buttonwidget( + + self.enable_button = ba.buttonwidget( parent=self._root_widget, position=(100, 470), size=(90, 70), scale=1.5, - color=(1,0,0) if loop else (0,1,0), + color=(1, 0, 0) if loop else (0, 1, 0), label="DISABLE" if loop else "ENABLE", on_activate_call=self.on_enableButton_press) - - + save_button = ba.buttonwidget( parent=self._root_widget, position=(520, 470), size=(90, 70), scale=1.5, label="SAVE", - on_activate_call=self.save_settings) - + on_activate_call=self.save_settings) + self.close_button = ba.buttonwidget( parent=self._root_widget, position=(550, 590), @@ -192,7 +193,7 @@ class SettingWindow(ba.Window): h_align="center", v_align="center", text="Limit brightness") - + decrease_button = ba.buttonwidget( parent=self._root_widget, position=(100, 100), @@ -200,7 +201,7 @@ class SettingWindow(ba.Window): scale=3.5, extra_touch_border_scale=2.5, icon=ba.gettexture("downButton"), - on_activate_call=self.decrease_limit) + on_activate_call=self.decrease_limit) increase_button = ba.buttonwidget( parent=self._root_widget, @@ -218,39 +219,46 @@ class SettingWindow(ba.Window): position=(150, 300), h_align="center", v_align="center", - maxwidth=600) + maxwidth=600) + +# ++++++++++++++++for keyboard navigation++++++++++++++++ + ba.widget(edit=self.enable_button, up_widget=decrease_button, + down_widget=self.lower_text, left_widget=save_button, right_widget=save_button) + ba.widget(edit=save_button, up_widget=self.close_button, down_widget=self.upper_text, + left_widget=self.enable_button, right_widget=self.enable_button) + ba.widget(edit=self.close_button, up_widget=increase_button, down_widget=save_button, + left_widget=self.enable_button, right_widget=save_button) + ba.widget(edit=self.lower_text, up_widget=self.enable_button, down_widget=decrease_button, + left_widget=self.upper_text, right_widget=self.upper_text) + ba.widget(edit=self.upper_text, up_widget=save_button, down_widget=increase_button, + left_widget=self.lower_text, right_widget=self.lower_text) + ba.widget(edit=decrease_button, up_widget=self.lower_text, down_widget=self.enable_button, + left_widget=increase_button, right_widget=increase_button) + ba.widget(edit=increase_button, up_widget=self.upper_text, down_widget=self.close_button, + left_widget=decrease_button, right_widget=decrease_button) +# -------------------------------------------------------------------------------------------------- -#++++++++++++++++for keyboard navigation++++++++++++++++ - ba.widget(edit=self.enable_button,up_widget=decrease_button,down_widget=self.lower_text,left_widget=save_button,right_widget=save_button) - ba.widget(edit=save_button,up_widget=self.close_button,down_widget=self.upper_text,left_widget=self.enable_button,right_widget=self.enable_button) - ba.widget(edit=self.close_button,up_widget=increase_button,down_widget=save_button,left_widget=self.enable_button,right_widget=save_button) - ba.widget(edit=self.lower_text,up_widget=self.enable_button,down_widget=decrease_button,left_widget=self.upper_text,right_widget=self.upper_text) - ba.widget(edit=self.upper_text,up_widget=save_button,down_widget=increase_button,left_widget=self.lower_text,right_widget=self.lower_text) - ba.widget(edit=decrease_button,up_widget=self.lower_text,down_widget=self.enable_button,left_widget=increase_button,right_widget=increase_button) - ba.widget(edit=increase_button,up_widget=self.upper_text,down_widget=self.close_button,left_widget=decrease_button,right_widget=decrease_button) -#-------------------------------------------------------------------------------------------------- - ba.textwidget(edit=self.upper_text, on_activate_call=ba.Call(self.on_text_click, "upper")) ba.textwidget(edit=self.lower_text, on_activate_call=ba.Call(self.on_text_click, "lower")) - + def on_enableButton_press(self): global loop - loop=ba.app.config.get("moodlightEnabled") + loop = ba.app.config.get("moodlightEnabled") if loop: - loop=False - label="ENABLE" - color=(0,1,0) + loop = False + label = "ENABLE" + color = (0, 1, 0) elif not loop: - loop=True - label="DISABLE" - color=(1,0,0) - Print("Restart level to enable") - ba.app.config["moodlightEnabled"]=loop + loop = True + label = "DISABLE" + color = (1, 0, 0) + Print("Restart level to enable") + ba.app.config["moodlightEnabled"] = loop ba.app.config.commit() - ba.buttonwidget(edit=self.enable_button,label=label,color=color) - + ba.buttonwidget(edit=self.enable_button, label=label, color=color) + def save_settings(self): - ba.app.config["moodlightingSettings"]=(Ldefault,Udefault) + ba.app.config["moodlightingSettings"] = (Ldefault, Udefault) ba.app.config.commit() Print("settings saved") self.close() @@ -258,58 +266,60 @@ class SettingWindow(ba.Window): def close(self): ba.containerwidget(edit=self._root_widget, transition="out_right",) -def new_chat_message(msg: Union[str, ba.Lstr], clients:Sequence[int] = None, sender_override: str = None): - old_fcm(msg, clients, sender_override) - if msg == 'ml': - try: - Ldefault, Udefault=ba.app.config.get("moodlightingSettings") - SettingWindow() - cprint("Mood light settings opened") - except Exception as err: - Print(err) - + +def new_chat_message(msg: Union[str, ba.Lstr], clients: Sequence[int] = None, sender_override: str = None): + old_fcm(msg, clients, sender_override) + if msg == 'ml': + try: + Ldefault, Udefault = ba.app.config.get("moodlightingSettings") + SettingWindow() + cprint("Mood light settings opened") + except Exception as err: + Print(err) + + old_fcm = _ba.chatmessage _ba.chatmessage = new_chat_message _ba.set_party_icon_always_visible(True) -Map._old_init = Map.__init__ - +Map._old_init = Map.__init__ + # ba_meta export plugin + class moodlight(ba.Plugin): def __init__(self): pass - - def on_app_running(self): - _ba.show_progress_bar() - def on_plugin_manager_prompt(self):#called by plugin manager - SettingWindow() - + def on_app_running(self): + _ba.show_progress_bar() + + def on_plugin_manager_prompt(self): # called by plugin manager + SettingWindow() + def _new_init(self, vr_overlay_offset: Optional[Sequence[float]] = None) -> None: self._old_init(vr_overlay_offset) - in_game = not isinstance(_ba.get_foreground_host_session(), mainmenu.MainMenuSession) + in_game = not isinstance(_ba.get_foreground_host_session(), mainmenu.MainMenuSession) if not in_game: return - - gnode = _ba.getactivity().globalsnode - default_tint=(1.100000023841858, 1.0, 0.8999999761581421) - transition_duration=1.0#for future improvements - - def changetint(): - if loop: - Range = (random.randrange(Ldefault, Udefault)/10, random.randrange(Ldefault, - Udefault)/10, random.randrange(Ldefault, Udefault)/10) - ba.animate_array(gnode, 'tint', 3 ,{ - 0.0: gnode.tint, - transition_duration: Range - }) - else: - global timer - timer=None - ba.animate_array(gnode,"tint",3, {0.0:gnode.tint,0.4:default_tint}) - - global timer - timer=ba.Timer(0.3, changetint, repeat=True) - - Map.__init__ = _new_init + gnode = _ba.getactivity().globalsnode + default_tint = (1.100000023841858, 1.0, 0.8999999761581421) + transition_duration = 1.0 # for future improvements + + def changetint(): + if loop: + Range = (random.randrange(Ldefault, Udefault)/10, random.randrange(Ldefault, + Udefault)/10, random.randrange(Ldefault, Udefault)/10) + ba.animate_array(gnode, 'tint', 3, { + 0.0: gnode.tint, + transition_duration: Range + }) + else: + global timer + timer = None + ba.animate_array(gnode, "tint", 3, {0.0: gnode.tint, 0.4: default_tint}) + + global timer + timer = ba.Timer(0.3, changetint, repeat=True) + + Map.__init__ = _new_init From 99a837b772e4e805e15a8fae5784c4f70f6002df Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:32:21 +0530 Subject: [PATCH 4/9] Removed unused code --- plugins/utilities/mood_light.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/plugins/utilities/mood_light.py b/plugins/utilities/mood_light.py index 3eb8527..c2f6cef 100644 --- a/plugins/utilities/mood_light.py +++ b/plugins/utilities/mood_light.py @@ -25,21 +25,6 @@ def Print(*args): def cprint(*args): out = "\n".join(args) _ba.chatmessage(out) -# -# class printerr:#for debugging -# #def __init__(self): -# global errcounter -# errcounter=1 -# def __enter__(self): -# _ba.chatmessage("executing") -# -# def __exit__(self, exc_type, exc_value, exc_tb): -# cprint(exc_type, exc_value, exc_tb) -# if not(exc_type==None): -# cprint(exc_type, exc_value, exc_tb) -# else: -# cprint("Executed sucessfully","No error") - try: Ldefault, Udefault = ba.app.config.get("moodlightingSettings") From 454ed537e312cce8696c28613003712a960910e0 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 6 Oct 2022 06:02:49 +0000 Subject: [PATCH 5/9] [ci] auto-format --- plugins/utilities/mood_light.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/utilities/mood_light.py b/plugins/utilities/mood_light.py index c2f6cef..0a0b827 100644 --- a/plugins/utilities/mood_light.py +++ b/plugins/utilities/mood_light.py @@ -26,6 +26,7 @@ def cprint(*args): out = "\n".join(args) _ba.chatmessage(out) + try: Ldefault, Udefault = ba.app.config.get("moodlightingSettings") except: From d04d04e4913af738f8c242d7222fde1cc1b4c5ea Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:36:28 +0530 Subject: [PATCH 6/9] Added version 1.2.0 --- plugins/utilities.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index 7badf8d..a0412b8 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,6 +14,8 @@ } ], "versions": { + "1.2.0":{ + }, "1.0.0": { "api_version": 7, "commit_sha": "430da49", @@ -286,4 +288,4 @@ } } } -} \ No newline at end of file +} From 59940fd9575acca828e9bbd6a3c8099147709ad4 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 6 Oct 2022 06:06:51 +0000 Subject: [PATCH 7/9] [ci] apply-version-metadata --- plugins/utilities.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index a0412b8..08a5097 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,8 +14,7 @@ } ], "versions": { - "1.2.0":{ - }, + "1.2.0": {}, "1.0.0": { "api_version": 7, "commit_sha": "430da49", @@ -288,4 +287,4 @@ } } } -} +} \ No newline at end of file From d838115de3f06f62b8f8076304afd72d6b069f90 Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:41:52 +0530 Subject: [PATCH 8/9] Update utilities.json --- plugins/utilities.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index 08a5097..b4c6ef2 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,7 +14,7 @@ } ], "versions": { - "1.2.0": {}, + "1.2.0": null, "1.0.0": { "api_version": 7, "commit_sha": "430da49", @@ -287,4 +287,4 @@ } } } -} \ No newline at end of file +} From 6b66c44167f5a30107167098f3bfd9196af8dcea Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Thu, 6 Oct 2022 06:12:17 +0000 Subject: [PATCH 9/9] [ci] apply-version-metadata --- plugins/utilities.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index b4c6ef2..98bffec 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,7 +14,12 @@ } ], "versions": { - "1.2.0": null, + "1.2.0": { + "api_version": 7, + "commit_sha": "d838115", + "released_on": "06-10-2022", + "md5sum": "bcb8e605969eef35a210590b410e2d44" + }, "1.0.0": { "api_version": 7, "commit_sha": "430da49", @@ -287,4 +292,4 @@ } } } -} +} \ No newline at end of file