From b590010d08b5df19cca40a2325ebfe3a7b014df3 Mon Sep 17 00:00:00 2001
From: GitHub Action
Date: Fri, 9 Sep 2022 19:47:52 +0000
Subject: [PATCH] Update content of files
---
data/web/corefork.telegram.org/api/dice.html | 43 +++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/data/web/corefork.telegram.org/api/dice.html b/data/web/corefork.telegram.org/api/dice.html
index f0da84d500..5f93a08b3f 100644
--- a/data/web/corefork.telegram.org/api/dice.html
+++ b/data/web/corefork.telegram.org/api/dice.html
@@ -76,7 +76,48 @@ Clients should display the correct dice animated sticker for the specified value
}
}
For each of the dice emojis, a maximum "winning" value is specified, along with the frame number at which to show the fireworks .
-Please note that dice animated stickers should loop only once, right after being sent/received for the first time; clicking on the dice sticker should bring up a popup, inviting the user to send a new dice of the same type.
+Please note that dice animated stickers should loop only once, right after being sent/received for the first time; clicking on the dice sticker should bring up a popup, inviting the user to send a new dice of the same type.
+Slot machine
+Slot machine dice stickers are implemented a bit differently: the value
isn't used to directly index the stickers array, but is instead used as follows.
+The value
is composed of three 2-bit values, each indicating the animated sticker to show in the three slots (left, center, right), incremented by one.
+The stickers
array is composed as follows:
+
+- 0 => Slot machine background
+- 1 => Slot machine winning background, to show after a winning spin
+- 2 => Slot machine frame&handle to play once at the beginning
+- 3 => Left slot winning 7
+- 4..7 => Left slot non-winning options
+- 8 => Left slot spinning animation
+- 9 => Center slot winning 7
+- 10..13 => Center slot non-winning options
+- 14 => Center slot spinning animation
+- 15 => Right slot winning 7
+- 16..19 => Right slot non-winning options
+- 20 => Right slot spinning animation
+
+How to play the animation (all involved stickers are to be directly overlaid on top of each other, no special placing is required):
+
+- Freeze single-frame background (
0
)
+- Play handle animation (
2
) once
+- Play the three spinning slots animations (
8
, 14
, 20
) once
+- Play the three slot animations once, chosen as follows
+- If we're in a winning
value == 64
:
+- Left slot: choose
3
+- Center slot: choose
9
+- Right slot: choose
15
+
+
+- Otherwise, considering
map := [1, 2, 3, 0]
:
+- Left slot: choose
4 + map[(value-1) & 3]
+- Center slot: choose
10 + map[((value-1) >> 2) & 3]
+- Right slot: choose
16 + map[((value-1) >> 4) & 3]
+
+
+
+
+- If we're in a winning
value=64
, replace the background (0
) with 1
.
+
+Example implementation: tdesktop.