mirror of
https://github.com/pandorabox-io/banners.git
synced 2025-01-08 00:50:32 +01:00
oopsie fixes
This commit is contained in:
parent
4178bd1501
commit
143e549ff9
11
init.lua
11
init.lua
@ -165,7 +165,7 @@ banners.creation_form = smartfs.create("banners:banner_creation",
|
|||||||
banners.creation_form_func)
|
banners.creation_form_func)
|
||||||
|
|
||||||
function banners.transform_string_to_table(transform_string)
|
function banners.transform_string_to_table(transform_string)
|
||||||
p('transform_string_to_table')
|
local mask, parts, texture
|
||||||
local transforms = {}
|
local transforms = {}
|
||||||
for part in transform_string:gmatch("%(([^%)]+)%)") do
|
for part in transform_string:gmatch("%(([^%)]+)%)") do
|
||||||
parts = part:split("^[")
|
parts = part:split("^[")
|
||||||
@ -184,13 +184,13 @@ p('transform_string_to_table')
|
|||||||
end
|
end
|
||||||
|
|
||||||
function banners.transform_table_to_string(transforms)
|
function banners.transform_table_to_string(transforms)
|
||||||
|
local i = #transforms
|
||||||
|
if 0 == i then return "" end
|
||||||
|
|
||||||
local final = {}
|
local final = {}
|
||||||
local used = {}
|
local used = {}
|
||||||
local transform
|
local transform
|
||||||
-- work backwards to keep resulting data small
|
-- work backwards to keep resulting data small
|
||||||
local i = #transforms
|
|
||||||
if 0 == i then return "" end
|
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
transform = transforms[i]
|
transform = transforms[i]
|
||||||
-- duplicate mask can be trimmed out only use most recent
|
-- duplicate mask can be trimmed out only use most recent
|
||||||
@ -213,7 +213,7 @@ banners.Banner = {}
|
|||||||
|
|
||||||
function banners.Banner:new(banner)
|
function banners.Banner:new(banner)
|
||||||
p('new')
|
p('new')
|
||||||
banner = banner or { color = "bg_pink.png", transforms = {} }
|
banner = banner or { color = "bg_black.png", transforms = {} }
|
||||||
setmetatable(banner, self)
|
setmetatable(banner, self)
|
||||||
self.__index = self
|
self.__index = self
|
||||||
return banner
|
return banner
|
||||||
@ -239,7 +239,6 @@ function banners.Banner:read_item(player_name)
|
|||||||
local item = player:get_wielded_item()
|
local item = player:get_wielded_item()
|
||||||
if "banners:" ~= item:get_name():sub(1, 8) then return end
|
if "banners:" ~= item:get_name():sub(1, 8) then return end
|
||||||
|
|
||||||
local parts, mask, texture
|
|
||||||
local transforms = banners.transform_string_to_table(
|
local transforms = banners.transform_string_to_table(
|
||||||
item:get_meta():get_string(""))
|
item:get_meta():get_string(""))
|
||||||
local total = #transforms
|
local total = #transforms
|
||||||
|
Loading…
Reference in New Issue
Block a user