When clearing auto timetables, mark times as undefined rather than 0.

Fix unautomate timetable having reversed ctrl key behaviour,
update tooltip string with ctrl behaviour.
Minor comment/whitespace fixes.
pull/6/merge
Jonathan G Rennison 9 years ago
parent a7e9c9ce65
commit d2b87485fb

@ -352,7 +352,7 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdChangeTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_CHANGE_TIMETABLE
DEF_CMD(CmdSetVehicleOnTime, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_VEHICLE_ON_TIME
DEF_CMD(CmdAutofillTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOFILL_TIMETABLE
DEF_CMD(CmdAutomateTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOMATE_TIMETABLE]
DEF_CMD(CmdAutomateTimetable, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_AUTOMATE_TIMETABLE
DEF_CMD(CmdSetTimetableStart, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_SET_TIMETABLE_START
DEF_CMD(CmdOpenCloseAirport, 0, CMDT_ROUTE_MANAGEMENT ), // CMD_OPEN_CLOSE_AIRPORT

@ -3944,7 +3944,7 @@ STR_TIMETABLE_AUTOFILL :{BLACK}Autofill
STR_TIMETABLE_AUTOFILL_TOOLTIP :{BLACK}Fill the timetable automatically with the values from the next journey (Ctrl+Click to try to keep waiting times)
STR_TIMETABLE_AUTOMATE :{BLACK}Automate
STR_TIMETABLE_AUTOMATE_TOOLTIP :{BLACK}Manage the timetables automatically by updating the values for each journey
STR_TIMETABLE_AUTOMATE_TOOLTIP :{BLACK}Manage the timetables automatically by updating the values for each journey (Ctrl+Click when disabling to keep the current timetable)
STR_TIMETABLE_EXPECTED :{BLACK}Expected
STR_TIMETABLE_SCHEDULED :{BLACK}Scheduled

@ -263,9 +263,9 @@ static int CDECL VehicleTimetableSorter(Vehicle * const *ap, Vehicle * const *bp
* Set the start date of the timetable.
* @param tile Not used.
* @param flags Operation to perform.
* @param p2 Various bitstuffed elements
* - p2 = (bit 0-19) - Vehicle ID.
* - p2 = (bit 20) - Set to 1 to set timetable start for all vehicles sharing this order
* @param p1 Various bitstuffed elements
* - p1 = (bit 0-19) - Vehicle ID.
* - p1 = (bit 20) - Set to 1 to set timetable start for all vehicles sharing this order
* @param p2 The timetable start date.
* @param text Not used.
* @return The error or cost of the operation.
@ -432,8 +432,8 @@ CommandCost CmdAutomateTimetable(TileIndex index, DoCommandFlag flags, uint32 p1
OrderList *orders = v2->orders.list;
if (orders != NULL) {
for (int i = 0; i < orders->GetNumOrders(); i++) {
ChangeTimetable(v2, i, 0, MTF_WAIT_TIME, true);
ChangeTimetable(v2, i, 0, MTF_TRAVEL_TIME, true);
ChangeTimetable(v2, i, 0, MTF_WAIT_TIME, false);
ChangeTimetable(v2, i, 0, MTF_TRAVEL_TIME, false);
}
}
}

@ -612,7 +612,7 @@ struct TimetableWindow : Window {
case WID_VT_AUTOMATE: {
uint32 p2 = 0;
if (!HasBit(v->vehicle_flags, VF_AUTOMATE_TIMETABLE)) SetBit(p2, 0);
if (!_ctrl_pressed) SetBit(p2, 1);
if (_ctrl_pressed) SetBit(p2, 1);
DoCommandP(0, v->index, p2, CMD_AUTOMATE_TIMETABLE | CMD_MSG(STR_ERROR_CAN_T_TIMETABLE_VEHICLE));
break;
}

Loading…
Cancel
Save