diff --git a/client/RailEnterprise.Client/assets/i18n/strings.csv b/client/RailEnterprise.Client/assets/i18n/strings.csv index c910eb2..a7922b8 100644 --- a/client/RailEnterprise.Client/assets/i18n/strings.csv +++ b/client/RailEnterprise.Client/assets/i18n/strings.csv @@ -7,7 +7,6 @@ Aderisci con le tue azioni,,Tender your shares adesso,,just now Aggiorna,,Refresh al giorno,,per day -al lavoro ora,,at work now Alto,,High Ambra,,Amber Amministrazione controllata,,Receivership @@ -345,7 +344,6 @@ carica,,load cavaliere bianco,,white knight città senza servizi per il personale,,towns without services for staff Client collegati,,Connected clients -Collegato a,,Connected to Collo di bottiglia,,Bottleneck Condizione degli impianti,,Plant condition Connetti a un server,,Connect to a server @@ -358,7 +356,6 @@ Copertura degli ingressi,,Input coverage Crea una linea verso questa industria,,Build a line to this industry Creazione della nuova partita sul server…,,Creating the new game on the server… da,,from -dati compatibili,,compatible data degli utili come dividendo e non puoi chiedere prestiti.,,of profits as dividends and cannot take new loans. dei ricavi,,of revenue del capitale,,of the capital @@ -588,7 +585,6 @@ Scegli un'industria nell'elenco in alto.,,Choose an industry from the list above Scheda dell'industria,,Industry sheet scorta,,stock serve,,needs -Server locale spento: scegli «Gioca in locale» per avviarlo,,Local server off: choose «Play locally» to start it "Server su questo computer, avviato e chiuso con il gioco. Le partite restano qui.",,"Server on this computer, started and stopped with the game. Games stay here." servita dalla stazione,,served by station servita dalla tua linea,,served by your line @@ -663,7 +659,6 @@ città oltre,,towns over collegata su,,connected out of collegate su,,connected out of merci su linea,,goods on a line -Prezzo medio realizzato,,Average realised price Rating creditizio,,Credit rating attuale,,current Binari e opere,,Track and structures @@ -782,3 +777,16 @@ Verifica connessione,,Test connection Versione,,Version Versione del gioco,,Game version viaggio medio,,average trip +Sostituire la partita?,,Replace the game? +Sostituisci la partita,,Replace the game +Il server sostituirà la partita in corso ({0}) con il salvataggio «{1}» per tutti i client collegati ({2}). Quello che non è stato salvato andrà perso.,,The server will replace the current game ({0}) with the save «{1}» for every connected client ({2}). Anything not saved will be lost. +Il server sostituirà la partita in corso ({0}) con una partita nuova per tutti i client collegati ({1}). Quello che non è stato salvato andrà perso.,,The server will replace the current game ({0}) with a new game for every connected client ({1}). Anything not saved will be lost. +Server raggiungibile,,Server reachable +Server locale spento: «Connetti e riprendi» lo avvia,,Local server off: «Connect and resume» starts it +protocollo,,protocol +in sede,,on site +Prezzo di vendita,,Selling price +Offerta inviata…,,Offer sent… +Industria inattiva: non è in vendita finché non riprende a produrre.,,Inactive industry: not for sale until it starts producing again. +L'industria è ferma: riprova a fermo finito.,,The industry is stopped: try again when the stop is over. +C'è già un lavoro in programma.,,Work is already scheduled. diff --git a/client/RailEnterprise.Client/scripts/App/AutoPilot.cs b/client/RailEnterprise.Client/scripts/App/AutoPilot.cs index 412f6a6..3b4f3a2 100644 --- a/client/RailEnterprise.Client/scripts/App/AutoPilot.cs +++ b/client/RailEnterprise.Client/scripts/App/AutoPilot.cs @@ -209,13 +209,14 @@ public partial class AutoPilot : Node var anchor = MapScale.V(near); var industry = World.Industries.Values.Where(i => !i.Closed && i.Owner < 0 && i.Level > 0) .OrderBy(i => MapScale.V(i.Position).DistanceTo(anchor)).ThenBy(i => i.Id).First(); + // dalla F6 la scheda dell'industria è a tutto schermo (immagine 07): 12 è la scheda di + // un'industria dei privati con l'avviso dell'acquisto rifiutato, 12b la stessa scheda in fondo + // (impianti, crescita, storico dei fermi). La mappa non si vede: niente centratura né zoom _game.OpenIndustry(industry.Id); await Until(() => World.IndustryCards.ContainsKey(industry.Id), "scheda dell'industria", 30); - // al livello iniziale il server rifiuta l'acquisto: il messaggio compare sulla mappa + // al livello iniziale il server rifiuta l'acquisto: l'avviso compare in alto sopra la scheda var buy = await Do(new BuyIndustryCommand(new IndustryId(industry.Id), World.IndustryCards[industry.Id].Valuation)); GD.Print($"autopilot: acquisto di {industry.Name}: {buy.Message}"); - _game.Map.CenterOn(MapScale.V(industry.Position)); - _game.Map.SetZoom(0.3f); await Shot("12_industria", 40); _game.ScrollPanel(1); await Shot("12b_industria_scorte", 20); @@ -270,12 +271,17 @@ public partial class AutoPilot : Node // locale con il suo stato e l'elenco dei salvataggi (uno appena fatto) Session.Send(new Save { Name = "Collaudo" }); var launcher = Session.LocalServer ?? throw new InvalidOperationException("collaudo senza server locale"); - var connect = new ConnectScreen(World.Data, remember: false); - _game.AddChild(connect); + // livello proprio sopra l'interfaccia della partita (CanvasLayer 1–3): sul livello 0 la + // schermata finirebbe sotto la scheda a tutto schermo e trasformata dalla camera della mappa + _game.CloseTools(); + var layer = new CanvasLayer { Layer = 10 }; + _game.AddChild(layer); + var connect = new ConnectScreen(World.Data, remember: false, autoStart: false); + layer.AddChild(connect); await Frame(); await connect.ProbeRemote(new Uri($"ws://127.0.0.1:{launcher.Port}/ws"), launcher.Token); await Until(() => connect.Loaded, "stato del server e salvataggi", 30); await Shot("20_connessione", 30); - connect.QueueFree(); + layer.QueueFree(); } } diff --git a/client/RailEnterprise.Client/scripts/Main.cs b/client/RailEnterprise.Client/scripts/Main.cs index 5360af3..41b81e1 100644 --- a/client/RailEnterprise.Client/scripts/Main.cs +++ b/client/RailEnterprise.Client/scripts/Main.cs @@ -35,13 +35,15 @@ public partial class Main : Node { GD.PrintErr($"Dati del gioco non validi: {e.Message}"); } - ShowMenu(_data is null ? T("Dati del gioco non trovati o non validi.") : ""); var args = OS.GetCmdlineUserArgs(); int i = Array.IndexOf(args, "--autopilot"); if (i >= 0 && _data is not null) + _autopilot = i + 1 < args.Length ? args[i + 1] : ProjectSettings.GlobalizePath("user://autopilot"); + // nel collaudo la schermata di connessione non avvia un suo server: lo avvia StartLocal qui sotto + ShowMenu(_data is null ? T("Dati del gioco non trovati o non validi.") : "", autoStart: _autopilot is null); + if (_autopilot is not null) { // collaudo: mappa piccola e seme fisso per il server locale - _autopilot = i + 1 < args.Length ? args[i + 1] : ProjectSettings.GlobalizePath("user://autopilot"); System.Environment.SetEnvironmentVariable("RE_MAP_SIZE", "64"); System.Environment.SetEnvironmentVariable("RE_SEED", "3"); System.Environment.SetEnvironmentVariable("RE_AUTOSAVE_MIN", "0"); @@ -57,7 +59,9 @@ public partial class Main : Node } /// Schermata iniziale e di connessione (immagine 09): server locale o in rete, stato, salvataggi. - private void ShowMenu(string status = "") + /// Avvia subito la strada scelta l'ultima volta (server locale o in rete). + /// Sessione di prova della schermata precedente, ripresa così com'è (cambio di lingua). + private void ShowMenu(string status = "", bool autoStart = true, GameSession? handover = null) { if (_data is null) { @@ -67,7 +71,7 @@ public partial class Main : Node Swap(label); return; } - var screen = new ConnectScreen(_data); + var screen = new ConnectScreen(_data, autoStart: autoStart, handover: handover); screen.PlayRequested += ShowGame; screen.LanguageChanged += code => { @@ -76,7 +80,8 @@ public partial class Main : Node cfg.SetValue("ui", "locale", code); cfg.Save(SettingsPath); TranslationServer.SetLocale(code); - ShowMenu(); + // la schermata si ricrea con i testi nuovi: la sessione di prova (e il server locale) passa a lei + ShowMenu(handover: screen.TakeSession()); }; Swap(screen); if (status.Length > 0) screen.SetStatus(status, error: true); @@ -89,7 +94,7 @@ public partial class Main : Node string? server = LocalServerLauncher.FindServer(); if (server is null) { - ShowMenu(T("Server locale non trovato: compila src/RailEnterprise.Server o imposta RE_SERVER_PATH.")); + ShowMenu(T("Server locale non trovato: compila src/RailEnterprise.Server o imposta RE_SERVER_PATH."), autoStart: false); return; } var launcher = new LocalServerLauncher(); @@ -105,7 +110,7 @@ public partial class Main : Node catch (Exception e) { launcher.Dispose(); - ShowMenu($"{T("Partita locale non avviata")}: {e.Message}"); + ShowMenu($"{T("Partita locale non avviata")}: {e.Message}", autoStart: false); } } @@ -115,10 +120,12 @@ public partial class Main : Node var game = new GameScreen(session); game.Exit += async () => { + // prima si chiude la partita (e il server locale), poi la schermata di connessione ne + // avvia uno nuovo: due server sulla stessa cartella dei salvataggi non convivono var s = _session; _session = null; - ShowMenu(); if (s is not null) await s.DisposeAsync(); + ShowMenu(); }; Swap(game); if (_autopilot is not null) game.AddChild(new AutoPilot(game, _autopilot)); diff --git a/client/RailEnterprise.Client/scripts/Panels/IndustryPanel.cs b/client/RailEnterprise.Client/scripts/Panels/IndustryPanel.cs index 1aa43b0..fdbf420 100644 --- a/client/RailEnterprise.Client/scripts/Panels/IndustryPanel.cs +++ b/client/RailEnterprise.Client/scripts/Panels/IndustryPanel.cs @@ -41,6 +41,9 @@ public partial class IndustryPanel : VBoxContainer private readonly VBoxContainer _controls = PanelKit.Column(8); private readonly VBoxContainer _history = PanelKit.Column(4); private readonly Label _status = UiTheme.Text("", 13, Palette.TextSecondary); + /// Esito dell'offerta di acquisto, accanto al pulsante (la scheda è a tutto schermo e la mappa è nascosta). + private readonly Label _buyStatus = UiTheme.Text("", 13, Palette.TextSecondary); + private Button? _overhaul, _upgrade; private readonly List