14 #include <fc_config.h>
35 #include "fc_version.h"
61 #include "packhand_gen.h"
89 struct option *(*option_by_number)(int);
90 struct option *(*option_first)();
93 const char *(*category_name)(int);
148 const char *(*name)(
const struct option *);
149 const char *(*description)(
const struct option *);
150 const char *(*help_text)(
const struct option *);
171 const char *(*get)(
const struct option *);
172 const char *(*def)(
const struct option *);
182 int (*
cmp)(
const char *,
const char *);
244 #define OPTION(poption) ((struct option *) (poption))
246 #define OPTION_INIT(optset, spec_type, spec_table_var, common_table, \
247 spec_table, changed_cb, cb_data) \
249 .poptset = optset, .type = spec_type, .common_vtable = &common_table, \
250 .spec_table_var = &spec_table, .changed_callback = changed_cb, \
251 .callback_data = cb_data, .gui_data = nullptr \
253 #define OPTION_BOOL_INIT(optset, common_table, bool_table, changed_cb) \
254 OPTION_INIT(optset, OT_BOOLEAN, bool_vtable, common_table, bool_table, \
256 #define OPTION_INT_INIT(optset, common_table, int_table, changed_cb) \
257 OPTION_INIT(optset, OT_INTEGER, int_vtable, common_table, int_table, \
259 #define OPTION_STR_INIT(optset, common_table, str_table, changed_cb, \
261 OPTION_INIT(optset, OT_STRING, str_vtable, common_table, str_table, \
263 #define OPTION_ENUM_INIT(optset, common_table, enum_table, changed_cb) \
264 OPTION_INIT(optset, OT_ENUM, enum_vtable, common_table, enum_table, \
266 #define OPTION_BITWISE_INIT(optset, common_table, bitwise_table, \
268 OPTION_INIT(optset, OT_BITWISE, bitwise_vtable, common_table, \
269 bitwise_table, changed_cb, 0)
270 #define OPTION_FONT_INIT(optset, common_table, font_table, changed_cb) \
271 OPTION_INIT(optset, OT_FONT, font_vtable, common_table, font_table, \
273 #define OPTION_COLOR_INIT(optset, common_table, color_table, changed_cb) \
274 OPTION_INIT(optset, OT_COLOR, color_vtable, common_table, color_table, \
334 return poption->
type;
398 void (*callback)(
struct option *))
613 for (val = 0; val < values->count(); val++) {
615 == poption->
enum_vtable->
cmp(qUtf8Printable(values->at(val)), str)) {
634 if (val < values->count()) {
636 return values->at(val);
714 return (1 << values->count()) - 1;
1020 #define CLIENT_OPTION(poption) ((struct client_option *) (poption))
1038 #define GEN_BOOL_OPTION(oname, odesc, ohelp, ocat, odef, ocb) \
1041 .base_option = OPTION_BOOL_INIT(&client_optset_static, \
1042 client_option_common_vtable, \
1043 client_option_bool_vtable, ocb), \
1044 .name = #oname, .description = odesc, .help_text = ohelp, \
1048 .pvalue = &gui_options->oname, \
1069 #define GEN_INT_OPTION(oname, odesc, ohelp, ocat, odef, omin, omax, ocb) \
1073 OPTION_INT_INIT(&client_optset_static, client_option_common_vtable, \
1074 client_option_int_vtable, ocb), \
1075 .name = #oname, .description = odesc, .help_text = ohelp, \
1076 .category = ocat, .u = { \
1077 .integer = {.pvalue = &gui_options->oname, \
1100 #define GEN_STR_OPTION(oname, odesc, ohelp, ocat, odef, ocb, cbd) \
1104 OPTION_STR_INIT(&client_optset_static, client_option_common_vtable, \
1105 client_option_str_vtable, ocb, cbd), \
1106 .name = #oname, .description = odesc, .help_text = ohelp, \
1107 .category = ocat, .u = { \
1108 .string = {.pvalue = gui_options->oname, \
1109 .size = sizeof(gui_options->oname), \
1111 .val_accessor = nullptr} \
1134 #define GEN_STR_LIST_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb, \
1139 OPTION_STR_INIT(&client_optset_static, client_option_common_vtable, \
1140 client_option_str_vtable, ocb, cbd), \
1141 .name = #oname, .description = odesc, .help_text = ohelp, \
1142 .category = ocat, .u = { \
1143 .string = {.pvalue = gui_options->oname, \
1144 .size = sizeof(gui_options->oname), \
1146 .val_accessor = oacc} \
1165 #define GEN_ENUM_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb) \
1168 .base_option = OPTION_ENUM_INIT(&client_optset_static, \
1169 client_option_common_vtable, \
1170 client_option_enum_vtable, ocb), \
1171 .name = #oname, .description = odesc, .help_text = ohelp, \
1172 .category = ocat, .u = { \
1173 .enumerator = {.pvalue = (int *) &gui_options->oname, \
1175 .support_names = nullptr, \
1176 .pretty_names = nullptr, \
1177 .name_accessor = oacc} \
1196 #define GEN_BITWISE_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb) \
1199 .base_option = OPTION_BITWISE_INIT(&client_optset_static, \
1200 client_option_common_vtable, \
1201 client_option_bitwise_vtable, ocb), \
1202 .name = #oname, .description = odesc, .help_text = ohelp, \
1203 .category = ocat, .u = { \
1204 .bitwise = {.pvalue = &gui_options->oname, \
1206 .support_names = nullptr, \
1207 .pretty_names = nullptr, \
1208 .name_accessor = oacc} \
1228 #define GEN_FONT_OPTION(oname, otgt, odesc, ohelp, ocat, ocb) \
1231 .base_option = OPTION_FONT_INIT(&client_optset_static, \
1232 client_option_common_vtable, \
1233 client_option_font_vtable, ocb), \
1234 .name = #oname, .description = odesc, .help_text = ohelp, \
1238 .value = &gui_options->oname, \
1258 #define GEN_COLOR_OPTION(oname, odesc, ohelp, ocat, odef_fg, odef_bg, ocb) \
1261 .base_option = OPTION_COLOR_INIT(&client_optset_static, \
1262 client_option_common_vtable, \
1263 client_option_color_vtable, ocb), \
1264 .name = #oname, .description = odesc, .help_text = ohelp, \
1265 .category = ocat, .u = { \
1266 .color = {.pvalue = &gui_options->oname, \
1267 .def = FT_COLOR(odef_fg, odef_bg)} \
1294 default_user_name,
N_(
"Login name"),
1295 N_(
"This is the default login username that will be used "
1296 "in the connection dialogs or with the -a command-line "
1300 use_prev_server,
N_(
"Default to previously used server"),
1301 N_(
"Automatically update \"Server\" and \"Server port\" "
1302 "options to match your latest connection, so by "
1303 "default you connect to the same server you used "
1304 "on the previous run. You should enable "
1305 "saving options on exit too, so that the automatic "
1306 "updates to the options get saved too."),
1309 default_server_host,
N_(
"Server"),
1310 N_(
"This is the default server hostname that will be used "
1311 "in the connection dialogs or with the -a command-line "
1315 default_server_port,
N_(
"Server port"),
1316 N_(
"This is the default server port that will be used "
1317 "in the connection dialogs or with the -a command-line "
1319 COC_NETWORK, DEFAULT_SOCK_PORT, 0, 65535,
nullptr),
1321 default_metaserver,
N_(
"Metaserver"),
1322 N_(
"The metaserver is a host that the client contacts to "
1323 "find out about games on the internet. Don't change "
1324 "this from its default value unless you know what "
1328 heartbeat_enabled,
N_(
"Send heartbeat messages to server"),
1329 N_(
"Periodically send an empty heartbeat message to the "
1330 "server to probe whether the connection is still up. "
1331 "This can help to make it obvious when the server has "
1332 "cut the connection due to a connectivity outage, if "
1333 "the client would otherwise sit idle for a long period."),
1336 default_sound_set_name,
N_(
"Soundset"),
1337 N_(
"This is the soundset that will be used. Changing "
1338 "this is the same as using the -S command-line "
1342 default_music_set_name,
N_(
"Musicset"),
1343 N_(
"This is the musicset that will be used. Changing "
1344 "this is the same as using the -m command-line "
1349 default_sound_plugin_name,
N_(
"Sound plugin"),
1350 N_(
"If you have a problem with sound, try changing "
1351 "the sound plugin. The new plugin won't take "
1352 "effect until you restart Freeciv21. Changing this "
1353 "is the same as using the -P command-line option."),
1357 "freeciv-chat.log",
nullptr, 0),
1359 N_(
"By changing this option you change the "
1370 default_tileset_square_name,
N_(
"Tileset (Square)"),
1371 N_(
"Select the tileset used with Square based maps. "
1372 "This may change the currently active tileset, if "
1373 "you are playing on such a map, in which "
1374 "case this is the same as using the -t "
1375 "command-line parameter."),
1378 default_tileset_hex_name,
N_(
"Tileset (Hex)"),
1379 N_(
"Select the tileset used with Hex maps. "
1380 "This may change the currently active tileset, if "
1381 "you are playing on such a map, in which "
1382 "case this is the same as using the -t "
1383 "command-line parameter."),
1387 default_tileset_isohex_name,
N_(
"Tileset (Iso-Hex)"),
1388 N_(
"Select the tileset used with Iso-Hex maps. "
1389 "This may change the currently active tileset, if "
1390 "you are playing on such a map, in which "
1391 "case this is the same as using the -t "
1392 "command-line parameter."),
1397 N_(
"Selects the style of the city bar."),
1403 N_(
"Setting this option will draw a line at the city "
1407 draw_city_output,
N_(
"Draw city output"),
1408 N_(
"Setting this option will draw city output for every "
1412 draw_map_grid,
N_(
"Draw the map grid"),
1413 N_(
"Setting this option will draw a grid over the map."),
1416 draw_city_names,
N_(
"Draw the city names"),
1417 N_(
"Setting this option will draw the names of the cities "
1421 draw_city_growth,
N_(
"Draw the city growth"),
1422 N_(
"Setting this option will draw in how many turns the "
1423 "cities will grow or shrink."),
1426 N_(
"Setting this option will draw what the cities are "
1427 "currently building on the map."),
1430 N_(
"Setting this option will draw how much gold is "
1431 "needed to buy the production of the cities."),
1434 N_(
"Draw the city trade routes"),
1435 N_(
"Setting this option will draw trade route lines "
1436 "between cities which have trade routes."),
1439 draw_coastline,
N_(
"Draw the coast line"),
1440 N_(
"Setting this option will draw a line to separate the "
1441 "land from the ocean."),
1444 N_(
"Draw the roads and the railroads"),
1445 N_(
"Setting this option will draw the roads and the "
1446 "railroads on the map."),
1449 draw_irrigation,
N_(
"Draw the irrigation"),
1450 N_(
"Setting this option will draw the irrigation systems "
1454 draw_mines,
N_(
"Draw the mines"),
1455 N_(
"Setting this option will draw the mines on the map."),
1458 draw_fortress_airbase,
N_(
"Draw the bases"),
1459 N_(
"Setting this option will draw the bases on the map."),
1462 draw_specials,
N_(
"Draw the resources"),
1463 N_(
"Setting this option will draw the resources on the "
1467 N_(
"Setting this option will draw the huts on the "
1471 N_(
"Draw the pollution/nuclear fallout"),
1472 N_(
"Setting this option will draw pollution and "
1473 "nuclear fallout on the map."),
1476 draw_cities,
N_(
"Draw the cities"),
1477 N_(
"Setting this option will draw the cities on the map."),
1480 draw_units,
N_(
"Draw the units"),
1481 N_(
"Setting this option will draw the units on the map."),
1484 N_(
"Solid unit background color"),
1485 N_(
"Setting this option will cause units on the map "
1486 "view to be drawn with a solid background color "
1487 "instead of the flag backdrop."),
1490 draw_unit_shields,
N_(
"Draw shield graphics for units"),
1491 N_(
"Setting this option will draw a shield icon "
1492 "as the flags on units. If unset, the full flag will "
1496 draw_focus_unit,
N_(
"Draw the units in focus"),
1497 N_(
"Setting this option will cause the currently focused "
1498 "unit(s) to always be drawn, even if units are not "
1499 "otherwise being drawn (for instance if 'Draw the units' "
1503 N_(
"Setting this option will draw the fog of war."),
1506 draw_borders,
N_(
"Draw the borders"),
1507 N_(
"Setting this option will draw the national borders."),
1511 N_(
"Draw whether tiles are native to "
1513 N_(
"Setting this option will highlight tiles that the "
1514 "currently selected unit cannot enter unaided due to "
1515 "non-native terrain. (If multiple units are selected, "
1516 "only tiles that all of them can enter are indicated.)"),
1519 N_(
"Show dead players in Nations report"),
1520 N_(
"This option controls whether defeated nations are "
1521 "shown on the Nations report page."),
1524 N_(
"When this option is set, the fonts and city "
1525 "descriptions will be "
1526 "scaled when the map is zoomed."),
1529 sound_bell_at_new_turn,
N_(
"Sound bell at new turn"),
1530 N_(
"Set this option to have a \"bell\" event be generated "
1531 "at the start of a new turn. You can control the "
1532 "behavior of the \"bell\" event by editing the message "
1536 smooth_move_unit_msec,
1537 N_(
"Unit movement animation time (milliseconds)"),
1538 N_(
"This option controls how long unit \"animation\" takes "
1539 "when a unit moves on the map view. Set it to 0 to "
1540 "disable animation entirely."),
1543 smooth_center_slide_msec,
1544 N_(
"Mapview recentering time (milliseconds)"),
1545 N_(
"When the map view is recentered, it will slide "
1546 "smoothly over the map to its new position. This "
1547 "option controls how long this slide lasts. Set it to "
1548 "0 to disable mapview sliding entirely."),
1551 smooth_combat_step_msec,
1552 N_(
"Combat animation step time (milliseconds)"),
1553 N_(
"This option controls the speed of combat animation "
1554 "between units on the mapview. Set it to 0 to disable "
1555 "animation entirely."),
1558 N_(
"Show icons in the technology tree"),
1559 N_(
"Setting this option will display icons "
1560 "on the technology tree diagram. Turning "
1561 "this option off makes the technology tree "
1565 N_(
"Use curved lines in the technology tree"),
1566 N_(
"Setting this option make the technology tree "
1567 "diagram use curved lines to show technology "
1568 "relations. Turning this option off causes "
1569 "the lines to be drawn straight."),
1572 highlight_our_names,
1573 N_(
"Color to highlight your player/user name"),
1574 N_(
"If set, your player and user name in the new chat "
1575 "messages will be highlighted using this color as "
1576 "background. If not set, it will just not highlight "
1580 N_(
"Disable this option if you do not want to "
1581 "press the Turn Done button manually when watching "
1585 N_(
"Set this option to have the active unit centered "
1586 "automatically when the unit focus changes."),
1589 N_(
"Disable this option if you do not want to see "
1590 "automated units autocentered and animated."),
1593 auto_center_on_combat,
N_(
"Auto center on combat"),
1594 N_(
"Set this option to have any combat be centered "
1595 "automatically. Disabling this will speed up the time "
1596 "between turns but may cause you to miss combat "
1600 N_(
"Set this option to have the client automatically "
1601 "recenter the map on a suitable location at the "
1602 "start of each turn."),
1605 N_(
"Set this option to have newly awoken units be "
1606 "focused automatically."),
1609 keyboardless_goto,
N_(
"Keyboardless goto"),
1610 N_(
"If this option is set then a goto may be initiated "
1611 "by left-clicking and then holding down the mouse "
1612 "button while dragging the mouse onto a different "
1616 goto_into_unknown,
N_(
"Allow goto into the unknown"),
1617 N_(
"Setting this option will make the game consider "
1618 "moving into unknown tiles. If not, then goto routes "
1619 "will detour around or be blocked by unknown tiles."),
1622 N_(
"Center map when popup city"),
1623 N_(
"Setting this option makes the mapview center on a "
1624 "city when its city dialog is popped up."),
1627 show_previous_turn_messages,
1628 N_(
"Show messages from previous turn"),
1629 N_(
"Message Window shows messages also from previous turn. "
1630 "This makes sure you don't miss messages received in the end "
1632 "the turn, just before the window gets cleared."),
1635 concise_city_production,
N_(
"Concise city production"),
1636 N_(
"Set this option to make the city production (as shown "
1637 "in the city dialog) to be more compact."),
1640 auto_turn_done,
N_(
"End turn when done moving"),
1641 N_(
"Setting this option makes your turn end automatically "
1642 "when all your units are done moving."),
1645 ask_city_name,
N_(
"Prompt for city names"),
1646 N_(
"Disabling this option will make the names of newly "
1647 "founded cities be chosen automatically by the server."),
1650 N_(
"Pop up city dialog for new cities"),
1651 N_(
"Setting this option will pop up a newly-founded "
1652 "city's city dialog automatically."),
1655 popup_actor_arrival,
N_(
"Pop up caravan and spy actions"),
1656 N_(
"If this option is enabled, when a unit arrives at "
1657 "a city where it can perform an action like "
1658 "establishing a trade route, helping build a wonder, or "
1659 "establishing an embassy, a window will pop up asking "
1660 "which action should be performed. "
1661 "Disabling this option means you will have to do the "
1662 "action manually by pressing either 'r' (for a trade "
1663 "route), 'b' (for building a wonder) or 'd' (for a "
1664 "spy action) when the unit is in the city."),
1667 popup_attack_actions,
N_(
"Pop up attack questions"),
1668 N_(
"If this option is enabled, when a unit arrives at a "
1669 "target it can attack, a window will pop up asking "
1670 "which action should be performed even if an attack "
1671 "action is legal and no other interesting action are. "
1672 "This allows you to change your mind or to select an "
1673 "uninteresting action."),
1676 popup_last_move_to_allied,
1677 N_(
"Pop up actions last move to allied"),
1678 N_(
"If this option is enabled the final move in a unit's"
1679 " orders to a tile with allied units or cities it can"
1680 " perform an action to is interpreted as an attempted"
1681 " action. This makes the action selection dialog pop up"
1682 " while the unit is at the adjacent tile."
1683 " This can, in cases where the action requires that"
1684 " the actor unit has moves left, save a turn."
1685 " The down side is that the unit remains adjacent to"
1686 " rather than inside the protection of an allied city"
1690 N_(
"This option controls whether the client should "
1691 "try to change the mouse cursor depending on what "
1692 "is being pointed at, as well as to indicate "
1693 "changes in the client or server state."),
1696 separate_unit_selection,
N_(
"Select cities before units"),
1697 N_(
"If this option is enabled, when both cities and "
1698 "units are present in the selection rectangle, only "
1699 "cities will be selected. See the help on Controls."),
1702 unit_selection_clears_orders,
N_(
"Clear unit orders on selection"),
1703 N_(
"Enabling this option will cause unit orders to be "
1704 "cleared as soon as one or more units are selected. If "
1705 "this option is disabled, busy units will not stop "
1706 "their current activity when selected. Giving them "
1707 "new orders will clear their current ones; pressing "
1708 "<space> once will clear their orders and leave them "
1709 "selected, and pressing <space> a second time will "
1713 N_(
"If this option is turned on, the vote bar will be "
1714 "displayed to show vote information."),
1717 voteinfo_bar_always_show,
N_(
"Always display the vote bar"),
1718 N_(
"If this option is turned on, the vote bar will never "
1719 "be hidden, even if there is no running vote."),
1722 voteinfo_bar_hide_when_not_player,
1723 N_(
"Do not show vote bar if not a player"),
1724 N_(
"If this option is enabled, the client won't show the "
1725 "vote bar if you are not a player."),
1728 N_(
"Set new votes at front"),
1729 N_(
"If this option is enabled, then new votes will go "
1730 "to the front of the vote list."),
1733 autoaccept_tileset_suggestion,
1734 N_(
"Autoaccept tileset suggestions"),
1735 N_(
"If this option is enabled, any tileset suggested by "
1736 "the ruleset is automatically used; otherwise you "
1737 "are prompted to change tileset."),
1741 N_(
"Play sound effects, assuming there's suitable "
1742 "sound plugin and soundset with the sounds."),
1745 sound_enable_game_music,
N_(
"Enable in-game music"),
1746 N_(
"Play music during the game, assuming there's suitable "
1747 "sound plugin and musicset with in-game tracks."),
1750 sound_enable_menu_music,
N_(
"Enable menu music"),
1751 N_(
"Play music while not in actual game, "
1752 "assuming there's suitable "
1753 "sound plugin and musicset with menu music tracks."),
1756 N_(
"Volume scale from 0-100"),
COC_SOUND, 100, 0, 100,
1760 autoaccept_soundset_suggestion,
1761 N_(
"Autoaccept soundset suggestions"),
1762 N_(
"If this option is enabled, any soundset suggested by "
1763 "the ruleset is automatically used."),
1766 autoaccept_musicset_suggestion,
1767 N_(
"Autoaccept musicset suggestions"),
1768 N_(
"If this option is enabled, any musicset suggested by "
1769 "the ruleset is automatically used."),
1773 N_(
"Background layer"),
1774 N_(
"The background layer of the overview shows just "
1778 N_(
"Terrain relief map layer"),
1779 N_(
"The relief layer shows all terrains on the map."),
1783 N_(
"The borders layer of the overview shows which tiles "
1784 "are owned by each player."),
1787 N_(
"Borders layer on ocean tiles"),
1788 N_(
"The borders layer of the overview are drawn on "
1789 "ocean tiles as well (this may look ugly with many "
1790 "islands). This option is only of interest if you "
1791 "have set the option \"Borders layer\" already."),
1794 N_(
"Enabling this will draw units on the overview."),
1797 N_(
"Enabling this will draw cities on the overview."),
1800 N_(
"Enabling this will show fog of war on the "
1849 N_(
"If this option is set the client will use the "
1850 "whole screen area for drawing."),
1853 gui_qt_show_titlebar,
N_(
"Show titlebar"),
1854 N_(
"If this option is set the client will show a titlebar. "
1855 "If disabled, then no titlebar will be shown, and "
1856 "minimize/maximize/etc buttons will be placed on the "
1860 N_(
"Change size of all fonts at once by given percent. "
1861 "This option cannot be saved. Hit the Apply button "
1862 "after changing this."),
1865 N_(
"Default font"),
N_(
"This is default font"),
1868 gui_qt_font_notify_label,
"notify_label",
N_(
"Notify Label"),
1869 N_(
"This font is used to display server reports such "
1870 "as the demographic report or historian publications."),
1873 gui_qt_font_help_label,
"help_label",
N_(
"Help Label"),
1874 N_(
"This font is used to display the help labels in the "
1878 gui_qt_font_help_text,
"help_text",
N_(
"Help Text"),
1879 N_(
"This font is used to display the help body text in "
1880 "the help window."),
1883 N_(
"This font is used to display the text in the "
1887 N_(
"This font is used to the display the city names "
1891 N_(
"City Productions"),
1892 N_(
"This font is used to display the city production "
1896 gui_qt_font_reqtree_text,
"reqtree_text",
N_(
"Requirement Tree"),
1897 N_(
"This font is used to the display the requirement tree "
1898 "in the Research report."),
1901 N_(
"If this option is set the client will show "
1902 "information and map preview of current savegame."),
1947 return _(
"Graphics");
1950 return _(
"Minimap");
1954 return _(
"Interface");
1956 return _(
"Map Image");
1958 return _(
"Network");
1965 qCritical(
"%s: invalid option category number %d.", __FUNCTION__,
2051 if (*pcoption->
u.
boolean.pvalue == val) {
2099 if (val < pcoption->
u.integer.min || val > pcoption->
u.
integer.max
2100 || *pcoption->
u.
integer.pvalue == val) {
2144 if (strlen(str) >= pcoption->
u.
string.size
2145 || 0 == strcmp(pcoption->
u.
string.pvalue, str)) {
2150 if (allowed_values && !allowed_values->contains(str)) {
2151 qWarning() <<
"Unrecognized value for option" <<
option_name(poption)
2152 <<
":" << QString(str);
2171 return (0 <= val && val < names->count() ? qUtf8Printable(names->at(val))
2186 return (0 <= val && val < names->count() ? qUtf8Printable(names->at(val))
2263 bool changed =
false;
2265 #define color_set(color_tgt, color) \
2266 if (nullptr == color_tgt) { \
2267 if (nullptr != color) { \
2268 color_tgt = fc_strdup(color); \
2272 if (nullptr == color) { \
2273 delete[] color_tgt; \
2274 color_tgt = nullptr; \
2276 } else if (0 != strcmp(color_tgt, color)) { \
2277 delete[] color_tgt; \
2278 color_tgt = fc_strdup(color); \
2338 const char *
string =
2351 sf,
"client.%s.foreground",
option_name(poption)))
2353 sf,
"client.%s.background",
option_name(poption)))
2559 #define SERVER_OPTION(poption) ((struct server_option *) (poption))
2581 delete[] poption->
string.value;
2582 delete[] poption->
string.def;
2583 poption->
string.value =
nullptr;
2584 poption->
string.def =
nullptr;
2595 delete poption->
bitwise.support_names;
2596 delete poption->
bitwise.pretty_names;
2597 poption->
bitwise.support_names =
nullptr;
2598 poption->
bitwise.pretty_names =
nullptr;
2608 delete[] poption->
name;
2611 poption->
name =
nullptr;
2654 const struct packet_server_setting_control *packet)
2665 if (0 < packet->categories_num) {
2676 if (0 < packet->settings_num) {
2686 const struct packet_server_setting_const *packet)
2701 psoption->
category = packet->category;
2707 #define handle_server_setting_common(psoption, packet) \
2708 psoption->is_changeable = packet->is_changeable; \
2709 psoption->setdef = packet->setdef; \
2710 psoption->is_visible = packet->is_visible; \
2712 if (!psoption->desired_sent && psoption->is_visible \
2713 && psoption->is_changeable && is_server_running() \
2714 && packet->initial_setting) { \
2720 desired_settable_option_send(OPTION(poption)); \
2721 psoption->desired_sent = true; \
2725 option_gui_update(poption);
2731 const struct packet_server_setting_bool *packet)
2742 poption->
type = OT_BOOLEAN;
2746 "Server setting \"%s\" (nb %d) has type %s (%d), "
2749 option_type_name(poption->
type), poption->
type,
2750 option_type_name(OT_BOOLEAN), OT_BOOLEAN);
2752 if (packet->is_visible) {
2753 psoption->
boolean.value = packet->val;
2754 psoption->
boolean.def = packet->default_val;
2764 const struct packet_server_setting_int *packet)
2775 poption->
type = OT_INTEGER;
2779 "Server setting \"%s\" (nb %d) has type %s (%d), "
2782 option_type_name(poption->
type), poption->
type,
2783 option_type_name(OT_INTEGER), OT_INTEGER);
2785 if (packet->is_visible) {
2786 psoption->
integer.value = packet->val;
2787 psoption->
integer.def = packet->default_val;
2788 psoption->
integer.min = packet->min_val;
2789 psoption->
integer.max = packet->max_val;
2799 const struct packet_server_setting_str *packet)
2810 poption->
type = OT_STRING;
2814 "Server setting \"%s\" (nb %d) has type %s (%d), "
2817 option_type_name(poption->
type), poption->
type,
2818 option_type_name(OT_STRING), OT_STRING);
2820 if (packet->is_visible) {
2821 if (
nullptr == psoption->
string.value) {
2823 }
else if (0 != strcmp(packet->val, psoption->
string.value)) {
2824 delete[] psoption->
string.value;
2827 if (
nullptr == psoption->
string.def) {
2829 }
else if (0 != strcmp(packet->default_val, psoption->
string.def)) {
2830 delete[] psoption->
string.def;
2842 const struct packet_server_setting_enum *packet)
2853 poption->
type = OT_ENUM;
2857 "Server setting \"%s\" (nb %d) has type %s (%d), "
2860 option_type_name(poption->
type), poption->
type,
2861 option_type_name(OT_ENUM), OT_ENUM);
2863 if (packet->is_visible) {
2867 psoption->
enumerator.def = packet->default_val;
2869 if (
nullptr == psoption->
enumerator.support_names) {
2873 psoption->
enumerator.support_names->resize(packet->values_num);
2875 psoption->
enumerator.pretty_names->resize(packet->values_num);
2876 for (i = 0; i < packet->values_num; i++) {
2878 i, packet->support_names[i]);
2880 psoption->
enumerator.pretty_names->replace(i,
2881 packet->pretty_names[i]);
2883 }
else if (psoption->
enumerator.support_names->count()
2884 != packet->values_num) {
2886 == psoption->
enumerator.pretty_names->count());
2889 psoption->
enumerator.support_names->resize(packet->values_num);
2890 psoption->
enumerator.pretty_names->resize(packet->values_num);
2891 for (i = 0; i < packet->values_num; i++) {
2893 i, packet->support_names[i]);
2895 psoption->
enumerator.pretty_names->replace(i,
2896 packet->pretty_names[i]);
2903 for (i = 0; i < packet->values_num; i++) {
2904 str = psoption->
enumerator.pretty_names->at(i);
2905 if (str.isEmpty() || (str == packet->pretty_names[i])) {
2908 i, packet->pretty_names[i]);
2913 i, packet->support_names[i]);
2925 const struct packet_server_setting_bitwise *packet)
2936 poption->
type = OT_BITWISE;
2940 "Server setting \"%s\" (nb %d) has type %s (%d), "
2943 option_type_name(poption->
type), poption->
type,
2944 option_type_name(OT_BITWISE), OT_BITWISE);
2946 if (packet->is_visible) {
2949 psoption->
bitwise.value = packet->val;
2950 psoption->
bitwise.def = packet->default_val;
2952 if (
nullptr == psoption->
bitwise.support_names) {
2956 psoption->
bitwise.support_names->resize(packet->bits_num);
2958 psoption->
bitwise.pretty_names->resize(packet->bits_num);
2959 for (i = 0; i < packet->bits_num; i++) {
2960 psoption->
bitwise.support_names->replace(i,
2961 packet->support_names[i]);
2963 psoption->
bitwise.pretty_names->replace(i, packet->pretty_names[i]);
2965 }
else if (psoption->
bitwise.support_names->count()
2966 != packet->bits_num) {
2968 == psoption->
bitwise.pretty_names->count());
2971 psoption->
bitwise.support_names->resize(packet->bits_num);
2972 psoption->
bitwise.pretty_names->resize(packet->bits_num);
2973 for (i = 0; i < packet->bits_num; i++) {
2974 psoption->
bitwise.support_names->replace(i,
2975 packet->support_names[i]);
2977 psoption->
bitwise.pretty_names->replace(i, packet->pretty_names[i]);
2984 for (i = 0; i < packet->bits_num; i++) {
2985 str = psoption->
bitwise.pretty_names->at(i);
2986 if (str.isEmpty() || (str != packet->pretty_names[i])) {
2988 psoption->
bitwise.pretty_names->replace(i,
2989 packet->pretty_names[i]);
2993 psoption->
bitwise.support_names->replace(i,
2994 packet->support_names[i]);
3011 while (
nullptr != poption && poption < max && !poption->
is_visible) {
3015 return (poption <
max ? poption :
nullptr);
3134 if (psoption->
boolean.value == val) {
3139 val ?
"enabled" :
"disabled");
3184 || psoption->
integer.value == val) {
3227 if (0 == strcmp(psoption->
string.value, str)) {
3270 || val >= psoption->
enumerator.support_names->size()) {
3275 "/set %s \"%s\"", psoption->
name,
3276 qUtf8Printable(psoption->
enumerator.support_names->at(val)));
3291 if (
nullptr != pvalue) {
3292 *pvalue = values->at(psoption->
enumerator.value);
3294 if (
nullptr != pdefault) {
3295 *pdefault = values->at(psoption->
enumerator.def);
3330 unsigned val,
char *buf,
size_t buf_len)
3335 for (bit = 0; bit < values->count(); bit++) {
3336 if ((1 << bit) & val) {
3337 if (
'\0' != buf[0]) {
3340 fc_strlcat(buf, qUtf8Printable(values->at(bit)), buf_len);
3354 if (val == psoption->
bitwise.value) {
3369 char *val_buf,
size_t val_len,
3370 char *def_buf,
size_t def_len)
3375 if (
nullptr != val_buf && 0 < val_len) {
3379 if (
nullptr != def_buf && 0 < def_len) {
3395 int none[] = {E_IMP_BUY,
3401 E_CITY_PRODUCTION_CHANGED,
3402 E_CITY_MAY_SOON_GROW,
3406 E_NATION_SELECTED, E_CHAT_MSG, E_CHAT_ERROR, E_CONNECTION,
3407 E_LOG_ERROR, E_SETTING, E_VOTE_NEW, E_VOTE_RESOLVED,
3408 E_VOTE_ABORTED, E_UNIT_LOST_ATT, E_UNIT_WIN_ATT,
3410 int all[] = {E_LOG_FATAL, E_SCRIPT, E_DEPRECATION_WARNING, E_MESSAGE_WALL};
3413 for (i = 0; i <= event_type_max(); i++) {
3442 enum event_type
event;
3449 const enum event_type old_events[] = {E_CITY_CANTBUILD,
3454 E_CITY_FAMINE_FEARED,
3456 E_CITY_MAY_SOON_GROW,
3458 E_CITY_IMPROVEMENT_BLDG,
3462 E_CITY_GRAN_THROTTLE,
3465 E_CITY_PRODUCTION_CHANGED,
3477 E_MY_DIPLOMAT_BRIBE,
3478 E_DIPLOMATIC_INCIDENT,
3479 E_MY_DIPLOMAT_ESCAPE,
3480 E_MY_DIPLOMAT_EMBASSY,
3481 E_MY_DIPLOMAT_FAILED,
3482 E_MY_DIPLOMAT_INCITE,
3483 E_MY_DIPLOMAT_POISON,
3484 E_MY_DIPLOMAT_SABOTAGE,
3485 E_MY_DIPLOMAT_THEFT,
3486 E_ENEMY_DIPLOMAT_BRIBE,
3487 E_ENEMY_DIPLOMAT_EMBASSY,
3488 E_ENEMY_DIPLOMAT_FAILED,
3489 E_ENEMY_DIPLOMAT_INCITE,
3490 E_ENEMY_DIPLOMAT_POISON,
3491 E_ENEMY_DIPLOMAT_SABOTAGE,
3492 E_ENEMY_DIPLOMAT_THEFT,
3512 E_HUT_BARB_CITY_NEAR,
3524 E_TREATY_SHARED_VISION,
3540 E_WONDER_WILL_BE_BUILT,
3550 const size_t old_events_num =
ARRAY_SIZE(old_events);
3552 for (i = 0; i < old_events_num; i++) {
3555 "%s.message_where_%02d", prefix, i);
3560 for (i = 0; i < num_events; i++) {
3563 qCritical(
"Corruption in file %s: %s",
secfile_name(file),
3569 qCWarning(deprecations_category,
3570 _(
"Deprecated event type E_UNIT_WIN in client options."));
3571 p =
"E_UNIT_WIN_DEF";
3577 deprecations_category,
3578 _(
"Deprecated event type E_CITY_AQUEDUCT in client options."));
3579 p =
"E_CITY_IMPROVEMENT";
3585 deprecations_category,
3586 _(
"Deprecated event type E_CITY_AQ_BUILDING in client options."));
3587 p =
"E_CITY_IMPROVEMENT_BLDG";
3589 event = event_type_by_name(p, strcmp);
3590 if (!event_type_is_valid(
event)) {
3591 qCritical(
"Event not supported: %s", p);
3596 "messages.event%d.where", i)) {
3597 qCritical(
"Corruption in file %s: %s",
secfile_name(file),
3611 enum event_type
event;
3614 for (
event = event_type_begin();
event != event_type_end();
3615 event = event_type_next(
event)) {
3649 file,
false,
"cma.preset%d.allow_disorder", i);
3651 file,
true,
"cma.preset%d.allow_specialists", i);
3669 "cma.preset%d.minsurp%d", i, o);
3681 "cma.preset%d.allow_disorder", i);
3683 "cma.preset%d.allow_specialists", i);
3694 _(
"If you add a preset by hand,"
3695 " also update \"number_of_presets\""),
3696 "cma.number_of_presets");
3703 #define OLD_OPTION_FILE_NAME ".civclientrc"
3705 #define MID_OPTION_FILE_NAME ".freeciv-client-rc-%d.%d"
3706 #define NEW_OPTION_FILE_NAME "freeciv-client-rc-%d.%d"
3707 #if MINOR_VERSION >= 90
3708 #define MAJOR_NEW_OPTION_FILE_NAME (MAJOR_VERSION + 1)
3709 #define MINOR_NEW_OPTION_FILE_NAME 0
3711 #define MAJOR_NEW_OPTION_FILE_NAME MAJOR_VERSION
3712 #if IS_DEVEL_VERSION
3713 #define MINOR_NEW_OPTION_FILE_NAME (MINOR_VERSION + 1)
3715 #define MINOR_NEW_OPTION_FILE_NAME MINOR_VERSION
3719 #define FIRST_MAJOR_NEW_OPTION_FILE_NAME 2
3720 #define FIRST_MINOR_NEW_OPTION_FILE_NAME 6
3722 #define FIRST_MAJOR_MID_OPTION_FILE_NAME 2
3723 #define FIRST_MINOR_MID_OPTION_FILE_NAME 2
3725 #define FIRST_MAJOR_NEW_BOOLEAN 2
3726 #define FIRST_MINOR_NEW_BOOLEAN 3
3737 static char name_buffer[256];
3739 auto name = QString::fromLocal8Bit(qgetenv(
"FREECIV_OPT"));
3741 if (!
name.isEmpty()) {
3744 #ifdef OPTION_FILE_NAME
3745 fc_strlcpy(name_buffer, OPTION_FILE_NAME,
sizeof(name_buffer));
3748 if (
name.isEmpty()) {
3749 qCritical(
_(
"Cannot find Freeciv21 storage directory"));
3753 "%s/freeciv-client-rc-%d.%d", qUtf8Printable(
name),
3757 qDebug(
"settings file is %s", name_buffer);
3771 static char name_buffer[256];
3772 static int last_minors[] = {
3778 #if MINOR_VERSION >= 90
3780 missing_last_minor);
3783 missing_last_minor);
3786 *allow_digital_boolean =
false;
3788 auto name = QString::fromLocal8Bit(qgetenv(
"FREECIV_OPT"));
3790 if (!
name.isEmpty()) {
3793 #ifdef OPTION_FILE_NAME
3794 fc_strlcpy(name_buffer, OPTION_FILE_NAME,
sizeof(name_buffer));
3800 if (
name.isEmpty()) {
3801 qCritical(
_(
"Cannot find Freeciv21 storage directory"));
3814 "%s/freeciv-client-rc-%d.%d", qUtf8Printable(
name),
3816 if (0 ==
fc_stat(name_buffer, &buf)) {
3819 qInfo(
_(
"Didn't find '%s' option file, "
3820 "loading from '%s' instead."),
3827 minor = last_minors[major - 1];
3838 "%s/.freeciv-client-rc-%d.%d",
3839 qUtf8Printable(QDir::homePath()), major, minor);
3840 if (0 ==
fc_stat(name_buffer, &buf)) {
3841 qInfo(
_(
"Didn't find '%s' option file, "
3842 "loading from '%s' instead."),
3844 + qstrlen(qUtf8Printable(QDir::homePath())) + 1,
3848 *allow_digital_boolean =
true;
3855 fc_snprintf(name_buffer,
sizeof(name_buffer),
"%s/%s",
3857 if (0 ==
fc_stat(name_buffer, &buf)) {
3858 qInfo(
_(
"Didn't find '%s' option file, "
3859 "loading from '%s' instead."),
3861 *allow_digital_boolean =
true;
3868 qDebug(
"settings file is %s", name_buffer);
3871 #undef OLD_OPTION_FILE_NAME
3872 #undef MID_OPTION_FILE_NAME
3873 #undef NEW_OPTION_FILE_NAME
3874 #undef FIRST_MAJOR_NEW_OPTION_FILE_NAME
3875 #undef FIRST_MINOR_NEW_OPTION_FILE_NAME
3876 #undef FIRST_MAJOR_MID_OPTION_FILE_NAME
3877 #undef FIRST_MINOR_MID_OPTION_FILE_NAME
3878 #undef FIRST_MINOR_NEW_BOOLEAN
3894 if (
name == QStringLiteral(
"cimpletoon")) {
3897 [QStringLiteral(
"cimpletoon")] =
true;
3898 }
else if (
name == QStringLiteral(
"toonhex")) {
3901 [QStringLiteral(
"cimpletoon")] =
true;
3931 auto settings = std::map<QString, bool>();
3939 qWarning(
"Could not load option %s for tileset %s",
3973 const struct section *psection;
3974 const struct entry_list *entries;
3979 settable_options->clear();
3982 if (
nullptr == psection) {
3994 fc_strlcpy(buf, bval ?
"enabled" :
"disabled",
sizeof(buf));
4019 if (
nullptr ==
string) {
4020 qCritical(
"Entry type variant of \"%s.%s\" is not supported.",
4025 settable_options->insert(
entry_name(pentry),
string);
4035 optionsHash::const_iterator it = settable_options->constBegin();
4036 while (it != settable_options->constEnd()) {
4037 if (!it.key().compare(QLatin1String(
"gameseed"))
4038 || !it.key().compare(QLatin1String(
"mapseed"))) {
4043 if (!it.key().compare(QLatin1String(
"topology"))) {
4057 QByteArray qkey = it.key().toLocal8Bit();
4058 QByteArray qval = it.value().toLocal8Bit();
4070 char val_buf[1024], def_buf[1024];
4071 QString value, def_val;
4099 def_buf,
sizeof(def_buf));
4108 if (
nullptr == value ||
nullptr == def_val) {
4109 qCritical(
"Option type %s (%d) not supported for '%s'.",
4115 if (value == def_val) {
4120 settable_options->insert(
option_name(poption), value);
4131 const char *op_value,
bool allow_replace)
4133 Q_UNUSED(allow_replace)
4134 settable_options->insert(op_name, op_value);
4142 int old_value,
char *buf,
4147 #define SETTING_CASE(ARG_name, ...) \
4148 if (0 == strcmp(ARG_name, name)) { \
4149 static const char *values[] = {__VA_ARGS__}; \
4150 if (0 <= old_value && old_value < ARRAY_SIZE(values) \
4151 && nullptr != values[old_value]) { \
4152 fc_strlcpy(buf, values[old_value], buf_len); \
4159 SETTING_CASE(
"topology",
"",
"WRAPX",
"WRAPY",
"WRAPX|WRAPY",
"ISO",
4160 "WRAPX|ISO",
"WRAPY|ISO",
"WRAPX|WRAPY|ISO",
"HEX",
4161 "WRAPX|HEX",
"WRAPY|HEX",
"WRAPX|WRAPY|HEX",
"ISO|HEX",
4162 "WRAPX|ISO|HEX",
"WRAPY|ISO|HEX",
"WRAPX|WRAPY|ISO|HEX");
4163 SETTING_CASE(
"generator",
nullptr,
"RANDOM",
"FRACTAL",
"ISLAND");
4164 SETTING_CASE(
"startpos",
"DEFAULT",
"SINGLE",
"2or3",
"ALL",
"VARIABLE");
4165 SETTING_CASE(
"borders",
"DISABLED",
"ENABLED",
"SEE_INSIDE",
"EXPAND");
4166 SETTING_CASE(
"diplomacy",
"ALL",
"HUMAN",
"AI",
"TEAM",
"DISABLED");
4167 SETTING_CASE(
"citynames",
"NO_RESTRICTIONS",
"PLAYER_UNIQUE",
4168 "GLOBAL_UNIQUE",
"NO_STEALING");
4169 SETTING_CASE(
"barbarians",
"DISABLED",
"HUTS_ONLY",
"NORMAL",
"FREQUENT",
4172 SETTING_CASE(
"compresstype",
"PLAIN",
"LIBZ",
"BZIP2");
4183 const char *desired;
4186 if (!settable_options->contains(
option_name(poption))) {
4191 settable_options->value(
option_name(poption)).toLocal8Bit();
4192 desired = qval.data();
4196 || (
str_to_int(desired, &value) && 1 == value))
4200 || (
str_to_int(desired, &value) && 0 == value))
4216 char desired_buf[256];
4221 sizeof(desired_buf))) {
4222 desired = desired_buf;
4227 if (desired == value_str) {
4233 char desired_buf[256], value_buf[256];
4238 sizeof(desired_buf))) {
4239 desired = desired_buf;
4244 if (0 != strcmp(desired, value_buf)) {
4254 qCritical(
"Option type %s (%d) not supported for '%s'.",
4266 const struct entry_list *entries;
4267 const char *prefixes[] = {
"player_dlg_",
"city_report_",
nullptr};
4268 const char **prefix;
4273 if (
nullptr != entries) {
4276 for (prefix = prefixes;
nullptr != *prefix; prefix++) {
4277 if (0 == strncmp(*prefix,
entry_name(pentry), qstrlen(*prefix))
4280 dialog_options->insert(
entry_name(pentry), visible);
4297 dialOptionsHash::const_iterator it = dialog_options->constBegin();
4298 while (it != dialog_options->constEnd()) {
4299 QByteArray qba = it.key().toLocal8Bit();
4345 if (dialog_options->contains(buf)) {
4354 if (dialog_options->contains(buf)) {
4372 const char *
const prefix =
"client";
4382 qInfo(
_(
"Didn't find the option file. Creating a new one."));
4400 qCritical(
_(
"Save failed, cannot write to file %s"),
name);
4402 qInfo(
_(
"Saved settings to file %s"),
name);
4418 "%s.save_options_on_exit", prefix);
4423 "client.default_tileset_overhead_name");
4424 if (str !=
nullptr) {
4428 "client.default_tileset_iso_name");
4429 if (str !=
nullptr) {
4433 bool draw_full_citybar =
4435 if (draw_full_citybar) {
4448 sf,
true,
"%s.popup_caravan_arrival", prefix);
4471 for (i = num - 1; i >= 0; i--) {
4504 char dir_name[2048];
4507 if (log_cb ==
nullptr) {
4513 log_cb(
LOG_ERROR,
_(
"Save failed, cannot find a filename."));
4521 "client.save_options_on_exit");
4523 "deprecated",
"client.fullscreen_mode");
4546 for (i = qstrlen(dir_name) - 1; i >= 0 && dir_name[i] !=
'/'; i--) {
4557 _(
"Save failed, cannot write to file %s"),
name));
4560 QString::asprintf(
_(
"Saved settings to file %s"),
name));
4577 for (val = 0; (
name = acc(val)); val++) {
4578 (*support)->append(
name->support);
4579 (*pretty)->append(
name->pretty);
4607 qCritical(
"option %s has default value of %d, which is "
4608 "out of its range [%d; %d], changing to %d.",
4612 *(
const_cast<int *
>(&(pcoption->u.integer.def))) = new_default;
4619 *(
const_cast<const char **
>(&(pcoption->u.string.def))) =
4626 if (
nullptr == values || values->count() == 0) {
4627 qCritical(
"Invalid nullptr default string for option %s.",
4630 *(
const_cast<const char **
>(&(pcoption->u.string.def))) =
4631 qstrdup(qUtf8Printable(values->at(0)));
4637 fc_assert(
nullptr == pcoption->u.enumerator.support_names);
4638 fc_assert(
nullptr == pcoption->u.enumerator.pretty_names);
4640 &pcoption->u.enumerator.support_names,
4641 &pcoption->u.enumerator.pretty_names);
4642 fc_assert(
nullptr != pcoption->u.enumerator.support_names);
4643 fc_assert(
nullptr != pcoption->u.enumerator.pretty_names);
4647 fc_assert(
nullptr == pcoption->u.bitwise.support_names);
4648 fc_assert(
nullptr == pcoption->u.bitwise.pretty_names);
4650 &pcoption->u.bitwise.support_names,
4651 &pcoption->u.bitwise.pretty_names);
4652 fc_assert(
nullptr != pcoption->u.bitwise.support_names);
4653 fc_assert(
nullptr != pcoption->u.bitwise.pretty_names);
4658 struct ft_color *pcolor = pcoption->u.color.pvalue;
4691 delete pcoption->u.enumerator.support_names;
4692 pcoption->u.enumerator.support_names =
nullptr;
4695 delete pcoption->u.enumerator.pretty_names;
4696 pcoption->u.enumerator.pretty_names =
nullptr;
4701 delete pcoption->u.bitwise.support_names;
4702 pcoption->u.bitwise.support_names =
nullptr;
4704 delete pcoption->u.bitwise.pretty_names;
4705 pcoption->u.bitwise.pretty_names =
nullptr;
4717 settable_options->clear();
4718 dialog_options->clear();
4870 const char *tsn =
nullptr;
4872 switch (topology_id & (TF_ISO | TF_HEX)) {
4880 case TF_ISO | TF_HEX:
4898 if (opt ==
nullptr) {
4904 return val ==
nullptr || val[0] ==
'\0';
4922 log_debug(
"Setting tileset for square topologies.");
4930 log_debug(
"Setting tileset for hex topology.");
4937 log_debug(
"Setting tileset for isohex topology.");
const QVector< QString > * get_musicset_list(const struct option *poption)
Returns a static string vector of musicsets available on the system.
void audio_set_volume(double volume)
Set sound volume to use.
const QVector< QString > * get_soundset_list(const struct option *poption)
Returns a static string vector of soundsets available on the system.
const QVector< QString > * get_soundplugin_list(const struct option *poption)
Returns a static string vector of all sound plugins available on the system.
int send_chat_printf(const char *format,...)
Send the message as a chat to the server.
void output_window_append(const struct ft_color color, const char *featured_text)
Add a line of text to the output ("chatline") window, like puts() would do it in the console.
#define output_type_iterate(output)
#define output_type_iterate_end
static void option_changed(option *opt)
Called by the option code when the option has changed.
static const QVector< QString > * available_vector(const option *)
Returns the list of all available city bar styles.
enum client_states client_state()
Return current client state.
QUrl & client_url()
Returns the URL that this client connects to.
struct player * client_player()
Either controlling or observing.
void user_ended_turn()
Handle user ending his/her turn.
void events_init()
Initialize events.
void events_free()
Free events.
const struct ft_color ftc_client
static struct ft_color ft_color_construct(const char *foreground, const char *background)
void global_worklists_free()
Free the client global worklists.
void global_worklists_load(struct section_file *file)
Load all global worklist from a section file.
static bool static void void global_worklists_init()
Initialize the client global worklists.
void global_worklists_save(struct section_file *file)
Save all global worklist into a section file.
int cmafec_preset_num()
Returns the total number of presets.
const struct cm_parameter * cmafec_preset_get_parameter(int idx)
Returns the indexed preset's parameter.
void create_default_cma_presets()
Create default cma presets for a new user (or without configuration file)
char * cmafec_preset_get_descr(int idx)
Returns the indexed preset's description.
void cmafec_preset_add(const char *descr_name, const cm_parameter *pparam)
Adds a preset.
void gui_update_allfonts()
void options_extra_init()
Extra initializers for client options.
void gui_update_font(const QString &font_name, const QFont &font)
Updates a gui font style.
#define fc_assert_ret(condition)
constexpr auto LOG_VERBOSE
#define fc_assert(condition)
#define fc_assert_ret_msg(condition, message,...)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define FC_STATIC_ASSERT(cond, tag)
void update_turn_done_button_state()
Update the turn done button state.
bool can_end_turn()
Return TRUE iff client can end turn.
void start_style_music()
Start music suitable for current game situation.
void musicspec_reread_callback(struct option *poption)
Musicset changed in options.
void start_menu_music(const QString &tag, const QString &alt_tag)
Start menu music.
void stop_menu_music()
Stop menu music completely.
void stop_style_music()
Stop style music completely.
const char *const help_text
void option_dialog_popdown(const struct option_set *poptset)
Popdown the option dialog for the option set.
void option_gui_update(struct option *poption)
Update the GUI for the option.
static void options_init_names(const struct copt_val_name *(*acc)(int), QVector< QString > **support, QVector< QString > **pretty)
Initialize lists of names for a client option.
QHash< QString, QString > optionsHash
static const QVector< QString > * client_option_str_values(const struct option *poption)
Returns the possible string values of this client option of type OT_STRING.
void handle_server_setting_const(const struct packet_server_setting_const *packet)
Receive a server setting info packet.
void handle_server_setting_int(const struct packet_server_setting_int *packet)
Receive a integer server setting info packet.
static const QVector< QString > * server_option_enum_pretty(const struct option *poption)
Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of typ...
static int server_option_int_max(const struct option *poption)
Returns the maximal value for this server option of type OT_INTEGER.
unsigned option_bitwise_mask(const struct option *poption)
Returns the mask of this bitwise option.
void desired_settable_options_update()
Update the desired settable options hash table from the current setting configuration.
#define FIRST_MAJOR_MID_OPTION_FILE_NAME
static void allfont_changed_callback(struct option *poption)
Callback for font options.
static void desired_settable_option_send(struct option *poption)
Send the desired server options to the server.
static const char * client_option_name(const struct option *poption)
Returns the name of this client option.
static unsigned server_option_bitwise_def(const struct option *poption)
Returns the default value of this server option of type OT_BITWISE.
#define FIRST_MAJOR_NEW_OPTION_FILE_NAME
static void server_option_bitwise_support_base(const QVector< QString > *values, unsigned val, char *buf, size_t buf_len)
Compute the long support names of a value.
const char * option_str_def(const struct option *poption)
Returns the default value of this string option.
void option_changed(struct option *poption)
Force to use the option changed callback.
static void tileset_options_migrate_cimpletoon(struct client_options *options)
Migrate players using cimpletoon/toonhex to amplio2/hexemplio with the cimpletoon option enabled.
static void menu_music_enable_callback(struct option *poption)
Callback for music enabling option.
static bool options_fully_initialized
void options_free()
Free the option module.
static const struct option_str_vtable client_option_str_vtable
unsigned option_bitwise_def(const struct option *poption)
Returns the default value of this bitwise option.
int option_enum_str_to_int(const struct option *poption, const char *str)
Returns the value corresponding to the user-visible (translatable but not translated) string.
static const char * client_option_description(const struct option *poption)
Returns the description of this client option.
int option_int_min(const struct option *poption)
Returns the minimal value of this integer option.
static void message_options_save(struct section_file *file, const char *prefix)
Save the message options; use the function defined by specnum.h (see also events.h).
bool option_bool_def(const struct option *poption)
Returns the default value of this boolean option.
static struct option * client_option_next(const struct option *poption)
Returns the next valid option pointer for the current gui type.
static QFont client_option_font_get(const struct option *poption)
Returns the value of this client option of type OT_FONT.
static const char * server_option_name(const struct option *poption)
Returns the name of this server option.
void options_init()
Initialize the option module.
static void server_option_enum_support_name(const struct option *poption, QString *pvalue, QString *pdefault)
Returns the long support names of the values of the server option of type OT_ENUM.
const char * option_name(const struct option *poption)
Returns the name of the option.
static bool server_option_str_set(struct option *poption, const char *str)
Set the value of this server option of type OT_STRING.
static const char * server_optset_category_name(int category)
Returns the name (translated) of the server option category.
const struct option_set * server_optset
static void view_option_changed_callback(struct option *poption)
Callback for when any view option is changed.
const char * option_str_get(const struct option *poption)
Returns the current value of this string option.
static const char * server_option_description(const struct option *poption)
Returns the (translated) description of this server option.
static unsigned server_option_bitwise_get(const struct option *poption)
Returns the current value of this server option of type OT_BITWISE.
static bool client_option_is_changeable(const struct option *poption)
Returns TRUE if this client option can be modified.
static const char * client_option_enum_secfile_str(secfile_data_t data, int val)
Returns the "support" name of the value for this client option of type OT_ENUM (a string suitable for...
static int server_option_int_min(const struct option *poption)
Returns the minimal value for this server option of type OT_INTEGER.
static const char * client_optset_category_name(int category)
Returns the name (translated) of the option class.
static struct option * server_option_next(const struct option *poption)
Returns the next valid (visible) option pointer.
#define SERVER_OPTION(poption)
void options_dialogs_set()
This set the city and player report dialog options.
#define OLD_OPTION_FILE_NAME
static const QVector< QString > * server_option_bitwise_pretty(const struct option *poption)
Returns the user-visible, translatable (but untranslated) "pretty" names of this server option of typ...
static void settable_options_save(struct section_file *sf)
Save the desired server options.
static bool server_option_bool_get(const struct option *poption)
Returns the value of this server option of type OT_BOOLEAN.
bool option_reset(struct option *poption)
Set the option to its default value.
const QVector< QString > * option_str_values(const struct option *poption)
Returns the possible string values of this string option.
static void message_options_free()
Free resources allocated for message options system.
static const char * get_last_option_file_name(bool *allow_digital_boolean)
Check the last option file we saved.
static int server_option_enum_def(const struct option *poption)
Returns the default value of this server option of type OT_ENUM.
static int server_option_int_def(const struct option *poption)
Returns the default value of this server option of type OT_INTEGER.
static int client_option_int_min(const struct option *poption)
Returns the minimal value for this client option of type OT_INTEGER.
static int server_options_categories_num
static struct ft_color client_option_color_def(const struct option *poption)
Returns the default value of this client option of type OT_COLOR.
static bool server_option_enum_set(struct option *poption, int val)
Set the value of this server option of type OT_ENUM.
static void save_cma_presets(struct section_file *file)
Insert all cma presets.
struct ft_color option_color_get(const struct option *poption)
Returns the current value of this color option.
client_options * gui_options
static int client_option_int_get(const struct option *poption)
Returns the value of this client option of type OT_INTEGER.
static char ** server_options_categories
Server options variables.
int option_enum_get_int(const struct option *poption)
Returns the current value of this enum option (as an integer).
static void settable_options_load(struct section_file *sf)
Load the server options.
void options_dialogs_update()
This set the city and player report dialog options to the current ones.
const char *const TILESET_OPTIONS_PREFIX
int option_number(const struct option *poption)
Returns the number of the option.
static void tileset_options_load(struct section_file *sf, struct client_options *options)
Load tileset options.
static struct server_option * server_options
static const struct option_int_vtable server_option_int_vtable
static void options_dialogs_save(struct section_file *sf)
Save the city and player report dialog options.
#define GEN_STR_OPTION(oname, odesc, ohelp, ocat, odef, ocb, cbd)
static struct option_set client_optset_static
static int client_optset_category_number()
Returns the number of client option categories.
static bool client_option_color_set(struct option *poption, struct ft_color color)
Set the value of this client option of type OT_COLOR.
static struct client_option * client_option_next_valid(struct client_option *poption)
Returns the next valid option pointer for the current gui type.
static void save_cma_preset(struct section_file *file, int i)
Does heavy lifting for inserting a preset.
static const char * client_option_str_def(const struct option *poption)
Returns the default value of this client option of type OT_STRING.
void server_options_free()
Free the server options, if already received.
void handle_server_setting_bitwise(const struct packet_server_setting_bitwise *packet)
Receive a bitwise server setting info packet.
static const struct option_font_vtable client_option_font_vtable
void desired_settable_option_update(const char *op_name, const char *op_value, bool allow_replace)
Update a desired settable option in the hash table from a value which can be different of the current...
#define GEN_INT_OPTION(oname, odesc, ohelp, ocat, odef, omin, omax, ocb)
struct option * option_next(const struct option *poption)
Returns the next option or nullptr if this is the last.
static void tileset_options_save(struct section_file *sf, const struct client_options *options)
Save tileset options.
#define GEN_FONT_OPTION(oname, otgt, odesc, ohelp, ocat, ocb)
QString option_font_target(const struct option *poption)
Returns the target style name of this font option.
bool option_str_set(struct option *poption, const char *str)
Sets the value of this string option.
void handle_server_setting_bool(const struct packet_server_setting_bool *packet)
Receive a boolean server setting info packet.
const struct option_set * client_optset
static const struct option_bool_vtable server_option_bool_vtable
static const struct option_bitwise_vtable server_option_bitwise_vtable
#define GEN_COLOR_OPTION(oname, odesc, ohelp, ocat, odef_fg, odef_bg, ocb)
static const char * client_option_help_text(const struct option *poption)
Returns the help text for this client option.
struct option * optset_option_first(const struct option_set *poptset)
Returns the first option of this option set.
static const QVector< QString > * server_option_str_values(const struct option *poption)
Returns the possible string values of this server option of type OT_STRING.
static int client_option_number(const struct option *poption)
Virtuals tables for the client options.
void handle_server_setting_str(const struct packet_server_setting_str *packet)
Receive a string server setting info packet.
int option_int_get(const struct option *poption)
Returns the current value of this integer option.
static void client_option_save(struct option *poption, struct section_file *sf)
Save the option to a file.
bool option_font_set(struct option *poption, const QFont &font)
Sets the value of this font option.
static int client_option_int_def(const struct option *poption)
Returns the default value of this client option of type OT_INTEGER.
const char * optset_category_name(const struct option_set *poptset, int category)
Returns the name (translated) of the category of this option set.
static int server_option_category(const struct option *poption)
Returns the category of this server option.
#define FIRST_MINOR_MID_OPTION_FILE_NAME
static const struct option_str_vtable server_option_str_vtable
static int server_options_num
#define handle_server_setting_common(psoption, packet)
Common part of handle_server_setting_*() functions.
static const struct option_color_vtable client_option_color_vtable
struct option * optset_option_by_name(const struct option_set *poptset, const char *name)
Returns the option corresponding of the name in this option set.
static void server_option_bitwise_support_name(const struct option *poption, char *val_buf, size_t val_len, char *def_buf, size_t def_len)
Compute the long support names of the values of the server option of type OT_BITWISE.
bool option_color_set(struct option *poption, struct ft_color color)
Sets the value of this color option.
#define SETTING_CASE(ARG_name,...)
QString option_enum_int_to_str(const struct option *poption, int val)
Returns the user-visible (translatable but not translated) string corresponding to the value.
#define MAJOR_NEW_OPTION_FILE_NAME
static bool is_ts_option_unset(const char *optname)
Does topology-specific tileset option lack value?
void option_set_changed_callback(struct option *poption, void(*callback)(struct option *))
Set the function to call every time this option changes.
const QVector< QString > * option_bitwise_values(const struct option *poption)
Returns a vector of strings describing every bit of this option, as user-visible (translatable but no...
static bool server_option_bool_set(struct option *poption, bool val)
Set the value of this server option of type OT_BOOLEAN.
bool option_bool_set(struct option *poption, bool val)
Sets the value of this boolean option.
bool option_is_changeable(const struct option *poption)
Returns TRUE if this option can be modified.
static int server_option_number(const struct option *poption)
Virtuals tables for the client options.
#define FIRST_MINOR_NEW_BOOLEAN
static const char * server_option_str_get(const struct option *poption)
Returns the value of this server option of type OT_STRING.
static struct option * server_optset_option_first()
Returns the first valid (visible) option pointer.
void option_set_gui_data(struct option *poption, void *data)
Set the gui data for this option.
#define FIRST_MINOR_NEW_OPTION_FILE_NAME
static bool client_option_bool_get(const struct option *poption)
Returns the value of this client option of type OT_BOOLEAN.
const char * option_description(const struct option *poption)
Returns the description (translated) of the option.
static const char * server_option_str_def(const struct option *poption)
Returns the default value of this server option of type OT_STRING.
static const struct option_common_vtable client_option_common_vtable
static bool settable_option_upgrade_value(const struct option *poption, int old_value, char *buf, size_t buf_len)
Convert old integer to new values (Freeciv 2.2.x to Freeciv 2.3.x).
static void sound_volume_callback(struct option *poption)
Callback for changing music volume.
bool option_enum_set_int(struct option *poption, int val)
Sets the value of this enum option.
bool option_bool_get(const struct option *poption)
Returns the current value of this boolean option.
#define color_set(color_tgt, color)
static bool client_option_bool_def(const struct option *poption)
Returns the default value of this client option of type OT_BOOLEAN.
enum option_type option_type(const struct option *poption)
Returns the type of the option.
static const char * get_current_option_file_name()
Returns pointer to static memory containing name of the current option file.
int option_get_cb_data(const struct option *poption)
Returns the callback data of this option.
static void options_dialogs_load(struct section_file *sf)
Load the city and player report dialog options.
static int server_option_enum_get(const struct option *poption)
Returns the current value of this server option of type OT_ENUM.
QHash< QString, intptr_t > dialOptionsHash
struct option * optset_option_by_number(const struct option_set *poptset, int id)
Returns the option corresponding of the number in this option set.
static struct option * client_optset_option_by_number(int id)
Client option set.
static void font_changed_callback(struct option *poption)
Callback for font options.
void option_font_set_default(const struct option *poption, const QFont &font)
Returns the default value of this font option.
int option_int_max(const struct option *poption)
Returns the maximal value of this integer option.
static const char * client_option_bitwise_secfile_str(secfile_data_t data, int val)
Returns the "support" name of a single value for this client option of type OT_BITWISE (a string suit...
static void option_save_output_window_callback(QtMsgType lvl, const QString &msg)
Write messages from option saving to the output window.
static const char * client_option_str_get(const struct option *poption)
Returns the value of this client option of type OT_STRING.
QString option_category_name(const struct option *poption)
Returns the name (translated) of the category of the option.
static const struct option_common_vtable server_option_common_vtable
static bool client_option_bool_set(struct option *poption, bool val)
Set the value of this client option of type OT_BOOLEAN.
static const char * server_option_help_text(const struct option *poption)
Returns the (translated) help text for this server option.
static const struct option_bool_vtable client_option_bool_vtable
void fill_topo_ts_default()
Fill default tilesets for topology-specific settings.
static bool client_option_load(struct option *poption, struct section_file *sf)
Load the option from a file.
static QFont client_option_font_def(const struct option *poption)
Returns the default value of this client option of type OT_FONT.
static bool server_option_bitwise_set(struct option *poption, unsigned val)
Set the value of this server option of type OT_BITWISE.
#define GEN_BOOL_OPTION(oname, odesc, ohelp, ocat, odef, ocb)
#define MINOR_NEW_OPTION_FILE_NAME
static struct server_option * server_option_next_valid(struct server_option *poption)
Returns the next valid option pointer for the current gui type.
static void voteinfo_bar_callback(struct option *poption)
Callback for when any voteinfo bar option is changed.
static struct option * server_optset_option_by_number(int id)
Server option set.
void * option_get_gui_data(const struct option *poption)
Returns the gui data of this option.
void options_save(option_save_log_callback log_cb)
Save all options.
static bool client_option_font_set(struct option *poption, const QFont &font)
Set the value of this client option of type OT_FONT.
static void init_client_options()
static const struct option_enum_vtable server_option_enum_vtable
static std::vector< client_option > client_options
static bool server_option_int_set(struct option *poption, int val)
Set the value of this server option of type OT_INTEGER.
int messages_where[E_COUNT]
Message Options:
static void message_options_load(struct section_file *file, const char *prefix)
Load the message options; use the function defined by specnum.h (see also events.h).
QFont option_font_get(const struct option *poption)
Returns the current value of this font option.
static void message_options_init()
These could be a static table initialisation, except its easier to do it this way.
static void server_option_free(struct server_option *poption)
Free one server option.
static void client_option_font_set_def(const struct option *poption, const QFont &font)
Returns the default value of this client option of type OT_FONT.
#define CLIENT_OPTION(poption)
static struct option * client_optset_option_first()
Returns the first valid option pointer for the current gui type.
static struct option_set server_optset_static
void handle_server_setting_control(const struct packet_server_setting_control *packet)
Allocate the server options and categories.
void options_load()
Load from the rc file any options that are not ruleset specific.
bool option_bitwise_set(struct option *poption, unsigned val)
Sets the value of this bitwise option.
QString option_help_text(const struct option *poption)
Returns the help text (translated) of the option.
static int server_option_int_get(const struct option *poption)
Returns the value of this server option of type OT_INTEGER.
static void manual_turn_done_callback(struct option *poption)
Callback for when ai_manual_turn_done is changed.
const char * tileset_name_for_topology(int topology_id)
Option framework wrapper for mapimg_get_format_list()
static void reqtree_show_icons_callback(struct option *poption)
Enumerator name accessors.
static void load_cma_preset(struct section_file *file, int i)
Does heavy lifting for looking up a preset.
static bool client_option_str_set(struct option *poption, const char *str)
Set the value of this client option of type OT_STRING.
void handle_server_setting_enum(const struct packet_server_setting_enum *packet)
Receive an enumerator server setting info packet.
struct ft_color option_color_def(const struct option *poption)
Returns the default value of this color option.
static int client_option_int_max(const struct option *poption)
Returns the maximal value for this client option of type OT_INTEGER.
static int server_optset_category_number()
Returns the number of server option categories.
unsigned option_bitwise_get(const struct option *poption)
Returns the current value of this bitwise option.
static bool server_option_is_changeable(const struct option *poption)
Returns TRUE if this client option can be modified.
static struct ft_color client_option_color_get(const struct option *poption)
Returns the value of this client option of type OT_COLOR.
int option_enum_def_int(const struct option *poption)
Returns the default value of this enum option (as an integer).
static bool client_option_int_set(struct option *poption, int val)
Set the value of this client option of type OT_INTEGER.
bool option_int_set(struct option *poption, int val)
Sets the value of this integer option.
QFont option_font_def(const struct option *poption)
Returns the default value of this font option.
void server_options_init()
Initialize the server options (not received yet).
static const struct option_int_vtable client_option_int_vtable
const struct option_set * option_optset(const struct option *poption)
Returns the option set owner of this option.
#define GEN_STR_LIST_OPTION(oname, odesc, ohelp, ocat, odef, oacc, ocb, cbd)
static void game_music_enable_callback(struct option *poption)
Callback for mapimg options.
int option_int_def(const struct option *poption)
Returns the default value of this integer option.
static QString client_option_font_target(const struct option *poption)
Returns the default value of this client option of type OT_FONT.
static bool server_option_bool_def(const struct option *poption)
Returns the default value of this server option of type OT_BOOLEAN.
#define FC_QT_DEFAULT_THEME_NAME
#define options_iterate(poptset, poption)
#define DEFAULT_METASERVER_OPTION
void(* option_save_log_callback)(QtMsgType lvl, const QString &msg)
#define options_iterate_end
@ OLAYER_BORDERS_ON_OCEAN
void overview_redraw_callback(struct option *option)
Callback to be called when an overview option is changed.
struct section_file * secfile_load(const QString &filename, bool allow_duplicates)
Create a section file from a file.
const char * secfile_error()
Returns the last error which occurred in a string.
struct section_file * secfile_new(bool allow_duplicates)
Create a new empty section file.
void secfile_allow_digital_boolean(struct section_file *secfile, bool allow_digital_boolean)
Set if we could consider values 0 and 1 as boolean.
const char * section_name(const struct section *psection)
Returns the section name.
void secfile_destroy(struct section_file *secfile)
Free a section file.
bool secfile_save(const struct section_file *secfile, QString filename)
Save the previously filled in section_file to disk.
bool entry_bool_get(const struct entry *pentry, bool *value)
Gets an boolean value.
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
Lookup a integer value in the secfile.
bool secfile_lookup_enum_data(const struct section_file *secfile, int *pvalue, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *path,...)
Lookup a value saved as string in the secfile.
const char * entry_name(const struct entry *pentry)
Returns the name of this entry.
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
Lookup a string value in the secfile.
bool entry_str_get(const struct entry *pentry, const char **value)
Gets an string value.
const char * secfile_name(const struct section_file *secfile)
Return the filename the section file was loaded as, or "(anonymous)" if this sectionfile was created ...
struct section * secfile_section_by_name(const struct section_file *secfile, const QString &name)
Returns the first section matching the name.
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
Lookup a boolean value in the secfile.
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
Lookup a string value in the secfile.
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
Lookup a integer value in the secfile.
bool entry_int_get(const struct entry *pentry, int *value)
Gets an integer value.
struct section_list * secfile_sections_by_name_prefix(const struct section_file *secfile, const char *prefix)
Returns the list of sections which match the name prefix.
const struct entry_list * section_entries(const struct section *psection)
Returns a list containing all the entries.
bool secfile_lookup_bool(const struct section_file *secfile, bool *bval, const char *path,...)
Lookup a boolean value in the secfile.
enum entry_type entry_type_get(const struct entry *pentry)
Returns the type of this entry or ENTRY_ILLEGAL or error.
#define secfile_insert_int(secfile, value, path,...)
#define secfile_insert_bool_comment(secfile, value, comment, path,...)
#define section_list_iterate(seclist, psection)
#define entry_list_iterate_end
#define secfile_insert_str(secfile, string, path,...)
#define secfile_insert_bool(secfile, value, path,...)
#define section_list_iterate_end
#define entry_list_iterate(entlist, pentry)
#define secfile_insert_enum_data(secfile, value, bitwise, name_fn, data, path,...)
#define secfile_insert_int_comment(secfile, value, comment, path,...)
const void * secfile_data_t
void science_report_dialog_redraw(void)
Resize and redraw the requirement tree.
Q_GLOBAL_STATIC(QVector< QString >, future_name_translation)
static struct setting settings[]
bool str_to_int(const char *str, int *pint)
Convert 'str' to it's int reprentation if possible.
bool make_dir(const QString &pathname)
If the directory "pathname" does not exist, recursively create all directories until it does.
QString freeciv_storage_dir()
Returns string which gives freeciv storage dir.
Derived class client option, inherinting of base class option.
QVector< QString > * support_names
struct client_option::@126::@130 enumerator
struct client_option::@126::@129 string
struct client_option::@126::@128 integer
struct client_option::@126::@131 bitwise
struct client_option::@126::@133 color
struct option base_option
struct client_option::@126::@132 font
struct client_option::@126 u
struct client_option::@126::@127 boolean
enum client_option_category category
QVector< QString > * pretty_names
int gui_qt_increase_fonts
bool sound_enable_menu_music
char default_tileset_hex_name[512]
std::map< QString, std::map< QString, bool > > tileset_options
Saved tileset options.
char default_tileset_iso_name[512]
char default_tileset_overhead_name[512]
char default_tileset_square_name[512]
bool save_options_on_exit
int smooth_combat_step_msec
bool first_boot
Migrations.
char default_tileset_isohex_name[512]
char default_city_bar_style_name[512]
bool sound_enable_game_music
char default_user_name[512]
int minimal_surplus[O_LAST]
bool(* set)(struct option *, unsigned)
unsigned(* get)(const struct option *)
const QVector< QString > *(* values)(const struct option *)
unsigned(* def)(const struct option *)
bool(* set)(struct option *, bool)
bool(* def)(const struct option *)
bool(* get)(const struct option *)
bool(* set)(struct option *, struct ft_color)
struct ft_color(* def)(const struct option *)
struct ft_color(* get)(const struct option *)
const char *(* name)(const struct option *)
struct option *(* next)(const struct option *)
const char *(* help_text)(const struct option *)
bool(* is_changeable)(const struct option *)
int(* number)(const struct option *)
int(* category)(const struct option *)
const char *(* description)(const struct option *)
bool(* set)(struct option *, int)
int(* cmp)(const char *, const char *)
int(* def)(const struct option *)
int(* get)(const struct option *)
const QVector< QString > *(* values)(const struct option *)
QFont(* def)(const struct option *)
QFont(* get)(const struct option *)
QString(* target)(const struct option *)
void(* set_def)(const struct option *, const QFont &font)
bool(* set)(struct option *, const QFont &)
int(* maximum)(const struct option *)
int(* get)(const struct option *)
bool(* set)(struct option *, int)
int(* def)(const struct option *)
int(* minimum)(const struct option *)
const char *(* category_name)(int)
struct option *(* option_by_number)(int)
struct option *(* option_first)()
const char *(* def)(const struct option *)
const char *(* get)(const struct option *)
bool(* set)(struct option *, const char *)
const QVector< QString > *(* values)(const struct option *)
The base class for options.
const struct option_str_vtable * str_vtable
const struct option_set * poptset
const struct option_common_vtable * common_vtable
const struct option_font_vtable * font_vtable
const struct option_enum_vtable * enum_vtable
const struct option_bool_vtable * bool_vtable
const struct option_color_vtable * color_vtable
const struct option_bitwise_vtable * bitwise_vtable
void(* changed_callback)(struct option *option)
const struct option_int_vtable * int_vtable
bool layers[OLAYER_COUNT]
bool allow_digital_boolean
Derived class server option, inheriting from base class option.
struct server_option::@134::@140 bitwise
QVector< QString > * pretty_names
struct server_option::@134::@139 enumerator
QVector< QString > * support_names
struct server_option::@134::@137 integer
struct server_option::@134::@138 string
enum setting_default_level setdef
struct server_option::@134::@136 boolean
struct option base_option
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
size_t fc_strlcpy(char *dest, const char *src, size_t n)
fc_strlcpy() provides utf-8 version of (non-standard) function strlcpy() It is intended as more user-...
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.
size_t fc_strlcat(char *dest, const char *src, size_t n)
fc_strlcat() provides utf-8 version of (non-standard) function strlcat() It is intended as more user-...
int fc_stat(const char *filename, struct stat *buf)
Wrapper function for stat() with filename conversion to local encoding on Windows.
#define sz_strlcpy(dest, src)
void theme_reread_callback(struct option *poption)
Wrapper for load_theme.
const QVector< QString > * get_themes_list(const struct option *poption)
Return a static string vector of useable theme names.
const char * tileset_basename(const struct tileset *t)
Return the name of the given tileset.
const QVector< QString > * get_tileset_list(const struct option *poption)
Returns a static list of tilesets available on the system by searching all data directories for files...
void tilespec_reread_callback(struct option *poption)
This is merely a wrapper for tilespec_reread (above) for use in options.c and the client local option...
bool tilespec_try_read(const QString &tileset_name, bool verbose, int topo_id)
Read a new tilespec in when first starting the game.
const char * freeciv21_version()
Returns the raw version string.
const char * city_report_spec_tagname(int i)
Simple wrapper for city_report_specs.tagname.
int num_city_report_spec()
Simple wrapper for num_creport_cols()
bool * city_report_spec_show_ptr(int i)
Simple wrapper for city_report_specs.show.
void update_map_canvas_visible()
Schedules an update of (only) the visible part of the map at the next unqueue_mapview_update().
struct player_dlg_column player_dlg_columns[]
...
const int num_player_dlg_columns
void voteinfo_gui_update(void)
Refresh all vote related GUI widgets.