From eed8001a014b1a8b1685f09ef01d524c93a7e20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=9A=D0=B0=D0=BF?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BA=D0=BE?= Date: Sun, 30 Jun 2024 23:23:23 +0300 Subject: [PATCH] d --- v5/desktop.py | 18 ++++++++++++++++++ v5/main-gui.py | 1 + 2 files changed, 19 insertions(+) diff --git a/v5/desktop.py b/v5/desktop.py index 8920c13..1fbc73b 100644 --- a/v5/desktop.py +++ b/v5/desktop.py @@ -78,6 +78,24 @@ def desktop_displaySelectedTile(p): #} #} +# Display title for the first selected tile +# +# Conditions: +# 1. tile has just been selected and it's the first one in pair +def desktop_displayTitle(p): + if ( + p.c.recentField == "selectedId" and + ( + len(p.c.selectedItems) == 0 or + len(p.c.selectedItems) == 2 + ) + ): + gid = p.c.playfieldItems[p.c.selectedId] + p.title.texture = p.titleTextures[gid] + p.title.visible = True + #} +#} + # Hide matching tiles # # Conditions: diff --git a/v5/main-gui.py b/v5/main-gui.py index 587dd88..d8d47d0 100644 --- a/v5/main-gui.py +++ b/v5/main-gui.py @@ -95,6 +95,7 @@ def process(c): # Similar to context functions, but no platform is returned. desktop_deselectMismatchedTiles(p) desktop_displaySelectedTile(p) + desktop_displayTitle(p) desktop_hideMatchingTiles(p) desktop_scheduleHidingOfMatchingTiles(p) desktop_scheduleDeselectionOfMismatchedTiles(p)