Il progetto adotta il nome «Rail Enterprise» ovunque (codice RailEnterprise.*, variabili RE_*, intestazioni RESV/RECL, immagine rail-enterprise-server) per allinearsi al repository Gitea. Aggiunge Gitea Actions sul modello di Chronos: CI su PR e main, rilascio da tag con gioco Windows (client Godot + server in server/), server Windows/Linux e immagine Docker nel registro Gitea, nightly. Aggiunge i riferimenti visivi 06–09, i modelli di PR e issue, l'ADR 0014 e aggiorna README (comandi locali), STATE e CLAUDE.md. 120 test verdi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using Godot;
|
|
using RailEnterprise.Client.App;
|
|
using RailEnterprise.Protocol.Messages;
|
|
using static RailEnterprise.Client.App.Localization;
|
|
|
|
namespace RailEnterprise.Client.Hud;
|
|
|
|
/// <summary>Notiziario in basso (immagine 01): «Notizie» e gli ultimi eventi che scorrono.</summary>
|
|
public partial class Ticker : PanelContainer
|
|
{
|
|
private readonly List<string> _items = [];
|
|
private readonly Label _text = UiTheme.Text("", 14);
|
|
private readonly Control _clip = new() { ClipContents = true, SizeFlagsHorizontal = SizeFlags.ExpandFill, CustomMinimumSize = new Vector2(0, 22) };
|
|
private float _offset;
|
|
|
|
public override void _Ready()
|
|
{
|
|
AddThemeStyleboxOverride("panel", UiTheme.Box(Palette.Panel, Palette.Border, 0, 14));
|
|
var row = new HBoxContainer();
|
|
row.AddThemeConstantOverride("separation", 18);
|
|
AddChild(row);
|
|
row.AddChild(UiTheme.Text(T("Notizie"), 14, Palette.Amber, bold: true));
|
|
row.AddChild(_clip);
|
|
_clip.AddChild(_text);
|
|
}
|
|
|
|
public void Add(EventInfo e)
|
|
{
|
|
_items.Insert(0, e.Text);
|
|
if (_items.Count > 8) _items.RemoveAt(_items.Count - 1);
|
|
_text.Text = string.Join(" | ", _items);
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
if (_items.Count == 0) return;
|
|
_offset += (float)delta * 40f;
|
|
float width = _text.GetMinimumSize().X;
|
|
if (_offset > width) _offset = -_clip.Size.X;
|
|
_text.Position = new Vector2(-_offset, 0);
|
|
}
|
|
}
|