返回提交历史
Modified
scripts/blocks/磁铜传送带.js
+36
-24
Modified
sprites/books/磁铜传送带/磁铜传送带-0.png
+0
-0
Modified
sprites/books/磁铜传送带/磁铜传送带-1.png
+0
-0
Modified
sprites/books/磁铜传送带/磁铜传送带-2.png
+0
-0
Added
sprites/books/磁铜传送带/磁铜传送带-back-0.png
+0
-0
Added
sprites/books/磁铜传送带/磁铜传送带-back-1.png
+0
-0
Added
sprites/books/磁铜传送带/磁铜传送带-back-2.png
+0
-0
Added
sprites/books/磁铜传送带/磁铜传送带-front-0.png
+0
-0
Added
sprites/books/磁铜传送带/磁铜传送带-front-1.png
+0
-0
Added
sprites/books/磁铜传送带/磁铜传送带-front-2.png
+0
-0
XFEstudio/MCIndustry
优化贴图显示
9cad13e
代码差异
10 个文件
+36
-24
@@ -197,6 +197,16 @@ Events.on(ContentInitEvent, cons(() => {
197
197
const magneticSideRegion = Core.atlas.find(
198
198
magneticConveyor.name + "-side"
199
199
);
200
const magneticFrontRegions = [];
201
const magneticBackRegions = [];
202
for(let i = 0; i < 3; i++){
203
magneticFrontRegions.push(Core.atlas.find(
204
magneticConveyor.name + "-front-" + i
205
));
206
magneticBackRegions.push(Core.atlas.find(
207
magneticConveyor.name + "-back-" + i
208
));
209
}
200
210
201
211
magneticConveyor.buildType = prov(() => extend(
202
212
StackConveyor.StackConveyorBuild,
@@ -255,33 +265,35 @@ Events.on(ContentInitEvent, cons(() => {
255
265
this.rotdeg()
256
266
);
257
267
258
// 接口图是以当前格中心为锚点的 32x32 单侧透明图层。
259
// 它只覆盖“中心到相邻格边界”这一半,不再发生半格贴图中心错位。
260
for(let i = 1; i <= 3; i += 2){
261
const dir = Mathf.mod(this.rotation - i, 4);
262
const near = this.nearby(dir);
263
if(isRenderConnection(magneticConveyor, this, near)){
264
Draw.rect(
265
magneticSideRegion,
266
this.x,
267
this.y,
268
dir * 90
269
);
270
}
271
}
272
273
// 四个方向逐一判断:只有实际连接的一侧才不绘制 edge。
274
// 因而空地一侧始终封边,端点、直线和 T/Cross 接口规则一致。
268
// 底图的四个方向默认全部封边,只在存在实际连接时打开对应方向。
269
// 前后端恢复当前状态底图的同向半幅,避免旋转侧向接口后破坏箭头;
270
// 左右两侧则绘制转向接口。支线的尾部属于 i=2,必须单独处理。
275
271
for(let i = 0; i < 4; i++){
276
272
const dir = Mathf.mod(this.rotation - i, 4);
277
273
const near = this.nearby(dir);
278
if(!isRenderConnection(magneticConveyor, this, near)){
279
Draw.rect(
280
magneticConveyor.edgeRegion,
281
this.x,
282
this.y,
283
(this.rotation - i) * 90
284
);
274
if(isRenderConnection(magneticConveyor, this, near)){
275
if(i == 0){
276
Draw.rect(
277
magneticFrontRegions[this.state],
278
this.x,
279
this.y,
280
this.rotdeg()
281
);
282
}else if(i == 2){
283
Draw.rect(
284
magneticBackRegions[this.state],
285
this.x,
286
this.y,
287
this.rotdeg()
288
);
289
}else{
290
Draw.rect(
291
magneticSideRegion,
292
this.x,
293
this.y,
294
dir * 90
295
);
296
}
285
297
}
286
298
}
287
299
}
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。
二进制文件已变更,无法进行逐行预览。