-- Lampovo Project ^ω^ Average Enjoyer

MoreDesignConfigs = {}

-- Увеличиваем лимит конфигураций
ConfigurationUtil.SEND_NUM_BITS = 8

-- Добавление новых конфигураций design и designColor.
local function inj_vehicle_init()
    -- Предотвращает ошибку "Error: configuration name X is already in use!"
    local function configExists(name)
        return g_vehicleConfigurationManager:getConfigurationDescByName(name) ~= nil
    end

    -- Количество добавляемых конфигураций
    local targetCount = 64

    for i = 17, targetCount do
        local designKey = string.format("design%d", i)
        local colorKey = string.format("designColor%d", i)

        if not configExists(designKey) then
            g_vehicleConfigurationManager:addConfigurationType(designKey, g_i18n:getText("configuration_design"), nil, VehicleConfigurationItem)
        end

        if not configExists(colorKey) then
            g_vehicleConfigurationManager:addConfigurationType(colorKey, g_i18n:getText("configuration_designColor"), nil, VehicleConfigurationItemColor)
        end
    end
end

Vehicle.init = Utils.appendedFunction(Vehicle.init, inj_vehicle_init)