OpenTTD: src/strings_func.h File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Functions | Variables
strings_func.h File Reference

Functions related to OTTD's strings. More...

`#include "strings_type.h"`
`#include "string_type.h"`
`#include "gfx_type.h"`

Go to the source code of this file.

## Data Structures
class | StringParameters
class | MissingGlyphSearcher
| A searcher for missing glyphs. More...

## Functions
char * | GetString (char *buffr, StringID string, const char *last)
char * | GetStringWithArgs (char *buffr, StringID string, StringParameters *args, const char *last, uint case_index=0, bool game_script=false)
| Get a parsed string with most special stringcodes replaced by the string parameters.
const char * | GetStringPtr (StringID string)
uint | ConvertKmhishSpeedToDisplaySpeed (uint speed)
| Convert the given km/h-ish speed to the display speed.
uint | ConvertDisplaySpeedToKmhishSpeed (uint speed)
| Convert the given display speed to the km/h-ish speed.
void | InjectDParam (uint amount)
| Shift the string parameters in the global string parameter array by amount positions, making room at the beginning.
static void | SetDParamX (uint64 *s, uint n, uint64 v)
| Set a string parameter v at index n in a given array s.
static void | SetDParam (uint n, uint64 v)
| Set a string parameter v at index n in the global string parameter array.
void | SetDParamMaxValue (uint n, uint64 max_value, uint min_count=0, FontSize size=FS_NORMAL)
| Set DParam n to some number that is suitable for string size computations.
void | SetDParamMaxDigits (uint n, uint count, FontSize size=FS_NORMAL)
| Set DParam n to some number that is suitable for string size computations.
void | SetDParamStr (uint n, const char *str)
| This function is used to "bind" a C string to a OpenTTD dparam slot.
void | CopyInDParam (int offs, const uint64 *src, int num)
| Copy num string parameters from array src into the global string parameter array.
void | CopyOutDParam (uint64 *dst, int offs, int num)
| Copy num string parameters from the global string parameter array to the dst array.
void | CopyOutDParam (uint64 *dst, const char **strings, StringID string, int num)
| Copy num string parameters from the global string parameter array to the dst array.
static uint64 | GetDParamX (const uint64 *s, uint n)
| Get the current string parameter at index n from parameter array s.
static uint64 | GetDParam (uint n)
| Get the current string parameter at index n from the global string parameter array.
void | InitializeLanguagePacks ()
| Make a list of the available language packs.
const char * | GetCurrentLanguageIsoCode ()
| Get the ISO language code of the currently loaded language.
int CDECL | StringIDSorter (const StringID *a, const StringID *b)
void | CheckForMissingGlyphs (bool base_font=true, MissingGlyphSearcher *search=NULL)
| Check whether the currently loaded language pack uses characters that the currently loaded font does not support.

## Variables
StringParameters | _global_string_params
TextDirection | _current_text_dir
| Text direction of the currently selected language.

## Detailed Description

Functions related to OTTD's strings.

Definition in file strings_func.h.

## Function Documentation

void CheckForMissingGlyphs | ( | bool | base_font,
|  | MissingGlyphSearcher * | searcher
| ) |  |

Check whether the currently loaded language pack uses characters that the currently loaded font does not support.

If this is the case an error message will be shown in English. The error message will not be localized because that would mean it might use characters that are not in the font, which is the whole reason this check has been added.

Parameters

  base_font | Whether to look at the base font as well.
  searcher | The methods to use to search for strings to check. If NULL the loaded language pack searcher is used.

Definition at line 2095 of file strings.cpp.

References _current_text_dir, MissingGlyphSearcher::FindMissingGlyphs(), InitFreeType(), INVALID_STRING_ID, LanguagePackHeader::isocode, LoadStringWidthTable(), MissingGlyphSearcher::Monospace(), SetDParamStr(), SetFallbackFont(), ShowErrorMessage(), stredup(), TD_LTR, Utf8Encode(), LanguagePackHeader::winlangid, WL_ERROR, and WL_WARNING.

Referenced by HandleBootstrap(), LoadIntroGame(), TextfileWindow::LoadTextfile(), GameOptionsWindow::OnDropdownSelect(), and openttd_main().

uint ConvertDisplaySpeedToKmhishSpeed | ( | uint | speed | ) |

Convert the given display speed to the km/h-ish speed.

Parameters

  speed | the speed to convert

Returns
  the converted speed.

Definition at line 760 of file strings.cpp.

References _settings_game, Units::c, UnitConversion::FromDisplay(), GameSettings::locale, and LocaleSettings::units_velocity.

Referenced by TimetableWindow::OnQueryTextFinished().

uint ConvertKmhishSpeedToDisplaySpeed | ( | uint | speed | ) |

Convert the given km/h-ish speed to the display speed.

Parameters

  speed | the speed to convert

Returns
  the converted speed.

Definition at line 750 of file strings.cpp.

References _settings_game, Units::c, GameSettings::locale, UnitConversion::ToDisplay(), and LocaleSettings::units_velocity.

Referenced by FormatString(), and TimetableWindow::OnClick().

void CopyInDParam | ( | int | offs,
|  | const uint64 * | src,
|  | int | num
| ) |  |

Copy num string parameters from array src into the global string parameter array.

Parameters

  offs | Index in the global array to copy the first string parameter to.
  src | Source array of string parameters.
  num | Number of string parameters to copy.

Definition at line 138 of file strings.cpp.

References StringParameters::GetPointerToOffset(), and MemCpyT().

Referenced by DrawNewsString(), ErrmsgWindow::DrawWidget(), NewsWindow::DrawWidget(), ErrmsgWindow::SetStringParameters(), QueryWindow::SetStringParameters(), ErrmsgWindow::UpdateWidgetSize(), and NewsWindow::UpdateWidgetSize().

void CopyOutDParam | ( | uint64 * | dst,
|  | int | offs,
|  | int | num
| ) |  |

Copy num string parameters from the global string parameter array to the dst array.

Parameters

  dst | Destination array of string parameters.
  offs | Index in the global array to copy the first string parameter from.
  num | Number of string parameters to copy.

Definition at line 149 of file strings.cpp.

References StringParameters::GetPointerToOffset(), and MemCpyT().

Referenced by AddNewsItem(), and ErrorMessageData::CopyOutDParams().

void CopyOutDParam | ( | uint64 * | dst,
|  | const char ** | strings,
|  | StringID | string,
|  | int | num
| ) |  |

Copy num string parameters from the global string parameter array to the dst array.

Furthermore clone raw string parameters into strings and amend the data in dst.

Parameters

  dst | Destination array of string parameters.
  strings | Destination array for clone of the raw strings. Must be of same length as dst. Deallocation left to the caller.
  string | The string used to determine where raw strings are and where there are no raw strings.
  num | Number of string parameters to copy.

Definition at line 162 of file strings.cpp.

References DRAW_STRING_BUFFER, StringParameters::GetPointerToOffset(), StringParameters::GetTypeAtOffset(), StringParameters::HasTypeInformation(), lastof, MemCpyT(), and stredup().

const char* GetCurrentLanguageIsoCode | ( |  | ) |

Get the ISO language code of the currently loaded language.

Returns
  the ISO code.

Definition at line 1998 of file strings.cpp.

References LanguagePackHeader::isocode.

Referenced by GameOptionsWindow::DrawWidget(), GetTextfile(), and GameOptionsWindow::UpdateWidgetSize().

static uint64 GetDParam | ( | uint | n | ) |
| inlinestatic

Get the current string parameter at index n from the global string parameter array.

Parameters

  n | Index of the string parameter.

Returns
  Value of the requested string parameter.

Definition at line 188 of file strings_func.h.

static uint64 GetDParamX | ( | const uint64 * | s,
|  | uint | n
| ) |  |
| inlinestatic

Get the current string parameter at index n from parameter array s.

Parameters

  s | Array of string parameters.
  n | Index of the string parameter.

Returns
  Value of the requested string parameter.

Definition at line 178 of file strings_func.h.

Referenced by ErrorMessageData::CopyOutDParams().

char* GetStringWithArgs | ( | char * | buffr,
|  | StringID | string,
|  | StringParameters * | args,
|  | const char * | last,
|  | uint | case_index,
|  | bool | game_script
| ) |  |

Get a parsed string with most special stringcodes replaced by the string parameters.

Parameters

  buffr | Pointer to a string buffer where the formatted string should be written to.
  string |
  args | Arguments for the string.
  last | Pointer just past the end of buffr.
  case_index | The "case index". This will only be set when FormatString wants to print the string in a different case.
  game_script | The string is coming directly from a game script.

Returns
  Pointer to the final zero byte of the formatted string.

Definition at line 218 of file strings.cpp.

References _langtab_num, error(), FormatString(), GAME_TEXT_TAB, GB(), GetGameStringPtr(), GetGRFStringPtr(), StringParameters::GetInt32(), GetStringWithArgs(), TAB_COUNT_BITS, TAB_COUNT_OFFSET, TAB_SIZE_BITS, and TAB_SIZE_OFFSET.

Referenced by FormatString(), GetStringWithArgs(), and GetTownName().

void InitializeLanguagePacks | ( |  | ) |

Make a list of the available language packs.

Put the data in _languages list.

< Matching the language in the configuration file or the current locale

< Using pt_PT for pt_BR locale when pt_BR is not available

< Fallback when no locale-matching language has been found

Definition at line 1950 of file strings.cpp.

References _config_language_file, SmallVector< T, S >::Begin(), SmallVector< T, S >::End(), LanguageMetadata::file, FOR_ALL_SEARCHPATHS, GetCurrentLocale(), GetLanguageList(), LANG_DIR, lastof, SmallVector< T, S >::Length(), ReadLanguagePack(), and usererror().

Referenced by openttd_main().

void InjectDParam | ( | uint | amount | ) |

Shift the string parameters in the global string parameter array by amount positions, making room at the beginning.

Parameters

  amount | Number of positions to shift.

Definition at line 293 of file strings.cpp.

References StringParameters::ShiftParameters().

Referenced by Subsidy::AwardTo().

static void SetDParam | ( | uint | n,
|  | uint64 | v
| ) |  |
| inlinestatic

Set a string parameter v at index n in the global string parameter array.

Parameters

  n | Index of the string parameter.
  v | Value of the string parameter.

Definition at line 158 of file strings_func.h.

Referenced by AdvertiseIndustryOpening(), AgeVehicle(), AircraftEntersTerminal(), AircraftHandleDestTooFar(), Subsidy::AwardTo(), CcBuildIndustry(), ChangeIndustryProduction(), NetworkChatWindow::ChatTabCompletionNextItem(), CheckAllowRemoveRoad(), CheckCompanyHasMoney(), ClientNetworkGameSocketHandler::CheckConnection(), CheckEngines(), CheckforTownRating(), CheckIfAuthorityAllowsNewStation(), CheckIndustries(), CheckOrders(), CheckTrainCollision(), CheckTrainsLengths(), ClearTile_Station(), CmdBuildAirport(), CmdBuildBridge(), CmdCompanyCtrl(), CmdDecreaseLoan(), CmdFoundTown(), CmdIncreaseLoan(), CompanyCheckBankrupt(), CrashAirplane(), Disaster_CoalMine_Init(), DisasterTick_Aircraft(), DisasterTick_Big_Ufo(), DisasterTick_Zeppeliner(), DoCommandPInternal(), StationViewWindow::DrawAcceptedCargo(), DrawAircraftDetails(), StationViewWindow::DrawCargoRatings(), CompanyInfrastructureWindow::DrawCountLine(), NetworkContentListWindow::DrawDetails(), DrawEngineList(), StationViewWindow::DrawEntries(), SelectCompanyManagerFaceWindow::DrawFaceStringLabel(), BaseGraphWindow::DrawGraph(), VehicleGroupWindow::DrawGroupInfo(), IndustryViewWindow::DrawInfo(), DrawOrderString(), DrawPrice(), TownAuthorityWindow::DrawRatings(), DrawRoadVehDetails(), NetworkGameWindow::DrawServerLine(), SettingEntry::DrawSetting(), DrawShipDetails(), DrawStationCoverageAreaText(), SmallMapWindow::DrawTowns(), DrawTrainDetails(), DepotWindow::DrawVehicleInDepot(), BaseVehicleListWindow::DrawVehicleListItems(), DrawVehiclePurchaseInfo(), DrawVehicleRefitWindow(), GraphLegendWindow::DrawWidget(), SelectGameWindow::DrawWidget(), EnginePreviewWindow::DrawWidget(), AIListWindow::DrawWidget(), StatusBarWindow::DrawWidget(), SubsidyListWindow::DrawWidget(), SmallMapWindow::DrawWidget(), TownAuthorityWindow::DrawWidget(), SignListWindow::DrawWidget(), BuildBridgeWindow::DrawWidget(), CheatWindow::DrawWidget(), NewGRFParametersWindow::DrawWidget(), TownViewWindow::DrawWidget(), CompanyFinancesWindow::DrawWidget(), SaveLoadWindow::DrawWidget(), TimetableWindow::DrawWidget(), ReplaceVehicleWindow::DrawWidget(), AISettingsWindow::DrawWidget(), BuildAirportWindow::DrawWidget(), MusicTrackSelectionWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), CompanyStationsWindow::DrawWidget(), StoryBookWindow::DrawWidget(), MusicWindow::DrawWidget(), TooltipsWindow::DrawWidget(), TownDirectoryWindow::DrawWidget(), SpriteAlignerWindow::DrawWidget(), PaymentRatesGraphWindow::DrawWidget(), MessageHistoryWindow::DrawWidget(), CompanyLeagueWindow::DrawWidget(), GenerateProgressWindow::DrawWidget(), PerformanceRatingDetailWindow::DrawWidget(), CompanyInfrastructureWindow::DrawWidget(), GameSettingsWindow::DrawWidget(), NetworkJoinStatusWindow::DrawWidget(), VehicleDetailsWindow::DrawWidget(), CompanyWindow::DrawWidget(), ScanProgressWindow::DrawWidget(), SelectStationWindow< T >::DrawWidget(), ScenarioEditorToolbarWindow::DrawWidget(), BuyCompanyWindow::DrawWidget(), VehicleViewWindow::DrawWidget(), DrawYearColumn(), EngineNameSorter(), ErrorUnknownCallbackResult(), CompanyNewsInformation::FillData(), FloodVehicle(), GenerateCompanyName(), GenerateDefaultSaveName(), GeneratePresidentName(), RefitWindow::GetCapacityString(), StationViewWindow::GetEntryString(), IndustryDirectoryWindow::GetIndustryString(), GetNameOfOwner(), GetSaveLoadErrorString(), BaseGraphWindow::GetYLabelWidth(), GRFLoadConfig(), VehicleGroupWindow::GroupNameSorter(), Vehicle::HandlePathfindingResult(), IndustryDirectoryWindow::IndustryNameSorter(), IndustryProductionCallback(), MenuClickLargeWorldScreenshot(), NetworkHandlePauseChange(), NetworkServerSendChat(), NewVehicleAvailable(), WaypointWindow::OnClick(), NewGRFParametersWindow::OnClick(), CheatWindow::OnClick(), TownViewWindow::OnClick(), AISettingsWindow::OnClick(), TimetableWindow::OnClick(), GenerateLandscapeWindow::OnClick(), DepotWindow::OnClick(), IndustryViewWindow::OnClick(), CreateScenarioWindow::OnClick(), NetworkStartServerWindow::OnClick(), OrdersWindow::OnClick(), BuildVehicleWindow::OnClick(), SelectCompanyManagerFaceWindow::OnClick(), StationViewWindow::OnClick(), GameSettingsWindow::OnClick(), VehicleDetailsWindow::OnClick(), CompanyWindow::OnClick(), CustomCurrencyWindow::OnClick(), GenerateLandscapeWindow::OnDropdownSelect(), LandInfoWindow::OnInit(), SmallMapWindow::OnInit(), SelectCompanyManagerFaceWindow::OnInit(), EndGameWindow::OnPaint(), HighScoreWindow::OnPaint(), BuildAirportWindow::OnPaint(), GameSettingsWindow::OnPaint(), BuildIndustryWindow::OnPlaceObject(), DepotWindow::OnRightClick(), ServerNetworkUDPSocketHandler::Receive_CLIENT_DETAIL_INFO(), ClientNetworkGameSocketHandler::Receive_SERVER_CHAT(), StoryBookWindow::RefreshSelectedPage(), ReportNewsProductionChangeIndustry(), RoadVehArrivesAt(), SaveHighScoreValue(), SaveHighScoreValueNetwork(), ServerNetworkAdminSocketHandler::SendCompanyInfo(), NetworkSocketHandler::SendCompanyInformation(), ServerNetworkAdminSocketHandler::SendCompanyUpdate(), SetDParamMaxDigits(), SetDParamStr(), NIHelper::SetObjectAtStringParameters(), NIHelper::SetSimpleStringParameters(), GoalListWindow::SetStringParameters(), ContentTextfileWindow::SetStringParameters(), ExtraViewportWindow::SetStringParameters(), WaypointWindow::SetStringParameters(), OskWindow::SetStringParameters(), AIListWindow::SetStringParameters(), BuildObjectWindow::SetStringParameters(), SetDateWindow::SetStringParameters(), BaseSetTextfileWindow< TBaseSet >::SetStringParameters(), SmallMapWindow::SetStringParameters(), TownAuthorityWindow::SetStringParameters(), SignListWindow::SetStringParameters(), NewGRFParametersWindow::SetStringParameters(), BuildAirportWindow::SetStringParameters(), CompanyFinancesWindow::SetStringParameters(), MusicTrackSelectionWindow::SetStringParameters(), GameOptionsWindow::SetStringParameters(), ReplaceVehicleWindow::SetStringParameters(), AISettingsWindow::SetStringParameters(), TownViewWindow::SetStringParameters(), GenerateLandscapeWindow::SetStringParameters(), TimetableWindow::SetStringParameters(), NewsWindow::SetStringParameters(), BuildIndustryWindow::SetStringParameters(), DepotWindow::SetStringParameters(), GoalQuestionWindow::SetStringParameters(), VehicleGroupWindow::SetStringParameters(), StoryBookWindow::SetStringParameters(), SignWindow::SetStringParameters(), CompanyStationsWindow::SetStringParameters(), NetworkGameWindow::SetStringParameters(), BuildRailToolbarWindow::SetStringParameters(), NewGRFTextfileWindow::SetStringParameters(), ScriptTextfileWindow::SetStringParameters(), SelectCompanyLiveryWindow::SetStringParameters(), RefitWindow::SetStringParameters(), AIConfigWindow::SetStringParameters(), TownDirectoryWindow::SetStringParameters(), NewGRFWindow::SetStringParameters(), IndustryViewWindow::SetStringParameters(), SpriteAlignerWindow::SetStringParameters(), CreateScenarioWindow::SetStringParameters(), QueryStringWindow::SetStringParameters(), NetworkStartServerWindow::SetStringParameters(), QueryWindow::SetStringParameters(), OrdersWindow::SetStringParameters(), AIDebugWindow::SetStringParameters(), BuildRailStationWindow::SetStringParameters(), IndustryDirectoryWindow::SetStringParameters(), BuildVehicleWindow::SetStringParameters(), StationViewWindow::SetStringParameters(), VehicleListWindow::SetStringParameters(), BuildSignalWindow::SetStringParameters(), CompanyInfrastructureWindow::SetStringParameters(), GameSettingsWindow::SetStringParameters(), VehicleDetailsWindow::SetStringParameters(), IndustryCargoesWindow::SetStringParameters(), CompanyWindow::SetStringParameters(), CustomCurrencyWindow::SetStringParameters(), BuyCompanyWindow::SetStringParameters(), VehicleViewWindow::SetStringParameters(), SetTimetableParams(), SetupSubsidyDecodeParam(), SettingEntry::SetValueDParams(), ShipArrivesAt(), ShowCostOrIncomeAnimation(), ShowEstimatedCostOrIncome(), ShowFeederIncomeAnimation(), ShowFillingPercent(), ShowNewGRFError(), ShowNewGrfVehicleError(), ShowRefitOptionsList(), ShowRejectOrAcceptNews(), SignList::SignNameFilter(), SignList::SignNameSorter(), CompanyStationsWindow::StationNameSorter(), ToolbarScenDatePanel(), TownDirectoryWindow::TownNameSorter(), TrainDetailsCapacityTab(), TrainDetailsCargoTab(), TrainDetailsInfoTab(), TrainEnterStation(), UpdateFillingPercent(), SettingEntry::UpdateFilterState(), Waypoint::UpdateVirtCoord(), Sign::UpdateVirtCoord(), Town::UpdateVirtCoord(), Station::UpdateVirtCoord(), SelectGameWindow::UpdateWidgetSize(), EnginePreviewWindow::UpdateWidgetSize(), StatusBarWindow::UpdateWidgetSize(), BuildBridgeWindow::UpdateWidgetSize(), TownAuthorityWindow::UpdateWidgetSize(), ReplaceVehicleWindow::UpdateWidgetSize(), CheatWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), BuildAirportWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), GenerateLandscapeWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), DepotWindow::UpdateWidgetSize(), TooltipsWindow::UpdateWidgetSize(), AIConfigWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), PaymentRatesGraphWindow::UpdateWidgetSize(), CreateScenarioWindow::UpdateWidgetSize(), MessageHistoryWindow::UpdateWidgetSize(), BuildRailStationWindow::UpdateWidgetSize(), CompanyLeagueWindow::UpdateWidgetSize(), PerformanceRatingDetailWindow::UpdateWidgetSize(), CompanyInfrastructureWindow::UpdateWidgetSize(), GameSettingsWindow::UpdateWidgetSize(), VehicleDetailsWindow::UpdateWidgetSize(), CompanyWindow::UpdateWidgetSize(), SelectStationWindow< T >::UpdateWidgetSize(), ScenarioEditorToolbarWindow::UpdateWidgetSize(), CustomCurrencyWindow::UpdateWidgetSize(), BuyCompanyWindow::UpdateWidgetSize(), VehicleEnterDepot(), and VehicleNameSorter().

void SetDParamMaxDigits | ( | uint | n,
|  | uint | count,
|  | FontSize | size
| ) |  |

Set DParam n to some number that is suitable for string size computations.

Parameters

  n | Index of the string parameter.
  count | Number of digits which shall be displayable.
  size | Font of the number

Definition at line 121 of file strings.cpp.

References GetBroadestDigit(), and SetDParam().

Referenced by DrawEngineList(), SetDParamMaxValue(), DepotWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), NetworkJoinStatusWindow::UpdateWidgetSize(), and ScanProgressWindow::UpdateWidgetSize().

void SetDParamMaxValue | ( | uint | n,
|  | uint64 | max_value,
|  | uint | min_count,
|  | FontSize | size
| ) |  |

Set DParam n to some number that is suitable for string size computations.

Parameters

  n | Index of the string parameter.
  max_value | The biggest value which shall be displayed. For the result only the number of digits of max_value matter.
  min_count | Minimum number of digits independent of max.
  size | Font of the number

Definition at line 105 of file strings.cpp.

References max(), and SetDParamMaxDigits().

Referenced by VehicleGroupWindow::ComputeGroupInfoSize(), TimetableWindow::DrawWidget(), OrdersWindow::DrawWidget(), SetDateWindow::UpdateWidgetSize(), StatusBarWindow::UpdateWidgetSize(), TimetableWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), SignListWindow::UpdateWidgetSize(), CheatWindow::UpdateWidgetSize(), CompanyFinancesWindow::UpdateWidgetSize(), GenerateLandscapeWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), NetworkGameWindow::UpdateWidgetSize(), DepotWindow::UpdateWidgetSize(), CreateScenarioWindow::UpdateWidgetSize(), GenerateProgressWindow::UpdateWidgetSize(), PerformanceRatingDetailWindow::UpdateWidgetSize(), CompanyInfrastructureWindow::UpdateWidgetSize(), VehicleDetailsWindow::UpdateWidgetSize(), NetworkJoinStatusWindow::UpdateWidgetSize(), CompanyWindow::UpdateWidgetSize(), and ScanProgressWindow::UpdateWidgetSize().

void SetDParamStr | ( | uint | n,
|  | const char * | str
| ) |  |

This function is used to "bind" a C string to a OpenTTD dparam slot.

Parameters

  n | slot of the string
  str | string to bind

Definition at line 284 of file strings.cpp.

References SetDParam().

Referenced by Subsidy::AwardTo(), CheckForMissingGlyphs(), CmdCompanyCtrl(), CmdCustomNewsItem(), CmdFoundTown(), CompanyCheckBankrupt(), NetworkContentListWindow::DrawDetails(), IndustryViewWindow::DrawInfo(), GoalListWindow::DrawPartialGoalList(), LandInfoWindow::DrawWidget(), AIListWindow::DrawWidget(), NewGRFParametersWindow::DrawWidget(), TownViewWindow::DrawWidget(), GameOptionsWindow::DrawWidget(), SaveLoadWindow::DrawWidget(), AISettingsWindow::DrawWidget(), NewsWindow::DrawWidget(), MusicTrackSelectionWindow::DrawWidget(), BuildIndustryWindow::DrawWidget(), GoalQuestionWindow::DrawWidget(), NetworkChatWindow::DrawWidget(), StoryBookWindow::DrawWidget(), MusicWindow::DrawWidget(), AIConfigWindow::DrawWidget(), ErrorUnknownCallbackResult(), GenerateCompanyName(), TownViewWindow::GetDesiredInfoHeight(), StoryBookWindow::GetHeadHeight(), IndustryDirectoryWindow::GetIndustryString(), StoryBookWindow::GetPageElementHeight(), GetSavegameFormat(), GetSaveLoadErrorString(), GRFLoadConfig(), IndustryProductionCallback(), MakeScreenshot(), NetworkDrawChatMessage(), NetworkGameWindow::OnClick(), NetworkStartServerWindow::OnClick(), CustomCurrencyWindow::OnClick(), LandInfoWindow::OnInit(), HighScoreWindow::OnPaint(), IConsoleWindow::OnPaint(), GoalListWindow::OnPaint(), openttd_main(), SaveFileError(), ContentTextfileWindow::SetStringParameters(), BaseSetTextfileWindow< TBaseSet >::SetStringParameters(), GameOptionsWindow::SetStringParameters(), StoryBookWindow::SetStringParameters(), AboutWindow::SetStringParameters(), NewGRFTextfileWindow::SetStringParameters(), ScriptTextfileWindow::SetStringParameters(), NewGRFWindow::SetStringParameters(), SpriteAlignerWindow::SetStringParameters(), AIDebugWindow::SetStringParameters(), NetworkLobbyWindow::SetStringParameters(), CustomCurrencyWindow::SetStringParameters(), ShowNewGRFError(), ShowNewGrfVehicleError(), LandInfoWindow::UpdateWidgetSize(), BuildIndustryWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), GoalQuestionWindow::UpdateWidgetSize(), NetworkChatWindow::UpdateWidgetSize(), MusicWindow::UpdateWidgetSize(), StoryBookWindow::UpdateWidgetSize(), NewGRFWindow::UpdateWidgetSize(), and WarnCorruptSprite().

static void SetDParamX | ( | uint64 * | s,
|  | uint | n,
|  | uint64 | v
| ) |  |
| inlinestatic

Set a string parameter v at index n in a given array s.

Parameters

  s | Array of string parameters.
  n | Index of the string parameter.
  v | Value of the string parameter.

Definition at line 148 of file strings_func.h.