F6: tooltip perché sui valori calcolati dal server
Ogni valore importante dei pannelli spiega al passaggio del mouse da dove viene: formula, termini con i valori di oggi e note, calcolati dal Core e mandati dal server, perché il client non deve rifare né ricomporre formule. - Core: modello comune Explanation ed Explanations, pure funzioni che chiamano le stesse funzioni del motore; estratte senza cambiare l'aritmetica (hash invariati) Market.NextPrice e LocalPriceTerms, Tariffs.FreightTerms e PassengerTerms, TownSystem.GrowthOf, Fleet.DailyHazard, GameClock.YearsAt; Industry.LastEfficiency transitorio (né salvato né nell'hash). - Protocollo: RequestDetail kind 11 con un blocco 1 (subject, arg) ed ExplanationReport 137; il server risponde sempre, anche con available falso. Nessun campo nei delta, formato dei salvataggi invariato. - Client: WhyTooltip comune (palette 05, apertura dopo 0,45 s, «in arrivo…» finché la spiegazione manca) su barra superiore, Mercato, Scalata, Finanze, scheda industria, Treni e Officine; testi in strings.csv. - ADR 0024, PROTOCOL.md, ARCHITECTURE.md, STATE.md; 10 test nuovi in Economy/ExplanationTests.cs con uguaglianza esatta ai valori del motore. Refs #44. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
767661957b
commit
19a3dd3af1
33 files changed
+2089
-64
No files matched your search
@@ -6,6 +6,8 @@ using RailEnterprise.Core.Common;
|
||||
using RailEnterprise.Protocol.Client;
|
||||
using RailEnterprise.Protocol.Messages;
|
||||
using static RailEnterprise.Client.App.Localization;
|
||||
using ExplainSubject = RailEnterprise.Core.Economy.ExplainSubject;
|
||||
using ExplainTarget = RailEnterprise.Core.Economy.ExplainTarget;
|
||||
|
||||
namespace RailEnterprise.Client.Panels;
|
||||
|
||||
@@ -70,6 +72,9 @@ public partial class ClimbPanel : VBoxContainer
|
||||
var trackCard = Card();
|
||||
var trackCol = (VBoxContainer)trackCard.GetChild(0);
|
||||
trackCol.AddChild(_track);
|
||||
// tooltip «perché» dell'avanzamento verso il prossimo livello (ADR 0024)
|
||||
WhyTooltip.Attach(_track, () => new ExplainTarget(ExplainSubject.TierProgress));
|
||||
WhyTooltip.Attach(_nextTitle, () => new ExplainTarget(ExplainSubject.TierProgress));
|
||||
trackCol.AddChild(_stations);
|
||||
AddChild(trackCard);
|
||||
|
||||
@@ -279,6 +284,7 @@ public partial class ClimbPanel : VBoxContainer
|
||||
bar.AddThemeStyleboxOverride("fill", UiTheme.Box(color, color, 4, 0));
|
||||
col.AddChild(bar);
|
||||
col.AddChild(UiTheme.Text((met ? "✓ " : "") + value, 13, met ? Palette.Ok : Palette.TextSecondary));
|
||||
WhyTooltip.Attach(col, () => new ExplainTarget(ExplainSubject.TierProgress));
|
||||
return col;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user