Михаил Капелько 5 months ago
parent
commit
633b1a3904
2 changed files with 34 additions and 1 deletions
  1. +32
    -1
      v5/desktop.py
  2. +2
    -0
      v5/main-gui.py

+ 32
- 1
v5/desktop.py View File

@@ -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


+ 2
- 0
v5/main-gui.py View File

@@ -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)


Loading…
Cancel
Save