Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On move support aka jumpdrive compat #9

Merged
merged 41 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c8012c7
whitespace and minetest. -> core.
SwissalpS Nov 27, 2024
51ec2a8
Update Readme: Minetest -> Luanti
SwissalpS Nov 27, 2024
3b3ea24
add luacheck
SwissalpS Nov 27, 2024
8d6b2f2
update optional depends
SwissalpS Nov 27, 2024
ae679a1
luacheck cleanups
SwissalpS Nov 27, 2024
7ff3dd0
clean close of file after reading
SwissalpS Nov 27, 2024
c8af7c7
avoid duplicate code
SwissalpS Nov 27, 2024
aa514d1
avoid error: "unknown global"
SwissalpS Nov 27, 2024
deb750a
stray whitespace fixups
SwissalpS Nov 27, 2024
c8a4801
whitespace: switch all files to same indent character
SwissalpS Nov 27, 2024
9c688d4
refactor weird declaration
SwissalpS Nov 28, 2024
2175d77
whitespace: two stray spaces
SwissalpS Nov 28, 2024
5cf1946
fix shaddowing global table
SwissalpS Nov 28, 2024
b1d63fd
reduce amount of times transformation string is calculated
SwissalpS Nov 28, 2024
b1ff0eb
use ipairs feature
SwissalpS Nov 28, 2024
78be161
cap max amount of layers
SwissalpS Nov 28, 2024
3d22f9b
fix #5 make transform history non-global
SwissalpS Nov 28, 2024
7e3a84e
minimize metadata size
SwissalpS Nov 28, 2024
dc9867f
add versioning
SwissalpS Nov 28, 2024
b99d10c
add recoverable per player history with saved colour
SwissalpS Nov 28, 2024
f2147ce
rename update_all -> update_preview_inv
SwissalpS Nov 28, 2024
38bf923
dynamically update masks
SwissalpS Nov 28, 2024
9b5962a
banner always exists
SwissalpS Nov 29, 2024
d86c93b
use same function declaration style throughout
SwissalpS Nov 29, 2024
3d5805c
remove set_banner_texture()
SwissalpS Nov 29, 2024
2fea87d
preserve player undo-history over joins
SwissalpS Nov 29, 2024
1c5b116
refactor: reusable transformation string creation
SwissalpS Nov 29, 2024
e3c216e
add transform_string_to_table
SwissalpS Nov 29, 2024
88d628d
cleanup old banners when their entities are generated
SwissalpS Nov 29, 2024
578bd70
read item meta allowing players to edit existing banners
SwissalpS Nov 29, 2024
4178bd1
version bump
SwissalpS Nov 29, 2024
143e549
oopsie fixes
SwissalpS Nov 29, 2024
767a49a
remove stray debug point
SwissalpS Nov 29, 2024
e9cbd37
Merge branch 'master' into readExistingBanner
SwissalpS Nov 29, 2024
fe72fc2
add chatcommand banners_fix
SwissalpS Nov 29, 2024
85ac3b0
Merge branch 'readExistingBanner' of github.com:pandorabox-io/banners…
SwissalpS Nov 29, 2024
088f94b
sensitive github luacheck syntax
SwissalpS Nov 29, 2024
80aff0d
version bump
SwissalpS Nov 29, 2024
cb6bfaf
cleanup: compact node definitions
SwissalpS Nov 30, 2024
f448d73
adds [jumpdrive] compat
SwissalpS Nov 30, 2024
d0989cb
also make factions banners jump-able
SwissalpS Nov 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cap max amount of layers
fixes #5
  • Loading branch information
SwissalpS committed Nov 28, 2024
commit 78be1611c3d3113fb7d4d6e6e19b0d54ace7cb31
13 changes: 13 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)
Expand Down