animate pondering
This commit is contained in:
1 parent
dd526a58a9
commit
21413c0990
3 files changed
+12
-1
No files matched your search
@@ -99,6 +99,7 @@ class KaTrainGui(Screen, KaTrainBase):
|
||||
|
||||
self._keyboard = Window.request_keyboard(None, self, "")
|
||||
self._keyboard.bind(on_key_down=self._on_keyboard_down)
|
||||
Clock.schedule_interval(self.animate_pondering, 0.1)
|
||||
|
||||
def log(self, message, level=OUTPUT_INFO):
|
||||
super().log(message, level)
|
||||
@@ -118,6 +119,12 @@ class KaTrainGui(Screen, KaTrainBase):
|
||||
) and getattr(self, "controls", None):
|
||||
self.controls.set_status(f"ERROR: {message}", STATUS_ERROR)
|
||||
|
||||
def animate_pondering(self,*_args):
|
||||
if not self.idle_analysis:
|
||||
self.board_controls.engine_status_pondering = -1
|
||||
else:
|
||||
self.board_controls.engine_status_pondering += 5
|
||||
|
||||
@property
|
||||
def play_analyze_mode(self):
|
||||
return self.play_mode.mode
|
||||
|
||||
@@ -250,6 +250,8 @@
|
||||
Color:
|
||||
rgba: root.engine_status_col
|
||||
Ellipse:
|
||||
angle_start: 0 if root.engine_status_pondering==-1 else root.engine_status_pondering % 360
|
||||
angle_end: 360 if root.engine_status_pondering==-1 else (root.engine_status_pondering % 360 + 180)
|
||||
pos: self.pos[0] + self.width/2 - self.width/6, self.pos[1] + self.height/2 - self.width/6
|
||||
size: self.width/3, self.width/3
|
||||
Color:
|
||||
@@ -501,6 +503,7 @@
|
||||
orientation: 'vertical'
|
||||
players: {'B':B_player,'W':W_player}
|
||||
engine_status_col: [1,1,1,1]
|
||||
engine_status_pondering: -1
|
||||
timer:timer
|
||||
graph: graph
|
||||
rank_graph: rank_graph
|
||||
|
||||
@@ -10,7 +10,7 @@ from kivy.core.window import Window
|
||||
from kivy.graphics.context_instructions import Color
|
||||
from kivy.graphics.vertex_instructions import Ellipse, Line, Rectangle
|
||||
from kivy.metrics import dp
|
||||
from kivy.properties import BooleanProperty, ListProperty, ObjectProperty
|
||||
from kivy.properties import BooleanProperty, ListProperty, ObjectProperty, NumericProperty
|
||||
from kivy.uix.dropdown import DropDown
|
||||
from kivy.uix.widget import Widget
|
||||
from kivymd.app import MDApp
|
||||
@@ -547,3 +547,4 @@ class AnalysisControls(MDBoxLayout):
|
||||
|
||||
class BadukPanControls(MDFloatLayout):
|
||||
engine_status_col = ListProperty(ENGINE_DOWN_COL)
|
||||
engine_status_pondering = NumericProperty(-1)
|
||||
Reference in new issue
Block a user