Skip to content

Commit d214d82

Browse files
committed
Add delivery message on station
1 parent e1c992c commit d214d82

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/rails_lib/backend/priority_shipment.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,9 @@ let delivery_text shipment region stations money =
118118

119119
let get_freight v = v.freight
120120

121+
let station_waiting_delivery_text priority ~loc =
122+
Option.bind priority (fun priority ->
123+
if Utils.equal_loc loc priority.dst_loc then
124+
Some(Freight.show priority.freight)
125+
else None)
126+

src/rails_lib/ui/station_report.ml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ let render win (s:State.t) loc ~show_demand =
189189
info.demand
190190
10
191191
in
192+
(* Priority shipment *)
193+
let goods_s = Backend.get_player s.backend C.player
194+
|> Player.get_priority
195+
|> Priority_shipment.station_waiting_delivery_text ~loc
196+
in
197+
Option.iter
198+
(fun goods ->
199+
let str = "PRIORITY\nDELIVERY:\n" ^ goods in
200+
Fonts.Render.write_shadow win s.fonts ~color:Ega.white ~idx:4 ~x:210 ~y:104 str)
201+
goods_s;
202+
192203
(* name with shadow *)
193204
write_name ~shadow:true ~x:8 ~y:104 ~color:Ega.white;
194205
()

0 commit comments

Comments
 (0)