Freeciv-3.1: /fast/freeciv/nightly/S3_1/client/text.h File Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Functions
text.h File Reference
`#include "fc_types.h"`
`#include "unitlist.h"`

Go to the source code of this file.

## Functions

const char * | get_tile_output_text (const struct tile *ptile)
const char * | popup_info_text (struct tile *ptile)
const char * | get_nearest_city_text (struct city *pcity, int sq_dist)
const char * | unit_description (struct unit *punit)
const char * | get_airlift_text (const struct unit_list *punits, const struct city *pdest)
const char * | science_dialog_text (void)
const char * | get_science_target_text (double *percent)
const char * | get_science_goal_text (Tech_type_id goal)
const char * | get_info_label_text (bool moreinfo)
const char * | get_info_label_text_popup (void)
const char * | get_bulb_tooltip (void)
const char * | get_global_warming_tooltip (void)
const char * | get_nuclear_winter_tooltip (void)
const char * | get_government_tooltip (void)
const char * | get_unit_info_label_text1 (struct unit_list *punits)
const char * | get_unit_info_label_text2 (struct unit_list *punits, int linebreaks)
bool | get_units_upgrade_info (char *buf, size_t bufsz, struct unit_list *punits)
bool | get_units_disband_info (char *buf, size_t bufsz, struct unit_list *punits)
const char * | get_spaceship_descr (struct player_spaceship *pship)
const char * | get_timeout_label_text (void)
const char * | get_ping_time_text (const struct player *pplayer)
const char * | get_score_text (const struct player *pplayer)
const char * | get_report_title (const char *report_name)
const char * | get_act_sel_action_custom_text (struct action *paction, const struct act_prob prob, const struct unit *actor_unit, const struct city *target_city)
const char * | act_sel_action_tool_tip (const struct action *paction, const struct act_prob prob)
const char * | text_happiness_buildings (const struct city *pcity)
const char * | text_happiness_nationality (const struct city *pcity)
const char * | text_happiness_cities (const struct city *pcity)
const char * | text_happiness_luxuries (const struct city *pcity)
const char * | text_happiness_units (const struct city *pcity)
const char * | text_happiness_wonders (const struct city *pcity)
const char * | production_help (const struct universal *uni, char *buf, size_t bufsize)
const char * | score_tooltip (const struct player *pplayer, int score)

## Function Documentation

## ◆ act_sel_action_tool_tip()

const char * act_sel_action_tool_tip | ( | const struct action * | paction,
|  | const struct act_prob | prob
| ) |  |

Get information about starting the action in the current situation. Suitable for a tool tip for the button that starts it.

Not re-entrant

Returns
  an explanation of a tool tip button suitable for a tool tip

Definition at line 1820 of file text.c.

Referenced by action_entry(), action_entry(), action_entry_update(), and action_entry_update().

## ◆ get_act_sel_action_custom_text()

const char * get_act_sel_action_custom_text | ( | struct action * | paction,
|  | const struct act_prob | prob,
|  | const struct unit * | actor_unit,
|  | const struct city * | target_city
| ) |  |

Returns custom part of the action selection dialog button text for the specified action (given that the action is possible).

Not re-entrant

Definition at line 1743 of file text.c.

Referenced by action_entry(), action_selection_refresh(), and popup_action_selection().

## ◆ get_airlift_text()

const char * get_airlift_text | ( | const struct unit_list * | punits,
|  | const struct city * | pdest
| ) |  |

Describe the airlift capacity of a city for the given units (from their current positions). If pdest is non-NULL, describe its capacity as a destination, otherwise describe the capacity of the city the unit's currently in (if any) as a source. (If the units in the list are in different cities, this will probably not give a useful result in this case.) If not all of the listed units can be airlifted, return the description for those that can. Returns NULL if an airlift is not possible for any of the units.

Not re-entrant

Definition at line 578 of file text.c.

Referenced by goto_dialog::fill_tab(), refresh_airlift_column(), and update_source_label().

## ◆ get_bulb_tooltip()

const char * get_bulb_tooltip | ( | void |  | ) |

Get a tooltip text for the info panel research indicator. See client_research_sprite().

Not re-entrant

Definition at line 1400 of file text.c.

## ◆ get_global_warming_tooltip()

const char * get_global_warming_tooltip | ( | void |  | ) |

Get a tooltip text for the info panel global warning indicator. See also client_warming_sprite().

Not re-entrant

Definition at line 1457 of file text.c.

## ◆ get_government_tooltip()

const char * get_government_tooltip | ( | void |  | ) |

Get a tooltip text for the info panel government indicator. See also government_by_number(...)->sprite.

Not re-entrant

Definition at line 1511 of file text.c.

## ◆ get_info_label_text()

const char * get_info_label_text | ( | bool | moreinfo | ) |

Return the text for the label on the info panel. (This is traditionally shown to the left of the mapview.)

Clicking on this text should bring up the get_info_label_text_popup() text.

Not re-entrant

Definition at line 950 of file text.c.

## ◆ get_info_label_text_popup()

const char * get_info_label_text_popup | ( | void |  | ) |

Return the text for the popup label on the info panel. (This is traditionally done as a popup whenever the regular info text is clicked on.)

Not re-entrant

Definition at line 1002 of file text.c.

## ◆ get_nearest_city_text()

const char * get_nearest_city_text | ( | struct city * | pcity,
|  | int | sq_dist
| ) |  |

Returns the text describing the city and its distance.

Not re-entrant

Definition at line 474 of file text.c.

Referenced by create_present_supported_units_widget_list(), and unit_description().

## ◆ get_nuclear_winter_tooltip()

const char * get_nuclear_winter_tooltip | ( | void |  | ) |

Get a tooltip text for the info panel nuclear winter indicator. See also client_cooling_sprite().

Not re-entrant

Definition at line 1484 of file text.c.

## ◆ get_ping_time_text()

const char * get_ping_time_text | ( | const struct player * | pplayer | ) |

Return text giving the ping time for the player. This is generally used in the playerdlg. This should only be used in plrdlg_common.c.

Not re-entrant

Definition at line 1654 of file text.c.

## ◆ get_report_title()

const char * get_report_title | ( | const char * | report_name | ) |

Get the title for a "report". This may include the city, economy, military, trade, player, etc., reports. Some clients may generate the text themselves to get a better GUI layout.

Not re-entrant

Definition at line 1705 of file text.c.

## ◆ get_science_goal_text()

const char * get_science_goal_text | ( | Tech_type_id | goal | ) |

Set the science-goal-label text as if we're researching the given goal.

Not re-entrant

Definition at line 899 of file text.c.

Referenced by real_science_report_dialog_update(), science_report_update(), and science_report::update_report().

## ◆ get_science_target_text()

const char * get_science_target_text | ( | double * | percent | ) |

Get the short science-target text. This is usually shown directly in the progress bar.

5/28 - 3 turns

The "percent" value, if given, will be set to the completion percentage of the research target (actually it's a [0,1] scale not a percent).

Not re-entrant

Definition at line 853 of file text.c.

Referenced by get_info_label_text_popup(), real_science_report_dialog_update(), science_report_update(), and science_report::update_report().

## ◆ get_score_text()

const char * get_score_text | ( | const struct player * | pplayer | ) |

Return text giving the score of the player. This should only be used in plrdlg_common.c.

Not re-entrant

Definition at line 1683 of file text.c.

## ◆ get_spaceship_descr()

const char * get_spaceship_descr | ( | struct player_spaceship * | pship | ) |

Returns a description of the given spaceship. If there is no spaceship (pship is NULL) then text with dummy values is returned.

Not re-entrant

Definition at line 1533 of file text.c.

Referenced by create_spaceship_dialog(), popup_spaceship_dialog(), refresh_spaceship_dialog(), spaceship_dialog_update_info(), and ss_report::update_report().

## ◆ get_tile_output_text()

const char * get_tile_output_text | ( | const struct tile * | ptile | ) |

Return a (static) string with a tile's food/prod/trade

Not re-entrant

Definition at line 62 of file text.c.

Referenced by popup_info_text(), popup_terrain_info(), and redraw_unit_info_label().

## ◆ get_timeout_label_text()

const char * get_timeout_label_text | ( | void |  | ) |

Get the text showing the timeout. This is generally displayed on the info panel.

Not re-entrant

Definition at line 1590 of file text.c.

## ◆ get_unit_info_label_text1()

const char * get_unit_info_label_text1 | ( | struct unit_list * | punits | ) |

Return the title text for the unit info shown in the info panel.

Not re-entrant

FIXME: this should be renamed.

Definition at line 1087 of file text.c.

Referenced by update_unit_info_label().

## ◆ get_unit_info_label_text2()

const char * get_unit_info_label_text2 | ( | struct unit_list * | punits,
|  | int | linebreaks
| ) |  |

Return the text body for the unit info shown in the info panel.

Not re-entrant

FIXME: this should be renamed.

Definition at line 1112 of file text.c.

Referenced by redraw_unit_info_label(), and update_unit_info_label().

## ◆ get_units_disband_info()

bool get_units_disband_info | ( | char * | buf,
|  | size_t | bufsz,
|  | struct unit_list * | punits
| ) |  |

Fill buffer with text about disbanding units on the list.

Returns TRUE iff any units can be disbanded.

Definition at line 1356 of file text.c.

Referenced by popup_disband_dialog(), and popup_unit_disband_dlg().

## ◆ get_units_upgrade_info()

bool get_units_upgrade_info | ( | char * | buf,
|  | size_t | bufsz,
|  | struct unit_list * | punits
| ) |  |

Fill buffer with text about upgrading units on the list.

Returns TRUE iff any units can be upgraded.

Definition at line 1290 of file text.c.

Referenced by popup_upgrade_dialog().

## ◆ popup_info_text()

const char * popup_info_text | ( | struct tile * | ptile | ) |

Text to popup on a middle-click in the mapview.

Not re-entrant

Definition at line 146 of file text.c.

Referenced by info_tile::calc_size(), popit(), popit(), popit(), popup_terrain_info_dialog(), and hud_units::update_actions().

## ◆ production_help()

const char * production_help | ( | const struct universal * | uni,
|  | char * | buf,
|  | size_t | bufsize
| ) |  |

Fill provided buffer with relatively short (not full) helptext of the universal.

Definition at line 2120 of file text.c.

Referenced by drag_drop(), menu_item_callback(), menu_item_callback(), and refresh_worklist().

## ◆ science_dialog_text()

const char * science_dialog_text | ( | void |  | ) |

Returns the text to display in the science dialog.

Not re-entrant

Definition at line 774 of file text.c.

## ◆ score_tooltip()

const char * score_tooltip | ( | const struct player * | pplayer,
|  | int | score
| ) |  |

Tooltip for the player row on reports. Negative score is not shown.

Not re-entrant

Definition at line 2157 of file text.c.

Referenced by endgame_report_dialog_player(), and fill_row().

## ◆ text_happiness_buildings()

const char * text_happiness_buildings | ( | const struct city * | pcity | ) |

Describe buildings that affect happiness.

Not re-entrant

Definition at line 1831 of file text.c.

Referenced by show_happiness_popup(), show_happiness_popup(), and city_dialog::update_citizens().

## ◆ text_happiness_cities()

const char * text_happiness_cities | ( | const struct city * | pcity | ) |

Describe city factors that affect happiness.

Not re-entrant

Definition at line 1931 of file text.c.

## ◆ text_happiness_luxuries()

const char * text_happiness_luxuries | ( | const struct city * | pcity | ) |

Describe luxuries that affect happiness.

Not re-entrant

Definition at line 2103 of file text.c.

Referenced by show_happiness_popup(), show_happiness_popup(), and city_dialog::update_citizens().

## ◆ text_happiness_nationality()

const char * text_happiness_nationality | ( | const struct city * | pcity | ) |

Describe nationality effects that affect happiness.

Not re-entrant

Definition at line 1859 of file text.c.

Referenced by show_happiness_popup(), show_happiness_popup(), and city_dialog::update_citizens().

## ◆ text_happiness_units()

const char * text_happiness_units | ( | const struct city * | pcity | ) |

Describe units that affect happiness.

Not re-entrant

Definition at line 2065 of file text.c.

Referenced by show_happiness_popup(), show_happiness_popup(), and city_dialog::update_citizens().

## ◆ text_happiness_wonders()

const char * text_happiness_wonders | ( | const struct city * | pcity | ) |

Describe wonders that affect happiness.

Not re-entrant

Definition at line 1901 of file text.c.

Referenced by show_happiness_popup(), show_happiness_popup(), and city_dialog::update_citizens().

## ◆ unit_description()

const char * unit_description | ( | struct unit * | punit | ) |

Returns a unit description. Used in e.g. city report tooltips.

Not re-entrant

Definition at line 508 of file text.c.

Referenced by city_dialog_update_present_units(), city_dialog_update_supported_units(), unit_item::unit_item(), and units_orders_city_dlg_callback().