Browse Source

New textures and new nodebox for ATM node

tags/nalc-1.0
Vitalie Ciubotaru 4 years ago
parent
commit
1a71ba41b6
No known key found for this signature in database GPG Key ID: 6B60758D4DF9A7EE
12 changed files with 120 additions and 8 deletions
  1. +2
    -2
      README.md
  2. +116
    -6
      atm.lua
  3. +2
    -0
      sounds/LICENSE
  4. BIN
      sounds/atm_beep.ogg
  5. BIN
      textures/global_exchange_atm_back.png
  6. BIN
      textures/global_exchange_atm_hi_front.png
  7. BIN
      textures/global_exchange_atm_hi_top.png
  8. BIN
      textures/global_exchange_atm_icon.png
  9. BIN
      textures/global_exchange_atm_lo_front.png
  10. BIN
      textures/global_exchange_atm_lo_top.png
  11. BIN
      textures/global_exchange_atm_side.png
  12. BIN
      textures/global_exchange_atm_top.png

+ 2
- 2
README.md View File

@@ -2,7 +2,7 @@

This mod provides a server-wide trading exchange for items. It is available
under GNU GPL version 3 or any later version. lsqlite3 is required by this mod,
and can be installed through luarocks.
and can be installed through luarocks. ($ sudo luarocks install lsqlite3)

Nodes
=====
@@ -98,4 +98,4 @@ is a sell offer for 5 cobblestone 3 credits each, it will give you 5 cobble
immediately, and leave an order on the exchange for 5 more cobblestone.

Once your offer is on the exchange, you can view or cancel it from the "Your
Orders" menu.
Orders" menu.

+ 116
- 6
atm.lua View File

@@ -1,4 +1,3 @@

-- A telling machine. Call this file with the exchange argument.
local exchange = ...

@@ -173,18 +172,127 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end)


minetest.register_node("global_exchange:atm", {
minetest.register_node("global_exchange:atm_bottom", {
description = "ATM",
tiles = {"global_exchange_box.png",
"global_exchange_box.png",
"global_exchange_box.png^global_exchange_atm_side.png",
inventory_image = "global_exchange_atm_icon.png",
wield_image = "global_exchange_atm_hi_front.png",
drawtype = "nodebox",
tiles = {
"global_exchange_atm_lo_top.png",
"global_exchange_atm_side.png",
"global_exchange_atm_side.png",
"global_exchange_atm_side.png",
"global_exchange_atm_back.png^[transform2",
"global_exchange_atm_lo_front.png",
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
stack_max = 1,
light_source = 3,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, 0.5, -0.5, -0.375, 1.125, -0.25},
{0.375, 0.5, -0.5, 0.5, 1.125, -0.25},
{-0.5, 0.5, -0.25, 0.5, 1.5, 0.5},
{-0.5, 1.125, -0.4375, -0.375, 1.25, -0.25},
{0.375, 1.125, -0.4375, 0.5, 1.25, -0.25},
{-0.5, 1.25, -0.375, -0.375, 1.375, -0.25},
{0.375, 1.25, -0.375, 0.5, 1.375, -0.25},
{-0.5, 1.375, -0.3125, -0.375, 1.5, -0.25},
{0.375, 1.375, -0.3125, 0.5, 1.5, -0.25},
},
},
groups = {cracky=2},
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local pos
if minetest.registered_items[minetest.get_node(under).name].buildable_to then
pos = under
else
pos = pointed_thing.above
end
if minetest.is_protected(pos, placer:get_player_name()) and
not minetest.check_player_privs(placer, "protection_bypass") then
minetest.record_protection_violation(pos, placer:get_player_name())
return itemstack
end
local def = minetest.registered_nodes[minetest.get_node(pos).name]
if not def or not def.buildable_to then
minetest.remove_node(pos)
return itemstack
end
local dir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z}
local def2 = minetest.registered_nodes[minetest.get_node(pos2).name]
if not def2 or not def2.buildable_to then
return itemstack
end
minetest.set_node(pos, {name = "global_exchange:atm_bottom", param2 = dir})
minetest.set_node(pos2, {name = "global_exchange:atm_top", param2 = dir})
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
return itemstack
end
end,
on_destruct = function(pos)
local pos2 = {x = pos.x, y = pos.y + 1, z = pos.z}
local n2 = minetest.get_node(pos2)
if minetest.get_item_group(n2.name, "atm") == 2 then
minetest.remove_node(pos2)
end
end,
groups = {cracky=2, atm = 1},
on_rightclick = function(pos, _, clicker)
minetest.sound_play("atm_beep", {pos = pos})
minetest.show_formspec(clicker:get_player_name(), atm_form, main_menu)
end,
})

minetest.register_node("global_exchange:atm_top", {
drawtype = "nodebox",
tiles = {
"global_exchange_atm_hi_top.png",
"global_exchange_atm_side.png",--not visible anyway
"global_exchange_atm_side.png",
"global_exchange_atm_side.png",
"global_exchange_atm_back.png",
"global_exchange_atm_hi_front.png",
},
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
light_source = 3,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, -0.375, 0.125, -0.25},
{0.375, -0.5, -0.5, 0.5, 0.125, -0.25},
{-0.5, -0.5, -0.25, 0.5, 0.5, 0.5},
{-0.5, 0.125, -0.4375, -0.375, 0.25, -0.25},
{0.375, 0.125, -0.4375, 0.5, 0.25, -0.25},
{-0.5, 0.25, -0.375, -0.375, 0.375, -0.25},
{0.375, 0.25, -0.375, 0.5, 0.375, -0.25},
{-0.5, 0.375, -0.3125, -0.375, 0.5, -0.25},
{0.375, 0.375, -0.3125, 0.5, 0.5, -0.25},
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0},
},
groups = {
atm = 2,
not_in_creative_inventory = 1
},
})

minetest.register_craft( {
output = "global_exchange:atm",
@@ -194,3 +302,5 @@ minetest.register_craft( {
{ "default:stone", "default:stone", "default:stone" },
}
})

minetest.register_alias("global_exchange:atm", "global_exchange:atm_bottom")

+ 2
- 0
sounds/LICENSE View File

@@ -0,0 +1,2 @@
File atm_beep.ogg is a derivative work from a sound file 'dialing 3.aiff' uploaded by 'benjaminharveydesign' to http://freesound.org under a Creative Commons 0 license.
File atm_cash.ogg is a derivative work from a sound file 'ATM.wav' uploaded by 'LG' to http://freesound.org under a Creative Commons Attribution license.

BIN
sounds/atm_beep.ogg View File


BIN
textures/global_exchange_atm_back.png View File

Before After
Width: 16  |  Height: 16  |  Size: 170 B

BIN
textures/global_exchange_atm_hi_front.png View File

Before After
Width: 16  |  Height: 16  |  Size: 247 B

BIN
textures/global_exchange_atm_hi_top.png View File

Before After
Width: 16  |  Height: 16  |  Size: 246 B

BIN
textures/global_exchange_atm_icon.png View File

Before After
Width: 64  |  Height: 64  |  Size: 860 B

BIN
textures/global_exchange_atm_lo_front.png View File

Before After
Width: 16  |  Height: 16  |  Size: 217 B

BIN
textures/global_exchange_atm_lo_top.png View File

Before After
Width: 16  |  Height: 16  |  Size: 228 B

BIN
textures/global_exchange_atm_side.png View File

Before After
Width: 16  |  Height: 16  |  Size: 136 B Width: 16  |  Height: 16  |  Size: 163 B

BIN
textures/global_exchange_atm_top.png View File

Before After
Width: 16  |  Height: 16  |  Size: 176 B

Loading…
Cancel
Save