|
2 | 2 | import numpy
|
3 | 3 | import sys
|
4 | 4 | from cv2 import cv2
|
5 |
| -from customizable import res_path, LANGUAGE |
| 5 | +from customizable import RES_PATH, LANGUAGE |
6 | 6 | from functions import readTSV, addBackground
|
7 | 7 |
|
8 | 8 |
|
9 | 9 | MAX_PLAYERS = 4 # Max number of players
|
10 | 10 |
|
11 | 11 |
|
12 |
| -CHARACTER_INFOS = readTSV(os.path.join(res_path, "character_references", "characters_info.tsv")) |
| 12 | +CHARACTER_INFOS = readTSV(os.path.join(RES_PATH, "character_references", "characters_info.tsv")) |
13 | 13 | CHARACTER_CLOSEUPS = []
|
14 | 14 | # 2 and 3 players closeups
|
15 |
| -characters_tile = cv2.cvtColor(cv2.imread(os.path.join(res_path, "character_references", "23-closeups.png"), flags=cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2BGRA) |
| 15 | +characters_tile = cv2.cvtColor(cv2.imread(os.path.join(RES_PATH, "character_references", "23-closeups.png"), flags=cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2BGRA) |
16 | 16 | tile_height = int(characters_tile.shape[0] / len(CHARACTER_INFOS))
|
17 | 17 | tile_width = int(characters_tile.shape[1] / 8)
|
18 | 18 | main_list = []
|
|
29 | 29 | CHARACTER_CLOSEUPS.append(main_list)
|
30 | 30 | CHARACTER_CLOSEUPS.append(main_list)
|
31 | 31 | # 4 players closeups
|
32 |
| -characters_tile = cv2.cvtColor(cv2.imread(os.path.join(res_path, "character_references", "4-closeups.png"), flags=cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2BGRA) |
| 32 | +characters_tile = cv2.cvtColor(cv2.imread(os.path.join(RES_PATH, "character_references", "4-closeups.png"), flags=cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2BGRA) |
33 | 33 | tile_height = int(characters_tile.shape[0] / len(CHARACTER_INFOS))
|
34 | 34 | tile_width = int(characters_tile.shape[1] / 8)
|
35 | 35 | main_list = []
|
|
40 | 40 | main_list.append(skins_list)
|
41 | 41 | CHARACTER_CLOSEUPS.append(main_list)
|
42 | 42 |
|
43 |
| -CHARACTER_CLOSEUPS_MASKS = [[(cv2.imread(os.path.join(res_path, "character_references", "23-lose_mask.png")) / 255).astype(numpy.uint8), |
44 |
| - (cv2.imread(os.path.join(res_path, "character_references", "23-win_mask.png")) / 255).astype(numpy.uint8)], |
45 |
| - [(cv2.imread(os.path.join(res_path, "character_references", "23-lose_mask.png")) / 255).astype(numpy.uint8), |
46 |
| - (cv2.imread(os.path.join(res_path, "character_references", "23-win_mask.png")) / 255).astype(numpy.uint8)], |
47 |
| - [(cv2.imread(os.path.join(res_path, "character_references", "4-lose_mask.png")) / 255).astype(numpy.uint8), |
48 |
| - (cv2.imread(os.path.join(res_path, "character_references", "4-win_mask.png")) / 255).astype(numpy.uint8)]] |
| 43 | +CHARACTER_CLOSEUPS_MASKS = [[(cv2.imread(os.path.join(RES_PATH, "character_references", "23-lose_mask.png")) / 255).astype(numpy.uint8), |
| 44 | + (cv2.imread(os.path.join(RES_PATH, "character_references", "23-win_mask.png")) / 255).astype(numpy.uint8)], |
| 45 | + [(cv2.imread(os.path.join(RES_PATH, "character_references", "23-lose_mask.png")) / 255).astype(numpy.uint8), |
| 46 | + (cv2.imread(os.path.join(RES_PATH, "character_references", "23-win_mask.png")) / 255).astype(numpy.uint8)], |
| 47 | + [(cv2.imread(os.path.join(RES_PATH, "character_references", "4-lose_mask.png")) / 255).astype(numpy.uint8), |
| 48 | + (cv2.imread(os.path.join(RES_PATH, "character_references", "4-win_mask.png")) / 255).astype(numpy.uint8)]] |
49 | 49 |
|
50 | 50 | CHARACTER_ICONS = []
|
51 |
| -characters_tile = cv2.cvtColor(cv2.imread(os.path.join(res_path, "character_references", "icons.png"), flags=cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2BGRA) |
| 51 | +characters_tile = cv2.cvtColor(cv2.imread(os.path.join(RES_PATH, "character_references", "icons.png"), flags=cv2.IMREAD_UNCHANGED), cv2.COLOR_BGR2BGRA) |
52 | 52 | tile_height = int(characters_tile.shape[0] / len(CHARACTER_INFOS))
|
53 | 53 | tile_width = int(characters_tile.shape[1] / 8)
|
54 | 54 | for i in range(len(CHARACTER_INFOS)):
|
|
96 | 96 | SMALL_DIGIT_HEIGHT = 21
|
97 | 97 | SMALL_DIGIT_SEP = 19.5
|
98 | 98 | SMALL_DIGIT_IMAGES = []
|
99 |
| -digits_tile = cv2.cvtColor(cv2.imread(os.path.join(res_path, "digits", "small_digits.png")), cv2.COLOR_BGR2GRAY) |
| 99 | +digits_tile = cv2.cvtColor(cv2.imread(os.path.join(RES_PATH, "digits", "small_digits.png")), cv2.COLOR_BGR2GRAY) |
100 | 100 | for i in range(11):
|
101 | 101 | SMALL_DIGIT_IMAGES.append(digits_tile[:, i*SMALL_DIGIT_WIDTH : (i+1)*SMALL_DIGIT_WIDTH].copy())
|
102 | 102 |
|
103 | 103 | BIG_DIGIT_WIDTH = 44
|
104 | 104 | BIG_DIGIT_HEIGHT = 63
|
105 | 105 | BIG_DIGIT_IMAGES = []
|
106 |
| -digits_tile = cv2.cvtColor(cv2.imread(os.path.join(res_path, "digits", "big_digits.png")), cv2.COLOR_BGR2GRAY) |
| 106 | +digits_tile = cv2.cvtColor(cv2.imread(os.path.join(RES_PATH, "digits", "big_digits.png")), cv2.COLOR_BGR2GRAY) |
107 | 107 | for i in range(12):
|
108 | 108 | BIG_DIGIT_IMAGES.append(digits_tile[:, i*BIG_DIGIT_WIDTH : (i+1)*BIG_DIGIT_WIDTH].copy())
|
109 | 109 |
|
|
0 commit comments