From 7effda9f5cdc38d6f153e91f846c7a3ed84841be Mon Sep 17 00:00:00 2001 From: Lunovox Date: Thu, 21 Mar 2024 10:30:11 -0300 Subject: [PATCH] [fix] Fix the Paper Printed. (but the texture of background is ugly.) --- item_atm.lua | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/item_atm.lua b/item_atm.lua index b117153..415f474 100644 --- a/item_atm.lua +++ b/item_atm.lua @@ -191,7 +191,7 @@ modMinerTrade.addTransferProof_v2 = function(player, accountname, txtBeneficiary local playername = player:get_player_name() local when = os.date("%Y-%B-%d %Hh:%Mm:%Ss") local title = modMinerTrade.translate("TRANSFER PROOF") - local itemDescription = core.colorize("#00FF00", title) + local itemDescription = minetest.colorize("#00FF00", title) .."\n"..modMinerTrade.translate("Reason: %s"):format( txtReason:sub(1, modMinerTrade.paperprinted.max_title_size) ) @@ -202,7 +202,7 @@ modMinerTrade.addTransferProof_v2 = function(player, accountname, txtBeneficiary .."\n"..modMinerTrade.translate("Account Holder")..": "..accountname .."\n"..modMinerTrade.translate("Beneficiary")..": "..txtBeneficiary .."\n"..modMinerTrade.translate("When")..": "..when - .."\n"..modMinerTrade.translate("Value")..": "..txtValue.." minercash" + .."\n"..modMinerTrade.translate("Value")..": "..("%02d"):format(tonumber(txtValue)).." minercash" .."\n"..modMinerTrade.translate("Transfer Reason")..": "..txtReason local Auth = minetest.get_password_hash( @@ -213,39 +213,33 @@ modMinerTrade.addTransferProof_v2 = function(player, accountname, txtBeneficiary local htmlBody = [[
- - [TRANSFER_PROOF] + +
-[DOC_DATA] +
----------------------------------= [AUTHENTICATION_HASH] =------------------------------------- -[AUTH] +---------------------------------= AUTHENTICATION HASH =------------------------------------- + ----------------------------------------------------------------------------------------------- -[EXIST_MESSAGE] +
]] - --[[ - htmlBody = htmlBody:gsub( - "[MINETEST_BANK]", - modMinerTrade.translate("MINETEST BANK") - ) - htmlBody = htmlBody:gsub( - "[EXIST_MESSAGE]", - modMinerTrade.translate("Press ESC to exit this screen!") - ) - htmlBody = htmlBody:gsub("[TRANSFER_PROOF]", title) - htmlBody = htmlBody:gsub("[DOC_DATA]", docData) - htmlBody = htmlBody:gsub("[AUTH]", Auth) + --[[ ]] + htmlBody = htmlBody:gsub('', minetest.formspec_escape(modMinerTrade.translate("MINETEST BANK"))) + htmlBody = htmlBody:gsub('AUTHENTICATION HASH', minetest.formspec_escape(modMinerTrade.translate("AUTHENTICATION HASH"))) + htmlBody = htmlBody:gsub('', minetest.formspec_escape(modMinerTrade.translate("Press ESC to exit this screen!"))) + htmlBody = htmlBody:gsub('', minetest.formspec_escape(title)) + htmlBody = htmlBody:gsub('', minetest.formspec_escape(docData)) + htmlBody = htmlBody:gsub('', minetest.formspec_escape(Auth)) --]] - --local player = minetest.get_player_by_name(playername) modMinerTrade.addPaperPrinted(player, itemDescription, htmlBody) end -modMinerTrade.addTransferProof = function(player, accountname, txtBeneficiary, txtValue, txtReason) +modMinerTrade.addTransferProof_v1 = function(player, accountname, txtBeneficiary, txtValue, txtReason) local playername = player:get_player_name() local objProof = modMinerTrade.getProofStack(playername, accountname, txtBeneficiary, txtValue, txtReason) local invPlayer = player:get_inventory() @@ -1081,8 +1075,8 @@ modMinerTrade.onReceiveFields = function(player, formname, fields) modMinerTrade.translate("The '%s' say to '%s': '%s'"):format(playername, txtBeneficiary, txtReason) ) - modMinerTrade.addTransferProof(player, accountname, txtBeneficiary, txtValue, txtReason) - + --modMinerTrade.addTransferProof_v1(player, accountname, txtBeneficiary, txtValue, txtReason) + modMinerTrade.addTransferProof_v2(player, accountname, txtBeneficiary, txtValue, txtReason) --modMinerTrade.doSoundPlayer(playername, "sfx_atm", 5) --modMinerTrade.showAccountBank.frmTransfer(playername, txtBeneficiary, txtValue, txtReason, msgDetails) --FORMULÁRIO: SAQUE