# Count Of List Items

Grammar — Count of list items of list for player
FlagsNative | Function

Returns the count of list items in the dialog item. Only works with dialog items that have lists, such as pulldowns or list boxes.

# Arguments

  • int<control> — List
  • int — Player

Returns — int

native int DialogControlGetItemCount(
	int control,
	int player,
);

Category: Dialog / Dialog Item Values

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:2186

    // Implementation
    DialogControlRemoveAllItems(libUIUI_gv_uIDebugPanel.lv_mountVariationDropdown, libCore_gv_playerGroupFromPlayer[lp_player]);
    if ((DialogControlGetItemCount(libUIUI_gv_uIDebugPanel.lv_mountBaseDropdown, lp_player) <= 0)) {
        return ;
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:10757

    lv_listIndexLeft = DialogControlGetSelectedItem(libUIUI_gv_uIDebugPanel.lv_soundVOList, lv_triggeringPlayer);
    lv_listRight = libUIUI_gv_uIDebugPanel.lv_soundVOPlayList;
    lv_listCountRight = DialogControlGetItemCount(lv_listRight, lv_triggeringPlayer);

    // Conditions

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:10871

    lv_soundID = DataTableGetString(true, ("DEBUG_AnnouncerVOSoundLink_Player_" + IntToString(lv_triggeringPlayer) + "_ListIndex_" + IntToString(lv_listIndexLeft) + "_SoundID"));
    DialogControlAddItem(lv_listRight, PlayerGroupSingle(lv_triggeringPlayer), StringToText(lv_soundID));
    DataTableSetString(true, ("DEBUG_SoundVOPlayBox_Player_" + IntToString(lv_triggeringPlayer) + "_ListIndex_" + IntToString(DialogControlGetItemCount(lv_listRight, lv_triggeringPlayer)) + "_SoundID"), lv_soundID);
    return true;
}