dashcode 1.2.6__tar.gz → 1.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dashcode-1.2.6 → dashcode-1.2.7}/PKG-INFO +1 -1
- {dashcode-1.2.6 → dashcode-1.2.7}/dashcode/core.py +32 -3
- {dashcode-1.2.6 → dashcode-1.2.7}/dashcode.egg-info/PKG-INFO +1 -1
- {dashcode-1.2.6 → dashcode-1.2.7}/setup.py +1 -1
- {dashcode-1.2.6 → dashcode-1.2.7}/README.md +0 -0
- {dashcode-1.2.6 → dashcode-1.2.7}/dashcode/__init__.py +0 -0
- {dashcode-1.2.6 → dashcode-1.2.7}/dashcode.egg-info/SOURCES.txt +0 -0
- {dashcode-1.2.6 → dashcode-1.2.7}/dashcode.egg-info/dependency_links.txt +0 -0
- {dashcode-1.2.6 → dashcode-1.2.7}/dashcode.egg-info/top_level.txt +0 -0
- {dashcode-1.2.6 → dashcode-1.2.7}/setup.cfg +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import base64
|
|
2
2
|
import gzip
|
|
3
|
+
from operator import index
|
|
4
|
+
|
|
3
5
|
obj_string = ""
|
|
4
6
|
lvlname = ""
|
|
5
7
|
|
|
@@ -36,7 +38,9 @@ class Dashcode:
|
|
|
36
38
|
"TargetColor":23,
|
|
37
39
|
"Delay": 63,
|
|
38
40
|
"SpawnTrigger":62,
|
|
39
|
-
"MultiTrigger":87
|
|
41
|
+
"MultiTrigger":87,
|
|
42
|
+
"X":2,
|
|
43
|
+
"Y":3,
|
|
40
44
|
}
|
|
41
45
|
self.objectids = {
|
|
42
46
|
"block": 1, "spike": 8, "yorb": 36, "coin": 1329,
|
|
@@ -108,6 +112,7 @@ class Dashcode:
|
|
|
108
112
|
pos_y = params.get('Y', 0) * 30 + 15
|
|
109
113
|
full_obj_string = f"1,{oid},2,{pos_x},3,{pos_y}{extraparams}"
|
|
110
114
|
self.objects.append(full_obj_string)
|
|
115
|
+
return full_obj_string
|
|
111
116
|
def parse_object_string(self,objstr):
|
|
112
117
|
data = objstr.split(',')
|
|
113
118
|
obj_dict = {}
|
|
@@ -116,7 +121,28 @@ class Dashcode:
|
|
|
116
121
|
value = data[i + 1]
|
|
117
122
|
obj_dict[key] = value
|
|
118
123
|
return obj_dict
|
|
119
|
-
|
|
124
|
+
def editobject(self, obj:str, params:dict):
|
|
125
|
+
parsed = self.parse_object_string(obj)
|
|
126
|
+
#print(parsed)
|
|
127
|
+
newparams = {}
|
|
128
|
+
for i,v in parsed.items():
|
|
129
|
+
if not newparams.get(i):
|
|
130
|
+
newparams[i] = v
|
|
131
|
+
for i,v in params.items():
|
|
132
|
+
#print(i,v)
|
|
133
|
+
if self.params.get(i) and not i in ["X","Y"]:
|
|
134
|
+
if not parsed.get(self.params.get(i)) and self.params.get(i):
|
|
135
|
+
newparams[str(self.params.get(i))] = str(v)
|
|
136
|
+
elif i in ["X","Y"]:
|
|
137
|
+
print(i,v)
|
|
138
|
+
newparams[str(self.params.get(i))] = str(v*30)
|
|
139
|
+
else:
|
|
140
|
+
newparams[str(i)] = str(v)
|
|
141
|
+
new_obj = ""
|
|
142
|
+
for i,v in newparams.items():
|
|
143
|
+
new_obj += f"{i},{v},"
|
|
144
|
+
print(newparams)
|
|
145
|
+
print(new_obj)
|
|
120
146
|
def addprefab(self, obj: str, params: dict, prefab: str):
|
|
121
147
|
fab = self.prefabs.get(prefab)
|
|
122
148
|
if not fab:
|
|
@@ -125,11 +151,13 @@ class Dashcode:
|
|
|
125
151
|
ey = params.get('EY', 0)
|
|
126
152
|
base_x = params.get('X', 0)
|
|
127
153
|
base_y = params.get('Y', 0)
|
|
154
|
+
placed = []
|
|
128
155
|
def place(x_val, y_val):
|
|
129
156
|
current_params = dict(params)
|
|
130
157
|
current_params["X"] = x_val
|
|
131
158
|
current_params["Y"] = y_val
|
|
132
|
-
self.addobject(obj, current_params)
|
|
159
|
+
preobj_str = self.addobject(obj, current_params)
|
|
160
|
+
placed.append(preobj_str)
|
|
133
161
|
if fab.get("X") == 0:
|
|
134
162
|
for i in range(ex):
|
|
135
163
|
place(base_x + i, base_y)
|
|
@@ -148,6 +176,7 @@ class Dashcode:
|
|
|
148
176
|
for i in range(ey):
|
|
149
177
|
place(base_x, base_y + i)
|
|
150
178
|
place(base_x + ex, base_y + i)
|
|
179
|
+
return placed
|
|
151
180
|
def build_timeline(self, timeline:list):
|
|
152
181
|
cdelay = 0
|
|
153
182
|
for tlobj in timeline:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|