Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
- When painting with ownership (in Ownership tab of Slab window), obey the rules of 'Ownable Natural Terrain' setting
  • Loading branch information
rainlizard committed Mar 24, 2024
1 parent 9ef3358 commit 8f25174
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Scenes/OverheadOwnership.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ onready var oDataOwnership = Nodelist.list["oDataOwnership"]
onready var oColorRectSlabOwner = Nodelist.list["oColorRectSlabOwner"]
onready var oInstanceOwnership = Nodelist.list["oInstanceOwnership"]
onready var oInstances = Nodelist.list["oInstances"]
onready var oDataSlab = Nodelist.list["oDataSlab"]
onready var oSlabPlacement = Nodelist.list["oSlabPlacement"]

onready var oMain = Nodelist.list["oMain"]
var OWNERSHIP_ALPHA = 0.5 setget set_ownership_alpha_graphics
Expand Down Expand Up @@ -65,8 +67,10 @@ func ownership_paint_shape(shapePositionArray, ownership):

slabOwnershipImage.lock()
for pos in shapePositionArray:
oDataOwnership.set_cellv(pos, ownership) # Set cell data
slabOwnershipImage.set_pixelv(pos, setColour) # Set image data
var slabID = oDataSlab.get_cell(pos.x, pos.y)
if oSlabPlacement.slabID_is_ownable(slabID) == true:
oDataOwnership.set_cellv(pos, ownership) # Set cell data
slabOwnershipImage.set_pixelv(pos, setColour) # Set image data
slabOwnershipImage.unlock()

slabOwnershipTexture.set_data(slabOwnershipImage)
Expand Down

0 comments on commit 8f25174

Please sign in to comment.