mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
[ci] auto-format
This commit is contained in:
parent
0df2c5e0dc
commit
f829acae3a
1 changed files with 498 additions and 483 deletions
|
|
@ -30,7 +30,10 @@ from bauiv1lib.colorpicker import ColorPicker, ColorPickerExact
|
||||||
from bauiv1lib.fileselector import FileSelectorWindow
|
from bauiv1lib.fileselector import FileSelectorWindow
|
||||||
from bauiv1lib.popup import PopupMenuWindow
|
from bauiv1lib.popup import PopupMenuWindow
|
||||||
|
|
||||||
import _babase as _ba, babase as ba, bascenev1 as bs, bauiv1 as bui
|
import _babase as _ba
|
||||||
|
import babase as ba
|
||||||
|
import bascenev1 as bs
|
||||||
|
import bauiv1 as bui
|
||||||
import bascenev1lib.mainmenu as menu
|
import bascenev1lib.mainmenu as menu
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
@ -243,6 +246,7 @@ GLOBALS_MAPDATA = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class CustomColorPicker(ColorPicker):
|
class CustomColorPicker(ColorPicker):
|
||||||
|
|
||||||
def _select_other(self):
|
def _select_other(self):
|
||||||
|
|
@ -648,7 +652,7 @@ class MenuThemeWindow:
|
||||||
# >> debugging
|
# >> debugging
|
||||||
self._menu_configreset_button = bui.buttonwidget(
|
self._menu_configreset_button = bui.buttonwidget(
|
||||||
parent=self._scroll_parent,
|
parent=self._scroll_parent,
|
||||||
position=(5, height - 486) if ui_type is ui_small else (12, height - 765) ,
|
position=(5, height - 486) if ui_type is ui_small else (12, height - 765),
|
||||||
size=(329, 50) if ui_type is ui_small else (600, 80),
|
size=(329, 50) if ui_type is ui_small else (600, 80),
|
||||||
color=(0.0, 0.67, 0.85),
|
color=(0.0, 0.67, 0.85),
|
||||||
textcolor=(0.8, 0.8, 0.8),
|
textcolor=(0.8, 0.8, 0.8),
|
||||||
|
|
@ -745,7 +749,8 @@ class MenuThemeWindow:
|
||||||
button_type="regular",
|
button_type="regular",
|
||||||
label=str(config["Menu Reflection Scale"]),
|
label=str(config["Menu Reflection Scale"]),
|
||||||
text_scale=0.6 if ui_type is ui_small else 1.0,
|
text_scale=0.6 if ui_type is ui_small else 1.0,
|
||||||
on_activate_call=lambda: FreeEditWindow(delegate=self, whitelist=['num'], config_name='Menu Reflection Scale')
|
on_activate_call=lambda: FreeEditWindow(
|
||||||
|
delegate=self, whitelist=['num'], config_name='Menu Reflection Scale')
|
||||||
)
|
)
|
||||||
|
|
||||||
self._menu_cameramode_button = bui.buttonwidget(
|
self._menu_cameramode_button = bui.buttonwidget(
|
||||||
|
|
@ -801,8 +806,6 @@ class MenuThemeWindow:
|
||||||
on_activate_call=bs.Call(self.checkbox_window)
|
on_activate_call=bs.Call(self.checkbox_window)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def checkbox_window(self):
|
def checkbox_window(self):
|
||||||
self._root_widget_checkbox = bui.containerwidget(
|
self._root_widget_checkbox = bui.containerwidget(
|
||||||
size=(800, 740),
|
size=(800, 740),
|
||||||
|
|
@ -950,15 +953,20 @@ class MenuThemeWindow:
|
||||||
if config["tint"]:
|
if config["tint"]:
|
||||||
bs.app.config["Menu Tint"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Tint")
|
bs.app.config["Menu Tint"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Tint")
|
||||||
if config["ambient_color"]:
|
if config["ambient_color"]:
|
||||||
bs.app.config["Menu Ambient"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Ambient")
|
bs.app.config["Menu Ambient"] = GLOBALS_MAPDATA.get(
|
||||||
|
config["Menu Map"]).get("Ambient")
|
||||||
if config["vignette_outer"]:
|
if config["vignette_outer"]:
|
||||||
bs.app.config["Menu Vignette Outer"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Vignette Outer")
|
bs.app.config["Menu Vignette Outer"] = GLOBALS_MAPDATA.get(
|
||||||
|
config["Menu Map"]).get("Vignette Outer")
|
||||||
if config["vignette_inner"]:
|
if config["vignette_inner"]:
|
||||||
bs.app.config["Menu Vignette Inner"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Vignette Inner")
|
bs.app.config["Menu Vignette Inner"] = GLOBALS_MAPDATA.get(
|
||||||
|
config["Menu Map"]).get("Vignette Inner")
|
||||||
if config["map_color"]:
|
if config["map_color"]:
|
||||||
bs.app.config["Menu Map Color"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Map Color")
|
bs.app.config["Menu Map Color"] = GLOBALS_MAPDATA.get(
|
||||||
|
config["Menu Map"]).get("Map Color")
|
||||||
if config["map_reflection_scale"]:
|
if config["map_reflection_scale"]:
|
||||||
bs.app.config["Menu Reflection Scale"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Map Reflection Scale")
|
bs.app.config["Menu Reflection Scale"] = GLOBALS_MAPDATA.get(
|
||||||
|
config["Menu Map"]).get("Map Reflection Scale")
|
||||||
if config["map_reflection_type"]:
|
if config["map_reflection_type"]:
|
||||||
bs.app.config["Menu Reflection Type"] = 'Soft'
|
bs.app.config["Menu Reflection Type"] = 'Soft'
|
||||||
|
|
||||||
|
|
@ -1014,16 +1022,19 @@ class MenuThemeWindow:
|
||||||
False
|
False
|
||||||
)
|
)
|
||||||
self.update_buttons()
|
self.update_buttons()
|
||||||
bui.screenmessage(f"Loaded {os.path.splitext(os.path.basename(self.path))[0]}!", color=(0.2, 0.4, 1.0))
|
bui.screenmessage(
|
||||||
except: pass
|
f"Loaded {os.path.splitext(os.path.basename(self.path))[0]}!", color=(0.2, 0.4, 1.0))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
del self._file_selector
|
del self._file_selector
|
||||||
|
|
||||||
def _export(self, window: FreeEditWindow, txt: Any):
|
def _export(self, window: FreeEditWindow, txt: Any):
|
||||||
path = _ba.env()['python_directory_user'] + "/_menutheme/"
|
path = _ba.env()['python_directory_user'] + "/_menutheme/"
|
||||||
try:
|
try:
|
||||||
a = _ba.env()['python_directory_user'] + "/_menutheme"
|
a = _ba.env()['python_directory_user'] + "/_menutheme"
|
||||||
os.makedirs(a, exist_ok = False)
|
os.makedirs(a, exist_ok=False)
|
||||||
except: pass
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
with open(path + txt + '.json', 'w') as file:
|
with open(path + txt + '.json', 'w') as file:
|
||||||
my_config = {
|
my_config = {
|
||||||
|
|
@ -1047,13 +1058,14 @@ class MenuThemeWindow:
|
||||||
"map_reflection_type": config["map_reflection_type"]
|
"map_reflection_type": config["map_reflection_type"]
|
||||||
}
|
}
|
||||||
json.dump(my_config, file, indent=4)
|
json.dump(my_config, file, indent=4)
|
||||||
bui.screenmessage(f"Saved {os.path.splitext(os.path.basename(path+txt+'.json'))[0]}!", color=(0.2, 0.4, 1.0))
|
bui.screenmessage(
|
||||||
|
f"Saved {os.path.splitext(os.path.basename(path+txt+'.json'))[0]}!", color=(0.2, 0.4, 1.0))
|
||||||
bui.getsound('gunCocking').play()
|
bui.getsound('gunCocking').play()
|
||||||
|
|
||||||
def color_picker_popup(self, tag: str):
|
def color_picker_popup(self, tag: str):
|
||||||
bs.app.classic.accounts.have_pro = lambda: True
|
bs.app.classic.accounts.have_pro = lambda: True
|
||||||
CustomColorPicker(parent=self._root_widget,
|
CustomColorPicker(parent=self._root_widget,
|
||||||
position=(0,0),
|
position=(0, 0),
|
||||||
initial_color=config[tag],
|
initial_color=config[tag],
|
||||||
delegate=self,
|
delegate=self,
|
||||||
tag=tag)
|
tag=tag)
|
||||||
|
|
@ -1086,7 +1098,8 @@ class MenuThemeWindow:
|
||||||
bui.buttonwidget(edit=self._menu_rcolor_button, color=config['Menu Map Color'])
|
bui.buttonwidget(edit=self._menu_rcolor_button, color=config['Menu Map Color'])
|
||||||
|
|
||||||
# menu values
|
# menu values
|
||||||
bui.buttonwidget(edit=self._menu_reflections_button, label=str(config['Menu Reflection Scale']))
|
bui.buttonwidget(edit=self._menu_reflections_button,
|
||||||
|
label=str(config['Menu Reflection Scale']))
|
||||||
bui.buttonwidget(edit=self._menu_cameramode_button, label=str(config['Menu Camera Mode']))
|
bui.buttonwidget(edit=self._menu_cameramode_button, label=str(config['Menu Camera Mode']))
|
||||||
bui.checkboxwidget(edit=self._menu_logotext_button.widget, value=config['Menu Logo Text'])
|
bui.checkboxwidget(edit=self._menu_logotext_button.widget, value=config['Menu Logo Text'])
|
||||||
|
|
||||||
|
|
@ -1101,7 +1114,7 @@ class MenuThemeWindow:
|
||||||
(0.45, 0.55, 0.54), (0.99, 0.98, 0.98), "Menu",
|
(0.45, 0.55, 0.54), (0.99, 0.98, 0.98), "Menu",
|
||||||
(1.0, 1.0, 1.0), 0.3, 'None', 'rotate',
|
(1.0, 1.0, 1.0), 0.3, 'None', 'rotate',
|
||||||
True, True, True, True, True, True, True, True, True
|
True, True, True, True, True, True, True, True, True
|
||||||
],False
|
], False
|
||||||
)
|
)
|
||||||
self.update_buttons()
|
self.update_buttons()
|
||||||
bui.screenmessage('Reset Settings', color=(0, 1, 0))
|
bui.screenmessage('Reset Settings', color=(0, 1, 0))
|
||||||
|
|
@ -1132,11 +1145,13 @@ class MainMenuTheme(MainMenuActivity):
|
||||||
bs.setmusic(music)
|
bs.setmusic(music)
|
||||||
|
|
||||||
def _make_word(self, *args, **kwargs) -> None:
|
def _make_word(self, *args, **kwargs) -> None:
|
||||||
if not config['Menu Logo Text']: return
|
if not config['Menu Logo Text']:
|
||||||
|
return
|
||||||
super()._make_word(*args, **kwargs)
|
super()._make_word(*args, **kwargs)
|
||||||
|
|
||||||
def _make_logo(self, *args, **kwargs) -> None:
|
def _make_logo(self, *args, **kwargs) -> None:
|
||||||
if not config['Menu Logo Text']: return
|
if not config['Menu Logo Text']:
|
||||||
|
return
|
||||||
super()._make_logo(*args, **kwargs)
|
super()._make_logo(*args, **kwargs)
|
||||||
|
|
||||||
def on_transition_in(self):
|
def on_transition_in(self):
|
||||||
|
|
@ -1858,7 +1873,8 @@ class MainMenuTheme(MainMenuActivity):
|
||||||
|
|
||||||
def menu_theme(self):
|
def menu_theme(self):
|
||||||
this_class = self
|
this_class = self
|
||||||
MenuThemeWindow(accounts_window = this_class)
|
MenuThemeWindow(accounts_window=this_class)
|
||||||
|
|
||||||
|
|
||||||
def handle_config(keys: List[str], adding: bool = False):
|
def handle_config(keys: List[str], adding: bool = False):
|
||||||
our_config = {
|
our_config = {
|
||||||
|
|
@ -1971,6 +1987,5 @@ class Plugin(ba.Plugin):
|
||||||
(0.45, 0.55, 0.54), (0.99, 0.98, 0.98), "Menu",
|
(0.45, 0.55, 0.54), (0.99, 0.98, 0.98), "Menu",
|
||||||
(1.0, 1.0, 1.0), 0.3, 'None', 'rotate',
|
(1.0, 1.0, 1.0), 0.3, 'None', 'rotate',
|
||||||
True, True, True, True, True, True, True, True, True
|
True, True, True, True, True, True, True, True, True
|
||||||
],True
|
], True
|
||||||
)
|
)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue