mirror of
https://github.com/MinetestForFun/fishing.git
synced 2025-01-09 10:30:16 +01:00
fix PR traduction break condition and missing variable renamed
fix typo in worms.lua
This commit is contained in:
parent
74486b832a
commit
fe062390ed
@ -1,7 +1,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
-- baitball
|
||||
minetest.register_craftitem("fishing:baitball", {
|
||||
description = fishing_setting.func.S("Bait Ball"),
|
||||
|
@ -25,4 +25,3 @@ fishing_setting.baits["fishing:fish_raw"] = { ["bait"] = "fishing:fish_raw", ["b
|
||||
|
||||
fishing_setting.baits["fishing:clownfish_raw"] = { ["bait"] = "fishing:clownfish_raw", ["bobber"] = "fishing:bobber_shark_entity",["texture"] = "fishing_clownfish_raw.png", ["hungry"] = 50 }
|
||||
fishing_setting.baits["fishing:bluewhite_raw"] = { ["bait"] = "fishing:bluewhite_raw", ["bobber"] = "fishing:bobber_shark_entity",["texture"] = "fishing_bluewhite_raw.png", ["hungry"] = 50 }
|
||||
|
||||
|
@ -187,7 +187,7 @@ fishing_setting.func.on_show_settings = function(player_name)
|
||||
-- WORM_IS_MOB
|
||||
"label[6,7.3;"..S("Worm is a mob (reboot)").."]"..
|
||||
"button[9.7,7.1;1,1;wormmob;"..tostring(fishing_setting.tmp_setting["worm_is_mob"]).."]"..
|
||||
"button_exit[0,8.2;1.5,1;save;"..S("Abort").."]"..
|
||||
"button_exit[0,8.2;1.5,1;abort;"..S("Abort").."]"..
|
||||
"button_exit[9.2,8.2;1.5,1;save;"..S("OK").."]"
|
||||
minetest.show_formspec(player_name, "fishing:settings", formspec)
|
||||
end
|
||||
@ -217,7 +217,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
local player_name = player:get_player_name()
|
||||
if not player_name then return end
|
||||
if formname == "fishing:settings" then
|
||||
if fields["save"] == "Ok" then
|
||||
if fields["save"] then
|
||||
fishing_setting.func.set_settings(fishing_setting.settings, fishing_setting.tmp_setting)
|
||||
fishing_setting.func.save()
|
||||
fishing_setting.tmp_setting = nil
|
||||
@ -303,15 +303,17 @@ function fishing_setting.func.timetostr(time)
|
||||
if countdown >= 3600 then
|
||||
local hours = math.floor(countdown / 3600)
|
||||
countdown = countdown % 3600
|
||||
answer = hours .. "H"
|
||||
answer = hours .. "h"
|
||||
end
|
||||
if countdown >= 60 then
|
||||
local minutes = math.floor(countdown / 60)
|
||||
countdown = countdown % 60
|
||||
answer = answer .. minutes .. "M"
|
||||
answer = answer .. minutes .. "m"
|
||||
else
|
||||
answer = answer .. "0m"
|
||||
end
|
||||
local seconds = countdown
|
||||
answer = answer .. math.floor(seconds) .. "S"
|
||||
answer = answer .. math.floor(seconds) .. "s"
|
||||
return answer
|
||||
end
|
||||
|
||||
@ -379,7 +381,6 @@ if (minetest.get_modpath("unified_inventory")) then
|
||||
local formspec = fishing_setting.func.get_stat()
|
||||
minetest.show_formspec(player_name, "fishing:classement", formspec)
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
||||
end
|
||||
@ -433,6 +434,12 @@ function fishing_setting.func.load_contest()
|
||||
end
|
||||
end
|
||||
|
||||
function fishing_setting.func.end_contest()
|
||||
fishing_setting.contest["contest"] = false
|
||||
minetest.chat_send_all(fishing_setting.func.S("End of fishing contest."))
|
||||
minetest.sound_play("fishing_contest_end",{gain=0.8})
|
||||
fishing_setting.func.show_result()
|
||||
end
|
||||
|
||||
--Menu fishing configuration
|
||||
fishing_setting.func.on_show_settings_contest = function(player_name)
|
||||
@ -441,7 +448,7 @@ fishing_setting.func.on_show_settings_contest = function(player_name)
|
||||
fishing_setting.tmp_setting = { ["contest"] = (fishing_setting.contest["contest"] or false),
|
||||
["duration"] = (math.floor(fishing_setting.contest["duration"]) or 3600),
|
||||
["bobber_nb"] = (fishing_setting.contest["bobber_nb"] or 2),
|
||||
["reset"] = ""
|
||||
["reset"] = false
|
||||
}
|
||||
end
|
||||
local formspec = "size[6.1,7]label[1.9,0;"..S("Fishing contest").."]"..
|
||||
@ -461,9 +468,9 @@ fishing_setting.func.on_show_settings_contest = function(player_name)
|
||||
"label[0.8,3.8;"..S("Enable contests").."]"..
|
||||
"button[4.5,3.6;1,1;contest;"..tostring(fishing_setting.tmp_setting["contest"]).."]"..
|
||||
--reset
|
||||
"label[0.8,5.2;"..S("Reset rankings (type 'yes')").."]"..
|
||||
"field[4.8,5.4;1,1;reset;;]"..
|
||||
"button_exit[0.8,6.2;1.5,1;save;"..S("Abort").."]"..
|
||||
"label[0.8,5.2;"..S("Reset rankings").."]"..
|
||||
"button[4.5,5;1,1;reset;"..tostring(fishing_setting.tmp_setting["reset"]).."]"..
|
||||
"button_exit[0.8,6.2;1.5,1;abort;"..S("Abort").."]"..
|
||||
"button_exit[4,6.2;1.5,1;save;"..S("OK").."]"
|
||||
minetest.show_formspec(player_name, "fishing:contest", formspec)
|
||||
end
|
||||
@ -472,8 +479,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname == "fishing:contest" then
|
||||
local name = player:get_player_name()
|
||||
if not name then return end
|
||||
if fields["save"] == "Ok" then
|
||||
if fields["reset"] and fields["reset"]:lower() == "yes" then
|
||||
if fields["save"] then
|
||||
if fishing_setting.tmp_setting["reset"] == true then
|
||||
fishing_setting.contest["fish_raw"] = {}
|
||||
fishing_setting.contest["clownfish_raw"] = {}
|
||||
fishing_setting.contest["bluewhite_raw"] = {}
|
||||
@ -491,9 +498,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
local time = fishing_setting.func.timetostr(fishing_setting.contest["duration"])
|
||||
minetest.chat_send_all(fishing_setting.func.S("Attention, Fishing contest start (duration %s)!!!"):format(time))
|
||||
minetest.sound_play("fishing_contest_start",{gain=0.8})
|
||||
|
||||
elseif progress == true and fishing_setting.tmp_setting["contest"] == false then
|
||||
fishing_setting.contest["contest"] = false
|
||||
fishing_setting.func.end_contest()
|
||||
end
|
||||
fishing_setting.func.save_contest()
|
||||
fishing_setting.tmp_setting = nil
|
||||
@ -507,6 +513,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
fishing_setting.tmp_setting["contest"] = bool(fields["contest"])
|
||||
elseif fields["bobbernb"] then
|
||||
fishing_setting.tmp_setting["bobber_nb"] = inc(fishing_setting.tmp_setting["bobber_nb"], fields["bobbernb"], 1, 8)
|
||||
elseif fields["reset"] then
|
||||
fishing_setting.tmp_setting["reset"] = bool(fields["reset"])
|
||||
else
|
||||
return
|
||||
end
|
||||
@ -615,6 +623,3 @@ function fishing_setting.func.show_result()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
9
init.lua
9
init.lua
@ -51,8 +51,8 @@ fishing_setting.settings["simple_deco_fishing_pole"] = SIMPLE_DECO_FISHING_POLE
|
||||
fishing_setting.settings["bobber_view_range"] = BOBBER_VIEW_RANGE
|
||||
fishing_setting.settings["fish_chance"] = FISH_CHANCE
|
||||
fishing_setting.settings["shark_chance"] = SHARK_CHANCE
|
||||
fishing_setting.settings["treasure_chance"] = TRESOR_CHANCE
|
||||
fishing_setting.settings["treasure_enable"] = TRESOR_RANDOM_ENABLE
|
||||
fishing_setting.settings["treasure_chance"] = TREASURE_CHANCE
|
||||
fishing_setting.settings["treasure_enable"] = TREASURE_RANDOM_ENABLE
|
||||
fishing_setting.settings["escape_chance"] = ESCAPE_CHANCE
|
||||
|
||||
-- load config file if exist in worldpath
|
||||
@ -87,10 +87,7 @@ minetest.register_globalstep(function(dtime)
|
||||
fishing_setting.contest["warning_said"] = true
|
||||
end
|
||||
if fishing_setting.contest["duration"] < 0 then
|
||||
minetest.chat_send_all(fishing_setting.func.S("End of fishing contest."))
|
||||
minetest.sound_play("fishing_contest_end",{gain=0.8})
|
||||
fishing_setting.contest["contest"] = false
|
||||
fishing_setting.func.show_result()
|
||||
fishing_setting.func.end_contest()
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
-- useless or useful ???
|
||||
-- useless or useful ??? No activated
|
||||
minetest.register_node("fishing:material_info", {
|
||||
description = fishing_setting.func.S("Show information about hunger fish"),
|
||||
name = "Fishing Info Center",
|
||||
|
@ -138,7 +138,7 @@ minetest.register_craft({
|
||||
-- get worms from digging in dirt:
|
||||
if fishing_setting.settings["new_worm_source"] == false then
|
||||
minetest.register_node(":default:dirt", {
|
||||
description = fishing_setting.func.fishing_setting.func.S("Dirt"),
|
||||
description = fishing_setting.func.S("Dirt"),
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
|
Loading…
Reference in New Issue
Block a user