Add levels 4-6 to level selector, use grid layout
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
672b831fc1
commit
4afe20842e
1 changed files with 22 additions and 16 deletions
|
|
@ -12,7 +12,10 @@ public partial class LevelSelectScreen : Control
|
|||
[
|
||||
("Premier Convoi", "Acheminez du bois de la scierie au depot."),
|
||||
("Deux Clients", "Fournissez deux destinations depuis une seule scierie."),
|
||||
("Le Col", "Franchissez le mur et gerez deux types de cargaison.")
|
||||
("Le Col", "Franchissez le mur et gerez deux types de cargaison."),
|
||||
("Le Carrefour", "Deux productions, deux demandes, et un carrefour au centre."),
|
||||
("Le Labyrinthe", "Un couloir etroit serpente a travers les murs."),
|
||||
("Trois Royaumes", "Trois productions, trois demandes. Gerez un reseau complet.")
|
||||
];
|
||||
|
||||
public override void _Ready()
|
||||
|
|
@ -66,27 +69,30 @@ public partial class LevelSelectScreen : Control
|
|||
// Spacer
|
||||
outerVBox.AddChild(new Control { CustomMinimumSize = new Vector2(0, 48) });
|
||||
|
||||
// --- Level cards ---
|
||||
var cardRow = new HBoxContainer();
|
||||
cardRow.Alignment = BoxContainer.AlignmentMode.Center;
|
||||
cardRow.AddThemeConstantOverride("separation", 28);
|
||||
cardRow.SizeFlagsVertical = SizeFlags.ExpandFill;
|
||||
cardRow.MouseFilter = MouseFilterEnum.Ignore;
|
||||
// --- Level cards in a scrollable grid ---
|
||||
var scroll = new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.ExpandFill,
|
||||
HorizontalScrollMode = ScrollContainer.ScrollMode.Disabled
|
||||
};
|
||||
|
||||
var grid = new GridContainer
|
||||
{
|
||||
Columns = 3,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
MouseFilter = MouseFilterEnum.Ignore
|
||||
};
|
||||
grid.AddThemeConstantOverride("h_separation", 28);
|
||||
grid.AddThemeConstantOverride("v_separation", 28);
|
||||
|
||||
for (int i = 0; i < _levels.Length; i++)
|
||||
{
|
||||
var (name, desc) = _levels[i];
|
||||
cardRow.AddChild(CreateLevelCard(i, name, desc));
|
||||
grid.AddChild(CreateLevelCard(i, name, desc));
|
||||
}
|
||||
|
||||
outerVBox.AddChild(cardRow);
|
||||
|
||||
// Bottom spacer
|
||||
outerVBox.AddChild(new Control
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.ExpandFill,
|
||||
CustomMinimumSize = new Vector2(0, 40)
|
||||
});
|
||||
scroll.AddChild(grid);
|
||||
outerVBox.AddChild(scroll);
|
||||
|
||||
margin.AddChild(outerVBox);
|
||||
AddChild(margin);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue