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