diff --git a/UniversalAutoloadInstaller.lua b/UniversalAutoloadInstaller.lua index 071e6f9..00b6177 100644 --- a/UniversalAutoloadInstaller.lua +++ b/UniversalAutoloadInstaller.lua @@ -1453,55 +1453,12 @@ function UniversalAutoloadManager.handleNewVehicleCreation(vehicle) print("CREATE SHOP VEHICLE: " .. vehicle:getFullName()) spec.isInsideShop = true UniversalAutoloadManager.shopVehicle = vehicle - -- configuration will be handled in onUpdate loop return configurationAdded elseif vehicle.propertyState == VehiclePropertyState.OWNED or vehicle.propertyState == VehiclePropertyState.LEASED then print("CREATE REAL VEHICLE: " .. vehicle:getFullName()) spec.isInsideShop = false - - -- local importVehicle = nil - -- if UniversalAutoloadManager.shopVehicle then - -- print("SHOP VEHICLE STILL EXISTS " .. UniversalAutoloadManager.shopVehicle.rootNode ) - -- importVehicle = UniversalAutoloadManager.shopVehicle - -- elseif UniversalAutoloadManager.lastShopVehicle then - -- print("WORKSHOP VEHICLE STILL EXISTS " .. UniversalAutoloadManager.lastShopVehicle.rootNode ) - -- importVehicle = UniversalAutoloadManager.lastShopVehicle - -- UniversalAutoloadManager.lastShopVehicle = nil - -- end - - -- local importSpec = importVehicle and importVehicle.spec_universalAutoload - -- if importSpec and UniversalAutoloadManager.shopConfig then - -- local configsMatch = spec.selectedConfigs == importSpec.selectedConfigs - -- local configNamesMatch = spec.useConfigName == nil or importSpec.useConfigName == nil or spec.useConfigName == importSpec.useConfigName - - -- if configsMatch and configNamesMatch then - - -- print("CLONE SETTINGS FROM SHOP VEHICLE") - -- if not importSpec.loadArea then - -- print("ERROR: importSpec.loadArea is nil") - -- return - -- end - - -- local importSpec = importVehicle.spec_universalAutoload - -- for k, v in pairs(UniversalAutoload.OPTIONS_DEFAULTS) do - -- local id = v.id - -- print(tostring(id) .. " = " .. tostring(importSpec[id])) - -- spec[id] = importSpec[id] - -- end - - -- spec.loadArea = {} - -- for i, loadArea in (importSpec.loadArea) do - -- spec.loadArea[i] = deepCopy(importSpec.loadArea[i]) - -- end - -- configurationAdded = true - - -- print("DEBUG: spec after cloning:") - -- DebugUtil.printTableRecursively(spec, " --", 0, 2) - -- end - -- end - return configurationAdded end end diff --git a/events/UpdateDefaultSettingsEvent.lua b/events/UpdateDefaultSettingsEvent.lua index 9f2bd73..3ee4e52 100644 --- a/events/UpdateDefaultSettingsEvent.lua +++ b/events/UpdateDefaultSettingsEvent.lua @@ -51,6 +51,7 @@ function UpdateDefaultSettingsEvent:readStream(streamId, connection) local selectedConfigs = streamReadString(streamId) print("selectedConfigs: " .. tostring(selectedConfigs)) local useConfigName = streamReadString(streamId) + useConfigName = useConfigName ~= "" and useConfigName or nil print("useConfigName: " .. tostring(useConfigName)) local config = {} @@ -110,7 +111,7 @@ function UpdateDefaultSettingsEvent:writeStream(streamId, connection) print("selectedConfigs: " .. tostring(self.selectedConfigs)) streamWriteString(streamId, self.selectedConfigs) print("useConfigName: " .. tostring(spec.useConfigName)) - streamWriteString(streamId, spec.useConfigName) + streamWriteString(streamId, spec.useConfigName or "") print("options:") iterateDefaultsTable(UniversalAutoload.OPTIONS_DEFAULTS, "", ".options", spec, sendValues) diff --git a/modDesc.xml b/modDesc.xml index bed7f16..8c756b5 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -2,7 +2,7 @@ loki_79 - 0.3.0.0 + 0.3.0.1 <en>Universal Autoload</en> diff --git a/scripts/LoadingVolume.lua b/scripts/LoadingVolume.lua index 1a1d828..cbc64b3 100644 --- a/scripts/LoadingVolume.lua +++ b/scripts/LoadingVolume.lua @@ -151,7 +151,9 @@ function LoadingVolume:draw(drawAll) drawDebugPoint(p[1], p[2], p[3], r, g, b, a, solid) end - + + local size = bb:getSize() + renderText(0.4, 0.92-(n*0.035), 0.025, string.format("[%d] W, H, L = %.3f, %.3f, %.3f", n, size.x, size.y, size.z)) end end end