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.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 json
|
||||
import os
|
||||
|
|
@ -243,6 +246,7 @@ GLOBALS_MAPDATA = {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class CustomColorPicker(ColorPicker):
|
||||
|
||||
def _select_other(self):
|
||||
|
|
@ -648,7 +652,7 @@ class MenuThemeWindow:
|
|||
# >> debugging
|
||||
self._menu_configreset_button = bui.buttonwidget(
|
||||
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),
|
||||
color=(0.0, 0.67, 0.85),
|
||||
textcolor=(0.8, 0.8, 0.8),
|
||||
|
|
@ -745,7 +749,8 @@ class MenuThemeWindow:
|
|||
button_type="regular",
|
||||
label=str(config["Menu Reflection Scale"]),
|
||||
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(
|
||||
|
|
@ -801,8 +806,6 @@ class MenuThemeWindow:
|
|||
on_activate_call=bs.Call(self.checkbox_window)
|
||||
)
|
||||
|
||||
|
||||
|
||||
def checkbox_window(self):
|
||||
self._root_widget_checkbox = bui.containerwidget(
|
||||
size=(800, 740),
|
||||
|
|
@ -950,15 +953,20 @@ class MenuThemeWindow:
|
|||
if config["tint"]:
|
||||
bs.app.config["Menu Tint"] = GLOBALS_MAPDATA.get(config["Menu Map"]).get("Tint")
|
||||
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"]:
|
||||
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"]:
|
||||
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"]:
|
||||
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"]:
|
||||
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"]:
|
||||
bs.app.config["Menu Reflection Type"] = 'Soft'
|
||||
|
||||
|
|
@ -1014,16 +1022,19 @@ class MenuThemeWindow:
|
|||
False
|
||||
)
|
||||
self.update_buttons()
|
||||
bui.screenmessage(f"Loaded {os.path.splitext(os.path.basename(self.path))[0]}!", color=(0.2, 0.4, 1.0))
|
||||
except: pass
|
||||
bui.screenmessage(
|
||||
f"Loaded {os.path.splitext(os.path.basename(self.path))[0]}!", color=(0.2, 0.4, 1.0))
|
||||
except:
|
||||
pass
|
||||
del self._file_selector
|
||||
|
||||
def _export(self, window: FreeEditWindow, txt: Any):
|
||||
path = _ba.env()['python_directory_user'] + "/_menutheme/"
|
||||
try:
|
||||
a = _ba.env()['python_directory_user'] + "/_menutheme"
|
||||
os.makedirs(a, exist_ok = False)
|
||||
except: pass
|
||||
os.makedirs(a, exist_ok=False)
|
||||
except:
|
||||
pass
|
||||
|
||||
with open(path + txt + '.json', 'w') as file:
|
||||
my_config = {
|
||||
|
|
@ -1047,13 +1058,14 @@ class MenuThemeWindow:
|
|||
"map_reflection_type": config["map_reflection_type"]
|
||||
}
|
||||
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()
|
||||
|
||||
def color_picker_popup(self, tag: str):
|
||||
bs.app.classic.accounts.have_pro = lambda: True
|
||||
CustomColorPicker(parent=self._root_widget,
|
||||
position=(0,0),
|
||||
position=(0, 0),
|
||||
initial_color=config[tag],
|
||||
delegate=self,
|
||||
tag=tag)
|
||||
|
|
@ -1086,7 +1098,8 @@ class MenuThemeWindow:
|
|||
bui.buttonwidget(edit=self._menu_rcolor_button, color=config['Menu Map Color'])
|
||||
|
||||
# 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.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",
|
||||
(1.0, 1.0, 1.0), 0.3, 'None', 'rotate',
|
||||
True, True, True, True, True, True, True, True, True
|
||||
],False
|
||||
], False
|
||||
)
|
||||
self.update_buttons()
|
||||
bui.screenmessage('Reset Settings', color=(0, 1, 0))
|
||||
|
|
@ -1132,11 +1145,13 @@ class MainMenuTheme(MainMenuActivity):
|
|||
bs.setmusic(music)
|
||||
|
||||
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)
|
||||
|
||||
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)
|
||||
|
||||
def on_transition_in(self):
|
||||
|
|
@ -1858,7 +1873,8 @@ class MainMenuTheme(MainMenuActivity):
|
|||
|
||||
def menu_theme(self):
|
||||
this_class = self
|
||||
MenuThemeWindow(accounts_window = this_class)
|
||||
MenuThemeWindow(accounts_window=this_class)
|
||||
|
||||
|
||||
def handle_config(keys: List[str], adding: bool = False):
|
||||
our_config = {
|
||||
|
|
@ -1971,6 +1987,5 @@ class Plugin(ba.Plugin):
|
|||
(0.45, 0.55, 0.54), (0.99, 0.98, 0.98), "Menu",
|
||||
(1.0, 1.0, 1.0), 0.3, 'None', 'rotate',
|
||||
True, True, True, True, True, True, True, True, True
|
||||
],True
|
||||
], True
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue