Skip to content

Commit

Permalink
Merge branch 'master' into currencySupport
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Dec 31, 2024
2 parents 26d37c8 + 03fe55a commit 2e0445f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ read_globals = {
"mesecon",
"pipeworks",
"signs_lib",
"smartshop",
"spacecannon",
"xdecor",
"bones",
Expand Down
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ local mods = {
"powerbanks",
"protector",
"signs_lib",
"smartshop",
"spacecannon",
"soundblock",
"technic",
Expand Down
1 change: 1 addition & 0 deletions mod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ optional_depends = """
powerbanks,
protector,
signs_lib,
smartshop,
spacecannon,
soundblock,
technic,
Expand Down
42 changes: 42 additions & 0 deletions nodes/smartshop.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

-- Register wrench support for the smartshop mod

wrench.register_node("smartshop:shop", {
lists = {
"give1", "give2", "give3", "give4",
"main",
"pay1", "pay2", "pay3", "pay4",
},
metas = {
alerted = wrench.META_TYPE_INT,
creative = wrench.META_TYPE_INT,
ghost = wrench.META_TYPE_INT,
infotext = wrench.META_TYPE_IGNORE,
owner = wrench.META_TYPE_STRING,
state = wrench.META_TYPE_IGNORE,
type = wrench.META_TYPE_INT,
},
after_pickup = function(pos)
-- Remove entities
if smartshop.update_entities then
smartshop.update_entities(pos, "clear")
else
-- Older version
smartshop.update(pos, "clear")
end
-- Give smartshop a chance to keep track of statistics
smartshop.update_info(pos)
end,
after_place = function(pos)
-- Update infotext
smartshop.update_info(pos)
-- Create entities
if smartshop.update_entities then
smartshop.update_entities(pos, "update")
else
-- Older version
smartshop.update(pos, "update")
end
end,
})

0 comments on commit 2e0445f

Please sign in to comment.