main
parent
eced480e23
commit
52902e988c
7
main.py
7
main.py
|
@ -328,7 +328,6 @@ class Button:
|
||||||
screen.blit(self.img, self.rect)
|
screen.blit(self.img, self.rect)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Ability to move window
|
# Ability to move window
|
||||||
def move_win(coordinates):
|
def move_win(coordinates):
|
||||||
hwnd = pygame.display.get_wm_info()["window"]
|
hwnd = pygame.display.get_wm_info()["window"]
|
||||||
|
@ -652,7 +651,8 @@ def save_puzzle_state():
|
||||||
|
|
||||||
|
|
||||||
def update_puzzle_data(completed, sorted, current_time, current_moves, real_time):
|
def update_puzzle_data(completed, sorted, current_time, current_moves, real_time):
|
||||||
path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[2:]
|
number = 2 if puzzle_version == '4x4' else 3
|
||||||
|
path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[number:]
|
||||||
current_data = storage["albums"][path_components[0]]
|
current_data = storage["albums"][path_components[0]]
|
||||||
for component in path_components[1:]:
|
for component in path_components[1:]:
|
||||||
if component in current_data:
|
if component in current_data:
|
||||||
|
@ -961,7 +961,8 @@ else:
|
||||||
|
|
||||||
|
|
||||||
def load_data():
|
def load_data():
|
||||||
path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[2:]
|
number = 2 if puzzle_version == '4x4' else 3
|
||||||
|
path_components = puzzle_data[f'current {puzzle_version}']['selected_image'].split('/')[number:]
|
||||||
current_data = storage["albums"][path_components[0]]
|
current_data = storage["albums"][path_components[0]]
|
||||||
for component in path_components[1:]:
|
for component in path_components[1:]:
|
||||||
current_data = current_data[component]
|
current_data = current_data[component]
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
"albums": {
|
"albums": {
|
||||||
"Original images": {
|
"Original images": {
|
||||||
"1.png": [
|
"1.png": [
|
||||||
|
0,
|
||||||
1,
|
1,
|
||||||
0,
|
0,
|
||||||
0,
|
9,
|
||||||
0,
|
"00:00:02",
|
||||||
"00:00:00",
|
"00:00:02",
|
||||||
"00:00:00",
|
|
||||||
0
|
0
|
||||||
],
|
],
|
||||||
"2.png": [
|
"2.png": [
|
||||||
|
@ -97,10 +97,10 @@
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
17,
|
||||||
"00:00:00",
|
"00:00:10",
|
||||||
"00:00:00",
|
"00:00:10",
|
||||||
0
|
8
|
||||||
],
|
],
|
||||||
"2.png": [
|
"2.png": [
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"puzzle 4x4": [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 0]], "puzzle 3x3": [[1, 2, 3], [4, 5, 6], [7, 8, 0]], "current 4x4": {"matrix": [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 0]], "selected_image": "images/albums/Original images/1.png"}, "current 3x3": {"matrix": [[6, 7, 0], [3, 4, 1], [5, 8, 2]], "selected_image": "/images/albums/Birds/1.png"}}
|
{"puzzle 4x4": [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 0]], "puzzle 3x3": [[1, 2, 3], [4, 5, 6], [7, 8, 0]], "current 4x4": {"matrix": [[1, 7, 4, 3], [5, 2, 6, 8], [0, 9, 10, 14], [13, 11, 15, 12]], "selected_image": "images/albums/Original images/1.png"}, "current 3x3": {"matrix": [[4, 0, 3], [1, 7, 6], [5, 8, 2]], "selected_image": "/images/albums/Birds/1.png"}}
|
|
@ -6,12 +6,12 @@
|
||||||
"music": {
|
"music": {
|
||||||
"on": true,
|
"on": true,
|
||||||
"volume": 8,
|
"volume": 8,
|
||||||
"version": "sunny day"
|
"version": "serenity"
|
||||||
},
|
},
|
||||||
"sound": {
|
"sound": {
|
||||||
"on": true,
|
"on": true,
|
||||||
"volume": 4,
|
"volume": 4,
|
||||||
"version": "puzzle"
|
"version": "wood"
|
||||||
},
|
},
|
||||||
"display": "time",
|
"display": "time",
|
||||||
"language": "english",
|
"language": "english",
|
||||||
|
|
Loading…
Reference in New Issue