IMPORTANT
Status: Supported
Minimum version: 1.4
Weight progress bar
Overview
In actor_menu.xml, you can enable the weight row using the actor_weight_row container. Inside the row, there are two possible modes: a weight progress bar or a text weight value.
Full actor_weight_row logic
- The engine first searches for the
actor_weight_rownode. - If the node is found:
- it creates the weight row container
- it always creates
actor_weight_row:actor_weight_caption - it then checks
actor_weight_row:weight_status_bar
- If
weight_status_baris found:- it creates
CUIProgressBar - the progress bar is enabled and shown
- the text
actor_weight_row:actor_weightis not created
- it creates
- If
weight_status_baris not found:- it creates
actor_weight_row:actor_weightas a fallback
- it creates
- In both cases,
actor_weight_row:actor_weight_maxis always created. - If
actor_weight_rowis missing entirely, the engine falls back to the old layout and searches for root nodesactor_weight_caption,actor_weight,actor_weight_max.
Tooltip logic for weight_status_bar
- The tooltip works only if
weight_status_barexists. - The tooltip appears when the cursor hovers over the bar.
- There is a 700 ms delay before display after focus.
- If another hint is already open, the new one is not shown.
- The tooltip text contains:
- current total inventory weight
- maximum carry weight
- Tooltip position is chosen near the cursor within the screen bounds.
Ready XML
xml
<actor_weight_row x="810" y="736" width="210" height="16">
<actor_weight_caption x="0" y="0" width="71" height="16">
<text font="ui_font_arial_14" align="l" color="ui_1">ui_inv_weight</text>
</actor_weight_caption>
<weight_status_bar x="73" y="4" width="90" height="8" horz="1" min="0" max="100" pos="0">
<background><texture>ui_inGame2_hint_wnd_bar_16</texture></background>
<progress><texture a="180">ui_inGame2_hint_wnd_bar_alfa_line_16</texture></progress>
<color_less color="pda_green"/>
<color_more color="pda_red"/>
</weight_status_bar>
<actor_weight_max x="166" y="0" width="44" height="16">
<text font="ui_font_arial_14" align="r" color="ui_1"/>
</actor_weight_max>
</actor_weight_row>XML fallback without progress bar
xml
<actor_weight_row x="810" y="736" width="210" height="16">
<actor_weight_caption x="0" y="0" width="71" height="16">
<text font="ui_font_arial_14" align="l" color="ui_1">ui_inv_weight</text>
</actor_weight_caption>
<actor_weight x="73" y="0" width="44" height="16">
<text font="ui_font_arial_14" align="r" color="ui_1"/>
</actor_weight>
<actor_weight_max x="121" y="0" width="44" height="16">
<text font="ui_font_arial_14" align="r" color="ui_1"/>
</actor_weight_max>
</actor_weight_row>Usage
- Add the block to
configs/ui/actor_menu.xml. - For the progress bar mode, add
weight_status_barand checkminandmaxranges. - For text mode, do not add
weight_status_bar; leaveactor_weight. - Verify:
- normal display
- overload display
- tooltip on hover over the progress bar
Related material: UI overview.