no hints if policy moves on

This commit is contained in:
Sander Land committed 2020-09-06 23:08:03 +02:00
1 parent a0d0bba58e
commit aed7b52f00
3 files changed
+5 -4

No files matched your search

+3 -1
View File
@@ -697,12 +697,13 @@
halign: 'center' halign: 'center'
font_size: root.height / 3 font_size: root.height / 3
font_name: root.font_name font_name: root.font_name
color: checkbox.selected_color if checkbox.active else checkbox.unselected_color color: checkbox.disabled_color if root.disabled else (checkbox.selected_color if checkbox.active else checkbox.unselected_color)
size_hint_x: None size_hint_x: None
width: self.texture_size[0] + 4 width: self.texture_size[0] + 4
on_left_press: checkbox.active = not checkbox.active on_left_press: checkbox.active = not checkbox.active
MDCheckbox: MDCheckbox:
id: checkbox id: checkbox
disabled: root.disabled
size_hint: None,0.5 size_hint: None,0.5
pos_hint: {'center_y': 0.5} pos_hint: {'center_y': 0.5}
width: self.height width: self.height
@@ -789,6 +790,7 @@
AnalysisToggle: AnalysisToggle:
id: hints id: hints
text: i18n._("analysis:topmoves") text: i18n._("analysis:topmoves")
disabled: policy.checkbox.active
AnalysisToggle: AnalysisToggle:
id: policy id: policy
text: i18n._("analysis:policy") text: i18n._("analysis:policy")
+1 -2
View File
@@ -268,7 +268,6 @@ class BadukPanWidget(Widget):
nodes = katrain.game.current_node.nodes_from_root nodes = katrain.game.current_node.nodes_from_root
realized_points_lost = None realized_points_lost = None
katrain.config("trainer/show_dots")
for i, node in enumerate(nodes[::-1]): # reverse order! for i, node in enumerate(nodes[::-1]): # reverse order!
points_lost = node.points_lost points_lost = node.points_lost
evalscale = 1 evalscale = 1
@@ -410,7 +409,7 @@ class BadukPanWidget(Widget):
self.active_pv_moves = [] self.active_pv_moves = []
# hints or PV # hints or PV
if katrain.analysis_controls.hints.active and not game_ended: if katrain.analysis_controls.hints.active and not katrain.analysis_controls.policy.active and not game_ended:
hint_moves = current_node.candidate_moves hint_moves = current_node.candidate_moves
for i, move_dict in enumerate(hint_moves): for i, move_dict in enumerate(hint_moves):
move = Move.from_gtp(move_dict["move"]) move = Move.from_gtp(move_dict["move"])
+1 -1
View File
@@ -372,7 +372,7 @@ class AnalysisToggle(MDBoxLayout):
text = StringProperty("") text = StringProperty("")
default_active = BooleanProperty(False) default_active = BooleanProperty(False)
font_name = StringProperty(DEFAULT_FONT) font_name = StringProperty(DEFAULT_FONT)
disabled = BooleanProperty(False)
def trigger_action(self, *args, **kwargs): def trigger_action(self, *args, **kwargs):
return self.checkbox.trigger_action(*args, **kwargs) return self.checkbox.trigger_action(*args, **kwargs)