StoryPage Tile/Vehicle Buttons
Posted: 05 Jan 2021 22:04
Hi,
I am writing my first GS. It is usefull for seasonal industries productions like Fruit Plantations (at least with ECS that is what I use).
What the GS does is to look between October and June if there are vehicles that can transport fruits and/or Oil Seeds on station with full load/Full Load Any orders. If the station is empty, and the vehicle has above a percentage loaded, it is informing on the StaryPage what vehicles are in this condition. Up to here, is working,
I can't understand how the StoryPAge Buttons work. When I create a vehicle buttonn, in the parameters, I have to say the vehicle type, not the vehicle ID. Or for tile button, nothing refered to a tile is passed.
How does the event handler knows the vehicle_id in the GSEventStoryPageVehicleSelect.GetVehicleID()?
Is there any working example to have a look how it is implemented?
Instead of given the vehicle type, should be passed the vehicle ID? I try it but crushed the entire OTTD game.
static StoryPageButtonFormatting MakeTileButtonReference (StoryPageButtonColour colour, StoryPageButtonFlags flags, StoryPageButtonCursor cursor)
static StoryPageButtonFormatting MakeVehicleButtonReference (StoryPageButtonColour colour, StoryPageButtonFlags flags, StoryPageButtonCursor cursor, GSVehicle::VehicleType vehtype)
Thanks in advance,
Alberto
I am writing my first GS. It is usefull for seasonal industries productions like Fruit Plantations (at least with ECS that is what I use).
What the GS does is to look between October and June if there are vehicles that can transport fruits and/or Oil Seeds on station with full load/Full Load Any orders. If the station is empty, and the vehicle has above a percentage loaded, it is informing on the StaryPage what vehicles are in this condition. Up to here, is working,
I can't understand how the StoryPAge Buttons work. When I create a vehicle buttonn, in the parameters, I have to say the vehicle type, not the vehicle ID. Or for tile button, nothing refered to a tile is passed.
How does the event handler knows the vehicle_id in the GSEventStoryPageVehicleSelect.GetVehicleID()?
Is there any working example to have a look how it is implemented?
Instead of given the vehicle type, should be passed the vehicle ID? I try it but crushed the entire OTTD game.
static StoryPageButtonFormatting MakeTileButtonReference (StoryPageButtonColour colour, StoryPageButtonFlags flags, StoryPageButtonCursor cursor)
static StoryPageButtonFormatting MakeVehicleButtonReference (StoryPageButtonColour colour, StoryPageButtonFlags flags, StoryPageButtonCursor cursor, GSVehicle::VehicleType vehtype)
Thanks in advance,
Alberto