Diffstat (limited to 'Block.gd')
-rw-r--r--Block.gd10
1 files changed, 10 insertions, 0 deletions
diff --git a/Block.gd b/Block.gd
index 8101e48..bde3ce9 100644
--- a/Block.gd
+++ b/Block.gd
@@ -12,3 +12,13 @@ func configure(text: String, background: Color, text_color: Color = Color.white)
label.text = text
if text_color != Color.white:
label.add_color_override("font_color", text_color)
+
+func update_colors(new_number):
+ if new_number == 0:
+ configure("", Constants.BACKGROUND_COLOR_CELL_EMPTY)
+ else:
+ configure(
+ str(new_number),
+ Constants.BACKGROUND_COLOR_ARRAY[Constants.cells[new_number]],
+ Constants.CELL_COLOR_ARRAY[Constants.cells[new_number]]
+ ) \ No newline at end of file