* This helper for Create/Update PageElement Cmd procedure updates a page * element with new content data. * @param pe The page element to update * @param tile The tile parameter of the DoCommand proc * @param reference The reference parameter of the DoCommand proc (p2) * @param text The text parameter of the DoCommand proc */
| 104 | * @param text The text parameter of the DoCommand proc |
| 105 | */ |
| 106 | static void UpdateElement(StoryPageElement &pe, TileIndex tile, uint32_t reference, const EncodedString &text) |
| 107 | { |
| 108 | switch (pe.type) { |
| 109 | case SPET_TEXT: |
| 110 | pe.text = text; |
| 111 | break; |
| 112 | case SPET_LOCATION: |
| 113 | pe.text = text; |
| 114 | pe.referenced_id = tile.base(); |
| 115 | break; |
| 116 | case SPET_GOAL: |
| 117 | pe.referenced_id = reference; |
| 118 | break; |
| 119 | case SPET_BUTTON_PUSH: |
| 120 | case SPET_BUTTON_TILE: |
| 121 | case SPET_BUTTON_VEHICLE: |
| 122 | pe.text = text; |
| 123 | pe.referenced_id = reference; |
| 124 | break; |
| 125 | default: NOT_REACHED(); |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /** Set the button background colour. */ |
| 130 | void StoryPageButtonData::SetColour(Colours button_colour) |
no test coverage detected