Skip to content

Commit e1b2ecb

Browse files
author
tom
committed
feat(godot): file d'ordres pad dans la sidebar bataille
OrdersQueue affiche les ordres O : HQ > CE avec compteur 0/5 ; OrdersLog reserve aux evenements de manche.
1 parent ccb55a4 commit e1b2ecb

4 files changed

Lines changed: 34 additions & 6 deletions

File tree

godot/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ Format des entrées : `AAAA-MM-JJ HH:MM:SS` (heure locale).
2323

2424
- **Connecteurs mer**`Space_*` rendus (Sp + `connector_h`/`connector_v`), tailles selon aspect atlas, positions couloirs entre quadrants
2525

26+
### Réalisé (suite)
27+
28+
- **File d’ordres**`%OrdersQueue` dans la sidebar (pad `O : HQ > CE`, compteur 0/5), journal `%OrdersLog` pour événements de manche
29+
2630
### À faire (prochaine étape critique)
2731

28-
- [ ] Synchroniser journal d’ordres sidebar ↔ `%OrdersLog` bataille
32+
- [ ] Déplacements mer/air depuis la carte (pas seulement terre)
2933
- [ ] Tuiles directionnelles emboîtées (échelle Unity) si souhaité
3034
- [ ] `Battleground.unity` pour calibration pixel-perfect
3135
- [ ] Bombes H, combats détaillés, animations

godot/scenes/battle/battle.tscn

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,20 @@ unique_name_in_owner = true
152152
layout_mode = 2
153153
text = "Orders / timer"
154154

155+
[node name="OrdersHint" type="Label" parent="Sidebar/OrdersPanel/VBox"]
156+
layout_mode = 2
157+
theme_override_colors/font_color = Color(0.75, 0.78, 0.85, 1)
158+
theme_override_font_sizes/font_size = 11
159+
autowrap_mode = 2
160+
text = "Planifiez vos ordres — touchez une case, puis une destination."
161+
162+
[node name="OrdersQueue" type="RichTextLabel" parent="Sidebar/OrdersPanel/VBox"]
163+
unique_name_in_owner = true
164+
layout_mode = 2
165+
bbcode_enabled = true
166+
fit_content = true
167+
text = ""
168+
155169
[node name="OrdersLog" type="RichTextLabel" parent="Sidebar/OrdersPanel/VBox"]
156170
unique_name_in_owner = true
157171
layout_mode = 2

godot/scripts/battle/battle.gd

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ func _begin_match() -> void:
7272
_planning_elapsed = 1
7373
_timer_accum = 0.0
7474
_log.clear()
75-
_log.append_text("[i]Planifiez vos ordres[/i] — touchez une case, puis une destination.\n")
7675

7776

7877
func _populate_sector_list() -> void:
@@ -122,10 +121,7 @@ func _update_move_highlights() -> void:
122121

123122

124123
func _log_last_order() -> void:
125-
var orders: Array[GameOrder] = _state.orders_for_camp(_state.human_camp)
126-
if orders.is_empty():
127-
return
128-
_log.append_text("[color=#e05555]%s[/color]\n" % orders.back().pad_label())
124+
pass
129125

130126

131127
func _phase_name(phase: GameConstants.GamePhase) -> String:

godot/scripts/battle/battle_sidebar.gd

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extends Control
99
@onready var _reserve_outline: Label = %ReserveOutline
1010
@onready var _reserve_counts: Label = %ReserveCounts
1111
@onready var _orders_timer: Label = %OrdersTimer
12+
@onready var _orders_queue: RichTextLabel = %OrdersQueue
1213
@onready var _orders_log: RichTextLabel = %OrdersLog
1314

1415

@@ -44,6 +45,19 @@ func refresh(
4445
_reserve_counts.text = _shape_row(["●", "■", "▲", "◆"], res, false)
4546

4647
_orders_timer.text = "Orders / timer : %s" % _format_timer(planning_elapsed)
48+
_orders_queue.text = _format_orders_queue(state, human_camp)
49+
50+
51+
static func _format_orders_queue(state: GameState, human_camp: GameConstants.Camp) -> String:
52+
var used: int = state.camp_orders_used(human_camp)
53+
var max_o: int = GameConstants.MAX_ORDERS_PER_ROUND
54+
var lines: PackedStringArray = PackedStringArray()
55+
for order: GameOrder in state.orders_for_camp(human_camp):
56+
lines.append("[color=#e8a060]%s[/color]" % order.pad_label())
57+
if lines.is_empty():
58+
lines.append("[color=#888]— aucun ordre —[/color]")
59+
lines.append("[color=#aaa](%d/%d)[/color]" % [used, max_o])
60+
return "\n".join(lines)
4761

4862

4963
static func _format_timer(elapsed: int) -> String:

0 commit comments

Comments
 (0)