mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
renderer is updated but wire pieces have some bugs on laying wire to the world
This commit is contained in:
@@ -903,10 +903,13 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
for (y in for_y_start..for_y_end) {
|
||||
for (x in for_x_start..for_x_end) {
|
||||
if (wiringCounter >= maxRenderableWires) break
|
||||
world.getAllWiresFrom(x, y)?.forEach {
|
||||
|
||||
val (wires, nodes) = world.getAllWiresFrom(x, y)
|
||||
|
||||
wires?.forEach {
|
||||
val wireActor = wireActorsContainer[wiringCounter]
|
||||
|
||||
wireActor.setWire(it, x, y)
|
||||
wireActor.setWire(it, x, y, nodes!![it]!!.cnx)
|
||||
|
||||
if (WireCodex[it].renderClass == selectedWireRenderClass || selectedWireRenderClass == "wire_render_all") {
|
||||
wireActor.renderOrder = Actor.RenderOrder.OVERLAY
|
||||
|
||||
@@ -134,8 +134,8 @@ object BlockBase {
|
||||
val thisTileWireCnx = ingame.world.getWireGraphOf(mouseTileX, mouseTileY, itemID)
|
||||
val oldTileWireCnx = ingame.world.getWireGraphOf(oldTileX, oldTileY, itemID)
|
||||
|
||||
val thisTileOccupied = thisTileWires?.searchFor(itemID) != null
|
||||
val oldTileOccupied = oldTileWires?.searchFor(itemID) != null
|
||||
val thisTileOccupied = thisTileWires.first?.searchFor(itemID) != null
|
||||
val oldTileOccupied = oldTileWires.first?.searchFor(itemID) != null
|
||||
val connectedEachOther = connectedEachOther(thisTileWireCnx, oldTileWireCnx)
|
||||
val thisTileWasDraggedOn = initialMouseDownTileX != mouseTileX || initialMouseDownTileY != mouseTileY
|
||||
|
||||
|
||||
@@ -39,9 +39,11 @@ class WireCutterAll(originalID: ItemID) : GameItem(originalID) {
|
||||
override fun startPrimaryUse(actor: ActorWithBody, delta: Float) = mouseInInteractableRange(actor) {
|
||||
val ingame = Terrarum.ingame!! as TerrarumIngame
|
||||
val mouseTile = Point2i(Terrarum.mouseTileX, Terrarum.mouseTileY)
|
||||
val wires = ingame.world.getAllWiresFrom(mouseTile.x, mouseTile.y)?.cloneToList()
|
||||
|
||||
wires?.forEach {
|
||||
val wireNet = ingame.world.getAllWiresFrom(mouseTile.x, mouseTile.y)
|
||||
val wireItems = wireNet.first?.cloneToList()
|
||||
|
||||
wireItems?.forEach {
|
||||
ingame.world.removeTileWire(mouseTile.x, mouseTile.y, it, false)
|
||||
ingame.queueActorAddition(DroppedItem(it, mouseTile.x * TILE_SIZED, mouseTile.y * TILE_SIZED))
|
||||
} ?: return@mouseInInteractableRange -1L
|
||||
|
||||
Reference in New Issue
Block a user