mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-12-23 06:32:25 +01:00
revert, chat msgs instead titles
This commit is contained in:
parent
ec81bb270f
commit
3ed54ea8fc
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
-- Copyright (C) 2021, 2022 Ale
|
||||
-- Copyright (C) 2021, 2023 Ale
|
||||
|
||||
-- This file is part of Emeraldbank Minetest Mod.
|
||||
|
||||
@ -56,10 +56,10 @@ core.register_chatcommand("pay", {
|
||||
pitch = 1.0,
|
||||
})
|
||||
else
|
||||
mcl_title.set(player1, "subtitle", {text=S("Not enough Emeralds in your account"), color="dark_red"})
|
||||
core.chat_send_player(name, S("Not enough Emeralds in your account"))
|
||||
end
|
||||
else
|
||||
mcl_title.set(player1, "subtitle", {text=S("Invalid pay"), color="dark_red"})
|
||||
core.chat_send_player(name, S("Invalid pay"))
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
-- Copyright (C) 2021, 2022 Ale
|
||||
-- Copyright (C) 2021, 2023 Ale
|
||||
|
||||
-- This file is part of Emeraldbank Minetest Mod.
|
||||
|
||||
@ -34,7 +34,7 @@ core.register_globalstep(function(dtime)
|
||||
for _, player in ipairs(core.get_connected_players()) do
|
||||
if not player or player.is_fake_player then return end
|
||||
local name = player:get_player_name()
|
||||
mcl_title.set(player, "subtitle", {text=S("You have earned @1 emeralds in your bank account!", income_count), color="green"})
|
||||
core.chat_send_player(name, S("You have earned @1 emeralds in your bank account!", income_count))
|
||||
emeraldbank.add_emeralds(player, income_count)
|
||||
end
|
||||
end
|
||||
|
8
shop.lua
8
shop.lua
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
-- Copyright (C) 2021, 2022 Ale
|
||||
-- Copyright (C) 2021, 2023 Ale
|
||||
|
||||
-- This file is part of Emeraldbank Minetest Mod.
|
||||
|
||||
@ -298,7 +298,7 @@ core.register_on_player_receive_fields(function(sender, formname, fields)
|
||||
|
||||
-- owner try exchanges
|
||||
if meta:get_string("owner") == name then
|
||||
mcl_title.set(sender, "subtitle", {text=S("This is your own shop, you can't exchange to yourself!"), color="dark_red"})
|
||||
core.chat_send_player(name, S("This is your own shop, you can't exchange to yourself!"))
|
||||
|
||||
else
|
||||
|
||||
@ -307,13 +307,13 @@ core.register_on_player_receive_fields(function(sender, formname, fields)
|
||||
-- have u money?
|
||||
if bankemeralds < old_price then
|
||||
can_exchange = false
|
||||
mcl_title.set(sender, "subtitle", {text=S("Not enough Emeralds in your account"), color="dark_red"})
|
||||
core.chat_send_player(name, S("Not enough Emeralds in your account"))
|
||||
end
|
||||
|
||||
--there are enough items?
|
||||
if not minv:contains_item("stock", shop_item.." "..old_count, true) then
|
||||
can_exchange = false
|
||||
mcl_title.set(sender, "subtitle", {text=S("Out of Stock!"), color="dark_red"})
|
||||
core.chat_send_player(name, S("Out of Stock!"))
|
||||
end
|
||||
|
||||
-- do not trade air
|
||||
|
Loading…
Reference in New Issue
Block a user