spawn buttons for buildable tiles

This commit is contained in:
ktyl 2022-12-17 23:25:43 +00:00
parent c22827967f
commit 8c55e2131f
2 changed files with 10 additions and 5 deletions

View File

@ -1,8 +1,9 @@
[gd_resource type="Resource" load_steps=3 format=2]
[gd_resource type="Resource" load_steps=4 format=2]
[ext_resource path="res://scripts/tile/TileTypeCollection.cs" type="Script" id=1]
[ext_resource path="res://resources/tiles/tile_types/developed.tres" type="Resource" id=2]
[ext_resource path="res://resources/tiles/tile_types/wild.tres" type="Resource" id=3]
[resource]
script = ExtResource( 1 )
_resources = [ ExtResource( 2 ) ]
_resources = [ ExtResource( 2 ), ExtResource( 3 ) ]

View File

@ -20,10 +20,14 @@ public class BuildModeUI : Control
_buildMode = GetNode<BuildMode>(_buildModePath);
var buttonHeight = 40;
var tileType = _buildMode.BuildableTiles[0];
int x = 50;
SpawnButton(tileType, buttonHeight, ref x);
int x = 50;
int margin = 5;
foreach (var tt in _buildMode.BuildableTiles)
{
SpawnButton(tt, buttonHeight, ref x);
x += margin;
}
}
private void UpdateButtonToggleState(TileType tileType)