mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 21:37:57 +08:00
public/private sync
This commit is contained in:
parent
552c6049f8
commit
463595f819
2
.idea/ballisticakit.iml
generated
2
.idea/ballisticakit.iml
generated
@ -74,4 +74,4 @@
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="analyzeDoctest" value="false" />
|
||||
</component>
|
||||
</module>
|
||||
</module>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -10,4 +10,4 @@
|
||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
@ -41,9 +41,9 @@
|
||||
- Modder
|
||||
|
||||
### Era0S
|
||||
- Community Suggestions Implementer
|
||||
- Bug Fixer
|
||||
- Modder
|
||||
- Added a feature
|
||||
|
||||
### VinniTR
|
||||
- Fixes
|
||||
|
||||
@ -370,7 +370,6 @@
|
||||
"ba_data/python/bauiv1lib/__pycache__/continues.cpython-311.opt-1.pyc",
|
||||
"ba_data/python/bauiv1lib/__pycache__/creditslist.cpython-311.opt-1.pyc",
|
||||
"ba_data/python/bauiv1lib/__pycache__/debug.cpython-311.opt-1.pyc",
|
||||
"ba_data/python/bauiv1lib/__pycache__/discord.cpython-311.opt-1.pyc",
|
||||
"ba_data/python/bauiv1lib/__pycache__/feedback.cpython-311.opt-1.pyc",
|
||||
"ba_data/python/bauiv1lib/__pycache__/fileselector.cpython-311.opt-1.pyc",
|
||||
"ba_data/python/bauiv1lib/__pycache__/getcurrency.cpython-311.opt-1.pyc",
|
||||
@ -431,7 +430,6 @@
|
||||
"ba_data/python/bauiv1lib/coop/tournamentbutton.py",
|
||||
"ba_data/python/bauiv1lib/creditslist.py",
|
||||
"ba_data/python/bauiv1lib/debug.py",
|
||||
"ba_data/python/bauiv1lib/discord.py",
|
||||
"ba_data/python/bauiv1lib/feedback.py",
|
||||
"ba_data/python/bauiv1lib/fileselector.py",
|
||||
"ba_data/python/bauiv1lib/gather/__init__.py",
|
||||
|
||||
@ -624,7 +624,7 @@ class Spaz(bs.Actor):
|
||||
1000.0 * (tval + self.curse_time)
|
||||
)
|
||||
self._curse_timer = bs.Timer(
|
||||
5.0, bs.WeakCall(self.handlemessage, CurseExplodeMessage())
|
||||
5.0, bs.WeakCall(self.curse_explode)
|
||||
)
|
||||
|
||||
def equip_boxing_gloves(self) -> None:
|
||||
|
||||
@ -1,129 +0,0 @@
|
||||
# Released under the MIT License. See LICENSE for details.
|
||||
#
|
||||
"""UI functionality for the Discord window."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import bauiv1 as bui
|
||||
|
||||
|
||||
class DiscordWindow(bui.Window):
|
||||
"""Window for joining the Discord."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
transition: str = 'in_right',
|
||||
origin_widget: bui.Widget | None = None,
|
||||
):
|
||||
if bui.app.classic is None:
|
||||
raise RuntimeError('This requires classic support.')
|
||||
|
||||
app = bui.app
|
||||
assert app.classic is not None
|
||||
|
||||
# If they provided an origin-widget, scale up from that.
|
||||
scale_origin: tuple[float, float] | None
|
||||
if origin_widget is not None:
|
||||
self._transition_out = 'out_scale'
|
||||
scale_origin = origin_widget.get_screen_space_center()
|
||||
transition = 'in_scale'
|
||||
else:
|
||||
self._transition_out = 'out_right'
|
||||
scale_origin = None
|
||||
|
||||
uiscale = bui.app.ui_v1.uiscale
|
||||
self._width = 800
|
||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||
self._height = 320
|
||||
top_extra = 10 if uiscale is bui.UIScale.SMALL else 0
|
||||
super().__init__(
|
||||
root_widget=bui.containerwidget(
|
||||
size=(self._width, self._height + top_extra),
|
||||
transition=transition,
|
||||
toolbar_visibility='menu_minimal',
|
||||
scale_origin_stack_offset=scale_origin,
|
||||
scale=(
|
||||
1.6
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 1.3
|
||||
if uiscale is bui.UIScale.MEDIUM
|
||||
else 1.0
|
||||
),
|
||||
stack_offset=(0, 5) if uiscale is bui.UIScale.SMALL else (0, 0),
|
||||
)
|
||||
)
|
||||
|
||||
if app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||
bui.containerwidget(
|
||||
edit=self._root_widget, on_cancel_call=self._do_back
|
||||
)
|
||||
self._back_button = None
|
||||
else:
|
||||
self._back_button = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
position=(53 + x_inset, self._height - 60),
|
||||
size=(140, 60),
|
||||
scale=0.8,
|
||||
autoselect=True,
|
||||
label=bui.Lstr(resource='backText'),
|
||||
button_type='back',
|
||||
on_activate_call=self._do_back,
|
||||
)
|
||||
bui.containerwidget(
|
||||
edit=self._root_widget, cancel_button=self._back_button
|
||||
)
|
||||
|
||||
self._title_text = bui.textwidget(
|
||||
parent=self._root_widget,
|
||||
position=(0, self._height - 52),
|
||||
size=(self._width, 25),
|
||||
text='Discord',
|
||||
color=app.ui_v1.title_color,
|
||||
h_align='center',
|
||||
v_align='top',
|
||||
)
|
||||
|
||||
min_size = min(self._width - 25, self._height - 25)
|
||||
bui.imagewidget(
|
||||
parent=self._root_widget,
|
||||
position=(40, -15),
|
||||
size=(min_size, min_size),
|
||||
texture=bui.gettexture('discordPreview'),
|
||||
)
|
||||
|
||||
bui.textwidget(
|
||||
parent=self._root_widget,
|
||||
position=(self._width / 2 - 60, self._height - 100),
|
||||
text='We have our own Discord server where you can:\n- Find new'
|
||||
' friends and people to play with\n- Participate in Office'
|
||||
' Hours/Coffee with Eric\n- Share mods, plugins, art, and'
|
||||
' memes\n- Report bugs and make feature suggestions\n'
|
||||
'- Troubleshoot issues',
|
||||
maxwidth=(self._width - 10) / 2,
|
||||
color=(1, 1, 1, 1),
|
||||
h_align='left',
|
||||
v_align='top',
|
||||
)
|
||||
|
||||
bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
position=(self._width / 2 - 30, 20),
|
||||
size=(self._width / 2 - 60, 60),
|
||||
autoselect=True,
|
||||
label='Join The Discord',
|
||||
text_scale=1.0,
|
||||
on_activate_call=bui.Call(
|
||||
bui.open_url, 'https://ballistica.net/discord'
|
||||
),
|
||||
)
|
||||
|
||||
if self._back_button is not None:
|
||||
bui.buttonwidget(
|
||||
edit=self._back_button,
|
||||
button_type='backSmall',
|
||||
size=(60, 60),
|
||||
label=bui.charstr(bui.SpecialChar.BACK),
|
||||
)
|
||||
|
||||
def _do_back(self) -> None:
|
||||
bui.containerwidget(edit=self._root_widget, transition='out_scale')
|
||||
@ -80,12 +80,15 @@ class AboutGatherTab(GatherTab):
|
||||
|
||||
bui.textwidget(
|
||||
parent=self._container,
|
||||
position=(region_width * 0.5, c_height_2 * 0.58),
|
||||
position=(
|
||||
region_width * 0.5,
|
||||
c_height_2 * (0.58 if include_invite else 0.5),
|
||||
),
|
||||
color=(0.6, 1.0, 0.6),
|
||||
scale=msc_scale,
|
||||
size=(0, 0),
|
||||
maxwidth=region_width * 0.9,
|
||||
max_height=c_height_2 * 0.7,
|
||||
max_height=c_height_2 * (0.7 if include_invite else 0.9),
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
text=message,
|
||||
@ -94,7 +97,7 @@ class AboutGatherTab(GatherTab):
|
||||
if include_invite:
|
||||
bui.textwidget(
|
||||
parent=self._container,
|
||||
position=(region_width * 0.57, 85),
|
||||
position=(region_width * 0.57, 35),
|
||||
color=(0, 1, 0),
|
||||
scale=0.6,
|
||||
size=(0, 0),
|
||||
@ -109,7 +112,7 @@ class AboutGatherTab(GatherTab):
|
||||
)
|
||||
bui.buttonwidget(
|
||||
parent=self._container,
|
||||
position=(region_width * 0.59, 60),
|
||||
position=(region_width * 0.59, 10),
|
||||
size=(230, 50),
|
||||
color=(0.54, 0.42, 0.56),
|
||||
textcolor=(0, 1, 0),
|
||||
@ -121,32 +124,6 @@ class AboutGatherTab(GatherTab):
|
||||
on_activate_call=bui.WeakCall(self._invite_to_try_press),
|
||||
up_widget=tab_button,
|
||||
)
|
||||
|
||||
bui.textwidget(
|
||||
parent=self._container,
|
||||
position=(region_width * 0.57, 15 if include_invite else 75),
|
||||
color=(0.6, 0.6, 1),
|
||||
scale=0.6,
|
||||
size=(0, 0),
|
||||
maxwidth=region_width * 0.5,
|
||||
h_align='right',
|
||||
v_align='center',
|
||||
flatness=1.0,
|
||||
text='Want to look for new people to play with?\nJoin our Discord'
|
||||
' and find new friends!',
|
||||
)
|
||||
bui.buttonwidget(
|
||||
parent=self._container,
|
||||
position=(region_width * 0.59, -10 if include_invite else 50),
|
||||
size=(230, 50),
|
||||
color=(0.54, 0.42, 0.56),
|
||||
textcolor=(0.6, 0.6, 1),
|
||||
label='Join The Discord',
|
||||
autoselect=True,
|
||||
on_activate_call=bui.WeakCall(self._join_the_discord_press),
|
||||
up_widget=tab_button,
|
||||
)
|
||||
|
||||
return self._container
|
||||
|
||||
def _invite_to_try_press(self) -> None:
|
||||
@ -160,10 +137,3 @@ class AboutGatherTab(GatherTab):
|
||||
show_sign_in_prompt()
|
||||
return
|
||||
handle_app_invites_press()
|
||||
|
||||
def _join_the_discord_press(self) -> None:
|
||||
# pylint: disable=cyclic-import
|
||||
from bauiv1lib.discord import DiscordWindow
|
||||
|
||||
assert bui.app.classic is not None
|
||||
DiscordWindow().get_root_widget()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user