1
0
mirror of https://github.com/pandorabox-io/banners.git synced 2025-06-30 07:11:06 +02:00

38 Commits

Author SHA1 Message Date
80aff0dc7d version bump 2024-11-29 12:32:58 +01:00
088f94b76a sensitive github luacheck syntax 2024-11-29 12:30:48 +01:00
85ac3b0921 Merge branch 'readExistingBanner' of github.com:pandorabox-io/banners into readExistingBanner 2024-11-29 12:00:15 +01:00
fe72fc27a3 add chatcommand banners_fix
fixes #7
provides a work-around for the engine problem with entities.
2024-11-29 11:59:11 +01:00
e9cbd37983 Merge branch 'master' into readExistingBanner 2024-11-29 10:50:30 +01:00
767a49a432 remove stray debug point 2024-11-29 10:38:17 +01:00
143e549ff9 oopsie fixes 2024-11-29 10:27:50 +01:00
4178bd1501 version bump 2024-11-29 10:16:30 +01:00
578bd700d1 read item meta allowing players to edit existing banners 2024-11-29 10:11:33 +01:00
88d628d73f cleanup old banners when their entities are generated 2024-11-29 10:09:31 +01:00
e3c216eba7 add transform_string_to_table
allows us to add more features such as:
- clean existing banners to slim down data
- read transforms from items in inventory -> allow players
  to change existing patterns without having to start from
  scratch.
2024-11-29 10:07:32 +01:00
1c5b11609b refactor: reusable transformation string creation
unfortunately the git diff is a bit messy on this one.
Nothing changed with:
- banners.Banner
- banners.Banner:new
- banners.Banner:push_transform
- banners.Banner:pop_transform

content of banners.Banner:get_transform_string was moved
to banners.transform_table_to_string with very few changes
2024-11-29 10:04:22 +01:00
2fea87dbde preserve player undo-history over joins
player could have timed-out and thus lost their history.
It isn't crucial to remove their history, so let's give
them this feature.
2024-11-29 09:56:17 +01:00
3d5805c8a9 remove set_banner_texture()
only used once and is easy enough to have inline
2024-11-29 09:51:03 +01:00
d86c93bcc5 use same function declaration style throughout 2024-11-29 09:49:40 +01:00
9b5962aba4 banner always exists
even if only "" it exists and there isn't an error.
not adding "" or texture string, causes a non critical error.
2024-11-29 07:45:14 +01:00
38bf923967 dynamically update masks
to reflect the currently selected colour.
2024-11-28 15:37:02 +01:00
f2147ce1b0 rename update_all -> update_preview_inv
since it isn't updating everything, only
the preview and the inventory item
2024-11-28 15:36:07 +01:00
b99d10cba5 add recoverable per player history with saved colour 2024-11-28 15:08:42 +01:00
dc9867f359 add versioning 2024-11-28 14:19:54 +01:00
7e3a84eaac minimize metadata size
also changed banners.max_transformations to
banners.max_undo_levels and lowered the value substantially.
2024-11-28 14:18:26 +01:00
3d22f9b76b fix #5 make transform history non-global
fixes #5
transformation history was shared by all users and kept growing as it
was never truely reset. Every time a user
used a banner a white background was dumped on top of the
stack making it possible to crash the server through an
overflow to core.serialize() function.
2024-11-28 12:59:45 +01:00
78be1611c3 cap max amount of layers
fixes #5
2024-11-28 12:55:46 +01:00
b1ff0eb558 use ipairs feature
or use the faster repeat-until-loop
2024-11-28 11:22:49 +01:00
b1d63fd7b1 reduce amount of times transformation string is calculated 2024-11-28 11:20:40 +01:00
5cf1946064 fix shaddowing global table 2024-11-28 10:17:03 +01:00
2175d77186 whitespace: two stray spaces
...that slipped through the cracks on previous whitespace edit
2024-11-28 10:15:52 +01:00
9c688d416b refactor weird declaration 2024-11-28 01:06:26 +01:00
c8a480135e whitespace: switch all files to same indent character
tabs -> spaces
2024-11-27 23:14:33 +01:00
deb750af99 stray whitespace fixups 2024-11-27 23:10:56 +01:00
aa514d114a avoid error: "unknown global" 2024-11-27 23:10:35 +01:00
c8af7c71e5 avoid duplicate code
save some lines and some extra method calls.
2024-11-27 23:08:26 +01:00
7ff3dd0311 clean close of file after reading 2024-11-27 22:55:15 +01:00
ae679a14d4 luacheck cleanups
- unused arguments
- shaddowed vars
- var redeclarations
- some whitespace involved in above lines
2024-11-27 22:54:39 +01:00
8d6b2f264f update optional depends 2024-11-27 22:40:38 +01:00
3b3ea242f7 add luacheck 2024-11-27 22:40:12 +01:00
51ec2a8695 Update Readme: Minetest -> Luanti 2024-11-27 22:33:14 +01:00
c8012c7266 whitespace and minetest. -> core.
- use same whitespace style throughout and fix some indents.
- change from minetest. to core. namespace.
2024-11-27 22:32:24 +01:00
3 changed files with 38 additions and 23 deletions

View File

@ -143,8 +143,12 @@ core.register_node("banners:power_banner", {
stack_max = 1,
paramtype = "light",
paramtype2 = "facedir",
after_place_node = banners.after_powerbanner_placed,
on_destruct = banners.banner_on_destruct,
after_place_node = function (pos, player, itemstack, pointed_thing)
banners.after_powerbanner_placed(pos, player, itemstack, pointed_thing)
end,
on_destruct = function(pos)
banners.banner_on_destruct(pos)
end,
on_dig = function(pos, n, p)
if core.is_protected(pos, p:get_player_name()) then
return
@ -159,7 +163,6 @@ core.register_node("banners:power_banner", {
end
banners.banner_on_dig(pos, n, p)
end,
on_movenode = banners.banner_on_movenode,
})
core.register_node("banners:death_banner", {
@ -173,8 +176,12 @@ core.register_node("banners:death_banner", {
stack_max = 1,
paramtype = "light",
paramtype2 = "facedir",
after_place_node = banners.after_deathbanner_placed,
on_destruct = banners.banner_on_destruct,
after_place_node = function (pos, player, itemstack, pointed_thing)
banners.after_deathbanner_placed(pos, player, itemstack, pointed_thing)
end,
on_destruct = function(pos)
banners.banner_on_destruct(pos)
end,
-- (pos, node, player)
on_dig = function(pos, _, player)
if core.is_protected(pos, player:get_player_name()) then
@ -191,7 +198,6 @@ core.register_node("banners:death_banner", {
end
core.remove_node(pos)
end,
on_movenode = banners.banner_on_movenode,
})
-- (pos, player, itemstack, pointed_thing)

View File

@ -2,7 +2,7 @@ local MP = core.get_modpath("banners") .. "/"
dofile(MP .. "smartfs.lua")
banners = {
version = 20241130.1920
version = 20241129.1232
}
banners.masks = {
@ -305,12 +305,6 @@ function banners.banner_after_place(pos, _, itemstack, pointed_thing)
core.add_entity(pos, "banners:banner_ent")
end
-- [jumpdrive] compat
-- (from_pos, to_pos, additional_info)
function banners.banner_on_movenode(_, to_pos)
core.add_entity(to_pos, "banners:banner_ent")
end
-- banner entity
function banners:banner_on_activate()

View File

@ -10,11 +10,18 @@ core.register_node("banners:wooden_banner", {
stack_max = 1,
paramtype = "light",
paramtype2 = "facedir",
after_place_node = banners.banner_after_place,
on_destruct = banners.banner_on_destruct,
on_use = banners.banner_on_use,
on_dig = banners.banner_on_dig,
on_movenode = banners.banner_on_movenode,
after_place_node = function (pos, player, itemstack, pointed_thing)
banners.banner_after_place(pos, player, itemstack, pointed_thing)
end,
on_destruct = function(pos)
banners.banner_on_destruct(pos)
end,
on_use = function(i, p, pt)
banners.banner_on_use(i, p, pt)
end,
on_dig = function(pos, n, p)
banners.banner_on_dig(pos, n, p)
end
})
-- steel banner
@ -29,10 +36,18 @@ core.register_node("banners:steel_banner", {
stack_max = 1,
paramtype = "light",
paramtype2 = "facedir",
after_place_node = banners.banner_after_place,
on_destruct = banners.banner_on_destruct,
on_use = banners.banner_on_use,
on_dig = banners.banner_on_dig,
on_movenode = banners.banner_on_movenode,
after_place_node = function (pos, player, itemstack, pointed_thing)
banners.banner_after_place(pos, player, itemstack, pointed_thing)
end,
on_destruct = function(pos)
banners.banner_on_destruct(pos)
end,
on_use = function(i, p, pt)
banners.banner_on_use(i, p, pt)
end,
on_dig = function(pos, n, p)
banners.banner_on_dig(pos, n, p)
end
})