mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-26 08:53:32 +08:00
Updating to ConfigCheckBox
This commit is contained in:
parent
713540cbb8
commit
de086a8a3f
@ -117,7 +117,7 @@ class PluginWindow(ba.Window):
|
||||
|
||||
ba.imagewidget(
|
||||
parent=self._root_widget,
|
||||
position=(settings_button_x + 5, self._height - 60),
|
||||
position=(settings_button_x + 3, self._height - 60),
|
||||
size=(35, 35),
|
||||
texture=ba.gettexture('settingsIcon'),
|
||||
)
|
||||
|
||||
@ -7,6 +7,7 @@ from __future__ import annotations
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import ba
|
||||
from bastd.ui.config import ConfigCheckBox
|
||||
|
||||
if TYPE_CHECKING:
|
||||
pass
|
||||
@ -100,15 +101,14 @@ class PluginSettingsWindow(ba.Window):
|
||||
)
|
||||
|
||||
self._y_position -= 70
|
||||
self._enable_new_plugins_check_box = ba.checkboxwidget(
|
||||
self._enable_new_plugins_check_box = ConfigCheckBox(
|
||||
parent=self._root_widget,
|
||||
position=(65, self._y_position),
|
||||
size=(350, 60),
|
||||
value=ba.app.config['Auto Enable New Plugins'],
|
||||
text=ba.Lstr(resource='AutoEnableNewPluginsText'),
|
||||
configkey='Auto Enable New Plugins',
|
||||
displayname=ba.Lstr(resource='AutoEnableNewPluginsText'),
|
||||
scale=1.0,
|
||||
maxwidth=430,
|
||||
on_value_change_call=self._update_value
|
||||
maxwidth=430
|
||||
)
|
||||
|
||||
def _enable_all_plugins(self) -> None:
|
||||
@ -135,11 +135,6 @@ class PluginSettingsWindow(ba.Window):
|
||||
color=(1.0, 0.5, 0.0),
|
||||
)
|
||||
|
||||
def _update_value(self, val: bool) -> None:
|
||||
cfg = ba.app.config
|
||||
cfg['Auto Enable New Plugins'] = val
|
||||
cfg.apply_and_commit()
|
||||
|
||||
def _do_back(self) -> None:
|
||||
# pylint: disable=cyclic-import
|
||||
from bastd.ui.settings.plugins import PluginWindow
|
||||
|
||||
@ -221,6 +221,8 @@ void AppConfig::SetupEntries() {
|
||||
// (default to internal keyboard on iircade; not elsewhere)
|
||||
bool_entries_[BoolID::kAlwaysUseInternalKeyboard] =
|
||||
BoolEntry("Always Use Internal Keyboard", g_buildconfig.iircade_build());
|
||||
bool_entries_[BoolID::kAutoEnableNewPlugins] =
|
||||
BoolEntry("Auto Enable New Plugins", true);
|
||||
bool_entries_[BoolID::kShowFPS] = BoolEntry("Show FPS", false);
|
||||
bool_entries_[BoolID::kTVBorder] =
|
||||
BoolEntry("TV Border", g_platform->IsRunningOnTV());
|
||||
|
||||
@ -60,6 +60,7 @@ class AppConfig {
|
||||
kFullscreen,
|
||||
kKickIdlePlayers,
|
||||
kAlwaysUseInternalKeyboard,
|
||||
kAutoEnableNewPlugins,
|
||||
kShowFPS,
|
||||
kTVBorder,
|
||||
kKeyboardP2Enabled,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user