tobymao / 18xx

A platform for playing 18xx games online!
https://18xx.games
Other
275 stars 179 forks source link

Retain Rusts, Available, and Events information on Info tab #10043

Open ChrisTheCat opened 6 months ago

ChrisTheCat commented 6 months ago

https://18xx.games/game/146451?action=496#info

On the Info tab, the Trains, Price, and Remaining from previous phases are greyed out while the Rusts, Available, and Events from previous phases are erased. It would be better if the Rusts, Available, and Events were retained and greyed out.

In this example, the information that it takes 40% to float has been erased, but that is information the players need to have.

Screenshot 2023-12-27 at 1 02 53 PM
benjaminxscott commented 6 months ago

I looked into this a bit since I agree w/ the usecase, the wrinkle is that we generate that table by iterating the list of trains and rendering each train.event

After a train is bought, we delete the event from that train, thus it's not rendered anymore in the table

https://github.com/tobymao/18xx/blob/master/lib/engine/phase.rb#L28

As a side effect, this prevents future trains of that type from re-triggering the events (as intended)

So it's a bit trickier than a rendering change upon investigation, IMO a bit of a refactor and making sure nothing breaks