Improve simplified belt, show hints everywheer

This commit is contained in:
tobspr 2020-09-19 12:21:32 +02:00
parent ed206363f2
commit 2075f4d011
18 changed files with 831 additions and 819 deletions

View File

@ -266,7 +266,7 @@
},
"sprites/belt/built/right_5.png":
{
"frame": {"x":1518,"y":1177,"w":130,"h":130},
"frame": {"x":1394,"y":1196,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
@ -274,7 +274,7 @@
},
"sprites/belt/built/right_6.png":
{
"frame": {"x":1656,"y":1177,"w":130,"h":130},
"frame": {"x":1532,"y":1177,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
@ -282,7 +282,7 @@
},
"sprites/belt/built/right_7.png":
{
"frame": {"x":1794,"y":1177,"w":130,"h":130},
"frame": {"x":1670,"y":1177,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
@ -290,7 +290,7 @@
},
"sprites/belt/built/right_8.png":
{
"frame": {"x":1528,"y":1315,"w":130,"h":130},
"frame": {"x":1808,"y":1177,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
@ -298,7 +298,7 @@
},
"sprites/belt/built/right_9.png":
{
"frame": {"x":1666,"y":1315,"w":130,"h":130},
"frame": {"x":1532,"y":1315,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
@ -336,33 +336,9 @@
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
"sourceSize": {"w":144,"h":144}
},
"sprites/belt/potato_mode/forward.png":
{
"frame": {"x":1307,"y":906,"w":116,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":0,"w":116,"h":144},
"sourceSize": {"w":144,"h":144}
},
"sprites/belt/potato_mode/left.png":
{
"frame": {"x":1804,"y":1315,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":14,"w":130,"h":130},
"sourceSize": {"w":144,"h":144}
},
"sprites/belt/potato_mode/right.png":
{
"frame": {"x":1676,"y":1453,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
"sourceSize": {"w":144,"h":144}
},
"sprites/blueprints/belt_left.png":
{
"frame": {"x":1814,"y":1453,"w":130,"h":130},
"frame": {"x":1670,"y":1315,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":14,"w":130,"h":130},
@ -370,7 +346,7 @@
},
"sprites/blueprints/belt_right.png":
{
"frame": {"x":1624,"y":1591,"w":130,"h":130},
"frame": {"x":1808,"y":1315,"w":130,"h":130},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":14,"w":130,"h":130},
@ -378,7 +354,7 @@
},
"sprites/blueprints/belt_top.png":
{
"frame": {"x":1394,"y":1196,"w":116,"h":144},
"frame": {"x":1307,"y":906,"w":116,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":14,"y":0,"w":116,"h":144},
@ -386,7 +362,7 @@
},
"sprites/blueprints/constant_signal.png":
{
"frame": {"x":1630,"y":1864,"w":105,"h":127},
"frame": {"x":1624,"y":1725,"w":105,"h":127},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":20,"y":0,"w":105,"h":127},
@ -426,7 +402,7 @@
},
"sprites/blueprints/lever.png":
{
"frame": {"x":1932,"y":1177,"w":111,"h":129},
"frame": {"x":1668,"y":1453,"w":111,"h":129},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":17,"y":4,"w":111,"h":129},
@ -722,7 +698,7 @@
},
"sprites/blueprints/wire-turn.png":
{
"frame": {"x":1814,"y":1726,"w":82,"h":82},
"frame": {"x":1793,"y":1588,"w":82,"h":82},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":62,"y":62,"w":82,"h":82},
@ -730,7 +706,7 @@
},
"sprites/blueprints/wire.png":
{
"frame": {"x":1992,"y":1418,"w":20,"h":144},
"frame": {"x":1904,"y":1453,"w":20,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":62,"y":0,"w":20,"h":144},
@ -778,7 +754,7 @@
},
"sprites/buildings/constant_signal.png":
{
"frame": {"x":1879,"y":1591,"w":104,"h":127},
"frame": {"x":1630,"y":1860,"w":104,"h":127},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":20,"y":0,"w":104,"h":127},
@ -826,7 +802,7 @@
},
"sprites/buildings/lever.png":
{
"frame": {"x":1624,"y":1729,"w":109,"h":127},
"frame": {"x":1787,"y":1453,"w":109,"h":127},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":18,"y":5,"w":109,"h":127},
@ -1130,7 +1106,7 @@
},
"sprites/buildings/wire.png":
{
"frame": {"x":2020,"y":1418,"w":18,"h":144},
"frame": {"x":1932,"y":1453,"w":18,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":0,"w":18,"h":144},
@ -1138,7 +1114,7 @@
},
"sprites/buildings/wire_tunnel-coating.png":
{
"frame": {"x":1952,"y":1418,"w":32,"h":134},
"frame": {"x":1946,"y":1177,"w":32,"h":134},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":56,"y":5,"w":32,"h":134},
@ -1154,7 +1130,7 @@
},
"sprites/debug/acceptor_slot.png":
{
"frame": {"x":1528,"y":1453,"w":12,"h":12},
"frame": {"x":1981,"y":119,"w":12,"h":12},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":12,"h":12},
@ -1162,7 +1138,7 @@
},
"sprites/debug/ejector_slot.png":
{
"frame": {"x":1952,"y":1560,"w":12,"h":12},
"frame": {"x":1394,"y":1334,"w":12,"h":12},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":12,"h":12},
@ -1170,7 +1146,7 @@
},
"sprites/misc/hub_direction_indicator.png":
{
"frame": {"x":1983,"y":961,"w":48,"h":48},
"frame": {"x":1630,"y":1995,"w":48,"h":48},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":48,"h":48},
@ -1186,7 +1162,7 @@
},
"sprites/misc/processor_disconnected.png":
{
"frame": {"x":1741,"y":1729,"w":65,"h":84},
"frame": {"x":1742,"y":1934,"w":65,"h":84},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":17,"y":8,"w":65,"h":84},
@ -1194,7 +1170,7 @@
},
"sprites/misc/reader_overlay.png":
{
"frame": {"x":1564,"y":1453,"w":104,"h":70},
"frame": {"x":1793,"y":1678,"w":104,"h":70},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":20,"y":38,"w":104,"h":70},
@ -1202,7 +1178,7 @@
},
"sprites/misc/slot_bad_arrow.png":
{
"frame": {"x":1782,"y":1999,"w":35,"h":35},
"frame": {"x":1815,"y":2007,"w":35,"h":35},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":2,"w":35,"h":35},
@ -1218,7 +1194,7 @@
},
"sprites/misc/storage_overlay.png":
{
"frame": {"x":1630,"y":1999,"w":89,"h":44},
"frame": {"x":1831,"y":1845,"w":89,"h":44},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":89,"h":44},
@ -1226,7 +1202,7 @@
},
"sprites/misc/waypoint.png":
{
"frame": {"x":1997,"y":1017,"w":38,"h":48},
"frame": {"x":1886,"y":1897,"w":38,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":5,"y":0,"w":38,"h":48},
@ -1234,7 +1210,7 @@
},
"sprites/wires/boolean_false.png":
{
"frame": {"x":1564,"y":1531,"w":31,"h":41},
"frame": {"x":1946,"y":1319,"w":31,"h":41},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":9,"y":5,"w":31,"h":41},
@ -1250,7 +1226,7 @@
},
"sprites/wires/display/blue.png":
{
"frame": {"x":1832,"y":1872,"w":47,"h":47},
"frame": {"x":1983,"y":961,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1258,7 +1234,7 @@
},
"sprites/wires/display/cyan.png":
{
"frame": {"x":1832,"y":1927,"w":47,"h":47},
"frame": {"x":1831,"y":1897,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1266,7 +1242,7 @@
},
"sprites/wires/display/green.png":
{
"frame": {"x":1993,"y":1722,"w":47,"h":47},
"frame": {"x":1815,"y":1952,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1274,7 +1250,7 @@
},
"sprites/wires/display/purple.png":
{
"frame": {"x":1993,"y":1777,"w":47,"h":47},
"frame": {"x":1870,"y":1953,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1282,7 +1258,7 @@
},
"sprites/wires/display/red.png":
{
"frame": {"x":1832,"y":1982,"w":47,"h":47},
"frame": {"x":1883,"y":1605,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1290,7 +1266,7 @@
},
"sprites/wires/display/white.png":
{
"frame": {"x":1888,"y":1816,"w":47,"h":47},
"frame": {"x":1938,"y":1605,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1298,7 +1274,7 @@
},
"sprites/wires/display/yellow.png":
{
"frame": {"x":1887,"y":1872,"w":47,"h":47},
"frame": {"x":1905,"y":1660,"w":47,"h":47},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":1,"w":47,"h":47},
@ -1306,7 +1282,7 @@
},
"sprites/wires/lever_on.png":
{
"frame": {"x":1762,"y":1591,"w":109,"h":127},
"frame": {"x":1624,"y":1590,"w":109,"h":127},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":18,"y":5,"w":109,"h":127},
@ -1330,7 +1306,7 @@
},
"sprites/wires/network_conflict.png":
{
"frame": {"x":1727,"y":1999,"w":47,"h":44},
"frame": {"x":1960,"y":1660,"w":47,"h":44},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":1,"y":2,"w":47,"h":44},
@ -1338,7 +1314,7 @@
},
"sprites/wires/network_empty.png":
{
"frame": {"x":1997,"y":1073,"w":41,"h":48},
"frame": {"x":1946,"y":1368,"w":41,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":5,"y":0,"w":41,"h":48},
@ -1346,7 +1322,7 @@
},
"sprites/wires/overlay_tile.png":
{
"frame": {"x":1942,"y":1314,"w":96,"h":96},
"frame": {"x":1564,"y":1453,"w":96,"h":96},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":96,"h":96},
@ -1362,7 +1338,7 @@
},
"sprites/wires/sets/color_forward.png":
{
"frame": {"x":1991,"y":1570,"w":18,"h":144},
"frame": {"x":1741,"y":1590,"w":18,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":0,"w":18,"h":144},
@ -1378,7 +1354,7 @@
},
"sprites/wires/sets/color_turn.png":
{
"frame": {"x":1904,"y":1726,"w":81,"h":81},
"frame": {"x":1737,"y":1756,"w":81,"h":81},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":63,"w":81,"h":81},
@ -1394,7 +1370,7 @@
},
"sprites/wires/sets/conflict_forward.png":
{
"frame": {"x":2017,"y":1570,"w":18,"h":144},
"frame": {"x":1767,"y":1590,"w":18,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":0,"w":18,"h":144},
@ -1410,7 +1386,7 @@
},
"sprites/wires/sets/conflict_turn.png":
{
"frame": {"x":1743,"y":1821,"w":81,"h":81},
"frame": {"x":1826,"y":1756,"w":81,"h":81},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":63,"w":81,"h":81},
@ -1426,7 +1402,7 @@
},
"sprites/wires/sets/regular_forward.png":
{
"frame": {"x":2020,"y":1418,"w":18,"h":144},
"frame": {"x":1932,"y":1453,"w":18,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":0,"w":18,"h":144},
@ -1458,7 +1434,7 @@
},
"sprites/wires/sets/shape_forward.png":
{
"frame": {"x":1993,"y":119,"w":18,"h":144},
"frame": {"x":1986,"y":1177,"w":18,"h":144},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":0,"w":18,"h":144},
@ -1474,7 +1450,7 @@
},
"sprites/wires/sets/shape_turn.png":
{
"frame": {"x":1743,"y":1910,"w":81,"h":81},
"frame": {"x":1742,"y":1845,"w":81,"h":81},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":63,"y":63,"w":81,"h":81},
@ -1482,7 +1458,7 @@
},
"sprites/wires/wires_preview.png":
{
"frame": {"x":1832,"y":1816,"w":48,"h":48},
"frame": {"x":1686,"y":1995,"w":48,"h":48},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":48,"h":48},
@ -1495,6 +1471,6 @@
"format": "RGBA8888",
"size": {"w":2048,"h":2048},
"scale": "0.75",
"smartupdate": "$TexturePacker:SmartUpdate:c7eb8309a6231af3a602b15ea83eb25e:dbcd9451525edae3c693f91da9e98be3:908b89f5ca8ff73e331a35a3b14d0604$"
"smartupdate": "$TexturePacker:SmartUpdate:604557e03fa42226ddc62b672c751ccf:2a9399f9a7c16dc686a4fb0941b02e6b:908b89f5ca8ff73e331a35a3b14d0604$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -10,7 +10,7 @@
},
"sprites/belt/built/forward_1.png":
{
"frame": {"x":948,"y":540,"w":40,"h":48},
"frame": {"x":946,"y":567,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -18,7 +18,7 @@
},
"sprites/belt/built/forward_2.png":
{
"frame": {"x":909,"y":652,"w":40,"h":48},
"frame": {"x":810,"y":628,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -26,7 +26,7 @@
},
"sprites/belt/built/forward_3.png":
{
"frame": {"x":957,"y":652,"w":40,"h":48},
"frame": {"x":858,"y":628,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -34,7 +34,7 @@
},
"sprites/belt/built/forward_4.png":
{
"frame": {"x":577,"y":546,"w":40,"h":48},
"frame": {"x":906,"y":679,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -42,7 +42,7 @@
},
"sprites/belt/built/forward_5.png":
{
"frame": {"x":521,"y":550,"w":40,"h":48},
"frame": {"x":954,"y":707,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -50,7 +50,7 @@
},
"sprites/belt/built/forward_6.png":
{
"frame": {"x":625,"y":546,"w":40,"h":48},
"frame": {"x":577,"y":546,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -58,7 +58,7 @@
},
"sprites/belt/built/forward_7.png":
{
"frame": {"x":673,"y":599,"w":40,"h":48},
"frame": {"x":521,"y":550,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -66,7 +66,7 @@
},
"sprites/belt/built/forward_8.png":
{
"frame": {"x":764,"y":634,"w":40,"h":48},
"frame": {"x":625,"y":546,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -74,7 +74,7 @@
},
"sprites/belt/built/forward_9.png":
{
"frame": {"x":812,"y":680,"w":40,"h":48},
"frame": {"x":673,"y":599,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -82,7 +82,7 @@
},
"sprites/belt/built/forward_10.png":
{
"frame": {"x":890,"y":572,"w":40,"h":48},
"frame": {"x":839,"y":572,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -90,7 +90,7 @@
},
"sprites/belt/built/forward_11.png":
{
"frame": {"x":813,"y":624,"w":40,"h":48},
"frame": {"x":887,"y":572,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -98,7 +98,7 @@
},
"sprites/belt/built/forward_12.png":
{
"frame": {"x":938,"y":596,"w":40,"h":48},
"frame": {"x":762,"y":582,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -106,7 +106,7 @@
},
"sprites/belt/built/forward_13.png":
{
"frame": {"x":861,"y":628,"w":40,"h":48},
"frame": {"x":935,"y":623,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -336,15 +336,7 @@
"spriteSourceSize": {"x":4,"y":4,"w":44,"h":44},
"sourceSize": {"w":48,"h":48}
},
"sprites/belt/potato_mode/forward.png":
{
"frame": {"x":860,"y":684,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
"sourceSize": {"w":48,"h":48}
},
"sprites/belt/potato_mode/left.png":
"sprites/blueprints/belt_left.png":
{
"frame": {"x":417,"y":467,"w":44,"h":44},
"rotated": false,
@ -352,7 +344,7 @@
"spriteSourceSize": {"x":0,"y":4,"w":44,"h":44},
"sourceSize": {"w":48,"h":48}
},
"sprites/belt/potato_mode/right.png":
"sprites/blueprints/belt_right.png":
{
"frame": {"x":469,"y":518,"w":44,"h":44},
"rotated": false,
@ -360,25 +352,9 @@
"spriteSourceSize": {"x":4,"y":4,"w":44,"h":44},
"sourceSize": {"w":48,"h":48}
},
"sprites/blueprints/belt_left.png":
{
"frame": {"x":846,"y":516,"w":44,"h":44},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":4,"w":44,"h":44},
"sourceSize": {"w":48,"h":48}
},
"sprites/blueprints/belt_right.png":
{
"frame": {"x":789,"y":526,"w":44,"h":44},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":4,"w":44,"h":44},
"sourceSize": {"w":48,"h":48}
},
"sprites/blueprints/belt_top.png":
{
"frame": {"x":569,"y":602,"w":40,"h":48},
"frame": {"x":721,"y":638,"w":40,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":40,"h":48},
@ -386,7 +362,7 @@
},
"sprites/blueprints/constant_signal.png":
{
"frame": {"x":617,"y":654,"w":36,"h":43},
"frame": {"x":946,"y":516,"w":36,"h":43},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":36,"h":43},
@ -434,7 +410,7 @@
},
"sprites/blueprints/logic_gate-not.png":
{
"frame": {"x":898,"y":516,"w":42,"h":48},
"frame": {"x":789,"y":526,"w":42,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":42,"h":48},
@ -450,7 +426,7 @@
},
"sprites/blueprints/logic_gate-transistor.png":
{
"frame": {"x":721,"y":599,"w":35,"h":48},
"frame": {"x":615,"y":602,"w":35,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":0,"w":35,"h":48},
@ -666,7 +642,7 @@
},
"sprites/blueprints/virtual_processor-rotater.png":
{
"frame": {"x":841,"y":568,"w":41,"h":48},
"frame": {"x":713,"y":543,"w":41,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":41,"h":48},
@ -778,7 +754,7 @@
},
"sprites/buildings/constant_signal.png":
{
"frame": {"x":661,"y":655,"w":36,"h":43},
"frame": {"x":983,"y":623,"w":36,"h":43},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":0,"w":36,"h":43},
@ -834,7 +810,7 @@
},
"sprites/buildings/logic_gate-not.png":
{
"frame": {"x":713,"y":543,"w":43,"h":48},
"frame": {"x":846,"y":516,"w":43,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":3,"y":0,"w":43,"h":48},
@ -850,7 +826,7 @@
},
"sprites/buildings/logic_gate-transistor.png":
{
"frame": {"x":705,"y":688,"w":35,"h":48},
"frame": {"x":658,"y":655,"w":35,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":0,"w":35,"h":48},
@ -1066,7 +1042,7 @@
},
"sprites/buildings/virtual_processor-rotater.png":
{
"frame": {"x":764,"y":578,"w":41,"h":48},
"frame": {"x":897,"y":516,"w":41,"h":48},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":41,"h":48},
@ -1194,7 +1170,7 @@
},
"sprites/misc/reader_overlay.png":
{
"frame": {"x":705,"y":655,"w":36,"h":25},
"frame": {"x":983,"y":674,"w":36,"h":25},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":6,"y":12,"w":36,"h":25},
@ -1306,7 +1282,7 @@
},
"sprites/wires/lever_on.png":
{
"frame": {"x":617,"y":602,"w":38,"h":44},
"frame": {"x":569,"y":602,"w":38,"h":44},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":5,"y":1,"w":38,"h":44},
@ -1495,6 +1471,6 @@
"format": "RGBA8888",
"size": {"w":1024,"h":1024},
"scale": "0.25",
"smartupdate": "$TexturePacker:SmartUpdate:c7eb8309a6231af3a602b15ea83eb25e:dbcd9451525edae3c693f91da9e98be3:908b89f5ca8ff73e331a35a3b14d0604$"
"smartupdate": "$TexturePacker:SmartUpdate:604557e03fa42226ddc62b672c751ccf:2a9399f9a7c16dc686a4fb0941b02e6b:908b89f5ca8ff73e331a35a3b14d0604$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

After

Width:  |  Height:  |  Size: 276 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 690 KiB

After

Width:  |  Height:  |  Size: 688 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -468,13 +468,24 @@ canvas {
display: flex;
flex-grow: 1;
}
.hint {
position: absolute;
@include S(left, 20px);
@include S(right, 20px);
@include S(bottom, 60px);
@include Text;
color: #666;
}
.loadingStatus {
position: absolute;
@include S(left, 20px);
@include S(right, 20px);
@include S(bottom, 30px);
@include Text;
@include TextShadow3D(#aaa);
@include PlainText;
color: #aaa;
display: flex;
flex-direction: column;
justify-content: center;

View File

@ -1,37 +1,46 @@
#state_InGameState {
.gameLoadingOverlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
align-items: center;
justify-content: center;
pointer-events: all;
display: flex;
background: $mainBgColor;
flex-direction: column;
}
#ingame_Canvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#ingame_HUD_ModalDialogs {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
@include DarkThemeOverride {
.gameLoadingOverlay {
background: $darkModeGameBackground;
}
}
}
#state_InGameState {
.gameLoadingOverlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 9999;
align-items: center;
justify-content: center;
pointer-events: all;
display: flex;
background: $mainBgColor;
flex-direction: column;
}
.hint {
position: absolute;
@include S(bottom, 40px);
@include S(left, 20px);
@include S(right, 20px);
@include PlainText;
text-align: center;
}
#ingame_Canvas {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#ingame_HUD_ModalDialogs {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
@include DarkThemeOverride {
.gameLoadingOverlay {
background: $darkModeGameBackground;
}
}
}

View File

@ -1,145 +1,145 @@
#state_PreloadState {
&.failure {
.loadingImage,
.loadingStatus {
display: none;
}
}
.changelogDialogEntry {
margin-top: 10px;
width: 100%;
flex-direction: column;
text-align: left;
padding: 10px;
box-sizing: border-box;
background: #eef1f4;
@include DarkThemeOverride {
background: #424242;
}
.version {
@include Heading;
}
.date {
@include PlainText;
&::before {
content: " | ";
}
color: #aaabaf;
}
.changes {
@include PlainText;
@include S(padding-left, 15px);
strong {
background: $colorBlueBright;
color: #fff;
text-transform: uppercase;
@include S(padding, 1px, 2px);
@include S(margin-right, 3px);
}
a {
color: $colorBlueBright;
}
li {
@include SuperSmallText;
@include S(margin-bottom, 10px);
}
}
}
.failureBox {
.logo {
img {
@include S(width, 240px);
}
@include S(margin-bottom, 30px);
}
@include InlineAnimation(0.3s ease-in-out) {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.failureInner {
// background: darken($mainBgColor, 6);
@include S(max-width, 350px);
margin: 0 20px;
text-align: left;
@include BoxShadow3D(#fff);
@include S(padding, 15px);
@include S(border-radius, $globalBorderRadius);
@include DropShadow;
.errorHeader {
color: #ef5072;
}
.errorMessage {
@include PlainText;
display: block;
color: #666;
text-align: left;
@include BreakText;
hyphens: auto;
// border: dotted #666;
// @include S(border-width, 1px, 0);
@include S(padding, 10px, 0);
@include S(margin-top, 10px);
}
.supportHelp {
@include S(margin-top, 10px);
@include PlainText;
.email {
color: $themeColor;
cursor: pointer;
pointer-events: all;
}
}
.lower {
display: flex;
align-items: center;
@include S(margin-top, 16px);
i {
flex-grow: 1;
text-align: right;
color: #777;
@include PlainText;
}
button.resetApp {
@include Button3D($colorRedBright);
@include PlainText;
@include S(padding, 5px, 8px, 4px);
color: #fff;
}
}
}
}
/* Animations */
.status {
transform: scale(0.7) $hardwareAcc;
opacity: 0;
@include StateAnim(transform, opacity);
}
&.arrived {
.status {
opacity: 1;
transform: none;
}
}
}
#state_PreloadState {
&.failure {
.loadingImage,
.loadingStatus {
display: none;
}
}
.changelogDialogEntry {
margin-top: 10px;
width: 100%;
flex-direction: column;
text-align: left;
padding: 10px;
box-sizing: border-box;
background: #eef1f4;
@include DarkThemeOverride {
background: #424242;
}
.version {
@include Heading;
}
.date {
@include PlainText;
&::before {
content: " | ";
}
color: #aaabaf;
}
.changes {
@include PlainText;
@include S(padding-left, 15px);
strong {
background: $colorBlueBright;
color: #fff;
text-transform: uppercase;
@include S(padding, 1px, 2px);
@include S(margin-right, 3px);
}
a {
color: $colorBlueBright;
}
li {
@include SuperSmallText;
@include S(margin-bottom, 10px);
}
}
}
.failureBox {
.logo {
img {
@include S(width, 240px);
}
@include S(margin-bottom, 30px);
}
@include InlineAnimation(0.3s ease-in-out) {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.failureInner {
// background: darken($mainBgColor, 6);
@include S(max-width, 350px);
margin: 0 20px;
text-align: left;
@include BoxShadow3D(#fff);
@include S(padding, 15px);
@include S(border-radius, $globalBorderRadius);
@include DropShadow;
.errorHeader {
color: #ef5072;
}
.errorMessage {
@include PlainText;
display: block;
color: #666;
text-align: left;
@include BreakText;
hyphens: auto;
// border: dotted #666;
// @include S(border-width, 1px, 0);
@include S(padding, 10px, 0);
@include S(margin-top, 10px);
}
.supportHelp {
@include S(margin-top, 10px);
@include PlainText;
.email {
color: $themeColor;
cursor: pointer;
pointer-events: all;
}
}
.lower {
display: flex;
align-items: center;
@include S(margin-top, 16px);
i {
flex-grow: 1;
text-align: right;
color: #777;
@include PlainText;
}
button.resetApp {
@include Button3D($colorRedBright);
@include PlainText;
@include S(padding, 5px, 8px, 4px);
color: #fff;
}
}
}
}
/* Animations */
.status {
transform: scale(0.7) $hardwareAcc;
opacity: 0;
@include StateAnim(transform, opacity);
}
&.arrived {
.status {
opacity: 1;
transform: none;
}
}
}

View File

@ -84,8 +84,8 @@ export const globalConfig = {
// Global game speed
gameSpeed: 1,
warmupTimeSecondsFast: 0.1,
warmupTimeSecondsRegular: 1,
warmupTimeSecondsFast: 0.5,
warmupTimeSecondsRegular: 3,
smoothing: {
smoothMainCanvas: smoothCanvas && true,
@ -132,5 +132,5 @@ if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
}
if (globalConfig.debug.fastGameEnter) {
globalConfig.debug.noArtificalDelays = true;
globalConfig.debug.noArtificialDelays = true;
}

View File

@ -1,6 +1,8 @@
/* typehints:start */
import { Application } from "../application";
/* typehints:end */
import { randomChoice } from "../core/utils";
import { T } from "../translations";
export class GameLoadingOverlay {
@ -43,6 +45,7 @@ export class GameLoadingOverlay {
this.element.classList.add("gameLoadingOverlay");
this.parent.appendChild(this.element);
this.internalAddSpinnerAndText(this.element);
this.internalAddHint(this.element);
}
/**
@ -55,4 +58,15 @@ export class GameLoadingOverlay {
inner.innerText = T.global.loading;
element.appendChild(inner);
}
/**
* Adds a random hint
* @param {HTMLElement} element
*/
internalAddHint(element) {
const hint = document.createElement("span");
hint.innerHTML = randomChoice(T.tips);
hint.classList.add("hint");
element.appendChild(hint);
}
}

22
src/js/game/hints.js Normal file
View File

@ -0,0 +1,22 @@
import { randomChoice } from "../core/utils";
import { T } from "../translations";
const hintsShown = [];
/**
* Finds a new hint to show about the game which the user hasn't seen within this session
*/
export function getRandomHint() {
let maxTries = 100 * T.tips.length;
while (maxTries-- > 0) {
const hint = randomChoice(T.tips);
if (!hintsShown.includes(hint)) {
hintsShown.push(hint);
return hint;
}
}
// All tips shown so far
return randomChoice(T.tips);
}

View File

@ -43,16 +43,6 @@ export class BeltSystem extends GameSystemWithFilter {
[enumDirection.right]: [],
};
/**
* Stores simplified sprites of a belt
* @type {Object<enumDirection, AtlasSprite>}
*/
this.potatoBeltSprites = {
[enumDirection.top]: Loader.getSprite("sprites/belt/potato_mode/forward.png"),
[enumDirection.right]: Loader.getSprite("sprites/belt/potato_mode/right.png"),
[enumDirection.left]: Loader.getSprite("sprites/belt/potato_mode/left.png"),
};
for (let i = 0; i < BELT_ANIM_COUNT; ++i) {
this.beltAnimations[enumDirection.top].push(
Loader.getSprite("sprites/belt/built/forward_" + i + ".png")
@ -523,7 +513,7 @@ export class BeltSystem extends GameSystemWithFilter {
const entity = contents[i];
if (entity.components.Belt) {
const direction = entity.components.Belt.direction;
let sprite = this.potatoBeltSprites[direction];
let sprite = this.beltAnimations[direction][0];
if (entity.components.Belt.assignedPath === hoveredBeltPath) {
sprite = this.beltAnimations[direction][animationIndex % BELT_ANIM_COUNT];

View File

@ -1,293 +1,331 @@
import { GameState } from "../core/game_state";
import { createLogger } from "../core/logging";
import { findNiceValue } from "../core/utils";
import { cachebust } from "../core/cachebust";
import { PlatformWrapperImplBrowser } from "../platform/browser/wrapper";
import { T, autoDetectLanguageId, updateApplicationLanguage } from "../translations";
import { HUDModalDialogs } from "../game/hud/parts/modal_dialogs";
import { CHANGELOG } from "../changelog";
import { globalConfig } from "../core/config";
const logger = createLogger("state/preload");
export class PreloadState extends GameState {
constructor() {
super("PreloadState");
}
getInnerHTML() {
return `
<div class="loadingImage"></div>
<div class="loadingStatus">
<span class="desc">Booting</span>
<span class="bar">
<span class="inner" style="width: 0%"></span>
<span class="status">0%</span>
</span>
</div>
</div>
`;
}
getThemeMusic() {
return null;
}
getHasFadeIn() {
return false;
}
onEnter() {
this.htmlElement.classList.add("prefab_LoadingState");
const elementsToRemove = ["#loadingPreload", "#fontPreload"];
for (let i = 0; i < elementsToRemove.length; ++i) {
const elem = document.querySelector(elementsToRemove[i]);
if (elem) {
elem.remove();
}
}
this.dialogs = new HUDModalDialogs(null, this.app);
const dialogsElement = document.body.querySelector(".modalDialogParent");
this.dialogs.initializeToElement(dialogsElement);
/** @type {HTMLElement} */
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
/** @type {HTMLElement} */
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
/** @type {HTMLElement} */
this.statusBarText = this.htmlElement.querySelector(".loadingStatus > .bar > .status");
this.currentStatus = "booting";
this.currentIndex = 0;
this.startLoading();
}
onLeave() {
// this.dialogs.cleanup();
}
startLoading() {
this.setStatus("Booting")
.then(() => this.setStatus("Creating platform wrapper"))
.then(() => this.app.platformWrapper.initialize())
.then(() => this.setStatus("Initializing local storage"))
.then(() => {
const wrapper = this.app.platformWrapper;
if (wrapper instanceof PlatformWrapperImplBrowser) {
try {
window.localStorage.setItem("local_storage_test", "1");
window.localStorage.removeItem("local_storage_test");
} catch (ex) {
logger.error("Failed to read/write local storage:", ex);
return new Promise(() => {
alert(`Your brower does not support thirdparty cookies or you have disabled it in your security settings.\n\n
In Chrome this setting is called "Block third-party cookies and site data".\n\n
Please allow third party cookies and then reload the page.`);
// Never return
});
}
}
})
.then(() => this.setStatus("Creating storage"))
.then(() => {
return this.app.storage.initialize();
})
.then(() => this.setStatus("Initializing libraries"))
.then(() => this.app.analytics.initialize())
.then(() => this.app.gameAnalytics.initialize())
.then(() => this.setStatus("Initializing settings"))
.then(() => {
return this.app.settings.initialize();
})
.then(() => {
// Initialize fullscreen
if (this.app.platformWrapper.getSupportsFullscreen()) {
this.app.platformWrapper.setFullscreen(this.app.settings.getIsFullScreen());
}
})
.then(() => this.setStatus("Initializing language"))
.then(() => {
if (this.app.settings.getLanguage() === "auto-detect") {
const language = autoDetectLanguageId();
logger.log("Setting language to", language);
return this.app.settings.updateLanguage(language);
}
})
.then(() => {
const language = this.app.settings.getLanguage();
updateApplicationLanguage(language);
})
.then(() => this.setStatus("Initializing sounds"))
.then(() => {
// Notice: We don't await the sounds loading itself
return this.app.sound.initialize();
})
.then(() => {
this.app.backgroundResourceLoader.startLoading();
})
.then(() => this.setStatus("Initializing savegame"))
.then(() => {
return this.app.savegameMgr.initialize().catch(err => {
logger.error("Failed to initialize savegames:", err);
alert(
"Your savegames failed to load, it seems your data files got corrupted. I'm so sorry!\n\n(This can happen if your pc crashed while a game was saved).\n\nYou can try re-importing your savegames."
);
return this.app.savegameMgr.writeAsync();
});
})
.then(() => this.setStatus("Downloading resources"))
.then(() => {
return this.app.backgroundResourceLoader.getPromiseForBareGame();
})
.then(() => this.setStatus("Checking changelog"))
.then(() => {
if (G_IS_DEV && globalConfig.debug.disableUpgradeNotification) {
return;
}
return this.app.storage
.readFileAsync("lastversion.bin")
.catch(err => {
logger.warn("Failed to read lastversion:", err);
return G_BUILD_VERSION;
})
.then(version => {
logger.log("Last version:", version, "App version:", G_BUILD_VERSION);
this.app.storage.writeFileAsync("lastversion.bin", G_BUILD_VERSION);
return version;
})
.then(version => {
let changelogEntries = [];
logger.log("Last seen version:", version);
for (let i = 0; i < CHANGELOG.length; ++i) {
if (CHANGELOG[i].version === version) {
break;
}
changelogEntries.push(CHANGELOG[i]);
}
if (changelogEntries.length === 0) {
return;
}
let dialogHtml = T.dialogs.updateSummary.desc;
for (let i = 0; i < changelogEntries.length; ++i) {
const entry = changelogEntries[i];
dialogHtml += `
<div class="changelogDialogEntry">
<span class="version">${entry.version}</span>
<span class="date">${entry.date}</span>
<ul class="changes">
${entry.entries.map(text => `<li>${text}</li>`).join("")}
</ul>
</div>
`;
}
return new Promise(resolve => {
this.dialogs.showInfo(T.dialogs.updateSummary.title, dialogHtml).ok.add(resolve);
});
});
})
.then(() => this.setStatus("Launching"))
.then(
() => {
this.moveToState("MainMenuState");
},
err => {
this.showFailMessage(err);
}
);
}
setStatus(text) {
logger.log("✅ " + text);
this.currentIndex += 1;
this.currentStatus = text;
this.statusText.innerText = text;
const numSteps = 10; // FIXME
const percentage = (this.currentIndex / numSteps) * 100.0;
this.statusBar.style.width = percentage + "%";
this.statusBarText.innerText = findNiceValue(percentage) + "%";
return Promise.resolve();
}
showFailMessage(text) {
logger.error("App init failed:", text);
const email = "bugs@shapez.io";
const subElement = document.createElement("div");
subElement.classList.add("failureBox");
subElement.innerHTML = `
<div class="logo">
<img src="${cachebust("res/logo.png")}" alt="Shapez.io Logo">
</div>
<div class="failureInner">
<div class="errorHeader">
Failed to initialize application!
</div>
<div class="errorMessage">
${this.currentStatus} failed:<br/>
${text}
</div>
<div class="supportHelp">
Please send me an email with steps to reproduce and what you did before this happened:
<br /><a class="email" href="mailto:${email}?subject=App%20does%20not%20launch">${email}</a>
</div>
<div class="lower">
<button class="resetApp styledButton">Reset App</button>
<i>Build ${G_BUILD_VERSION} @ ${G_BUILD_COMMIT_HASH}</i>
</div>
</div>
`;
this.htmlElement.classList.add("failure");
this.htmlElement.appendChild(subElement);
const resetBtn = subElement.querySelector("button.resetApp");
this.trackClicks(resetBtn, this.showResetConfirm);
}
showResetConfirm() {
if (confirm("Are you sure you want to reset the app? This will delete all your savegames")) {
this.resetApp();
}
}
resetApp() {
this.app.settings
.resetEverythingAsync()
.then(() => {
this.app.savegameMgr.resetEverythingAsync();
})
.then(() => {
this.app.settings.resetEverythingAsync();
})
.then(() => {
window.location.reload();
});
}
}
import { CHANGELOG } from "../changelog";
import { cachebust } from "../core/cachebust";
import { globalConfig } from "../core/config";
import { GameState } from "../core/game_state";
import { createLogger } from "../core/logging";
import { findNiceValue } from "../core/utils";
import { getRandomHint } from "../game/hints";
import { HUDModalDialogs } from "../game/hud/parts/modal_dialogs";
import { PlatformWrapperImplBrowser } from "../platform/browser/wrapper";
import { autoDetectLanguageId, T, updateApplicationLanguage } from "../translations";
const logger = createLogger("state/preload");
export class PreloadState extends GameState {
constructor() {
super("PreloadState");
}
getInnerHTML() {
return `
<div class="loadingImage"></div>
<div class="loadingStatus">
<span class="desc">Booting</span>
<span class="bar">
<span class="inner" style="width: 0%"></span>
<span class="status">0%</span>
</span>
</div>
</div>
<span class="hint"></span>
`;
}
getThemeMusic() {
return null;
}
getHasFadeIn() {
return false;
}
onEnter() {
this.htmlElement.classList.add("prefab_LoadingState");
const elementsToRemove = ["#loadingPreload", "#fontPreload"];
for (let i = 0; i < elementsToRemove.length; ++i) {
const elem = document.querySelector(elementsToRemove[i]);
if (elem) {
elem.remove();
}
}
this.dialogs = new HUDModalDialogs(null, this.app);
const dialogsElement = document.body.querySelector(".modalDialogParent");
this.dialogs.initializeToElement(dialogsElement);
/** @type {HTMLElement} */
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
/** @type {HTMLElement} */
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
/** @type {HTMLElement} */
this.statusBarText = this.htmlElement.querySelector(".loadingStatus > .bar > .status");
/** @type {HTMLElement} */
this.hintsText = this.htmlElement.querySelector(".hint");
this.lastHintShown = -1000;
this.nextHintDuration = 0;
this.currentStatus = "booting";
this.currentIndex = 0;
this.startLoading();
}
onLeave() {
// this.dialogs.cleanup();
}
startLoading() {
this.setStatus("Booting")
.then(() => this.setStatus("Creating platform wrapper"))
.then(() => this.app.platformWrapper.initialize())
.then(() => this.setStatus("Initializing local storage"))
.then(() => {
const wrapper = this.app.platformWrapper;
if (wrapper instanceof PlatformWrapperImplBrowser) {
try {
window.localStorage.setItem("local_storage_test", "1");
window.localStorage.removeItem("local_storage_test");
} catch (ex) {
logger.error("Failed to read/write local storage:", ex);
return new Promise(() => {
alert(`Your brower does not support thirdparty cookies or you have disabled it in your security settings.\n\n
In Chrome this setting is called "Block third-party cookies and site data".\n\n
Please allow third party cookies and then reload the page.`);
// Never return
});
}
}
})
.then(() => this.setStatus("Creating storage"))
.then(() => {
return this.app.storage.initialize();
})
.then(() => this.setStatus("Initializing libraries"))
.then(() => this.app.analytics.initialize())
.then(() => this.app.gameAnalytics.initialize())
.then(() => this.setStatus("Initializing settings"))
.then(() => {
return this.app.settings.initialize();
})
.then(() => {
// Initialize fullscreen
if (this.app.platformWrapper.getSupportsFullscreen()) {
this.app.platformWrapper.setFullscreen(this.app.settings.getIsFullScreen());
}
})
.then(() => this.setStatus("Initializing language"))
.then(() => {
if (this.app.settings.getLanguage() === "auto-detect") {
const language = autoDetectLanguageId();
logger.log("Setting language to", language);
return this.app.settings.updateLanguage(language);
}
})
.then(() => {
const language = this.app.settings.getLanguage();
updateApplicationLanguage(language);
})
.then(() => this.setStatus("Initializing sounds"))
.then(() => {
// Notice: We don't await the sounds loading itself
return this.app.sound.initialize();
})
.then(() => {
this.app.backgroundResourceLoader.startLoading();
})
.then(() => this.setStatus("Initializing savegame"))
.then(() => {
return this.app.savegameMgr.initialize().catch(err => {
logger.error("Failed to initialize savegames:", err);
alert(
"Your savegames failed to load, it seems your data files got corrupted. I'm so sorry!\n\n(This can happen if your pc crashed while a game was saved).\n\nYou can try re-importing your savegames."
);
return this.app.savegameMgr.writeAsync();
});
})
.then(() => this.setStatus("Downloading resources"))
.then(() => {
return this.app.backgroundResourceLoader.getPromiseForBareGame();
})
.then(() => this.setStatus("Checking changelog"))
.then(() => {
if (G_IS_DEV && globalConfig.debug.disableUpgradeNotification) {
return;
}
return this.app.storage
.readFileAsync("lastversion.bin")
.catch(err => {
logger.warn("Failed to read lastversion:", err);
return G_BUILD_VERSION;
})
.then(version => {
logger.log("Last version:", version, "App version:", G_BUILD_VERSION);
this.app.storage.writeFileAsync("lastversion.bin", G_BUILD_VERSION);
return version;
})
.then(version => {
let changelogEntries = [];
logger.log("Last seen version:", version);
for (let i = 0; i < CHANGELOG.length; ++i) {
if (CHANGELOG[i].version === version) {
break;
}
changelogEntries.push(CHANGELOG[i]);
}
if (changelogEntries.length === 0) {
return;
}
let dialogHtml = T.dialogs.updateSummary.desc;
for (let i = 0; i < changelogEntries.length; ++i) {
const entry = changelogEntries[i];
dialogHtml += `
<div class="changelogDialogEntry">
<span class="version">${entry.version}</span>
<span class="date">${entry.date}</span>
<ul class="changes">
${entry.entries.map(text => `<li>${text}</li>`).join("")}
</ul>
</div>
`;
}
return new Promise(resolve => {
this.dialogs.showInfo(T.dialogs.updateSummary.title, dialogHtml).ok.add(resolve);
});
});
})
.then(() => this.setStatus("Launching"))
.then(
() => {
this.moveToState("MainMenuState");
},
err => {
this.showFailMessage(err);
}
);
}
update() {
const now = performance.now();
if (now - this.lastHintShown > this.nextHintDuration) {
this.lastHintShown = now;
const hintText = getRandomHint();
this.hintsText.innerHTML = hintText;
/**
* Compute how long the user will need to read the hint.
* We calculate with 130 words per minute, with an average of 5 chars
* that is 650 characters / minute
*/
this.nextHintDuration = Math.max(2500, (hintText.length / 650) * 60 * 1000);
}
}
onRender() {
this.update();
}
onBackgroundTick() {
this.update();
}
/**
*
* @param {string} text
*/
setStatus(text) {
logger.log("✅ " + text);
this.currentIndex += 1;
this.currentStatus = text;
this.statusText.innerText = text;
const numSteps = 10; // FIXME
const percentage = (this.currentIndex / numSteps) * 100.0;
this.statusBar.style.width = percentage + "%";
this.statusBarText.innerText = findNiceValue(percentage) + "%";
return Promise.resolve();
}
showFailMessage(text) {
logger.error("App init failed:", text);
const email = "bugs@shapez.io";
const subElement = document.createElement("div");
subElement.classList.add("failureBox");
subElement.innerHTML = `
<div class="logo">
<img src="${cachebust("res/logo.png")}" alt="Shapez.io Logo">
</div>
<div class="failureInner">
<div class="errorHeader">
Failed to initialize application!
</div>
<div class="errorMessage">
${this.currentStatus} failed:<br/>
${text}
</div>
<div class="supportHelp">
Please send me an email with steps to reproduce and what you did before this happened:
<br /><a class="email" href="mailto:${email}?subject=App%20does%20not%20launch">${email}</a>
</div>
<div class="lower">
<button class="resetApp styledButton">Reset App</button>
<i>Build ${G_BUILD_VERSION} @ ${G_BUILD_COMMIT_HASH}</i>
</div>
</div>
`;
this.htmlElement.classList.add("failure");
this.htmlElement.appendChild(subElement);
const resetBtn = subElement.querySelector("button.resetApp");
this.trackClicks(resetBtn, this.showResetConfirm);
this.hintsText.remove();
}
showResetConfirm() {
if (confirm("Are you sure you want to reset the app? This will delete all your savegames!")) {
this.resetApp();
}
}
resetApp() {
this.app.settings
.resetEverythingAsync()
.then(() => {
this.app.savegameMgr.resetEverythingAsync();
})
.then(() => {
this.app.settings.resetEverythingAsync();
})
.then(() => {
window.location.reload();
});
}
}

View File

@ -1058,4 +1058,4 @@ tips:
- Mix all primary colours together to make white!
- You have an infinite map, don't cramp your factory, expand!
- Also try Factorio! It's my favourite game.
- The quad cutter cuts counter-clockwise starting from the top right!
- The quad cutter cuts clockwise starting from the top right!