mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-23 07:23:19 +08:00
plugin categories translations and polishing
This commit is contained in:
parent
abd2d54645
commit
aa108ba813
52
.efrocachemap
generated
52
.efrocachemap
generated
@ -421,7 +421,7 @@
|
||||
"build/assets/ba_data/audio/zoeOw.ogg": "https://files.ballistica.net/cache/ba1/51/22/5b47da0beb5800a004d4a4396632",
|
||||
"build/assets/ba_data/audio/zoePickup01.ogg": "https://files.ballistica.net/cache/ba1/16/7c/afb1cdfb86bdca56ca9118676b49",
|
||||
"build/assets/ba_data/audio/zoeScream01.ogg": "https://files.ballistica.net/cache/ba1/d2/c2/5689203c1819d0f3a344e3d46193",
|
||||
"build/assets/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/95/8e/3b8fd5d19e234342a9f5dc610a78",
|
||||
"build/assets/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/be/d0/3137fc997e700bd36aa7203edfac",
|
||||
"build/assets/ba_data/data/languages/arabic.json": "https://files.ballistica.net/cache/ba1/d5/70/3296c2e326874fa11d813e35aed0",
|
||||
"build/assets/ba_data/data/languages/belarussian.json": "https://files.ballistica.net/cache/ba1/b6/42/dd53253b506f18d2851066c15672",
|
||||
"build/assets/ba_data/data/languages/chinese.json": "https://files.ballistica.net/cache/ba1/ce/76/eef117a6d75204f49d4428429aed",
|
||||
@ -430,12 +430,12 @@
|
||||
"build/assets/ba_data/data/languages/czech.json": "https://files.ballistica.net/cache/ba1/ea/77/035aac8b1642ae99c51476f9617d",
|
||||
"build/assets/ba_data/data/languages/danish.json": "https://files.ballistica.net/cache/ba1/58/a5/b47cbedf0089f2a91533d35f11c4",
|
||||
"build/assets/ba_data/data/languages/dutch.json": "https://files.ballistica.net/cache/ba1/8d/eb/98377780a8ca10fad206039a9855",
|
||||
"build/assets/ba_data/data/languages/english.json": "https://files.ballistica.net/cache/ba1/9f/98/06b9c62fc92ef12c1d9db45628ef",
|
||||
"build/assets/ba_data/data/languages/english.json": "https://files.ballistica.net/cache/ba1/30/60/e7480435137da8f92657c0ecfea5",
|
||||
"build/assets/ba_data/data/languages/esperanto.json": "https://files.ballistica.net/cache/ba1/53/13/3bfa0a5c743cd62a6049081ca8bb",
|
||||
"build/assets/ba_data/data/languages/filipino.json": "https://files.ballistica.net/cache/ba1/05/9f/fca2243adbcf28bb69a9d3648da9",
|
||||
"build/assets/ba_data/data/languages/french.json": "https://files.ballistica.net/cache/ba1/e2/18/15a112dd407a4f5cb0ca22bd3067",
|
||||
"build/assets/ba_data/data/languages/german.json": "https://files.ballistica.net/cache/ba1/24/32/7c98a2a1f1eb1c4ce89603a2724a",
|
||||
"build/assets/ba_data/data/languages/gibberish.json": "https://files.ballistica.net/cache/ba1/3c/1c/16c6ca71928720e1e3e0d3fdbe90",
|
||||
"build/assets/ba_data/data/languages/gibberish.json": "https://files.ballistica.net/cache/ba1/dc/59/9f80ffe62792c7ddfcc48e9a61f3",
|
||||
"build/assets/ba_data/data/languages/greek.json": "https://files.ballistica.net/cache/ba1/16/89/a9d8e2f88935d9bf15187abb5d65",
|
||||
"build/assets/ba_data/data/languages/hindi.json": "https://files.ballistica.net/cache/ba1/cd/14/8015add5aaf548ce4331bf50b1d5",
|
||||
"build/assets/ba_data/data/languages/hungarian.json": "https://files.ballistica.net/cache/ba1/01/29/a1c235417824047197e2fe79d8cf",
|
||||
@ -443,17 +443,17 @@
|
||||
"build/assets/ba_data/data/languages/italian.json": "https://files.ballistica.net/cache/ba1/ab/61/c6f8e4d8772accf8f0d98ffb04ee",
|
||||
"build/assets/ba_data/data/languages/korean.json": "https://files.ballistica.net/cache/ba1/12/20/18d34604ffd61e9f81a5ca2a3800",
|
||||
"build/assets/ba_data/data/languages/malay.json": "https://files.ballistica.net/cache/ba1/b4/1d/e9aa13b23246b1e5270bef53f18c",
|
||||
"build/assets/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/48/c2/c86b5fe7598de328d6c5ca6db5b9",
|
||||
"build/assets/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/47/b6/24ea71618f71cb44b12455e16b5e",
|
||||
"build/assets/ba_data/data/languages/polish.json": "https://files.ballistica.net/cache/ba1/1a/a9/e9ea6fef590f149d1a6d615f4c08",
|
||||
"build/assets/ba_data/data/languages/portuguese.json": "https://files.ballistica.net/cache/ba1/88/20/000ee8ecc06ee4e89a4596a46176",
|
||||
"build/assets/ba_data/data/languages/romanian.json": "https://files.ballistica.net/cache/ba1/2d/e9/daebca347a9450266a1c4f9c0fa5",
|
||||
"build/assets/ba_data/data/languages/russian.json": "https://files.ballistica.net/cache/ba1/e5/b4/2a6e5a48b12eecb226a827975e5d",
|
||||
"build/assets/ba_data/data/languages/serbian.json": "https://files.ballistica.net/cache/ba1/5f/a9/3a0bd59533cf6cea2f3463b0f16f",
|
||||
"build/assets/ba_data/data/languages/slovak.json": "https://files.ballistica.net/cache/ba1/12/c7/2e123ab6be9c5326397dd4e02f9f",
|
||||
"build/assets/ba_data/data/languages/spanish.json": "https://files.ballistica.net/cache/ba1/9f/8e/38a50d6b1ace1e461b57a63f3864",
|
||||
"build/assets/ba_data/data/languages/spanish.json": "https://files.ballistica.net/cache/ba1/36/23/3e4106f621dfecafd705cf02cfcd",
|
||||
"build/assets/ba_data/data/languages/swedish.json": "https://files.ballistica.net/cache/ba1/87/cb/692935d8462ea4f0843e0e42582c",
|
||||
"build/assets/ba_data/data/languages/tamil.json": "https://files.ballistica.net/cache/ba1/11/7b/6fde0b82f8bce5dbcb847744c137",
|
||||
"build/assets/ba_data/data/languages/thai.json": "https://files.ballistica.net/cache/ba1/02/8a/a4c87d7e13f280dc6b18848f1058",
|
||||
"build/assets/ba_data/data/languages/thai.json": "https://files.ballistica.net/cache/ba1/bd/70/4ce5a617da1366b0a8bd30b5726a",
|
||||
"build/assets/ba_data/data/languages/turkish.json": "https://files.ballistica.net/cache/ba1/f8/1a/da8d61236cfe345b874dd7c44b66",
|
||||
"build/assets/ba_data/data/languages/ukrainian.json": "https://files.ballistica.net/cache/ba1/f7/55/8362c390108bbe7eef4411c706a9",
|
||||
"build/assets/ba_data/data/languages/venetian.json": "https://files.ballistica.net/cache/ba1/d4/19/e1308b440afe2eacc05ed310ddc6",
|
||||
@ -4072,26 +4072,26 @@
|
||||
"build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/c5/09/4f10b8a21ba87aa5509cff7a164b",
|
||||
"build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/ff/0a/a354984f9c074dab0676ac7e4877",
|
||||
"build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/2a/1c/9ee5db6d1bceca7fa6638fb8abde",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/7a/07/c4705a424f294fd9edd6b23d0b36",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/15/d0/28bb8ccda6ac709b134eca933bc1",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d6/9f/eb5f169aaf9a683a603ee2e0d1b5",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/5f/b2/c364417b2b3a2a77140bc3f76a19",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/24/8b/003c2cf32712cf4b31614afc4e19",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/4b/0f/3935287e71cc6a0a329707f157b0",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e9/90/66b477c087a7a5e123182ec4bbfa",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/34/d4/30dcd4b7cc36e00a0b24b4a4e638",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/7e/9e/938e630d6ec9441e63eec0f4934b",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/9d/e0/f1d9a6b64086c97314a07d612747",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/cc/46/636ac189c75f554128de10e2a15a",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/63/b4/081ae5a491ae7734142c322efdb1",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/f4/11/70173d1a40daef28a5ab56120fba",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/c5/f3/a191439ea2f83d5ba2402d0aa85b",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/da/fe/d36966c57e0075e90c71caccfc35",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/48/24/b6ba4eaa4c87f35c1b55b7c2be42",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/b6/45/652409e6d23d2ba8ae45bc57b0ff",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/bc/70/4ac3893f8b6fb5068e127b3fe41f",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/8b/a7/8b4e43e5a2b07e880be150d638b7",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/22/a2/0c87b5fa24da90474008933b0570",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/4e/65/6ddc357022d2156a5e815768f5b8",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/0a/a0/d3f457c18784865583813e048217",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/f2/7f/31fcda65c9aa25b134a6f9aa251d",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/dd/5a/1f812b58c39965074bdd2c331f28",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/54/b4/eb5b65d7c919bc4a76e84b8d6dec",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/cd/c4/eee9f1aeaea094e7f2260d2212e6",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/9b/c5/bba824ad5bac20df4714e463396a",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/56/56/d58b32259595650ad1e223431d9e",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/d0/e1/1f1dabe91ff3f2342bc0a95e9590",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/63/e8/4fd3f5dd6f26032723b6891fe12b",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/83/df/3155778d93febcb4c1b38f034bc2",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/07/b8/a03d51d80df45b72dc5aa8b528a0",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/94/cf/405249325345835760d84aba715e",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/77/59/970e4ec95c82329d031ea561afab",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/94/a0/f4e11f2c604e9bd124ce2fcd9178",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/33/b2/1cb36ea0a4d499c1c7c8a18faa39",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/b3/d7/d7c643beaf9d2792bec59bc92e68",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/3c/08/7207278e4f50ab1c06d22bae2402",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/e9/5a/fdefccb94f0ac5804d7abac4fe6a",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/f2/be/7e76d426e464100857bc1d3cbcf9",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/08/f1/36613a6c3ca87c93b4fbbe0de451",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/08/67/849330893eeb104e5a4dd44db54d",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d4/63/436f0f9b3c22d669bbd6262dee66",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
### 1.7.20 (build 21084, api 8, 2023-06-09)
|
||||
### 1.7.20 (build 21085, api 8, 2023-06-09)
|
||||
|
||||
- This seems like a good time for a `refactoring` release in anticipation of
|
||||
changes coming in 1.8. Basically this means that a lot of things will be
|
||||
@ -315,6 +315,8 @@
|
||||
had been placed under bauiv1 but that was just silly).
|
||||
- (build 21080) Fixed an issue where the touch screen controller arrow on
|
||||
Android would not show correctly under the player.
|
||||
- (build 21084) Plugin UI now has a categories dropdown for showing only enabled
|
||||
or disabled plugins (Thanks vishal332008!)
|
||||
|
||||
### 1.7.19 (build 20997, api 7, 2023-01-19)
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 21084
|
||||
TARGET_BALLISTICA_BUILD = 21085
|
||||
TARGET_BALLISTICA_VERSION = '1.7.20'
|
||||
|
||||
_g_env_config: EnvConfig | None = None
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, assert_never
|
||||
|
||||
import bauiv1 as bui
|
||||
from bauiv1lib import popup
|
||||
@ -13,6 +14,19 @@ if TYPE_CHECKING:
|
||||
pass
|
||||
|
||||
|
||||
class Category(Enum):
|
||||
"""Categories we can display."""
|
||||
|
||||
ALL = 'all'
|
||||
ENABLED = 'enabled'
|
||||
DISABLED = 'disabled'
|
||||
|
||||
@property
|
||||
def resource(self) -> str:
|
||||
"""Resource name for us."""
|
||||
return f'{self.value}Text'
|
||||
|
||||
|
||||
class PluginWindow(bui.Window):
|
||||
"""Window for configuring plugins."""
|
||||
|
||||
@ -25,6 +39,8 @@ class PluginWindow(bui.Window):
|
||||
# pylint: disable=too-many-statements
|
||||
app = bui.app
|
||||
|
||||
self._category = Category.ALL
|
||||
|
||||
# If they provided an origin-widget, scale up from that.
|
||||
scale_origin: tuple[float, float] | None
|
||||
if origin_widget is not None:
|
||||
@ -94,12 +110,13 @@ class PluginWindow(bui.Window):
|
||||
|
||||
self._title_text = bui.textwidget(
|
||||
parent=self._root_widget,
|
||||
position=(0, self._height - 52),
|
||||
size=(self._width, 25),
|
||||
position=(self._width * 0.5, self._height - 38),
|
||||
size=(0, 0),
|
||||
text=bui.Lstr(resource='pluginsText'),
|
||||
color=app.ui_v1.title_color,
|
||||
maxwidth=200,
|
||||
h_align='center',
|
||||
v_align='top',
|
||||
v_align='center',
|
||||
)
|
||||
|
||||
if self._back_button is not None:
|
||||
@ -115,9 +132,9 @@ class PluginWindow(bui.Window):
|
||||
self._category_button = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
scale=0.7,
|
||||
position=(settings_button_x - 140, self._height - 60),
|
||||
position=(settings_button_x - 105, self._height - 60),
|
||||
size=(130, 60),
|
||||
label=bui.Lstr(resource='AllText'),
|
||||
label=bui.Lstr(resource='allText'),
|
||||
autoselect=True,
|
||||
on_activate_call=bui.WeakCall(self._show_options),
|
||||
color=(0.55, 0.73, 0.25),
|
||||
@ -126,7 +143,7 @@ class PluginWindow(bui.Window):
|
||||
|
||||
self._settings_button = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
position=(settings_button_x, self._height - 60),
|
||||
position=(settings_button_x, self._height - 58),
|
||||
size=(40, 40),
|
||||
label='',
|
||||
on_activate_call=self._open_settings,
|
||||
@ -134,7 +151,8 @@ class PluginWindow(bui.Window):
|
||||
|
||||
bui.imagewidget(
|
||||
parent=self._root_widget,
|
||||
position=(settings_button_x + 3, self._height - 60),
|
||||
position=(settings_button_x + 3, self._height - 57),
|
||||
draw_controller=self._settings_button,
|
||||
size=(35, 35),
|
||||
texture=bui.gettexture('settingsIcon'),
|
||||
)
|
||||
@ -173,8 +191,10 @@ class PluginWindow(bui.Window):
|
||||
size=(sub_width, sub_height),
|
||||
background=False,
|
||||
)
|
||||
self._show_plugins("All")
|
||||
|
||||
self._show_plugins()
|
||||
bui.containerwidget(
|
||||
edit=self._root_widget, selected_child=self._scrollwidget
|
||||
)
|
||||
self._restore_state()
|
||||
|
||||
def _check_value_changed(
|
||||
@ -214,13 +234,9 @@ class PluginWindow(bui.Window):
|
||||
if uiscale is bui.UIScale.MEDIUM
|
||||
else 1.23
|
||||
),
|
||||
choices=['All', 'Enabled', 'Disabled'],
|
||||
choices_display=[
|
||||
bui.Lstr(resource='AllText'),
|
||||
bui.Lstr(resource='EnabledText'),
|
||||
bui.Lstr(resource='DisabledText'),
|
||||
],
|
||||
current_choice='Default',
|
||||
choices=[c.value for c in Category],
|
||||
choices_display=[bui.Lstr(resource=c.resource) for c in Category],
|
||||
current_choice=self._category.value,
|
||||
delegate=self,
|
||||
)
|
||||
|
||||
@ -229,13 +245,13 @@ class PluginWindow(bui.Window):
|
||||
) -> None:
|
||||
"""Called when a choice is selected in the popup."""
|
||||
del popup_window # unused
|
||||
|
||||
self._category = Category(choice)
|
||||
self._clear_scroll_widget()
|
||||
self._show_plugins(choice)
|
||||
self._show_plugins()
|
||||
|
||||
bui.buttonwidget(
|
||||
edit=self._category_button,
|
||||
label=bui.Lstr(resource=(choice + 'Text')),
|
||||
label=bui.Lstr(resource=self._category.resource),
|
||||
)
|
||||
|
||||
def popup_menu_closing(self, popup_window: popup.PopupWindow) -> None:
|
||||
@ -247,44 +263,48 @@ class PluginWindow(bui.Window):
|
||||
for i in existing_widgets:
|
||||
i.delete()
|
||||
|
||||
def _show_plugins(self, category: str) -> None:
|
||||
def _show_plugins(self) -> None:
|
||||
# pylint: disable=too-many-locals
|
||||
# pylint: disable=too-many-branches
|
||||
# pylint: disable=too-many-statements
|
||||
pluglist = bui.app.plugins.potential_plugins
|
||||
plugstates: dict[str, dict] = bui.app.config.setdefault('Plugins', {})
|
||||
assert isinstance(plugstates, dict)
|
||||
|
||||
plug_line_height = 50
|
||||
sub_width = self._scroll_width
|
||||
sub_height = len(pluglist) * plug_line_height
|
||||
sub_height1 = 0
|
||||
sub_height2 = 0
|
||||
num_of_plugs_active = 0
|
||||
num_of_plugs_disabled = 0
|
||||
num_active = 0
|
||||
num_disabled = 0
|
||||
|
||||
for i, availplug in enumerate(pluglist):
|
||||
# counting number of enabled and disabled plugins
|
||||
plugin = bui.app.plugins.active_plugins.get(availplug.class_path)
|
||||
active = plugin is not None
|
||||
if active:
|
||||
num_of_plugs_active = num_of_plugs_active + 1
|
||||
num_active += 1
|
||||
elif availplug.available and not active:
|
||||
num_of_plugs_disabled = num_of_plugs_disabled + 1
|
||||
num_disabled += 1
|
||||
|
||||
if category == "All":
|
||||
if self._category is Category.ALL:
|
||||
sub_height = len(pluglist) * plug_line_height
|
||||
bui.containerwidget(
|
||||
edit=self._subcontainer, size=(self._scroll_width, sub_height)
|
||||
)
|
||||
if category == "Enabled":
|
||||
sub_height1 = num_of_plugs_active * plug_line_height
|
||||
elif self._category is Category.ENABLED:
|
||||
sub_height = num_active * plug_line_height
|
||||
bui.containerwidget(
|
||||
edit=self._subcontainer, size=(self._scroll_width, sub_height1)
|
||||
edit=self._subcontainer, size=(self._scroll_width, sub_height)
|
||||
)
|
||||
elif category == "Disabled":
|
||||
sub_height2 = num_of_plugs_disabled * plug_line_height
|
||||
elif self._category is Category.DISABLED:
|
||||
sub_height = num_disabled * plug_line_height
|
||||
bui.containerwidget(
|
||||
edit=self._subcontainer, size=(self._scroll_width, sub_height2)
|
||||
edit=self._subcontainer, size=(self._scroll_width, sub_height)
|
||||
)
|
||||
else:
|
||||
# Make sure we handle all cases.
|
||||
assert_never(self._category)
|
||||
|
||||
num_of_plugs = 0
|
||||
num_shown = 0
|
||||
for i, availplug in enumerate(pluglist):
|
||||
plugin = bui.app.plugins.active_plugins.get(availplug.class_path)
|
||||
active = plugin is not None
|
||||
@ -293,170 +313,64 @@ class PluginWindow(bui.Window):
|
||||
checked = plugstate.get('enabled', False)
|
||||
assert isinstance(checked, bool)
|
||||
|
||||
if category == "All":
|
||||
item_y = sub_height - (i + 1) * plug_line_height
|
||||
check = bui.checkboxwidget(
|
||||
if self._category is Category.ALL:
|
||||
show = True
|
||||
elif self._category is Category.ENABLED:
|
||||
show = active
|
||||
elif self._category is Category.DISABLED:
|
||||
show = availplug.available and not active
|
||||
else:
|
||||
assert_never(self._category)
|
||||
|
||||
if not show:
|
||||
continue
|
||||
|
||||
item_y = sub_height - (num_shown + 1) * plug_line_height
|
||||
check = bui.checkboxwidget(
|
||||
parent=self._subcontainer,
|
||||
text=availplug.display_name,
|
||||
autoselect=True,
|
||||
value=checked,
|
||||
maxwidth=self._scroll_width - 200,
|
||||
position=(10, item_y),
|
||||
size=(self._scroll_width - 40, 50),
|
||||
on_value_change_call=bui.Call(
|
||||
self._check_value_changed, availplug
|
||||
),
|
||||
textcolor=(
|
||||
(0.8, 0.3, 0.3) if not availplug.available else (0, 1, 0)
|
||||
),
|
||||
)
|
||||
if plugin is not None and plugin.has_settings_ui():
|
||||
button = bui.buttonwidget(
|
||||
parent=self._subcontainer,
|
||||
text=availplug.display_name,
|
||||
label=bui.Lstr(resource='mainMenu.settingsText'),
|
||||
autoselect=True,
|
||||
value=checked,
|
||||
maxwidth=self._scroll_width - 200,
|
||||
position=(10, item_y),
|
||||
size=(self._scroll_width - 40, 50),
|
||||
on_value_change_call=bui.Call(
|
||||
self._check_value_changed, availplug
|
||||
),
|
||||
textcolor=(
|
||||
(0.8, 0.3, 0.3)
|
||||
if not availplug.available
|
||||
else (0, 1, 0)
|
||||
if active
|
||||
else (0.6, 0.6, 0.6)
|
||||
),
|
||||
size=(100, 40),
|
||||
position=(sub_width - 130, item_y + 6),
|
||||
)
|
||||
if plugin is not None and plugin.has_settings_ui():
|
||||
button = bui.buttonwidget(
|
||||
parent=self._subcontainer,
|
||||
label=bui.Lstr(resource='mainMenu.settingsText'),
|
||||
autoselect=True,
|
||||
size=(100, 40),
|
||||
position=(sub_width - 130, item_y + 6),
|
||||
)
|
||||
bui.buttonwidget(
|
||||
edit=button,
|
||||
on_activate_call=bui.Call(
|
||||
plugin.show_settings_ui, button
|
||||
),
|
||||
)
|
||||
else:
|
||||
button = None
|
||||
bui.buttonwidget(
|
||||
edit=button,
|
||||
on_activate_call=bui.Call(plugin.show_settings_ui, button),
|
||||
)
|
||||
else:
|
||||
button = None
|
||||
|
||||
# Allow getting back to back button.
|
||||
if i == 0:
|
||||
bui.widget(
|
||||
edit=check,
|
||||
up_widget=self._back_button,
|
||||
left_widget=self._back_button,
|
||||
right_widget=self._settings_button,
|
||||
)
|
||||
if button is not None:
|
||||
bui.widget(edit=button, up_widget=self._back_button)
|
||||
|
||||
# Make sure we scroll all the way to the end when using
|
||||
# keyboard/button nav.
|
||||
# Allow getting back to back button.
|
||||
if i == 0:
|
||||
bui.widget(
|
||||
edit=check, show_buffer_top=40, show_buffer_bottom=40
|
||||
edit=check,
|
||||
up_widget=self._back_button,
|
||||
left_widget=self._back_button,
|
||||
right_widget=self._settings_button,
|
||||
)
|
||||
if button is not None:
|
||||
bui.widget(edit=button, up_widget=self._back_button)
|
||||
|
||||
elif category == "Enabled":
|
||||
if active:
|
||||
item_y = sub_height1 - (num_of_plugs + 1) * plug_line_height
|
||||
check = bui.checkboxwidget(
|
||||
parent=self._subcontainer,
|
||||
text=availplug.display_name,
|
||||
autoselect=True,
|
||||
value=checked,
|
||||
maxwidth=self._scroll_width - 200,
|
||||
position=(10, item_y),
|
||||
size=(self._scroll_width - 40, 50),
|
||||
on_value_change_call=bui.Call(
|
||||
self._check_value_changed, availplug
|
||||
),
|
||||
textcolor=(
|
||||
(0.8, 0.3, 0.3)
|
||||
if not availplug.available
|
||||
else (0, 1, 0)
|
||||
),
|
||||
)
|
||||
if plugin is not None and plugin.has_settings_ui():
|
||||
button = bui.buttonwidget(
|
||||
parent=self._subcontainer,
|
||||
label=bui.Lstr(resource='mainMenu.settingsText'),
|
||||
autoselect=True,
|
||||
size=(100, 40),
|
||||
position=(sub_width - 130, item_y + 6),
|
||||
)
|
||||
bui.buttonwidget(
|
||||
edit=button,
|
||||
on_activate_call=bui.Call(
|
||||
plugin.show_settings_ui, button
|
||||
),
|
||||
)
|
||||
else:
|
||||
button = None
|
||||
|
||||
# Allow getting back to back button.
|
||||
if i == 0:
|
||||
bui.widget(
|
||||
edit=check,
|
||||
up_widget=self._back_button,
|
||||
left_widget=self._back_button,
|
||||
right_widget=self._settings_button,
|
||||
)
|
||||
if button is not None:
|
||||
bui.widget(edit=button, up_widget=self._back_button)
|
||||
|
||||
# Make sure we scroll all the way to the end when using
|
||||
# keyboard/button nav.
|
||||
bui.widget(
|
||||
edit=check, show_buffer_top=40, show_buffer_bottom=40
|
||||
)
|
||||
num_of_plugs = num_of_plugs + 1
|
||||
|
||||
elif category == "Disabled":
|
||||
if availplug.available and not active:
|
||||
item_y = sub_height2 - (num_of_plugs + 1) * plug_line_height
|
||||
check = bui.checkboxwidget(
|
||||
parent=self._subcontainer,
|
||||
text=availplug.display_name,
|
||||
autoselect=True,
|
||||
value=checked,
|
||||
maxwidth=self._scroll_width - 200,
|
||||
position=(10, item_y),
|
||||
size=(self._scroll_width - 40, 50),
|
||||
on_value_change_call=bui.Call(
|
||||
self._check_value_changed, availplug
|
||||
),
|
||||
textcolor=(0.6, 0.6, 0.6),
|
||||
)
|
||||
if plugin is not None and plugin.has_settings_ui():
|
||||
button = bui.buttonwidget(
|
||||
parent=self._subcontainer,
|
||||
label=bui.Lstr(resource='mainMenu.settingsText'),
|
||||
autoselect=True,
|
||||
size=(100, 40),
|
||||
position=(sub_width - 130, item_y + 6),
|
||||
)
|
||||
bui.buttonwidget(
|
||||
edit=button,
|
||||
on_activate_call=bui.Call(
|
||||
plugin.show_settings_ui, button
|
||||
),
|
||||
)
|
||||
else:
|
||||
button = None
|
||||
|
||||
# Allow getting back to back button.
|
||||
if i == 0:
|
||||
bui.widget(
|
||||
edit=check,
|
||||
up_widget=self._back_button,
|
||||
left_widget=self._back_button,
|
||||
right_widget=self._settings_button,
|
||||
)
|
||||
if button is not None:
|
||||
bui.widget(edit=button, up_widget=self._back_button)
|
||||
|
||||
# Make sure we scroll all the way to the end when using
|
||||
# keyboard/button nav.
|
||||
bui.widget(
|
||||
edit=check, show_buffer_top=40, show_buffer_bottom=40
|
||||
)
|
||||
num_of_plugs = num_of_plugs + 1
|
||||
|
||||
bui.containerwidget(
|
||||
edit=self._root_widget, selected_child=self._scrollwidget
|
||||
)
|
||||
# Make sure we scroll all the way to the end when using
|
||||
# keyboard/button nav.
|
||||
bui.widget(edit=check, show_buffer_top=40, show_buffer_bottom=40)
|
||||
num_shown += 1
|
||||
|
||||
def _save_state(self) -> None:
|
||||
pass
|
||||
|
||||
@ -582,7 +582,8 @@ void Graphics::DrawMiscOverlays(RenderPass* pass) {
|
||||
if (i->translation_dirty) {
|
||||
BA_LOG_ONCE(
|
||||
LogLevel::kWarning,
|
||||
"Found dirty translation on screenmessage draw pass 1.");
|
||||
"Found dirty translation on screenmessage draw pass 1; raw="
|
||||
+ i->s_raw);
|
||||
}
|
||||
float str_height =
|
||||
g_base->text_graphics->GetStringHeight(i->s_translated.c_str());
|
||||
@ -673,7 +674,8 @@ void Graphics::DrawMiscOverlays(RenderPass* pass) {
|
||||
if (i->translation_dirty) {
|
||||
BA_LOG_ONCE(
|
||||
LogLevel::kWarning,
|
||||
"Found dirty translation on screenmessage draw pass 2.");
|
||||
"Found dirty translation on screenmessage draw pass 2; raw="
|
||||
+ i->s_raw);
|
||||
}
|
||||
float str_height =
|
||||
g_base->text_graphics->GetStringHeight(i->s_translated.c_str());
|
||||
@ -1901,7 +1903,11 @@ void Graphics::DrawRadialMeter(MeshIndexedSimpleFull* m, float amt) {
|
||||
}
|
||||
|
||||
auto Graphics::ScreenMessageEntry::GetText() -> TextGroup& {
|
||||
assert(!translation_dirty);
|
||||
if (translation_dirty) {
|
||||
BA_LOG_ONCE(
|
||||
LogLevel::kWarning,
|
||||
"Found dirty translation on screenmessage GetText; raw=" + s_raw);
|
||||
}
|
||||
if (!s_mesh_.Exists()) {
|
||||
s_mesh_ = Object::New<TextGroup>();
|
||||
mesh_dirty = true;
|
||||
|
||||
@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
|
||||
namespace ballistica {
|
||||
|
||||
// These are set automatically via script; don't modify them here.
|
||||
const int kEngineBuildNumber = 21084;
|
||||
const int kEngineBuildNumber = 21085;
|
||||
const char* kEngineVersion = "1.7.20";
|
||||
|
||||
auto MonolithicMain(const core::CoreConfig& core_config) -> int {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user