state saves and restores for plugins window

This commit is contained in:
Eric 2023-06-09 14:17:02 -07:00
parent aa108ba813
commit 96f4c66d01
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
5 changed files with 65 additions and 37 deletions

56
.efrocachemap generated
View File

@ -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/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/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/a1/00/78686f2a059da640dab862a53fef",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/d3/ac/0e07b5e026bda0b7ec9bcdde5717",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/8c/83/dc5fe7f7d47eed70576395c1af0b",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/02/62/d70c64604ecf1f87361f0c5de641",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/0f/7f/3b0df4950585eac12ce61487d2f8",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/c3/35/93a6f08a028b0cc8757391b60070",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/6c/ce/98078f39089454c002090d93e3b3",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/53/0a/39c93ea70b4d19b75619d55ce785",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/d1/43/c7d83522ba2c467e02cb5f1f7cbc",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/48/e2/c8e4d93d01b7446c9357d3ddf27d",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/aa/6c/eb4ac89260fe0041a57073ab7af1",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/36/c1/6105e83016b73960b07716e31831",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/b6/6a/19359e6014d1da7f53cf086605e7",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/a7/26/45f619dde6ea071c5f692bffb271",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a5/7e/322441bc305735a279d389e8ada1",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/17/dc/bee20b4d6f94297827a20978ce12",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/ee/d0/4482567a7d5ecfea7d1a1b4e8a6e",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/ba/5e/c8d0aed6450a39e7c8d88edfa117",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/27/18/6a221f8ee1acbb43f0369c9e55f3",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/40/b4/d70f3ad169a7029803809051bf46",
"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",
@ -4108,14 +4108,14 @@
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/0d/da/cf2b3140c0c83b3e368623f1d705",
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/94/6c/3489c9df42324ad7f089d6271c4b",
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a6/0b/3ae5a82111a12bb75cd62252c2cc",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/07/c5/868cac199d95c99f99bf1a79cdb9",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/c7/4a/0ead10c153f13f2422208044145c",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/80/bf/69dd06c2c904227c8f0d6bc09102",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/da/86/2b58ec00034d93f891992051ed30",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/b8/de/acc7e5fd6cfe0cb5d33c048ab399",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/15/06/84046ac383a66b0611a4b6262f2d",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/d0/2b/dab33e75b735c1bd439f28ed8709",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/12/ec/8e3000e603e5b6fdd5bc5af94cd0",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/de/50/e953e9f4bef5249444bf92cf7431",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/44/d4/c945282e101215eb32677adf6ee7",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/80/52/fec8962cf5f258068449d728e3f9",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/0d/dc/576e81d6a01de5a1d274d41fdc4b",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/5c/e8/dd981295029e587001e8e631def6",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/d9/a1/f00e661f34a44fdd82af47d63706",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/9d/01/701403052ee0cd98d324e138491c",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/06/df/07ac07299a66a7ea90e40a82736c",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/fe/d2/3be7462aaff43bd651b5b5ac9d04",

View File

@ -1,4 +1,4 @@
### 1.7.20 (build 21085, api 8, 2023-06-09)
### 1.7.20 (build 21086, 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

View File

@ -28,7 +28,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 21085
TARGET_BALLISTICA_BUILD = 21086
TARGET_BALLISTICA_VERSION = '1.7.20'
_g_env_config: EnvConfig | None = None

View File

@ -5,6 +5,7 @@
from __future__ import annotations
from enum import Enum
import logging
from typing import TYPE_CHECKING, assert_never
import bauiv1 as bui
@ -136,7 +137,7 @@ class PluginWindow(bui.Window):
size=(130, 60),
label=bui.Lstr(resource='allText'),
autoselect=True,
on_activate_call=bui.WeakCall(self._show_options),
on_activate_call=bui.WeakCall(self._show_category_options),
color=(0.55, 0.73, 0.25),
iconscale=1.2,
)
@ -214,15 +215,14 @@ class PluginWindow(bui.Window):
# pylint: disable=cyclic-import
from bauiv1lib.settings.pluginsettings import PluginSettingsWindow
bui.getsound('swish').play()
self._save_state()
bui.containerwidget(edit=self._root_widget, transition='out_left')
assert bui.app.classic is not None
bui.app.ui_v1.set_main_menu_window(
PluginSettingsWindow(transition='in_right').get_root_widget()
)
def _show_options(self) -> None:
def _show_category_options(self) -> None:
uiscale = bui.app.ui_v1.uiscale
popup.PopupMenuWindow(
@ -373,10 +373,38 @@ class PluginWindow(bui.Window):
num_shown += 1
def _save_state(self) -> None:
pass
try:
sel = self._root_widget.get_selected_child()
if sel == self._category_button:
sel_name = 'Category'
elif sel == self._settings_button:
sel_name = 'Settings'
elif sel == self._back_button:
sel_name = 'Back'
else:
raise ValueError(f'unrecognized selection \'{sel}\'')
assert bui.app.classic is not None
bui.app.ui_v1.window_states[type(self)] = sel_name
except Exception:
logging.exception('Error saving state for %s.', self)
def _restore_state(self) -> None:
pass
try:
assert bui.app.classic is not None
sel_name = bui.app.ui_v1.window_states.get(type(self))
sel: bui.Widget | None
if sel_name == 'Category':
sel = self._category_button
elif sel_name == 'Settings':
sel = self._settings_button
elif sel_name == 'Back':
sel = self._back_button
else:
sel = self._scrollwidget
if sel:
bui.containerwidget(edit=self._root_widget, selected_child=sel)
except Exception:
logging.exception('Error restoring state for %s.', self)
def _do_back(self) -> None:
# pylint: disable=cyclic-import

View File

@ -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 = 21085;
const int kEngineBuildNumber = 21086;
const char* kEngineVersion = "1.7.20";
auto MonolithicMain(const core::CoreConfig& core_config) -> int {