Skip to content
Snippets Groups Projects
Commit cf7d83fa authored by dos's avatar dos Committed by dos
Browse files

py,st3m: BaseView: Guard the usage of bundled InputController instance

Allows users to disable the provided InputController instance with
`self.input = None`.
parent 2246036f
No related branches found
No related tags found
1 merge request!566py,st3m: BaseView: Guard the usage of bundled InputController instance
Pipeline #9263 passed
...@@ -66,10 +66,12 @@ class BaseView(View): ...@@ -66,10 +66,12 @@ class BaseView(View):
self.vm: Optional["ViewManager"] = None self.vm: Optional["ViewManager"] = None
def on_enter(self, vm: Optional["ViewManager"]) -> None: def on_enter(self, vm: Optional["ViewManager"]) -> None:
if self.input:
self.input._ignore_pressed() self.input._ignore_pressed()
self.vm = vm self.vm = vm
def think(self, ins: InputState, delta_ms: int) -> None: def think(self, ins: InputState, delta_ms: int) -> None:
if self.input:
self.input.think(ins, delta_ms) self.input.think(ins, delta_ms)
def is_active(self) -> bool: def is_active(self) -> bool:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment