1
0
mirror of https://github.com/TeTpaAka/quests.git synced 2025-01-22 07:50:49 +01:00

Clean up whitespace

This commit is contained in:
Jordan Irwin 2025-01-17 22:52:54 -08:00 committed by TeTpaAka
parent 3baf31ea1a
commit 1f08ee8126
4 changed files with 14 additions and 14 deletions

View File

@ -139,7 +139,7 @@ end
function quests.abort_quest(playername, questname)
if (questname == nil) then
return false
end
end
if (quests.failed_quests[playername] == nil) then
quests.failed_quests[playername] = {}
end

View File

@ -24,7 +24,7 @@ function quests.create_formspec(playername, tab, integrated)
questlist = quests.failed_quests[playername] or {}
end
quests.formspec_lists[playername].tab = tab
local no_quests = true
for questname,questspecs in pairs(questlist) do
if (questspecs.finished == nil) then
@ -75,7 +75,7 @@ function quests.create_config(playername, integrated)
formspec = formspec .. "true"
else
formspec = formspec .. "false"
end
end
formspec = formspec .. "]checkbox[.25,1.25;quests_config_central_message;" .. S("Central messages") .. ";"
if(quests.hud[playername] ~= nil and quests.hud[playername].central_message_enabled) then
formspec = formspec .. "true"
@ -122,7 +122,7 @@ function quests.create_info(playername, questname, integrated)
if (not integrated) then
formspec = formspec .. "size[9,6.5]"
end
formspec = formspec .. "label[0.5,0.5;"
formspec = formspec .. "label[0.5,0.5;"
if (questname) then
formspec = formspec .. quests.registered_quests[questname].title .. "]" ..
@ -192,7 +192,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
if (quests.formspec_lists[playername].id == nil) then
return
end
quests.abort_quest(playername, quests.formspec_lists[playername]["list"][quests.formspec_lists[playername].id])
quests.abort_quest(playername, quests.formspec_lists[playername]["list"][quests.formspec_lists[playername].id])
if (formname == "quests:questlog") then
core.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
else
@ -217,7 +217,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
-- config
if (fields["quests_config_enable"]) then
quests.hud[playername].autohide = false
if (fields["quests_config_enable"] == "true") then
if (fields["quests_config_enable"] == "true") then
quests.show_hud(playername)
else
quests.hide_hud(playername)
@ -257,7 +257,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
if (fields["quests_config_return"]) then
if (formname == "quests:config") then
core.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
else
else
unified_inventory.set_inventory_formspec(player, "quests")
end
end
@ -267,17 +267,17 @@ core.register_on_player_receive_fields(function(player, formname, fields)
if (quests.formspec_lists[playername].id == nil) then
return
end
quests.abort_quest(playername, quests.formspec_lists[playername]["list"][quests.formspec_lists[playername].id])
quests.abort_quest(playername, quests.formspec_lists[playername]["list"][quests.formspec_lists[playername].id])
if (formname == "quests:info") then
core.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
else
else
unified_inventory.set_inventory_formspec(player, "quests")
end
end
if (fields["quests_info_return"]) then
if (formname == "quests:info") then
core.show_formspec(playername, "quests:questlog", quests.create_formspec(playername))
else
else
unified_inventory.set_inventory_formspec(player, "quests")
end
end

View File

@ -17,7 +17,7 @@ end
quests.formspec_lists = {}
function quests.round(num, n)
function quests.round(num, n)
local mult = 10^(n or 0)
return math.floor(num * mult + .5) / mult
end

View File

@ -8,7 +8,7 @@ unified_inventory.register_button("quests", {
})
unified_inventory.register_page("quests", {
get_formspec = function(player)
get_formspec = function(player)
local playername = player:get_player_name()
local formspec = quests.create_formspec(playername, "1", true)
return {formspec = formspec, draw_inventory=false}
@ -16,7 +16,7 @@ unified_inventory.register_page("quests", {
})
unified_inventory.register_page("quests_successfull", {
get_formspec = function(player)
get_formspec = function(player)
local playername = player:get_player_name()
local formspec = quests.create_formspec(playername, "2", true)
return {formspec = formspec, draw_inventory=false}
@ -24,7 +24,7 @@ unified_inventory.register_page("quests_successfull", {
})
unified_inventory.register_page("quests_failed", {
get_formspec = function(player)
get_formspec = function(player)
local playername = player:get_player_name()
local formspec = quests.create_formspec(playername, "3", true)
return {formspec = formspec, draw_inventory=false}