feat: Add player action and input managers to handle player actions, movement, targeting, and visual feedback.

This commit is contained in:
Yogi Wiguna
2026-02-04 14:25:21 +08:00
parent 757051aca8
commit 77b8542896
5 changed files with 182 additions and 59 deletions
+9 -2
View File
@@ -71,16 +71,23 @@ func after_action_completed():
# Highlight Operations
# =============================================================================
func highlight_cells_if_authorized(cells_to_highlight: Array):
func highlight_cells_if_authorized(cells_to_highlight: Array, item_id: int = -1):
if not player.is_multiplayer_authority() or player.is_bot or player.is_in_group("Bots"):
return
# Start with fresh highlights if logical state changes?
# But dragging mouse calls this every frame. We need to clear previous calls.
# The simplistic clear_highlights() clears ALL highlights.
# Which is fine for targeting mode as we only highlight the target area.
clear_highlights()
var highlight_item = item_id if item_id != -1 else enhanced_gridmap.hover_item
for cell in cells_to_highlight:
highlighted_cells.append(cell)
enhanced_gridmap.set_cell_item(
Vector3i(cell.x, 0, cell.y),
enhanced_gridmap.hover_item
highlight_item
)
func highlight_empty_adjacent_cells():