from retail

This commit is contained in:
NoM0Re
2025-01-22 18:23:23 +01:00
parent 23c7da5ea6
commit 674ea9fe1e
10 changed files with 137 additions and 38 deletions
+2 -2
View File
@@ -91,7 +91,7 @@ local function formatValueForAssignment(vType, value, pathToCustomFunction, path
return tostring(value)
end
return "nil"
elseif (vType == "string") then
elseif (vType == "string" or vType == "texture") then
if type(value) == "string" then
return string.format("%s", Private.QuotedString(value))
end
@@ -154,7 +154,7 @@ local function formatValueForAssignment(vType, value, pathToCustomFunction, path
end
local function formatValueForCall(type, property)
if type == "bool" or type == "number" or type == "list" or type == "icon" or type == "string"
if type == "bool" or type == "number" or type == "list" or type == "icon" or type == "string" or type == "texture"
or type == "progressSource"
then
return "propertyChanges['" .. property .. "']";
+36
View File
@@ -84,6 +84,17 @@ local properties = {
type = "bool",
default = true,
},
tick_use_texture = {
display = L["Use Texture"],
setter = "SetUseTexture",
type = "bool",
default = true,
},
tick_texture = {
display = L["Texture"],
setter = "SetTexture",
type = "texture"
}
}
local function GetProperties(parentData, data)
@@ -408,6 +419,31 @@ local funcs = {
end
end
end,
UpdateTexture = function(self)
if self.use_texture then
for _, tick in ipairs(self.ticks) do
tick:SetTexture(tick, self.tick_texture)
end
else
for _, tick in ipairs(self.ticks) do
tick:SetTexture(self.tick_color[1], self.tick_color[2], self.tick_color[3], self.tick_color[4])
end
end
end,
SetTexture = function(self, texture)
if self.tick_texture == texture then
return
end
self.tick_texture = texture
self:UpdateTexture()
end,
SetUseTexture = function(self, use)
if self.use_texture == use then
return
end
self.use_texture = use
self:UpdateTexture()
end
}
local function modify(parent, region, parentData, data, first)