Keywords.tbl

From FreeSpace Wiki
Revision as of 22:43, 27 August 2024 by Naomimyselfandi (talk | contribs)
Jump to: navigation, search
This feature requires FreeSpace Open
List of Tables and related code files
* Notes Modular Tables
** Notes tables which only use modular tables
Ai.tbl* /ai/aicode.cpp
Ai_profiles.tbl* /ai/ai_profiles.cpp
Animation.tbl** /model/modelanimation.cpp
Armor.tbl* /ship/ship.cpp
Asteroid.tbl* /asteroid/asteroid.cpp
Autopilot.tbl* /autopilot/autopilot.cpp
Cheats.tbl* /cheats_table/cheats_table.cpp
Colors.tbl* /globalincs/alphacolors.cpp
Curves.tbl* /math/curves.cpp
Controlconfigdefaults.tbl /controlconfig/controlsconfigcommon.cpp
Credits.tbl* /menuui/credits.cpp
Cutscenes.tbl* /cutscene/cutscenes.cpp
Decals.tbl** /decals/decals.cpp
Fireball.tbl* /fireball/fireballs.cpp
Fonts.tbl* /graphics/font.cpp
Game_settings.tbl* /mod_table/mod_table.cpp
Glowpoints.tbl* /model/modelread.cpp
Help.tbl* /gamehelp/contexthelp.cpp
Hud_gauges.tbl* /hud/hudparse.cpp
Icons.tbl* /mission/missionbriefcommon.cpp
Iff_defs.tbl* /iff_defs/iff_defs.cpp
Lighting_Profiles.tbl* /lighting/lighting_profiles.cpp
Lightning.tbl* /nebula/neblightning.cpp
Mainhall.tbl* /menuui/mainhallmenu.cpp
Medals.tbl* /stats/medals.cpp
Messages.tbl* /mission/missionmessage.cpp
Mflash.tbl* /weapon/muzzleflash.cpp
Music.tbl* /gamesnd/eventmusic.cpp
Nebula.tbl* /nebula/neb.cpp
Objecttypes.tbl* /ship/ship.cpp
Options.tbl* Not In Codebase
Particle effects(-part.tbm)** /particle/effects...
Post_processing.tbl /graphics/gropenglpostprocessing.cpp
Rank.tbl* /stats/scoring.cpp
Scpui.tbl* Not In Codebase
Scripting.tbl* /parse/scripting.cpp
Ships.tbl* /ship/ship.cpp
Sexps.tbl** /parse/sexp/sexp_lookup.cpp
Sounds.tbl* /gamesnd/gamesnd.cpp
Species_defs.tbl* /species_defs/species_defs.cpp
Species.tbl* /menuui/techmenu.cpp
Ssm.tbl* /hud/hudartillery.cpp
Stars.tbl* /starfield/starfield.cpp
Strings.tbl* /localization/localize.cpp
Tips.tbl* /menuui/playermenu.cpp
Traitor.tbl* /stats/scoring.cpp
Tstrings.tbl* /localization/localize.cpp
Virtual_pofs.tbl* /model/modelreplace.cpp
Weapon_expl.tbl* /weapon/weapons.cpp
Weapons.tbl* /weapon/weapons.cpp

Keywords.tbl is SCPUI's extension of the color tag system. It allows styling important words throughout the briefing UIs without having to use inline color tags (although they are supported, under a different syntax, for one-off words). Keywords can also be given tooltips.

Keyword matching is performed in briefings (including loop and red alert briefings), command briefings, debriefings, the fiction viewer, and campaign descriptions. It utilizes SCPUI's HTML support, so they must be put into HTML mode. Keyword matching is not performed inside preexisting HTML tags, allowing them to override keywords. <span class='green italic'>Iceni<$slashspan> will render as Iceni, even if "Iceni" is keyworded as red italics normally.

Keyword matching uses a system of prefixes and suffixes to provide flexibility. When a keyword is matched, if it follows one of its prefixes, is followed by one of its suffixes, or both, the prefix and/or suffix is treated as part of the keyword. Prefixes and suffixes can be separate, meaning they're their own word (or words), or separate, meaning that they're part of the word they attach to. An example of the former would be ship prefixes like GTD or SC. An example of the latter would be the English possessive marker "'s".

Prefixes and suffixes are usually defined per keyword, but may be defined globally as well.

Keywords.tbl can be extended with xxx-kwrd.tbm.

Keywords.tbl

  • Defines colors and tooltips for the briefing UIs throughout the SCPUI interface system.
  • Begins with #Default and ends with #End.
  • Translation support will be added soon™.

#Default

  • This section defines the basic keyword colors and tooltips.

+Prefix:

  • Define a globally-available separated prefix (see above).
  • Can be listed multiple times.
  • Syntax: string

+Immediate Prefix:

  • Define a globally-available immediate prefix (see above).
  • Can be listed multiple times
  • Syntax: string

+Suffix:

  • Define a globally-available separated suffix (see above).
  • Can be listed multiple times
  • Syntax: string

+Immediate Suffix:

  • Define a globally-available immediate suffix (see above).
  • Can be listed multiple times
  • In English, this is typically used for plurals (s, es) and possessives ('s).
  • Syntax: string

$Style

  • Begin defining a keyword, and define the CSS class(es) associated with it.
  • The string here should be a CSS class from common.rcss, or multiple such classes separated with spaces.
  • Syntax: string

+Prefix:

  • Define a separated prefix for this keyword (see above).
  • Can be listed multiple times.
  • An example would be GTD for a keyword representing a list of destroyers.
  • Syntax: string

+Immediate Prefix:

  • Define an immediate prefix for this keyword (see above).
  • Can be listed multiple times.
  • Syntax: string

+Suffix:

  • Define a separated suffix for this keyword (see above).
  • Can be listed multiple times.
  • Common examples include listing Roman numerals for planets orbiting a star, or digits after a wing name.
  • Syntax: string

+Immediate Suffix:

  • Define an immediate suffix for this keyword (see above).
  • Can be listed multiple times.
  • Syntax: string

+Text:

  • The actual keyword to apply this style to.
  • Can be listed multiple times.
  • There's no actual requirement that this be a single word - e.g. "Beta Aquilae" is perfectly valid.
  • Syntax: string
++Tooltip:
  • A tooltip to add to this specific keyword. Will show up if the mouse is hovered over the keyword.
  • This applies only to the previous +Text: entry.
  • Syntax: string

Example

#Default

; Possessive markers
+Immediate Suffix: '
+Immediate Suffix: 's

; Friendly wings, and specific ships within those wings, are blue.
$Style: blue
+Suffix: 1
+Suffix: 2
+Suffix: 3
+Suffix: 4
+Text: Alpha
+Text: Beta
+Text: Gamma
; Delta, Epsilon, etc. omitted for brevity

; Stars and planets are yellow.
$Style: yellow
+Suffix: I
+Suffix: II
+Suffix: III
+Suffix: IV
+Suffix: V
+Suffix: VI
+Suffix: VII
+Suffix: VIII
+Text: Antares
+Text: Beta Aquilae
+Text: Delta Serpentis

$Style: blue
+Text: RIO
++Tooltip: Radar Intercept Officer
+Text: SAR
++Tooltip: Search and Rescue
+Text: OrBat
++Tooltip: Order of Battle

$Style: blue
+Suffix: s
+Text: Terran
+Text: Vasudan

$Style: green italic
+Prefix: GTD
+Text: Amadeus
+Text: Bastion
+Text: Delacroix
+Text: Eisenhower
+Text: Galatea
+Text: Goliath
+Text: Intrepid
+Text: Krios
+Text: Legion
+Text: Malendroke
+Text: Minnow
+Text: Nereid
+Text: Soyakaze
+Text: Uhuru
+Text: Vienna
; "Intrepid", "Intrepid's", "GTD Intrepid", and "GTD Intrepid's" will all be green and italicized.

#end