Chessistics/Scripts/UI/DetailPanel.cs
Samuel Bouchet 8918140114 Phase 5: Dame (Queen) piece and network levels 7-8
Dame (Queen):
- Moves 1-2 cells in all 8 directions (orthogonal + diagonal)
- Social status 7 (highest — priority over all other pieces)
- Deep burgundy color, letter "D"
- Rare and powerful, forces strategic placement choices

Levels:
- Level 7 "La Dame Blanche": 10x10, walled arena with central fortress,
  1 queen available as a logistics superweapon
- Level 8 "Le Grand Reseau": 12x10, 4 productions + 4 demands,
  two vertical wall corridors, 2 queens, full network challenge

GDD updated with Dame section and status hierarchy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 23:24:14 +02:00

82 lines
2.9 KiB
C#

using Godot;
using Chessistics.Engine.Model;
using Chessistics.Scripts.Pieces;
namespace Chessistics.Scripts.UI;
public partial class DetailPanel : PanelContainer
{
[Signal]
public delegate void RemoveRequestedEventHandler(int pieceId);
private Label _infoLabel = null!;
private Button _removeButton = null!;
private int _currentPieceId;
public override void _Ready()
{
var style = new StyleBoxFlat
{
BgColor = new Color(0.14f, 0.14f, 0.16f, 0.95f),
BorderColor = new Color("#444448"),
BorderWidthTop = 1,
CornerRadiusTopLeft = 4, CornerRadiusTopRight = 4,
ContentMarginLeft = 12, ContentMarginRight = 12,
ContentMarginTop = 8, ContentMarginBottom = 8
};
AddThemeStyleboxOverride("panel", style);
var vbox = new VBoxContainer();
vbox.AddThemeConstantOverride("separation", 4);
var title = new Label { Text = "DETAIL" };
title.AddThemeFontSizeOverride("font_size", 13);
title.AddThemeColorOverride("font_color", new Color("#B8942A"));
vbox.AddChild(title);
_infoLabel = new Label { Text = "" };
_infoLabel.AddThemeFontSizeOverride("font_size", 11);
_infoLabel.AddThemeColorOverride("font_color", new Color("#CCCCCC"));
vbox.AddChild(_infoLabel);
_removeButton = new Button { Text = "Retirer", CustomMinimumSize = new Vector2(80, 26) };
_removeButton.AddThemeFontSizeOverride("font_size", 11);
var btnStyle = new StyleBoxFlat
{
BgColor = new Color("#5A2A2A"),
CornerRadiusTopLeft = 4, CornerRadiusTopRight = 4,
CornerRadiusBottomLeft = 4, CornerRadiusBottomRight = 4,
ContentMarginLeft = 8, ContentMarginRight = 8,
ContentMarginTop = 2, ContentMarginBottom = 2
};
_removeButton.AddThemeStyleboxOverride("normal", btnStyle);
_removeButton.Pressed += () => EmitSignal(SignalName.RemoveRequested, _currentPieceId);
vbox.AddChild(_removeButton);
AddChild(vbox);
Visible = false;
}
public void ShowPiece(PieceSnapshot piece)
{
_currentPieceId = piece.Id;
var kindName = piece.Kind switch
{
PieceKind.Pawn => "Pion",
PieceKind.Rook => "Tour II",
PieceKind.Bishop => "Fou II",
PieceKind.Knight => "Cavalier",
PieceKind.Queen => "Dame",
_ => piece.Kind.ToString()
};
var cargoText = piece.Cargo != null ? piece.Cargo.Value.ToString() : "aucun";
_infoLabel.Text = $"{kindName} (ID: {piece.Id})\n" +
$"Trajet: {piece.StartCell} ↔ {piece.EndCell}\n" +
$"Statut social: {piece.SocialStatus}\n" +
$"Porte: {cargoText}";
Visible = true;
}
public new void Hide() => Visible = false;
}