diff --git a/v5/desktop.py b/v5/desktop.py index 0d39262..3106b37 100644 --- a/v5/desktop.py +++ b/v5/desktop.py @@ -76,6 +76,24 @@ def desktop_deselectMismatchedTiles(p): #} #} +# Display description for the first selected tile +# +# Conditions: +# 1. tile has just been selected and it's the first one in pair +def desktop_displayDesc(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.desc.texture = p.descTextures[gid] + p.desc.visible = True + #} +#} + # Hide deselected tile and show selected one # # Conditions: @@ -108,6 +126,19 @@ def desktop_displayTitle(p): #} #} +# Hide description +# +# Conditions: +# 1. tiles has been mismatched or timed out to to hide after matching +def desktop_hideDesc(p): + if ( + p.c.recentField == "hideMatchingTiles" or + p.c.recentField == "mismatchedItems" + ): + p.desc.visible = False + #} +#} + # Hide matching tiles # # Conditions: @@ -126,7 +157,7 @@ def desktop_hideMatchingTiles(p): # Hide title # # Conditions: -# 1. tiles has been scheduled to hide after being matched or just mismatched +# 1. tiles has been mismatched or timed out to to hide after matching def desktop_hideTitle(p): if ( p.c.recentField == "hideMatchingTiles" or diff --git a/v5/main-gui.py b/v5/main-gui.py index b1562d9..dfd1910 100644 --- a/v5/main-gui.py +++ b/v5/main-gui.py @@ -95,8 +95,10 @@ def process(c): # Perform context dependent calls of desktop functions. # Similar to context functions, but no platform is returned. desktop_deselectMismatchedTiles(p) + desktop_displayDesc(p) desktop_displaySelectedTile(p) desktop_displayTitle(p) + desktop_hideDesc(p) desktop_hideMatchingTiles(p) desktop_hideTitle(p) desktop_scheduleHidingOfMatchingTiles(p)