mirror of
https://github.com/pandorabox-io/banners.git
synced 2025-01-06 16:10:32 +01:00
parent
b1ff0eb558
commit
78be1611c3
13
init.lua
13
init.lua
@ -29,6 +29,16 @@ banners.masks = {
|
||||
"star_chevron", "checkered_8_4", "checkered_16_8"
|
||||
}
|
||||
|
||||
-- The amount of transformations needs to be capped somewhere
|
||||
-- to avoid crashing server.
|
||||
-- It doesn't make sense to have any one mask multiple times
|
||||
-- but users normally don't follow strict logic when being
|
||||
-- creative, so we give them plenty of space to work with.
|
||||
-- A better approach would be to strip duplicates and to
|
||||
-- drop all previous masks if a full background is dropped
|
||||
-- on top of other masks.
|
||||
banners.max_transformations = #banners.masks * #banners.masks
|
||||
|
||||
banners.colors = {
|
||||
"black", "cyan", "green", "white",
|
||||
"blue", "darkblue", "red", "yellow",
|
||||
@ -134,6 +144,9 @@ function banners.Banner:new(banner)
|
||||
end
|
||||
function banners.Banner.push_transform(self, transform)
|
||||
table.insert(self.transforms, transform)
|
||||
if #self.transforms > banners.max_transformations then
|
||||
table.remove(self.transforms, 1)
|
||||
end
|
||||
end
|
||||
function banners.Banner.pop_transform(self)
|
||||
table.remove(self.transforms)
|
||||
|
Loading…
Reference in New Issue
Block a user