added multiplayer connection. TODO: Sync Inventory values. Disable moving of other color tiles
This commit is contained in:
parent
e8cd148bc7
commit
3de181134d
13 changed files with 360 additions and 67 deletions
|
|
@ -4,7 +4,7 @@ class_name InsectButton
|
|||
@onready var hex = $Hex
|
||||
@onready var tile_count_label = $Hex/TileCountLabel
|
||||
@onready var insect_icon = $Hex/InsectIcon
|
||||
const BEE = preload("res://Tile/Prefabs/Bee.tres")
|
||||
var BEE = load("res://Tile/Prefabs/Bee.tres")
|
||||
@export var insect_resource: TileResource = BEE
|
||||
|
||||
const HEX_BLACK = preload("res://InsectTiles/Assets/UI/hex_black.svg")
|
||||
|
|
@ -12,6 +12,8 @@ const HEX_WHITE = preload("res://InsectTiles/Assets/UI/hex_white.svg")
|
|||
|
||||
@export var is_black: bool = false
|
||||
|
||||
var disable_amount_display: bool = false
|
||||
|
||||
var tile_count: int = 1
|
||||
|
||||
var selected: bool = false
|
||||
|
|
@ -83,6 +85,9 @@ func refresh_state() -> void:
|
|||
func _ready() -> void:
|
||||
update_color(is_black)
|
||||
|
||||
if disable_amount_display:
|
||||
$Hex/TileCountLabel.visible = false
|
||||
|
||||
GameEvents.insect_selected.connect(_on_insect_selected)
|
||||
GameEvents.insect_placement_cancelled.connect(_on_placement_cancelled)
|
||||
GameEvents.insect_placed.connect(_on_insect_placed)
|
||||
|
|
@ -133,6 +138,9 @@ func _on_pressed():
|
|||
if is_empty():
|
||||
return
|
||||
|
||||
if GameData.is_player_black != is_black and not GameData.debug:
|
||||
return
|
||||
|
||||
selected = true
|
||||
|
||||
GameEvents.insect_selected.emit(self, is_black)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue