Main menu looking almost good
This commit is contained in:
@@ -6,6 +6,7 @@ signal tile_hovered(coords: Vector2i)
|
||||
@export var tile_set: DLTileset
|
||||
@onready var tile_map: TileMapLayer = %TerrainLayer
|
||||
@onready var highlight_map: GridOverlay = %OverlayLayer
|
||||
@onready var tile_highlight: ColorRect = $TileHighlight
|
||||
|
||||
const TILE_SIZE := 48.0
|
||||
const SOURCE_ID: int = 0
|
||||
@@ -82,3 +83,8 @@ func remove_unit(unit: Unit) -> void:
|
||||
func target_tile(coords: Vector2i) -> void:
|
||||
highlight_map.target_tile(coords)
|
||||
tile_hovered.emit(coords)
|
||||
|
||||
|
||||
func set_highlight_enabled(enabled: bool) -> void:
|
||||
tile_highlight.visible = enabled
|
||||
tile_highlight.set_process(enabled)
|
||||
|
||||
@@ -3,14 +3,21 @@ class_name StrategyPhase extends Node2D
|
||||
@onready var player_controller: PlayerController = $PlayerController
|
||||
@onready var combat_system: CombatSystem = $CombatSystem
|
||||
@onready var combat_ui: CombatUI = $CombatUI
|
||||
@onready var combat_map: CombatMap = $CombatMap
|
||||
|
||||
func _ready() -> void:
|
||||
player_controller.combat_requested.connect(_on_combat_requested)
|
||||
combat_ui.fight_confirmed.connect(_on_fight_confirmed)
|
||||
combat_ui.fight_cancelled.connect(_on_fight_cancelled)
|
||||
|
||||
func _on_combat_requested(attacker: Unit, defender: Unit) -> void:
|
||||
var proposal := combat_system.create_proposal(attacker, defender)
|
||||
combat_map.set_highlight_enabled(false)
|
||||
combat_ui.show_proposal(proposal)
|
||||
|
||||
func _on_fight_confirmed(proposal: CombatProposal) -> void:
|
||||
combat_system.apply_proposal(proposal)
|
||||
combat_map.set_highlight_enabled(true)
|
||||
|
||||
func _on_fight_cancelled() -> void:
|
||||
combat_map.set_highlight_enabled(true)
|
||||
|
||||
Reference in New Issue
Block a user