screeps-client 0.7.3 → 0.7.4
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.
- package/dist/embedded/_client/{CodePanel-D9_QoSKt.js → CodePanel-Bi3XPaKx.js} +1 -1
- package/dist/{standalone/_client/MapViewer-BZFlOYMm.js → embedded/_client/MapViewer-PlEeWriH.js} +1 -1
- package/dist/embedded/_client/{index-CiIFojZ8.js → index-mOFrrLBB.js} +5 -5
- package/dist/embedded/index.html +1 -1
- package/dist/{xxscreeps-mod/themes/default/test.json → embedded/themes/default/sprite-0.json} +81 -63
- package/dist/embedded/themes/default/sprite-0.png +0 -0
- package/dist/standalone/_client/{CodePanel-BVffzTP9.js → CodePanel-BU8lj9Lg.js} +1 -1
- package/dist/{embedded/_client/MapViewer-B9YQqu-y.js → standalone/_client/MapViewer-pnfc3Uhb.js} +1 -1
- package/dist/standalone/_client/{index-B34meIT0.js → index-C0afJplS.js} +5 -5
- package/dist/standalone/index.html +1 -1
- package/dist/standalone/themes/default/{test.json → sprite-0.json} +81 -63
- package/dist/standalone/themes/default/sprite-0.png +0 -0
- package/dist/xxscreeps-mod/_client/{CodePanel-rvH6VDdF.js → CodePanel-C1_2NSto.js} +1 -1
- package/dist/xxscreeps-mod/_client/{MapViewer-DKem8ATA.js → MapViewer-BIb_DMMc.js} +1 -1
- package/dist/xxscreeps-mod/_client/{index-l6aLrGf1.js → index-DKLACUsG.js} +5 -5
- package/dist/xxscreeps-mod/index.html +1 -1
- package/dist/{embedded/themes/default/test.json → xxscreeps-mod/themes/default/sprite-0.json} +81 -63
- package/dist/xxscreeps-mod/themes/default/sprite-0.png +0 -0
- package/package.json +1 -1
- package/dist/embedded/themes/default/test.png +0 -0
- package/dist/standalone/themes/default/test.png +0 -0
- package/dist/xxscreeps-mod/themes/default/test.png +0 -0
package/dist/embedded/index.html
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
to { opacity: 1; transform: translate(-50%, -50%); }
|
|
27
27
|
}
|
|
28
28
|
</style>
|
|
29
|
-
<script type="module" crossorigin src="/client/_client/index-
|
|
29
|
+
<script type="module" crossorigin src="/client/_client/index-mOFrrLBB.js"></script>
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/client/_client/rolldown-runtime-QTnfLwEv.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/client/_client/vendor-pixi-Df5Nob1b.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/client/_client/vendor-codemirror-B_kaIH0M.js">
|
package/dist/{xxscreeps-mod/themes/default/test.json → embedded/themes/default/sprite-0.json}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
"controller/background":
|
|
4
4
|
{
|
|
5
|
-
"frame": {"x":
|
|
5
|
+
"frame": {"x":1047,"y":0,"w":180,"h":180},
|
|
6
6
|
"rotated": false,
|
|
7
7
|
"trimmed": false,
|
|
8
8
|
"spriteSourceSize": {"x":0,"y":0,"w":180,"h":180},
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"controller/segment":
|
|
13
13
|
{
|
|
14
|
-
"frame": {"x":
|
|
15
|
-
"rotated":
|
|
14
|
+
"frame": {"x":488,"y":435,"w":158,"h":74},
|
|
15
|
+
"rotated": false,
|
|
16
16
|
"trimmed": true,
|
|
17
17
|
"spriteSourceSize": {"x":221,"y":86,"w":158,"h":74},
|
|
18
18
|
"sourceSize": {"w":600,"h":600},
|
|
@@ -20,61 +20,61 @@
|
|
|
20
20
|
},
|
|
21
21
|
"deposit/biomass/fill":
|
|
22
22
|
{
|
|
23
|
-
"frame": {"x":
|
|
23
|
+
"frame": {"x":714,"y":400,"w":110,"h":111},
|
|
24
24
|
"rotated": false,
|
|
25
25
|
"trimmed": true,
|
|
26
|
-
"spriteSourceSize": {"x":
|
|
27
|
-
"sourceSize": {"w":
|
|
26
|
+
"spriteSourceSize": {"x":9,"y":12,"w":110,"h":111},
|
|
27
|
+
"sourceSize": {"w":128,"h":128},
|
|
28
28
|
"anchor": {"x":0.5,"y":0.5}
|
|
29
29
|
},
|
|
30
30
|
"deposit/biomass/shape":
|
|
31
31
|
{
|
|
32
|
-
"frame": {"x":
|
|
32
|
+
"frame": {"x":254,"y":256,"w":234,"h":256},
|
|
33
33
|
"rotated": false,
|
|
34
|
-
"trimmed":
|
|
35
|
-
"spriteSourceSize": {"x":
|
|
36
|
-
"sourceSize": {"w":
|
|
34
|
+
"trimmed": true,
|
|
35
|
+
"spriteSourceSize": {"x":11,"y":0,"w":234,"h":256},
|
|
36
|
+
"sourceSize": {"w":256,"h":256},
|
|
37
37
|
"anchor": {"x":0.5,"y":0.5}
|
|
38
38
|
},
|
|
39
39
|
"deposit/metal/fill":
|
|
40
40
|
{
|
|
41
|
-
"frame": {"x":
|
|
41
|
+
"frame": {"x":1237,"y":0,"w":105,"h":105},
|
|
42
42
|
"rotated": false,
|
|
43
43
|
"trimmed": true,
|
|
44
|
-
"spriteSourceSize": {"x":
|
|
45
|
-
"sourceSize": {"w":
|
|
44
|
+
"spriteSourceSize": {"x":9,"y":13,"w":105,"h":105},
|
|
45
|
+
"sourceSize": {"w":128,"h":128},
|
|
46
46
|
"anchor": {"x":0.5,"y":0.5}
|
|
47
47
|
},
|
|
48
48
|
"deposit/metal/shape":
|
|
49
49
|
{
|
|
50
|
-
"frame": {"x":
|
|
51
|
-
"rotated":
|
|
52
|
-
"trimmed":
|
|
53
|
-
"spriteSourceSize": {"x":0,"y":
|
|
54
|
-
"sourceSize": {"w":
|
|
50
|
+
"frame": {"x":256,"y":0,"w":256,"h":230},
|
|
51
|
+
"rotated": true,
|
|
52
|
+
"trimmed": true,
|
|
53
|
+
"spriteSourceSize": {"x":0,"y":13,"w":256,"h":230},
|
|
54
|
+
"sourceSize": {"w":256,"h":256},
|
|
55
55
|
"anchor": {"x":0.5,"y":0.5}
|
|
56
56
|
},
|
|
57
57
|
"deposit/mist/fill":
|
|
58
58
|
{
|
|
59
|
-
"frame": {"x":
|
|
59
|
+
"frame": {"x":824,"y":400,"w":122,"h":106},
|
|
60
60
|
"rotated": false,
|
|
61
61
|
"trimmed": true,
|
|
62
|
-
"spriteSourceSize": {"x":
|
|
63
|
-
"sourceSize": {"w":
|
|
62
|
+
"spriteSourceSize": {"x":3,"y":2,"w":122,"h":106},
|
|
63
|
+
"sourceSize": {"w":128,"h":128},
|
|
64
64
|
"anchor": {"x":0.5,"y":0.5}
|
|
65
65
|
},
|
|
66
66
|
"deposit/mist/shape":
|
|
67
67
|
{
|
|
68
|
-
"frame": {"x":
|
|
68
|
+
"frame": {"x":0,"y":256,"w":254,"h":256},
|
|
69
69
|
"rotated": false,
|
|
70
|
-
"trimmed":
|
|
71
|
-
"spriteSourceSize": {"x":
|
|
72
|
-
"sourceSize": {"w":
|
|
70
|
+
"trimmed": true,
|
|
71
|
+
"spriteSourceSize": {"x":1,"y":0,"w":254,"h":256},
|
|
72
|
+
"sourceSize": {"w":256,"h":256},
|
|
73
73
|
"anchor": {"x":0.5,"y":0.5}
|
|
74
74
|
},
|
|
75
75
|
"deposit/silicon/fill":
|
|
76
76
|
{
|
|
77
|
-
"frame": {"x":
|
|
77
|
+
"frame": {"x":1237,"y":415,"w":94,"h":94},
|
|
78
78
|
"rotated": false,
|
|
79
79
|
"trimmed": true,
|
|
80
80
|
"spriteSourceSize": {"x":17,"y":17,"w":94,"h":94},
|
|
@@ -83,16 +83,16 @@
|
|
|
83
83
|
},
|
|
84
84
|
"deposit/silicon/shape":
|
|
85
85
|
{
|
|
86
|
-
"frame": {"x":
|
|
86
|
+
"frame": {"x":0,"y":0,"w":256,"h":256},
|
|
87
87
|
"rotated": false,
|
|
88
88
|
"trimmed": false,
|
|
89
|
-
"spriteSourceSize": {"x":0,"y":0,"w":
|
|
90
|
-
"sourceSize": {"w":
|
|
89
|
+
"spriteSourceSize": {"x":0,"y":0,"w":256,"h":256},
|
|
90
|
+
"sourceSize": {"w":256,"h":256},
|
|
91
91
|
"anchor": {"x":0.5,"y":0.5}
|
|
92
92
|
},
|
|
93
93
|
"flag/main":
|
|
94
94
|
{
|
|
95
|
-
"frame": {"x":
|
|
95
|
+
"frame": {"x":646,"y":435,"w":73,"h":68},
|
|
96
96
|
"rotated": true,
|
|
97
97
|
"trimmed": true,
|
|
98
98
|
"spriteSourceSize": {"x":78,"y":36,"w":73,"h":68},
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
},
|
|
102
102
|
"flag/second":
|
|
103
103
|
{
|
|
104
|
-
"frame": {"x":
|
|
105
|
-
"rotated":
|
|
104
|
+
"frame": {"x":486,"y":205,"w":34,"h":28},
|
|
105
|
+
"rotated": true,
|
|
106
106
|
"trimmed": true,
|
|
107
107
|
"spriteSourceSize": {"x":114,"y":48,"w":34,"h":28},
|
|
108
108
|
"sourceSize": {"w":200,"h":200},
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
},
|
|
111
111
|
"grave/cross":
|
|
112
112
|
{
|
|
113
|
-
"frame": {"x":
|
|
114
|
-
"rotated":
|
|
113
|
+
"frame": {"x":1287,"y":105,"w":59,"h":58},
|
|
114
|
+
"rotated": false,
|
|
115
115
|
"trimmed": true,
|
|
116
116
|
"spriteSourceSize": {"x":72,"y":76,"w":59,"h":58},
|
|
117
117
|
"sourceSize": {"w":200,"h":200},
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
},
|
|
120
120
|
"grave/shell":
|
|
121
121
|
{
|
|
122
|
-
"frame": {"x":
|
|
122
|
+
"frame": {"x":946,"y":381,"w":130,"h":153},
|
|
123
123
|
"rotated": true,
|
|
124
124
|
"trimmed": true,
|
|
125
125
|
"spriteSourceSize": {"x":36,"y":22,"w":130,"h":153},
|
|
@@ -128,70 +128,70 @@
|
|
|
128
128
|
},
|
|
129
129
|
"mineral/H":
|
|
130
130
|
{
|
|
131
|
-
"frame": {"x":
|
|
131
|
+
"frame": {"x":676,"y":0,"w":190,"h":192},
|
|
132
132
|
"rotated": false,
|
|
133
133
|
"trimmed": true,
|
|
134
|
-
"spriteSourceSize": {"x":
|
|
135
|
-
"sourceSize": {"w":
|
|
134
|
+
"spriteSourceSize": {"x":42,"y":45,"w":190,"h":192},
|
|
135
|
+
"sourceSize": {"w":256,"h":256},
|
|
136
136
|
"anchor": {"x":0.5,"y":0.5}
|
|
137
137
|
},
|
|
138
138
|
"mineral/K":
|
|
139
139
|
{
|
|
140
|
-
"frame": {"x":
|
|
140
|
+
"frame": {"x":486,"y":0,"w":205,"h":190},
|
|
141
141
|
"rotated": true,
|
|
142
142
|
"trimmed": true,
|
|
143
|
-
"spriteSourceSize": {"x":
|
|
144
|
-
"sourceSize": {"w":
|
|
143
|
+
"spriteSourceSize": {"x":12,"y":39,"w":205,"h":190},
|
|
144
|
+
"sourceSize": {"w":256,"h":256},
|
|
145
145
|
"anchor": {"x":0.5,"y":0.5}
|
|
146
146
|
},
|
|
147
147
|
"mineral/L":
|
|
148
148
|
{
|
|
149
|
-
"frame": {"x":
|
|
149
|
+
"frame": {"x":1029,"y":185,"w":176,"h":182},
|
|
150
150
|
"rotated": false,
|
|
151
151
|
"trimmed": true,
|
|
152
|
-
"spriteSourceSize": {"x":
|
|
153
|
-
"sourceSize": {"w":
|
|
152
|
+
"spriteSourceSize": {"x":33,"y":45,"w":176,"h":182},
|
|
153
|
+
"sourceSize": {"w":256,"h":256},
|
|
154
154
|
"anchor": {"x":0.5,"y":0.5}
|
|
155
155
|
},
|
|
156
156
|
"mineral/O":
|
|
157
157
|
{
|
|
158
|
-
"frame": {"x":
|
|
158
|
+
"frame": {"x":855,"y":192,"w":174,"h":189},
|
|
159
159
|
"rotated": false,
|
|
160
160
|
"trimmed": true,
|
|
161
|
-
"spriteSourceSize": {"x":
|
|
162
|
-
"sourceSize": {"w":
|
|
161
|
+
"spriteSourceSize": {"x":44,"y":44,"w":174,"h":189},
|
|
162
|
+
"sourceSize": {"w":256,"h":256},
|
|
163
163
|
"anchor": {"x":0.5,"y":0.5}
|
|
164
164
|
},
|
|
165
165
|
"mineral/U":
|
|
166
166
|
{
|
|
167
|
-
"frame": {"x":
|
|
167
|
+
"frame": {"x":666,"y":205,"w":189,"h":195},
|
|
168
168
|
"rotated": false,
|
|
169
169
|
"trimmed": true,
|
|
170
|
-
"spriteSourceSize": {"x":
|
|
171
|
-
"sourceSize": {"w":
|
|
170
|
+
"spriteSourceSize": {"x":27,"y":43,"w":189,"h":195},
|
|
171
|
+
"sourceSize": {"w":256,"h":256},
|
|
172
172
|
"anchor": {"x":0.5,"y":0.5}
|
|
173
173
|
},
|
|
174
174
|
"mineral/X":
|
|
175
175
|
{
|
|
176
|
-
"frame": {"x":
|
|
177
|
-
"rotated":
|
|
176
|
+
"frame": {"x":866,"y":0,"w":185,"h":181},
|
|
177
|
+
"rotated": true,
|
|
178
178
|
"trimmed": true,
|
|
179
|
-
"spriteSourceSize": {"x":
|
|
180
|
-
"sourceSize": {"w":
|
|
179
|
+
"spriteSourceSize": {"x":30,"y":47,"w":185,"h":181},
|
|
180
|
+
"sourceSize": {"w":256,"h":256},
|
|
181
181
|
"anchor": {"x":0.5,"y":0.5}
|
|
182
182
|
},
|
|
183
183
|
"mineral/Z":
|
|
184
184
|
{
|
|
185
|
-
"frame": {"x":
|
|
185
|
+
"frame": {"x":488,"y":239,"w":178,"h":196},
|
|
186
186
|
"rotated": false,
|
|
187
187
|
"trimmed": true,
|
|
188
|
-
"spriteSourceSize": {"x":
|
|
189
|
-
"sourceSize": {"w":
|
|
188
|
+
"spriteSourceSize": {"x":39,"y":33,"w":178,"h":196},
|
|
189
|
+
"sourceSize": {"w":256,"h":256},
|
|
190
190
|
"anchor": {"x":0.5,"y":0.5}
|
|
191
191
|
},
|
|
192
192
|
"storage/fill":
|
|
193
193
|
{
|
|
194
|
-
"frame": {"x":
|
|
194
|
+
"frame": {"x":1227,"y":105,"w":60,"h":70},
|
|
195
195
|
"rotated": false,
|
|
196
196
|
"trimmed": true,
|
|
197
197
|
"spriteSourceSize": {"x":20,"y":15,"w":60,"h":70},
|
|
@@ -200,20 +200,38 @@
|
|
|
200
200
|
},
|
|
201
201
|
"storage/shell":
|
|
202
202
|
{
|
|
203
|
-
"frame": {"x":
|
|
204
|
-
"rotated":
|
|
203
|
+
"frame": {"x":1237,"y":331,"w":84,"h":100},
|
|
204
|
+
"rotated": true,
|
|
205
205
|
"trimmed": true,
|
|
206
206
|
"spriteSourceSize": {"x":8,"y":0,"w":84,"h":100},
|
|
207
207
|
"sourceSize": {"w":100,"h":100},
|
|
208
208
|
"anchor": {"x":0.5,"y":0.5}
|
|
209
|
+
},
|
|
210
|
+
"tower/body":
|
|
211
|
+
{
|
|
212
|
+
"frame": {"x":1205,"y":180,"w":132,"h":151},
|
|
213
|
+
"rotated": false,
|
|
214
|
+
"trimmed": true,
|
|
215
|
+
"spriteSourceSize": {"x":84,"y":65,"w":132,"h":151},
|
|
216
|
+
"sourceSize": {"w":300,"h":300},
|
|
217
|
+
"anchor": {"x":0.5,"y":0.5}
|
|
218
|
+
},
|
|
219
|
+
"tower/ring":
|
|
220
|
+
{
|
|
221
|
+
"frame": {"x":1099,"y":367,"w":138,"h":138},
|
|
222
|
+
"rotated": false,
|
|
223
|
+
"trimmed": true,
|
|
224
|
+
"spriteSourceSize": {"x":81,"y":81,"w":138,"h":138},
|
|
225
|
+
"sourceSize": {"w":300,"h":300},
|
|
226
|
+
"anchor": {"x":0.5,"y":0.5}
|
|
209
227
|
}},
|
|
210
228
|
"meta": {
|
|
211
229
|
"app": "https://www.codeandweb.com/texturepacker",
|
|
212
230
|
"version": "1.1",
|
|
213
|
-
"image": "
|
|
231
|
+
"image": "sprite-0.png?v=840bfc846e4a",
|
|
214
232
|
"format": "RGBA8888",
|
|
215
|
-
"size": {"w":
|
|
233
|
+
"size": {"w":1346,"h":512},
|
|
216
234
|
"scale": "1",
|
|
217
|
-
"smartupdate": "$TexturePacker:SmartUpdate:
|
|
235
|
+
"smartupdate": "$TexturePacker:SmartUpdate:17dbb1fe09c6ef3d23f6af0bda74218f:4ffddbb5131bccfa8b1c8f8e91f29fa4:7bec641508ea82bbc6f9e7dac5c284da$"
|
|
218
236
|
}
|
|
219
237
|
}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t,d as n,f as r,h as i,i as a,m as o,n as s,o as c,r as l,t as u,y as d}from"./vendor-codemirror-B_kaIH0M.js";import{S as f,_ as p,b as m,f as h,g,v as _,x as v,y}from"./index-
|
|
1
|
+
import{_ as e,a as t,d as n,f as r,h as i,i as a,m as o,n as s,o as c,r as l,t as u,y as d}from"./vendor-codemirror-B_kaIH0M.js";import{S as f,_ as p,b as m,f as h,g,v as _,x as v,y}from"./index-C0afJplS.js";var b=v(`<span style=font-size:11px;color:#e3b341>Unsaved changes`),x=v(`<div style="padding:12px 10px;font-size:12px;color:#484f58;font-style:italic">Loading…`),S=v(`<div style=flex:1;display:flex;align-items:center;justify-content:center;color:#484f58;font-size:13px;font-style:italic>`),C=v(`<div style=position:absolute;inset:0px;background:#0d1117;z-index:100;display:flex;flex-direction:column;overflow:hidden><div style="display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid #30363d;flex-shrink:0"><span style=font-size:15px;font-weight:600;color:#c9d1d9>Code</span><select style="background:#010409;color:#c9d1d9;border:1px solid #30363d;border-radius:4px;padding:4px 8px;font-size:12px;cursor:pointer"></select><div style=flex:1></div><button style="padding:5px 14px;border-radius:4px;border:1px solid #238636;font-size:12px;font-weight:600"></button><button style="background:transparent;border:none;color:#8b949e;font-size:18px;cursor:pointer;line-height:1;padding:2px 6px">✕</button></div><div style=flex:1;display:flex;overflow:hidden><div style="width:180px;flex-shrink:0;border-right:1px solid #21262d;display:flex;flex-direction:column;overflow:hidden"><div style="padding:6px 10px;font-size:10px;font-weight:700;color:#8b949e;text-transform:uppercase;letter-spacing:0.06em;border-bottom:1px solid #21262d;flex-shrink:0">Modules</div><div style=flex:1;overflow:auto></div></div><div style=flex:1;display:flex;flex-direction:column;overflow:hidden><div style="padding:5px 14px;font-size:12px;color:#8b949e;border-bottom:1px solid #21262d;flex-shrink:0;font-family:monospace;background:#0d1117">.js</div><div style=flex:1;overflow:hidden;flex-direction:column>`),w=v(`<option>`),T=v(`<div style="padding:7px 12px;font-size:12px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis">`),{error:E}=g(`code`),D=c.theme({"&":{height:`100%`},".cm-scroller":{"font-family":`'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace`,"font-size":`13px`,"line-height":`1.6`,overflow:`auto`},".cm-gutters":{background:`#0d1117`,"border-right":`1px solid #21262d`},".cm-lineNumbers .cm-gutterElement":{color:`#484f58`,"min-width":`3em`},".cm-activeLineGutter":{background:`#161b22`},".cm-activeLine":{background:`#161b22`}}),O=[l,s(),u,D];function k(s){let[c,l]=d([]),[u,g]=d(``),[_,v]=d({}),[D,k]=d(``),[A,j]=d(!1),[M,N]=d(!1),[P,F]=d(!1),I=()=>Object.keys(_()),{editorView:L,ref:R,createExtension:z}=t({onValueChange:e=>{let t=D();!t||_()[t]===e||(v(n=>({...n,[t]:e})),F(!0))}});a(L,()=>_()[D()]??``),z(O),i(()=>{let e=h();e&&e.http.user.branches().then(e=>{l(e.list);let t=e.list.find(e=>e.activeWorld)??e.list[0];t&&g(t.branch)}).catch(e=>{E(`branches failed:`,e),p(`Failed to load branches`,`error`)})}),i(()=>{let e=u(),t=h();!e||!t||(j(!0),v({}),k(``),F(!1),t.http.user.code.get(e).then(e=>{let t=e.modules??{};v(t),k(Object.keys(t)[0]??``)}).catch(e=>{E(`get failed:`,e),p(`Failed to load code`,`error`)}).finally(()=>j(!1)))});let B=()=>{let e=h(),t=u();!e||!t||(N(!0),e.http.user.code.set(t,_()).then(()=>{p(`Code saved`,`success`),F(!1)}).catch(e=>{E(`set failed:`,e),p(`Failed to save code`,`error`)}).finally(()=>N(!1)))};return(()=>{var t=C(),i=t.firstChild,a=i.firstChild.nextSibling,l=a.nextSibling.nextSibling,d=l.nextSibling,p=i.nextSibling.firstChild,h=p.firstChild.nextSibling,_=p.nextSibling,v=_.firstChild,E=v.firstChild,O=v.nextSibling;return a.addEventListener(`change`,e=>g(e.currentTarget.value)),y(a,o(n,{get each(){return c()},children:t=>(()=>{var n=w();return y(n,()=>t.branch,null),y(n,()=>t.activeWorld?` ★`:``,null),e(()=>n.value=t.branch),n})()})),y(i,o(r,{get when(){return P()},get children(){return b()}}),l),l.$$click=B,y(l,()=>M()?`Saving…`:`Save`),d.$$click=()=>s.onClose(),y(h,o(r,{get when(){return A()},get children(){return x()}}),null),y(h,o(n,{get each(){return I()},children:t=>(()=>{var n=T();return n.$$click=()=>k(t),y(n,t),e(e=>{var r=D()===t?`#1f3158`:`transparent`,i=D()===t?`#58a6ff`:`#c9d1d9`,a=`2px solid ${D()===t?`#388bfd`:`transparent`}`;return r!==e.e&&m(n,`background`,e.e=r),i!==e.t&&m(n,`color`,e.t=i),a!==e.a&&m(n,`border-left`,e.a=a),e},{e:void 0,t:void 0,a:void 0}),n})()}),null),y(v,D,E),f(R,O),y(_,o(r,{get when(){return!D()},get children(){var e=S();return y(e,()=>A()?`Loading code…`:`Select a module`),e}}),null),e(e=>{var t=M()||A()||!P(),n=M()||!P()?`#161b22`:`#1a3a2a`,r=M()||!P()?`#484f58`:`#3fb950`,i=M()||!P()?`default`:`pointer`,a=D()?`block`:`none`,o=D()?`flex`:`none`;return t!==e.e&&(l.disabled=e.e=t),n!==e.t&&m(l,`background`,e.t=n),r!==e.a&&m(l,`color`,e.a=r),i!==e.o&&m(l,`cursor`,e.o=i),a!==e.i&&m(v,`display`,e.i=a),o!==e.n&&m(O,`display`,e.n=o),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e(()=>a.value=u()),t})()}_([`click`]);export{k as CodePanel};
|
package/dist/{embedded/_client/MapViewer-B9YQqu-y.js → standalone/_client/MapViewer-pnfc3Uhb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as e,h as t,w as n,y as r}from"./vendor-codemirror-B_kaIH0M.js";import{S as i,a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,x}from"./index-
|
|
1
|
+
import{T as e,h as t,w as n,y as r}from"./vendor-codemirror-B_kaIH0M.js";import{S as i,a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,x}from"./index-C0afJplS.js";var S=x(`<div style=width:100%;height:100%;position:relative><canvas style=display:block>`),{log:C,error:w}=l(`map`);function T(l){let x,T=null,[E,D]=r([]),[O,k]=r(1),[A,j]=r(l.originRoom??null),M=null,N=null,P=new Map,F=new Map,I=new Map,L=new Map,R=e=>{let t=u();if(!t)return!0;let n=o(e);return!!n&&v(n.x,n.y,t)},z=e=>{let t=F.get(e);return{room:e,owner:t?.username??(t?.own?.user?`user:${t.own.user}`:null),mineral:t?.mineral??null,density:t?.density??null}},B=[],V=null,H=new Set,U=()=>{V=null;let e=c();if(!e||!T)return;let t=new Set(E());if(B=B.filter(e=>t.has(e)&&!T.hasRoom(e)&&!H.has(e)),B.length===0)return;let n=B.splice(0,200);for(let e of n)H.add(e);e.stores.room.terrainBulk(n,l.shard).then(async e=>{let t=[];for(let[n,r]of e){let e=T?.setRoomTerrain(n,r);e&&t.push(e);let i=I.get(n);i!==void 0&&T?.setRoomOwned(n,i)}for(let t of n)e.has(t)||T?.markRoomFetched(t);await Promise.all(t)}).catch(e=>w(`terrain fetch failed:`,e)).finally(()=>{for(let e of n)H.delete(e);B.length>0&&(V=setTimeout(U,0))})};return t(()=>{c(),l.shard,F.clear(),I.clear()}),e(()=>{x&&(async()=>{if(T=new y({onRoomHover:e=>{l.onHoveredRoomChanged?.(e?z(e):null)},onRoomClick:e=>{A()===e?R(e)&&setTimeout(()=>l.onNavigateToRoom(e),0):(j(e),T?.setSelectedRoom(e),l.onSelectedRoomChanged?.(z(e)))},onVisibleRoomsChanged:e=>{let t=e.length===0;N!==t&&(N=t,C(t?`zoom out — too many rooms visible, terrain loading paused`:`zoom in — terrain loading active, ${e.length} rooms visible`)),D(e)},onZoomChanged:e=>{k(e),l.onZoomChanged?.(e)}}),await T.init(x),!T)return;l.initialZoom!==void 0&&l.initialZoom>0&&T.setZoom(l.initialZoom),l.onZoomChanged?.(T.zoom);let e=u();if(e&&T.setBounds(e.minX,e.maxX,e.minY,e.maxY),l.originRoom){let e=o(l.originRoom);e&&T.centerOn(e.x,e.y),T.setSelectedRoom(l.originRoom),l.onSelectedRoomChanged?.(z(l.originRoom))}else{let e=c();if(e)try{let t=await e.http.user.worldStartRoom(l.shard??`shard0`);if(!T)return;let n=Array.isArray(t?.room)?t.room[0]:t?.room;if(typeof n==`string`){let e=o(n);e&&T.centerOn(e.x,e.y)}}catch(e){w(`worldStartRoom failed:`,e)}}})()}),n(()=>{V!==null&&(clearTimeout(V),V=null),B=[],H.clear();for(let e of P.values())e.dispose();P.clear(),T?.destroy(),T=null}),t(()=>{_({currentRoom:A,worldBounds:u,onMove:(e,t)=>{let n=d(e,t);j(n),T?.setSelectedRoom(n),T?.centerOn(e,t,!0),l.onSelectedRoomChanged?.(z(n)),l.onHoveredRoomChanged?.(z(n))}});let e=e=>{let t=e.target?.tagName??``,n=e.target?.isContentEditable??!1;if(!(t===`INPUT`||t===`TEXTAREA`||n)&&e.key===`m`){let e=A();e&&R(e)&&l.onNavigateToRoom(e)}};window.addEventListener(`keydown`,e),n(()=>window.removeEventListener(`keydown`,e))}),t(()=>{let e=c(),t=E(),n=l.shard;if(!e||t.length===0)return;let r=new Set(t),i=t.filter(e=>!T?.hasRoom(e)&&!H.has(e));if(i.length>0){let e=t.reduce((e,t)=>e+(o(t)?.x??0),0)/t.length,n=t.reduce((e,t)=>e+(o(t)?.y??0),0)/t.length;B=i.slice().sort((t,r)=>{let i=o(t),a=o(r);return(i?Math.abs(i.x-e)+Math.abs(i.y-n):999)-(a?Math.abs(a.x-e)+Math.abs(a.y-n):999)}),V===null&&(V=setTimeout(U,0))}e.stores.mapStats.request(t,`owner0`,n??void 0);let a=O()>=.4;if(a!==M&&(M=a,l.onSubscriptionStateChanged?.(a),a||T?.clearAllMap2()),a){let r=new Set(t.map(e=>`${e}/${n}`));for(let[e,t]of P)r.has(e)||(t.dispose(),P.delete(e),T?.clearRoomMap2(e.split(`/`)[0]));for(let r of t){let t=`${r}/${n}`;P.has(t)||P.set(t,e.stores.map.subscribeMap2(r,n))}}else{for(let[,e]of P)e.dispose();P.clear()}T?.clearInvisibleRooms(r)}),t(()=>{T?.setShowRoomNames(f()),T&&(T.currentShard=l.shard??`shard0`)}),t(()=>{T?.setUnclaimableOverlayVisible(s())}),t(()=>{T?.setMapVisualVisible(b())}),t(()=>{T?.setOverlayMode(m())}),t(()=>{let e=c(),t=l.shard;e&&e.stores.server.worldInfo(t??void 0).then(e=>{C(`worldInfo(shard=${t??`none`}) — x: [${e.minX}, ${e.maxX}] y: [${e.minY}, ${e.maxY}]`),g(e)}).catch(e=>{C(`worldInfo(shard=${t??`none`}) failed:`,e)})}),t(()=>{T?.setCurrentUser(p()?._id??null)}),t(()=>{let e=u();e?(T?.setBounds(e.minX,e.maxX,e.minY,e.maxY),C(`worldBounds applied — shard: ${l.shard??`none`} x: [${e.minX}, ${e.maxX}] y: [${e.minY}, ${e.maxY}] (fetched for shard: ${e.shard??`none`})`)):(T?.clearBounds(),C(`worldBounds — none (shard: ${l.shard??`none`})`))}),t(()=>{let e=c();if(!e)return;let t=e.stores.user.subscribeMapVisual(l.shard),r=e.stores.user.on(`user:mapVisual`,({shard:e,data:t})=>{e===l.shard&&(t?T?.setMapVisual(t):T?.clearMapVisual())});n(()=>{t.dispose(),r.dispose()})}),t(()=>{let e=c();if(!e)return;let t=e.stores.map.on(`room:map2update`,({room:e,shard:t,data:n,source:r})=>{t===l.shard&&T?.setRoomMap2(e,n,r)});n(()=>t.dispose())}),t(()=>{let e=c();if(!e)return;let t=p()?._id,r=new Set(E()),i=e.stores.mapStats.on(`mapStats:room`,({room:e,stat:n})=>{F.set(e,n);let i=o(e),s=i?a(i.x,i.y)||h(i.x,i.y):!1,c=n.status===`out of borders`,u=!!(n.own&&n.own.user===t),d=!!(n.own&&n.own.user!==t),f=u?`own`:s||c||d?`other`:`none`;I.set(e,f),r.has(e)&&(T?.setRoomOwned(e,f),T?.setRoomSafeMode(e,!!n.safeMode)),T?.setRoomMineral(e,n.mineral,n.density);let p=n.badge?JSON.stringify(n.badge):``;L.get(e)!==p&&(L.set(e,p),T?.setRoomBadge(e,n.badge,n.own?.level)),A()===e&&l.onSelectedRoomChanged?.(z(e))});n(()=>i.dispose())}),(()=>{var e=S(),t=e.firstChild;return i(e=>x=e,t),e})()}export{T as MapViewer};
|