Merge pull request #360 from BroBordd/main

Many fixes
This commit is contained in:
Loup 2025-04-08 22:18:44 +05:30 committed by GitHub
commit 2fe40c15d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 241 additions and 164 deletions

View file

@ -1,5 +1,9 @@
## Plugin Manager (dd-mm-yyyy) ## Plugin Manager (dd-mm-yyyy)
### 1.1.2 (06-04-2025)
- Small UI fixes.
### 1.1.1 (09-02-2025) ### 1.1.1 (09-02-2025)
- Added bomb spinner widget for loading animation. - Added bomb spinner widget for loading animation.

View file

@ -1,6 +1,12 @@
{ {
"plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py",
"versions": { "versions": {
"1.1.2": {
"api_version": 9,
"commit_sha": "8f484fc",
"released_on": "08-04-2025",
"md5sum": "a6dd38d92c6c850cd1bab866870e48b5"
},
"1.1.1": { "1.1.1": {
"api_version": 9, "api_version": 9,
"commit_sha": "93106f2", "commit_sha": "93106f2",

View file

@ -29,7 +29,7 @@ from datetime import datetime
# Modules used for overriding AllSettingsWindow # Modules used for overriding AllSettingsWindow
import logging import logging
PLUGIN_MANAGER_VERSION = "1.1.1" PLUGIN_MANAGER_VERSION = "1.1.2"
REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager"
# Current tag can be changed to "staging" or any other branch in # Current tag can be changed to "staging" or any other branch in
# plugin manager repo for testing purpose. # plugin manager repo for testing purpose.
@ -850,12 +850,13 @@ class ChangelogWindow(popup.PopupWindow):
self._transition_out = 'out_scale' self._transition_out = 'out_scale'
transition = 'in_scale' transition = 'in_scale'
self._root_widget = bui.containerwidget(size=(width, height), self._root_widget = bui.containerwidget(
on_outside_click_call=self._back, size=(width, height),
transition=transition, on_outside_click_call=self._back,
scale=(1.5 if _uiscale is babase.UIScale.SMALL else 1.5 transition=transition,
if _uiscale is babase.UIScale.MEDIUM else 1.0), scale=(1.5 if _uiscale is babase.UIScale.SMALL else 1.5 if _uiscale is babase.UIScale.MEDIUM else 1.0),
scale_origin_stack_offset=self.scale_origin) scale_origin_stack_offset=self.scale_origin
)
bui.textwidget(parent=self._root_widget, bui.textwidget(parent=self._root_widget,
position=(width * 0.49, height * 0.87), size=(0, 0), position=(width * 0.49, height * 0.87), size=(0, 0),
@ -928,12 +929,14 @@ class AuthorsWindow(popup.PopupWindow):
self._transition_out = 'out_scale' self._transition_out = 'out_scale'
transition = 'in_scale' transition = 'in_scale'
self._root_widget = bui.containerwidget(size=(width, height), self._root_widget = bui.containerwidget(
on_outside_click_call=self._back, size=(width, height),
transition=transition, on_outside_click_call=self._back,
scale=(1.5 if _uiscale is babase.UIScale.SMALL else 1.5 transition=transition,
if _uiscale is babase.UIScale.MEDIUM else 1.0), scale=(1.5 if _uiscale is babase.UIScale.SMALL else 1.5
scale_origin_stack_offset=self.scale_origin) if _uiscale is babase.UIScale.MEDIUM else 1.0),
scale_origin_stack_offset=self.scale_origin
)
pos = height * 0.9 pos = height * 0.9
bui.textwidget(parent=self._root_widget, bui.textwidget(parent=self._root_widget,
@ -1030,12 +1033,14 @@ class PluginWindow(popup.PopupWindow):
self._transition_out = 'out_scale' self._transition_out = 'out_scale'
transition = 'in_scale' transition = 'in_scale'
self._root_widget = bui.containerwidget(size=(width, height), self._root_widget = bui.containerwidget(
on_outside_click_call=self._cancel, size=(width, height),
transition=transition, on_outside_click_call=self._cancel,
scale=(2.1 if _uiscale is babase.UIScale.SMALL else 1.5 transition=transition,
if _uiscale is babase.UIScale.MEDIUM else 1.0), scale=(2.1 if _uiscale is babase.UIScale.SMALL else 1.5
scale_origin_stack_offset=self.scale_origin) if _uiscale is babase.UIScale.MEDIUM else 1.0),
scale_origin_stack_offset=self.scale_origin
)
pos = height * 0.8 pos = height * 0.8
plug_name = self.plugin.name.replace('_', ' ').title() plug_name = self.plugin.name.replace('_', ' ').title()
@ -1146,9 +1151,11 @@ class PluginWindow(popup.PopupWindow):
text_scale=1, text_scale=1,
label=button3_label) label=button3_label)
bui.containerwidget(edit=self._root_widget, bui.containerwidget(
on_cancel_call=self._cancel, edit=self._root_widget,
selected_child=selected_btn) on_cancel_call=self._cancel,
selected_child=selected_btn
)
open_pos_x = (390 if _uiscale is babase.UIScale.SMALL else open_pos_x = (390 if _uiscale is babase.UIScale.SMALL else
450 if _uiscale is babase.UIScale.MEDIUM else 440) 450 if _uiscale is babase.UIScale.MEDIUM else 440)
@ -1474,13 +1481,15 @@ class PluginSourcesWindow(popup.PopupWindow):
b_textcolor = (0.75, 0.7, 0.8) b_textcolor = (0.75, 0.7, 0.8)
self._transition_out = 'out_scale' self._transition_out = 'out_scale'
transition = 'in_scale' transition = 'in_scale'
self._root_widget = bui.containerwidget(size=(400, 340), self._root_widget = bui.containerwidget(
on_outside_click_call=self._ok, size=(400, 340),
transition=transition, on_outside_click_call=self._ok,
scale=(2.1 if _uiscale is babase.UIScale.SMALL else 1.5 transition=transition,
if _uiscale is babase.UIScale.MEDIUM else 1.0), scale=(2.1 if _uiscale is babase.UIScale.SMALL else 1.5
scale_origin_stack_offset=self.scale_origin, if _uiscale is babase.UIScale.MEDIUM else 1.0),
on_cancel_call=self._ok) scale_origin_stack_offset=self.scale_origin,
on_cancel_call=self._ok
)
bui.textwidget( bui.textwidget(
parent=self._root_widget, parent=self._root_widget,
@ -1637,7 +1646,7 @@ class PluginCategoryWindow(popup.PopupMenuWindow):
self._asyncio_callback = asyncio_callback self._asyncio_callback = asyncio_callback
self.scale_origin = origin_widget.get_screen_space_center() self.scale_origin = origin_widget.get_screen_space_center()
super().__init__( super().__init__(
position=(200, 0), position=self.scale_origin,
scale=(2.3 if _uiscale is babase.UIScale.SMALL else scale=(2.3 if _uiscale is babase.UIScale.SMALL else
1.65 if _uiscale is babase.UIScale.MEDIUM else 1.23), 1.65 if _uiscale is babase.UIScale.MEDIUM else 1.23),
choices=choices, choices=choices,
@ -1667,7 +1676,7 @@ class PluginCategoryWindow(popup.PopupMenuWindow):
class PluginManagerWindow(bui.MainWindow): class PluginManagerWindow(bui.MainWindow):
def __init__(self, transition: str = "in_right", origin_widget: bui.Widget = None): def __init__(self, transition: str = "in_right", origin_widget: bui.widget = None):
self.plugin_manager = PluginManager() self.plugin_manager = PluginManager()
self.category_selection_button = None self.category_selection_button = None
self.selected_category = 'All' self.selected_category = 'All'
@ -1760,12 +1769,18 @@ class PluginManagerWindow(bui.MainWindow):
size=48, size=48,
) )
def spin(self, show=False):
w = self._loading_spinner
p = self._root_widget
bui.spinnerwidget(w, visible=show) if w.exists(
) and p.exists() and not p.transitioning_out else None
@contextlib.contextmanager @contextlib.contextmanager
def exception_handler(self): def exception_handler(self):
try: try:
yield yield
except urllib.error.URLError: except urllib.error.URLError:
bui.spinnerwidget(edit=self._loading_spinner, visible=False) self.spin()
try: try:
bui.textwidget( bui.textwidget(
edit=self._plugin_manager_status_text, edit=self._plugin_manager_status_text,
@ -1778,7 +1793,7 @@ class PluginManagerWindow(bui.MainWindow):
# User probably went back before a bui.Window could finish loading. # User probably went back before a bui.Window could finish loading.
pass pass
except Exception as e: except Exception as e:
bui.spinnerwidget(edit=self._loading_spinner, visible=False) self.spin()
try: try:
bui.textwidget(edit=self._plugin_manager_status_text, text=str(e)) bui.textwidget(edit=self._plugin_manager_status_text, text=str(e))
except: except:
@ -1794,7 +1809,7 @@ class PluginManagerWindow(bui.MainWindow):
with self.exception_handler(): with self.exception_handler():
await self.plugin_manager.setup_changelog() await self.plugin_manager.setup_changelog()
await self.plugin_manager.setup_index() await self.plugin_manager.setup_index()
bui.spinnerwidget(edit=self._loading_spinner, visible=False) self.spin()
try: try:
bui.textwidget(edit=self._plugin_manager_status_text, text="") bui.textwidget(edit=self._plugin_manager_status_text, text="")
except: except:
@ -1840,26 +1855,30 @@ class PluginManagerWindow(bui.MainWindow):
textcolor=b_textcolor, textcolor=b_textcolor,
text_scale=0.6) text_scale=0.6)
else: else:
bui.buttonwidget(edit=self.alphabet_order_selection_button, b = self.alphabet_order_selection_button
label=('Z - A' if self.selected_alphabet_order == 'z_a' else 'A - Z') bui.buttonwidget(
) edit=b,
label=('Z - A' if self.selected_alphabet_order == 'z_a' else 'A - Z')
) if b.exists() else None
label = f"Category: {post_label}" label = f"Category: {post_label}"
if self.category_selection_button is None: if self.category_selection_button is None:
self.category_selection_button = bui.buttonwidget(parent=self._root_widget, self.category_selection_button = b = bui.buttonwidget(parent=self._root_widget,
position=(category_pos_x, position=(category_pos_x,
category_pos_y), category_pos_y),
size=b_size, size=b_size,
on_activate_call=( label=label,
self.show_categories_window), button_type="square",
label=label, textcolor=b_textcolor,
button_type="square", text_scale=0.6)
textcolor=b_textcolor, bui.buttonwidget(b, on_activate_call=lambda: self.show_categories_window(source=b)),
text_scale=0.6)
else: else:
self.category_selection_button = bui.buttonwidget(edit=self.category_selection_button, b = self.category_selection_button
label=label) bui.buttonwidget(
edit=b,
label=label
) if b.exists() else None
async def _on_order_button_press(self) -> None: async def _on_order_button_press(self) -> None:
self.selected_alphabet_order = ('a_z' if self.selected_alphabet_order == 'z_a' else 'z_a') self.selected_alphabet_order = ('a_z' if self.selected_alphabet_order == 'z_a' else 'z_a')
@ -1944,10 +1963,15 @@ class PluginManagerWindow(bui.MainWindow):
position=(settings_pos_x, settings_pos_y), position=(settings_pos_x, settings_pos_y),
size=(30, 30), size=(30, 30),
button_type="square", button_type="square",
label="", label="")
on_activate_call=babase.Call(PluginManagerSettingsWindow, bui.buttonwidget(
self.plugin_manager, controller_button,
self._root_widget)) on_activate_call=babase.Call(
PluginManagerSettingsWindow,
self.plugin_manager,
controller_button
)
)
bui.imagewidget(parent=self._root_widget, bui.imagewidget(parent=self._root_widget,
position=(settings_pos_x, settings_pos_y), position=(settings_pos_x, settings_pos_y),
size=(30, 30), size=(30, 30),
@ -1961,19 +1985,22 @@ class PluginManagerWindow(bui.MainWindow):
refresh_pos_y = (180 if _uiscale is babase.UIScale.SMALL else refresh_pos_y = (180 if _uiscale is babase.UIScale.SMALL else
108 if _uiscale is babase.UIScale.MEDIUM else 120) 108 if _uiscale is babase.UIScale.MEDIUM else 120)
controller_button = bui.buttonwidget(parent=self._root_widget, controller_button = bui.buttonwidget(
position=(refresh_pos_x, refresh_pos_y), parent=self._root_widget,
size=(30, 30), position=(refresh_pos_x, refresh_pos_y),
button_type="square", size=(30, 30),
label="", button_type="square",
on_activate_call=lambda: label="",
loop.create_task(self.refresh())) on_activate_call=lambda: loop.create_task(self.refresh())
bui.imagewidget(parent=self._root_widget, )
position=(refresh_pos_x, refresh_pos_y), bui.imagewidget(
size=(30, 30), parent=self._root_widget,
color=(0.8, 0.95, 1), position=(refresh_pos_x, refresh_pos_y),
texture=bui.gettexture("replayIcon"), size=(30, 30),
draw_controller=controller_button) color=(0.8, 0.95, 1),
texture=bui.gettexture("replayIcon"),
draw_controller=controller_button
)
def search_term_filterer(self, plugin, search_term): def search_term_filterer(self, plugin, search_term):
# This helps resolve "plugin name" to "plugin_name". # This helps resolve "plugin name" to "plugin_name".
@ -2029,17 +2056,19 @@ class PluginManagerWindow(bui.MainWindow):
self._last_filter_text = search_term self._last_filter_text = search_term
self._last_filter_plugins = plugins self._last_filter_plugins = plugins
if not self._columnwidget.exists():
return
if category == 'Installed': if category == 'Installed':
plugin_names_to_draw = tuple(self.draw_plugin_name(plugin) plugin_names_to_draw = tuple(
for plugin in plugins if plugin.is_installed) self.draw_plugin_name(plugin) for plugin in plugins if plugin.is_installed
)
else: else:
plugin_names_to_draw = tuple(self.draw_plugin_name(plugin) for plugin in plugins) plugin_names_to_draw = tuple(self.draw_plugin_name(plugin) for plugin in plugins)
for plugin in self._columnwidget.get_children(): [plugin.delete() for plugin in self._columnwidget.get_children()]
plugin.delete()
text_widget = bui.textwidget(parent=self._columnwidget) text_widget = bui.textwidget(parent=self._columnwidget)
text_widget.delete() text_widget.delete()
await asyncio.gather(*plugin_names_to_draw) await asyncio.gather(*plugin_names_to_draw)
async def draw_plugin_name(self, plugin): async def draw_plugin_name(self, plugin):
@ -2065,20 +2094,24 @@ class PluginManagerWindow(bui.MainWindow):
plugin_name_widget_to_update = self.plugins_in_current_view.get(plugin.name) plugin_name_widget_to_update = self.plugins_in_current_view.get(plugin.name)
if plugin_name_widget_to_update: if plugin_name_widget_to_update:
bui.textwidget(edit=plugin_name_widget_to_update, bui.textwidget(
color=color) edit=plugin_name_widget_to_update,
color=color
)
else: else:
text_widget = bui.textwidget(parent=self._columnwidget, text_widget = bui.textwidget(
size=(410, 30), parent=self._columnwidget,
selectable=True, size=(410, 30),
always_highlight=True, selectable=True,
color=color, always_highlight=True,
text=plugin.name.replace('_', ' ').title(), color=color,
click_activate=True, text=plugin.name.replace('_', ' ').title(),
on_activate_call=lambda: self.show_plugin_window(plugin), click_activate=True,
h_align='left', on_activate_call=lambda: self.show_plugin_window(plugin),
v_align='center', h_align='left',
maxwidth=420) v_align='center',
maxwidth=420
)
self.plugins_in_current_view[plugin.name] = text_widget self.plugins_in_current_view[plugin.name] = text_widget
# XXX: This seems nicer. Might wanna use this in future. # XXX: This seems nicer. Might wanna use this in future.
# text_widget.add_delete_callback(lambda: self.plugins_in_current_view.pop(plugin.name)) # text_widget.add_delete_callback(lambda: self.plugins_in_current_view.pop(plugin.name))
@ -2086,11 +2119,11 @@ class PluginManagerWindow(bui.MainWindow):
def show_plugin_window(self, plugin): def show_plugin_window(self, plugin):
PluginWindow(plugin, self._root_widget, lambda: self.draw_plugin_name(plugin)) PluginWindow(plugin, self._root_widget, lambda: self.draw_plugin_name(plugin))
def show_categories_window(self): def show_categories_window(self, source):
PluginCategoryWindow( PluginCategoryWindow(
self.plugin_manager.categories.keys(), self.plugin_manager.categories.keys(),
self.selected_category, self.selected_category,
self._root_widget, source,
self.select_category, self.select_category,
) )
@ -2116,13 +2149,13 @@ class PluginManagerWindow(bui.MainWindow):
# except: # except:
# pass # pass
bui.spinnerwidget(edit=self._loading_spinner, visible=True) self.spin(True)
with self.exception_handler(): with self.exception_handler():
await self.plugin_manager.refresh() await self.plugin_manager.refresh()
await self.plugin_manager.setup_changelog() await self.plugin_manager.setup_changelog()
await self.plugin_manager.setup_index() await self.plugin_manager.setup_index()
bui.spinnerwidget(edit=self._loading_spinner, visible=False) self.spin()
try: try:
bui.textwidget(edit=self._plugin_manager_status_text, text="") bui.textwidget(edit=self._plugin_manager_status_text, text="")
except: except:
@ -2158,34 +2191,37 @@ class PluginManagerSettingsWindow(popup.PopupWindow):
transition = 'in_scale' transition = 'in_scale'
button_size = (32 * s, 32 * s) button_size = (32 * s, 32 * s)
# index = await self._plugin_manager.get_index() # index = await self._plugin_manager.get_index()
self._root_widget = bui.containerwidget(size=(width, height), self._root_widget = bui.containerwidget(
on_outside_click_call=self._ok, size=(width, height),
transition=transition, on_outside_click_call=self._ok,
scale=(2.1 if _uiscale is babase.UIScale.SMALL else 1.5 transition=transition,
if _uiscale is babase.UIScale.MEDIUM else 1.0), scale=(2.1 if _uiscale is babase.UIScale.SMALL else 1.5
scale_origin_stack_offset=self.scale_origin) if _uiscale is babase.UIScale.MEDIUM else 1.0),
scale_origin_stack_offset=self.scale_origin
)
pos = height * 0.9 pos = height * 0.9
setting_title = "Settings" setting_title = "Settings"
bui.textwidget(parent=self._root_widget, bui.textwidget(
position=(width * 0.49, pos), parent=self._root_widget,
size=(0, 0), position=(width * 0.49, pos),
h_align='center', size=(0, 0),
v_align='center', h_align='center',
text=setting_title, v_align='center',
scale=text_scale, text=setting_title,
color=bui.app.ui_v1.title_color, scale=text_scale,
maxwidth=width * 0.9) color=bui.app.ui_v1.title_color,
maxwidth=width * 0.9
)
pos -= 20 pos -= 20
self._changelog_button = bui.buttonwidget(parent=self._root_widget, self._changelog_button = b = bui.buttonwidget(parent=self._root_widget,
position=((width * 0.2) - button_size[0] / 2 - 5, position=((width * 0.2) - button_size[0] / 2 - 5,
pos), pos),
size=(80, 30), size=(80, 30),
on_activate_call=lambda: textcolor=b_text_color,
ChangelogWindow(self._root_widget), button_type='square',
textcolor=b_text_color, label='')
button_type='square', bui.buttonwidget(b, on_activate_call=lambda: ChangelogWindow(b))
label='')
bui.textwidget(parent=self._root_widget, bui.textwidget(parent=self._root_widget,
position=((width * 0.2) - button_size[0] / 2, pos), position=((width * 0.2) - button_size[0] / 2, pos),
size=(70, 30), size=(70, 30),
@ -2369,7 +2405,7 @@ class NewAllSettingsWindow(AllSettingsWindow):
def __init__( def __init__(
self, self,
transition: str | None = 'in_right', transition: str | None = 'in_right',
origin_widget: bui.Widget | None = None, origin_widget: bui.widget | None = None,
): ):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -2445,7 +2481,7 @@ class NewAllSettingsWindow(AllSettingsWindow):
x_offs4 -= x_dif x_offs4 -= x_dif
def _b_title( def _b_title(
x: float, y: float, button: bui.Widget, text: str | bui.Lstr x: float, y: float, button: bui.widget, text: str | bui.Lstr
) -> None: ) -> None:
bui.textwidget( bui.textwidget(
parent=self._root_widget, parent=self._root_widget,
@ -2604,7 +2640,7 @@ class NewAllSettingsWindow(AllSettingsWindow):
sel_name = bui.app.ui_v1.window_states.get(type(self), {}).get( sel_name = bui.app.ui_v1.window_states.get(type(self), {}).get(
'sel_name' 'sel_name'
) )
sel: bui.Widget | None sel: bui.widget | None
if sel_name == 'Controllers': if sel_name == 'Controllers':
sel = self._controllers_button sel = self._controllers_button
elif sel_name == 'Graphics': elif sel_name == 'Graphics':

View file

@ -58,6 +58,12 @@
} }
], ],
"versions": { "versions": {
"1.2.1": {
"api_version": 9,
"commit_sha": "f1917f7",
"released_on": "08-04-2025",
"md5sum": "e523a7a40024c01e6a7595836237ee8b"
},
"1.2.0": { "1.2.0": {
"api_version": 8, "api_version": 8,
"commit_sha": "3a62e48", "commit_sha": "3a62e48",
@ -77,6 +83,12 @@
} }
], ],
"versions": { "versions": {
"1.1.1": {
"api_version": 9,
"commit_sha": "f1917f7",
"released_on": "08-04-2025",
"md5sum": "45925247145c0126f73f895932202822"
},
"1.1.0": { "1.1.0": {
"api_version": 9, "api_version": 9,
"commit_sha": "90cbaf7", "commit_sha": "90cbaf7",
@ -753,6 +765,12 @@
} }
], ],
"versions": { "versions": {
"2.1.3": {
"api_version": 9,
"commit_sha": "0defd84",
"released_on": "05-04-2025",
"md5sum": "9d58abc6e5b9e6779e59a2e2f35f8a3d"
},
"2.1.2": { "2.1.2": {
"api_version": 9, "api_version": 9,
"commit_sha": "c912759", "commit_sha": "c912759",

View file

@ -78,9 +78,8 @@ def newconnect_to_party(address, port=43210, print_progress=False):
global p_port global p_port
bs.chatmessage(" Joined IP "+ip_add+" PORT "+str(p_port)) bs.chatmessage(" Joined IP "+ip_add+" PORT "+str(p_port))
dd = bs.get_connection_to_host_info_2() dd = bs.get_connection_to_host_info_2()
if dd != None and dd.get('name', '') != '': title = getattr(dd, 'name', '')
title = dd['name'] bs.chatmessage(title) if dd and title else None
bs.chatmessage(title)
if (bool(dd)): if (bool(dd)):
bs.disconnect_from_host() bs.disconnect_from_host()

View file

@ -1,6 +1,6 @@
import babase as ba import babase as ba
import _babase as _ba # music control import _babase as _ba # music control
import bauiv1lib.mainmenu as mm from bauiv1lib.ingamemenu import InGameMenuWindow as igm
import bauiv1 as bui import bauiv1 as bui
import bascenev1 as bs import bascenev1 as bs
from bascenev1 import broadcastmessage as push, get_foreground_host_activity as ga from bascenev1 import broadcastmessage as push, get_foreground_host_activity as ga
@ -48,7 +48,7 @@ def var(s, v=None):
cfg.commit() cfg.commit()
class Nice(mm.MainMenuWindow): class Nice(igm):
# config, trash code ik # config, trash code ik
def_attrs = [False, "Spaz", 2.0, 0.0, 1.0, 0.4, (1, 1, 1), 3, "normal", False, False, def_attrs = [False, "Spaz", 2.0, 0.0, 1.0, 0.4, (1, 1, 1), 3, "normal", False, False,
(1, 1, 1), 0.5, False, 0.0, False, False, 9.0, 5.0, 1.0, 0.7, True, False, (1, 1, 1), 0.5, False, 0.0, False, False, 9.0, 5.0, 1.0, 0.7, True, False,
@ -2415,7 +2415,7 @@ class Nice(mm.MainMenuWindow):
if self.sbox.exists(): if self.sbox.exists():
bui.buttonwidget(edit=self.sbox, icon=bui.gettexture('chestIcon')) bui.buttonwidget(edit=self.sbox, icon=bui.gettexture('chestIcon'))
def wrap(self=mm.MainMenuWindow._refresh_in_game, *args, **kwargs): def wrap(self=igm._refresh_in_game, *args, **kwargs):
r = s(self, *args, **kwargs) r = s(self, *args, **kwargs)
h = 125 h = 125
v = self._height - 60.0 v = self._height - 60.0
@ -3108,7 +3108,7 @@ class Nice(mm.MainMenuWindow):
bui.textwidget(edit=preview_text4, text=currently_txt) bui.textwidget(edit=preview_text4, text=currently_txt)
s.hl2(lmao_bots[currently_dux].node, True) s.hl2(lmao_bots[currently_dux].node, True)
# start colntrol from here # start control from here
i.assigninput(ba.InputType.UP_DOWN, bs.Call(s.set_x)) i.assigninput(ba.InputType.UP_DOWN, bs.Call(s.set_x))
i.assigninput(ba.InputType.LEFT_RIGHT, bs.Call(s.set_y)) i.assigninput(ba.InputType.LEFT_RIGHT, bs.Call(s.set_y))
i.assigninput(ba.InputType.PICK_UP_PRESS, bs.Call(s.key, 0)) i.assigninput(ba.InputType.PICK_UP_PRESS, bs.Call(s.key, 0))
@ -3983,7 +3983,7 @@ class Nice(mm.MainMenuWindow):
s.preview(i, (bot.node.hurt < 1), 1) s.preview(i, (bot.node.hurt < 1), 1)
def listen_window(s): def listen_window(s):
global listen_widget, music_preview_image, music_preview_text, music_preview_text2, music_dux global listen_widget, music_preview_image, wmusic_preview_text, music_preview_text2, music_dux
music_dux = 8 music_dux = 8
listen_widget = bui.containerwidget(parent=bui.get_special_widget('overlay_stack'), listen_widget = bui.containerwidget(parent=bui.get_special_widget('overlay_stack'),
size=(500, 300), size=(500, 300),
@ -5925,7 +5925,7 @@ class CustomBotSet(SpazBotSet):
except: except:
pass pass
# ba_meta require api 8 # ba_meta require api 9
# BroBordd touch grass # BroBordd touch grass
# Copyright 2024, solely by BroBordd. All rights reserved. # Copyright 2024, solely by BroBordd. All rights reserved.
# ba_meta export plugin # ba_meta export plugin
@ -5933,7 +5933,7 @@ class CustomBotSet(SpazBotSet):
class byBordd(ba.Plugin): class byBordd(ba.Plugin):
def __init__(s): def __init__(s):
mm.MainMenuWindow._refresh_in_game = Nice.Button(mm.MainMenuWindow._refresh_in_game) igm._refresh_in_game = Nice.Button(igm._refresh_in_game)
# All Textures (generated) # All Textures (generated)

View file

@ -1,32 +1,46 @@
import babase as ba from bauiv1lib import party
import bauiv1 as bui from babase import (
import bauiv1lib.party SpecialChar as sc,
from bascenev1 import get_chat_messages as gcm, screenmessage as push charstr as cs,
Plugin,
Call
)
from bauiv1 import (
containerwidget as cw,
buttonwidget as bw,
textwidget as tw,
getsound as gs
)
from bascenev1 import (
get_chat_messages as gcm,
screenmessage as push
)
class VeryPW(bauiv1lib.party.PartyWindow): class VeryPW(party.PartyWindow):
def __init__(s, *args, **kwargs): def __init__(s, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
s._n = 0 s._n = 0
s._o = "" s._o = ""
s._f = True s._f = True
s._chat_texts_haxx = []
for i in range(2): for i in range(2):
bui.buttonwidget( bw(
parent=s._root_widget, parent=s._root_widget,
size=(30, 30), size=(30, 30),
label=ba.charstr(ba.SpecialChar.DOWN_ARROW if i else ba.SpecialChar.UP_ARROW), label=cs(getattr(sc, f"{['UP', 'DOWN'][i]}_ARROW")),
button_type='square', button_type='square',
position=(-15, 70 - (i * 40)), enable_sound=False,
on_activate_call=(s._d if i else s._p) position=(-15, 70-(i*40)),
on_activate_call=[s._p, s._d][i]
) )
def _c(s, t=""): bui.textwidget(edit=s._text_field, text=t) def _c(s, t=""): tw(edit=s._text_field, text=t)
def _d(s): s._p(1) def _d(s): s._p(1)
def _p(s, i=0): def _p(s, i=0):
print(s._chat_texts)
if s._f: if s._f:
s._o = bui.textwidget(query=s._text_field) s._o = tw(query=s._text_field)
s._f = False s._f = False
s._n = -1 s._n = -1
s._n = s._n + (1 if i else -1) s._n = s._n + (1 if i else -1)
@ -36,42 +50,42 @@ class VeryPW(bauiv1lib.party.PartyWindow):
except IndexError: except IndexError:
if not s._w1: if not s._w1:
push("Empty chat") push("Empty chat")
gs('block').play()
s._n = 0 s._n = 0
return return
s._n = -1 s._n = -1
s._c(s._o) s._c(s._o)
gs('deek').play()
for msg in s._chat_texts: [z.delete() for z in s._columnwidget.get_children()]
msg.delete()
for msg in s._chat_texts_haxx:
msg.delete()
for z in range(len(s._w1)): for z in range(len(s._w1)):
txt = bui.textwidget(parent=s._columnwidget, txt = tw(
text=s._w1[z], parent=s._columnwidget,
h_align='left', text=s._w1[z],
v_align='center', h_align='left',
size=(900, 13), v_align='center',
scale=0.55, size=(900, 13),
color=(1, 1, 1) if z != (s._n if s._n > - scale=0.55,
1 else s._n + len(s._w1) + 1) else (0, 0.7, 0), color=(1, 1, 1) if z != (s._n if s._n > -
position=(-0.6, 0), 1 else s._n + len(s._w1) + 1) else (0, 0.7, 0),
selectable=True, position=(-0.6, 0),
autoselect=True, selectable=True,
click_activate=True, autoselect=True,
maxwidth=s._scroll_width * 0.94, click_activate=True,
shadow=0.3, maxwidth=s._scroll_width * 0.94,
flatness=1.0) shadow=0.3,
bui.textwidget(edit=txt, flatness=1.0
on_activate_call=ba.Call( )
s._copy_msg, tw(
s._w1[z])) txt,
s._chat_texts_haxx.append(txt) on_activate_call=Call(s._copy_msg, s._w1[z])
bui.containerwidget(edit=s._columnwidget, visible_child=txt) )
cw(edit=s._columnwidget, visible_child=txt)
# ba_meta require api 9 # ba_meta require api 9
# ba_meta export plugin # ba_meta export plugin
class byBordd(ba.Plugin): class byBordd(Plugin):
def __init__(s): def __init__(s):
bauiv1lib.party.PartyWindow = VeryPW party.PartyWindow = VeryPW