-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.py
129 lines (123 loc) · 3.08 KB
/
data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import sys
import os
import tkinter.messagebox
from PIL import Image
def path_finder(relative_path: str) -> str:
return relative_path # keep this line for the build
# return os.path.dirname(os.path.realpath(__file__)) + '/' + relative_path
def define(file: str, folderName: str) -> str:
# get the current path
path = path_finder("picts/" + folderName + "/" + file + ".png")
if not os.path.exists(path):
tkinter.messagebox.showerror("Error", "The " + folderName + " file '" + file + "' does not exist.")
sys.exit()
return path
def get_all_miscs() -> list:
miscs = []
path = path_finder("picts/miscs/")
for file in os.listdir(path):
if file.endswith(".png"):
miscs.append(file[:-4])
return miscs
def get_all_backgrounds() -> list:
backgrounds = []
path = path_finder("picts/backgrounds/")
for file in os.listdir(path):
if file.endswith(".png") and Image.open(path + file).size == (460, 595):
backgrounds.append(file[:-4])
return backgrounds
globals = {
"character": None,
"gcChar": None,
"gcMisc": None,
"render": {
"background": define("default", "backgrounds"),
"misc": define("none", "miscs"),
"characterPath": None,
"val": {
"characterXpos": 0,
"characterYpos": 0,
"characterScale": 100,
"characterRotation": 0,
"characterGlitch": .1,
"characterGlitchSeed": 1,
"characterGradient": "none",
"characterGlow": "none",
"miscPosX": 0,
"miscPosY": 0,
"miscScale": 100,
"miscRotate": 0,
"crt": False
},
"output": ""
},
"backgrounds": get_all_backgrounds(),
"background_container": None,
"misc_container": None,
"miscs": get_all_miscs(),
"misc_container": None,
"crt_container": None,
"gradients": [
"none",
"autumn",
"bone",
"jet",
"winter",
"rainbow",
"ocean",
"summer",
"spring",
"cool",
"hsv",
"pink",
"hot",
"parula",
"magma",
"inferno",
"plasma",
"viridis",
"cividis",
"deepgreen"
],
"glow": [
"none",
"red",
"green",
"blue",
"yellow"
],
"CRT": None,
}
gui = {
"frame": {
"left": None,
"right": None,
"preview": None,
"canvas": None,
"window": None,
},
"el": {
"warning_label": None,
"save_button": None,
"char": {
"posX": None,
"posY": None,
"scale": 100,
"rotate": None,
"glitch": None,
"glitchSeed": None,
"gradients": None,
# "glow": None
},
"misc": {
"posX": None,
"posY": None,
"scale": 100,
"rotate": None,
"select": None
},
"crt": {
"checkbox": None
}
}
}