From 27e9e83b5de0283b6837da82aaa9e584c8d0ab90 Mon Sep 17 00:00:00 2001 From: rainlizard <15337628+rainlizard@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:19:28 +1000 Subject: [PATCH] - --- Scenes/DataOwnership.gd | 18 ++++++++++++++---- Scenes/GenerateBorderWindow.gd | 1 - Scenes/SlabPlacement.gd | 2 +- Scenes/oAnalyzeGrids.gd | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Scenes/DataOwnership.gd b/Scenes/DataOwnership.gd index d98771bb..2800ed02 100644 --- a/Scenes/DataOwnership.gd +++ b/Scenes/DataOwnership.gd @@ -1,13 +1,23 @@ extends Grid -func set_cell_ownership(x, y, value): - set_cell(x*3, y*3, value) - func set_cellv_ownership(pos, value): - set_cell(pos.x*3, pos.y*3, value) + var x = pos.x * 3 + var y = pos.y * 3 + var start_seek_pos = (y * width + x) * bytes_per_entry + if start_seek_pos >= 0 and start_seek_pos < buffer_size: + var seek_pos = start_seek_pos + for _i in range(3): + for _j in range(3): + buffer.seek(seek_pos) + buffer.put_u8(value) + seek_pos += bytes_per_entry + seek_pos += (width - 3) * bytes_per_entry + func get_cell_ownership(x, y): return get_cell(x*3, y*3) + + func get_cellv_ownership(pos): return get_cell(pos.x*3, pos.y*3) diff --git a/Scenes/GenerateBorderWindow.gd b/Scenes/GenerateBorderWindow.gd index c814b82e..e2c4db34 100644 --- a/Scenes/GenerateBorderWindow.gd +++ b/Scenes/GenerateBorderWindow.gd @@ -123,7 +123,6 @@ func _on_ButtonNewMapOK_pressed(): # yield must be used here, because this function has yields inside of it. yield(oSlabPlacement.generate_slabs_based_on_id(shapePositionArray, false), "completed") - if oCheckBoxNewMapAutoOpensMapSettings.pressed == true: Utils.popup_centered(oMapSettingsWindow) diff --git a/Scenes/SlabPlacement.gd b/Scenes/SlabPlacement.gd index 03c66ebc..7ed9186d 100644 --- a/Scenes/SlabPlacement.gd +++ b/Scenes/SlabPlacement.gd @@ -405,7 +405,7 @@ func _on_ConfirmAutoGen_confirmed(): shapePositionArray.append(Vector2(xSlab,ySlab)) autogen_was_called = true - generate_slabs_based_on_id(shapePositionArray, updateNearby) + yield(generate_slabs_based_on_id(shapePositionArray, updateNearby), "completed") autogen_was_called = false print('Auto-generated all slabs: ' + str(OS.get_ticks_msec() - CODETIME_START) + 'ms') diff --git a/Scenes/oAnalyzeGrids.gd b/Scenes/oAnalyzeGrids.gd index 22e6b4a8..e266e459 100644 --- a/Scenes/oAnalyzeGrids.gd +++ b/Scenes/oAnalyzeGrids.gd @@ -21,7 +21,7 @@ onready var tilemap_data = { "Wibble": {"extension": ".wib", "grid_type": "SUBTILE", "node": oDataWibble}, "Liquid": {"extension": ".wlb", "grid_type": "TILE", "node": oDataLiquid}, "Slab": {"extension": ".slb", "grid_type": "TILE", "node": oDataSlab}, - "Ownership": {"extension": ".own", "grid_type": "TILE", "node": oDataOwnership}, + "Ownership": {"extension": ".own", "grid_type": "SUBTILE", "node": oDataOwnership}, "Column Positions": {"extension": ".dat", "grid_type": "SUBTILE", "node": oDataClmPos}, "Fake Slabs": {"extension": ".une", "grid_type": "TILE", "node": oDataFakeSlab}, "Style": {"extension": ".slx", "grid_type": "TILE", "node": oDataSlx}