Skip to content

[CPLUS plus ex] Extra Info UI

DasKeifer edited this page Sep 30, 2026 · 1 revision

Extra Info UI

Hangar UI that shows icons for virtual skills and optionally earned pilot skills. Positioned relative to the back_1 pilot portrait image.

Hidden in missions and when no strategy pawn / portrait is available. Updates when selection or screen size changes.

See also Events and Hooks (ExtraInfoSelectedChanged) and Skill State (getVirtualSkills, getPilotEarnedSkillIndexes).

Hangar panel

A fixed size framed panel below the selected pilot portrait. It holds a horizontal row of outlined, scaled icons with tooltips.

  • Shown only in hangar/strategy UI. In mission is handled by traitReplace lib
  • Anchored to img/portraits/pilots/back_1.png draw position
  • Hidden when the selected pilot has no panel icons after rebuild

Content rebuild:

  1. Clears previous panel icons
  2. Collects virtual skill icons for the selected pilot
  3. Fires ExtraInfoSelectedChanged so mods can call ui:addIcon
  4. Builds UI for all collected icons; hides the panel if none

Virtual skill icons

For the selected pilot, CPLUS+ automatically adds icons for each virtual skill that has registered icon data:

  1. cplus_plus_ex:getVirtualSkills(pilot)
  2. cplus_plus_ex:getRegisteredSkillInfo(skillId)
  3. If skillInfo.icon is set, addIcon(icon, GetText(fullName), GetText(description))

Mods can append more icons in the same rebuild via onExtraInfoSelectedChanged.

Earned skill icons

When showPilotSkillIcons is enabled:

  1. Reads earned indexes from cplus_plus_ex:getPilotEarnedSkillIndexes(pilot) for slots 1-2
  2. Resolves each skill id via getRegisteredSkillInfo
  3. Places icons next to hangar skill name rows (offsets adjust if the pilot has no innate skill string)

These are separate widgets from the bottom panel; they do not use addIcon.

Table of Contents

onExtraInfoSelectedChanged

Event: cplus_plus_ex.events.onExtraInfoSelectedChanged:subscribe(callback)
Hook: cplus_plus_ex:addExtraInfoSelectedChangedHook(callback)

Fired when the extra info panel is rebuilt for the selected hangar pawn (selection change or screen size change).

Arguments

Argument name Type Description
ui table Extra info UI object; call ui:addIcon(...) to add icons
pawn BoardPawn Vanilla pawn of the selected strategy pawn
pilot Pilot memhack Pilot for that pawn

Example

cplus_plus_ex.events.onExtraInfoSelectedChanged:subscribe(function(ui, pawn, pilot)
    if not pilot then
        return
    end
    ui:addIcon(
        "img/combat/icons/icon_my_mod.png",
        "My Extra Info",
        "Shown in the hangar panel for this pilot."
    )
end)

ui:addIcon

  • ui:addIcon(icon, title, description)
Argument name Type Description
icon string Path to icon image
title string Tooltip title
description string Tooltip description

Adds an icon to the virtual skills / extra info panel for the current rebuild. All three arguments are required; missing any skips the icon.

Tooltip text is title .. "\n\n" .. description.

Call only from an ExtraInfoSelectedChanged handler (or during the same rebuild path). Icons are cleared at the start of each rebuild.

Example:

cplus_plus_ex:addExtraInfoSelectedChangedHook(function(ui, pawn, pilot)
    ui:addIcon("img/combat/icons/icon_Pilot_Health.png", "Bonus", "Custom hangar tip")
end)

showPilotSkillIcons

Mod Content generation option: "Show Pilot Skill Icons" (showPilotSkillIcons, default enabled).

Stored at runtime as:

cplus_plus_ex.config_options.showPilotSkillIcons  -- boolean

When true, earned skill icons are drawn next to pilot skill names in the hangar. When false, earned icons are hidden. Does not affect the virtual skills / extra info panel.

Clone this wiki locally