almost there

This commit is contained in:
Sander Land committed 2020-04-28 22:14:40 +02:00
1 parent 7a0fe66d70
commit 75263e7262
3 files changed
+12 -11

No files matched your search

+5 -1
View File
@@ -50,7 +50,8 @@ class Controls(BoxLayout):
if current_node:
move = current_node.single_move
next_player_is_human_or_both_robots = current_node.player and ("ai" not in self.player_mode(current_node.player) or "ai" in self.player_mode(current_node.next_player))
both_players_are_robots = "ai" in self.player_mode(current_node.player) and "ai" in self.player_mode(current_node.next_player)
next_player_is_human_or_both_robots = current_node.player and ("ai" not in self.player_mode(current_node.player) or both_players_are_robots)
current_player_is_ai_playing_human = current_node.player and "ai" in self.player_mode(current_node.player) and "ai" not in self.player_mode(current_node.next_player)
if next_player_is_human_or_both_robots and not current_node.is_root and move:
info += current_node.comment(teach="undo" in self.player_mode(current_node.player), hints=self.hints.active)
@@ -67,6 +68,9 @@ class Controls(BoxLayout):
elif not current_player_is_ai_playing_human:
self.score_change.label = f"Points lost"
self.score_change.text = ""
elif both_players_are_robots and current_node.parent and current_node.parent.analysis_ready:
self.score.text = current_node.parent.format_score()
self.win_rate.text = current_node.parent.format_win_rate()
self.graph.update_value(current_node)
+2 -3
View File
@@ -202,9 +202,8 @@ class LabelledIntInput(LabelledTextInput):
class CensorableLabel(BoxLayout):
@property
def text(self):
return self.value.text
text = StringProperty("")
label = StringProperty("")
class ScoreGraph(Label):
+5 -7
View File
@@ -150,23 +150,21 @@
valign: 'center'
size: self.texture_size
<ClickableLabel@DarkLabel+ButtonBehavior>:
<ClickableLabel@ButtonBehavior+DarkLabel>:
color: BLACK
halign: 'center'
valign: 'center'
size: self.texture_size
<CensorableLabel>:
value : value
orientation: 'horizontal'
text: ''
label: ''
ClickableLabel:
size_hint: 0.6,1
id: desc
text: root.label
font_size: self.size[1] * 0.8
on_press:
value.opacity = 1 if value.opacity==0 else 0
on_press: value.opacity = 1 if value.opacity==0 else 0
DarkLabel:
size_hint: 0.4,1
text: root.text
@@ -578,8 +576,8 @@
size_hint: 1,0.2
CensorableLabel:
id: score_change
size_hint: 1, 0.025
label: 'Score change'
size_hint: 1, 0.024
label: 'Points Lost'
text: ''
BoxLayout:
size_hint: 1,0.2