diff --git a/init.lua b/init.lua index d6a0292..0486a23 100644 --- a/init.lua +++ b/init.lua @@ -10,6 +10,7 @@ dofile(modPath.."/item_atm.lua") --dofile(modPath.."/item_strongbox.lua") --dofile(modPath.."/item_strongbox_old.lua") dofile(modPath.."/item_minercash.lua") +dofile(modPath.."/item_computing_app.lua") --dofile(path.."/item_rent_door.lua") dofile(modPath.."/api_payday.lua") --dofile(modPath.."/commands.lua") diff --git a/item_computing_app.lua b/item_computing_app.lua new file mode 100644 index 0000000..e0fb00a --- /dev/null +++ b/item_computing_app.lua @@ -0,0 +1,23 @@ + + +if core.global_exists("modComputing") then + modComputing.add_app("minertrade:btnWebBank", { + icon_name = "btnWebBank", + icon_title = modMinerTrade.translate("WEB BANK"), + icon_descryption = modMinerTrade.translate("Allows you to access the bank account anywhere in the world."), + icon_type = "button", --types: button/button_exit + icon_image = "obj_credit_card.png", + on_iconclick = function(player) + local playername = player:get_player_name() + core.log( + "action","[MINERTRADE] " + ..modCorreio.translate( + "Player '@1' is trying to access the bank account via the '@2'!" + , playername + , "computing app" + ) + ) + modMinerTrade.showAccountBank.inCreditCard(playername, playername) + end, + }) +end \ No newline at end of file diff --git a/item_minercash.lua b/item_minercash.lua index d5389ad..52999f5 100644 --- a/item_minercash.lua +++ b/item_minercash.lua @@ -273,61 +273,13 @@ minetest.register_alias( minetest.register_craftitem("minertrade:creditcard", { description = core.colorize("#00FF00", modMinerTrade.translate("CREDIT CARD") - ).."\n\t* "..modMinerTrade.translate("Allows you to access the bank account of the credit card owner anywhere in the world."), + ).."\n\t* "..modMinerTrade.translate("Allows you to access the bank account anywhere in the world."), inventory_image = "obj_credit_card.png", --stack_max=9, --Acumula 9 por slot groups = {cash=0, trade=1}, on_use = function(itemstack, player) - --[[ - modMinerTrade.showInventory( - clicker, - clickername, - modMinerTrade.translate("PUBLIC ATM - Account of '%s':"):format(clickername) - ) - --]] local playername = player:get_player_name() - --modMinerTrade.doSoundPlayer(playername, "sfx_atm", 5) - --modMinerTrade.showAtm.frmMain(playername) modMinerTrade.showAccountBank.inCreditCard(playername, playername) - - - --[[ - local playername = player:get_player_name() - local meta = itemstack:get_meta() - local old_data = minetest.deserialize(itemstack:get_metadata()) - if old_data then - meta:from_table({ fields = old_data }) - end - local tmpDatabase = meta:to_table().fields - - if type(tmpDatabase.ownername)~="string" or tmpDatabase.ownername=="" then - tmpDatabase.ownername = playername - tmpDatabase.description = modMinerTrade.translate("CREDIT CARD of '%s'"):format(tmpDatabase.ownername) - local invPlayer = player:get_inventory() - local new_stack - local count = itemstack:get_count() - itemstack:set_count(count - 1) - new_stack = ItemStack("minertrade:creditcard") - new_stack:get_meta():from_table({ fields = tmpDatabase }) - if invPlayer:room_for_item("main", new_stack) then - invPlayer:add_item("main", new_stack) - else - minetest.add_item(player:get_pos(), new_stack) - end - minetest.chat_send_player(playername, - core.colorize("#00FF00", "["..modMinerTrade.translate("CREDIT CARD").."]: ") - ..modMinerTrade.translate("Your name has been saved to this credit card. Anyone using this credit card will be able to access the '%s' bank account."):format(tmpDatabase.ownername) - ) - minetest.sound_play("sfx_alert", {object=player, max_hear_distance=5.0,}) - return itemstack - end - modMinerTrade.showInventory( - player, - tmpDatabase.ownername, - modMinerTrade.translate("ACCOUNT BANK of '%s':"):format(tmpDatabase.ownername) - ) - return itemstack - --]] end, })