Remove welcome mod
This commit is contained in:
parent
657c0a1bec
commit
b1c51d1b71
@ -25,10 +25,6 @@ movement_gravity = 9.8
|
||||
|
||||
default_privs = fast, interact, player_skin, shout, spawn, zoom
|
||||
|
||||
# If the welcome formspec is shown on join
|
||||
|
||||
welcome_enable = true
|
||||
|
||||
# If you're given the inital stuff
|
||||
|
||||
give_initial_enable = false
|
||||
@ -98,10 +94,6 @@ hunger_step = 3
|
||||
headbars_enable = true
|
||||
headbars_scale = 1
|
||||
|
||||
# Private messages
|
||||
|
||||
pm_enable_saving = true
|
||||
|
||||
# Ambiance sounds
|
||||
|
||||
ambiance_enable = true
|
||||
@ -149,4 +141,4 @@ mg_valleys_river_size = 5
|
||||
mg_valleys_river_depth = 2
|
||||
|
||||
mg_valleys_np_biome_humidity = 50, 20, (600, 850, 600), 31478, 2, 0.5, 2.0
|
||||
mg_valleys_np_terrain_height = 10, 25, (750, 1500, 750), 88533, 5, 0.65, 2, 2
|
||||
mg_valleys_np_terrain_height = 10, 25, (750, 1500, 750), 88533, 5, 0.65, 2, 2
|
||||
|
@ -127,17 +127,6 @@ local function on_joinplayer(player)
|
||||
|
||||
-- Uncomment to disable the minimap
|
||||
player:hud_set_flags({minimap = false})
|
||||
|
||||
-- Welcome
|
||||
|
||||
minetest.after(1.0, function()
|
||||
minetest.chat_send_player(
|
||||
player:get_player_name(),
|
||||
minetest.colorize(
|
||||
"#ff0",
|
||||
"Welcome to Pixture! Type /help for a list of commands."
|
||||
))
|
||||
end)
|
||||
end
|
||||
|
||||
local function on_leaveplayer(player)
|
||||
|
@ -1,7 +0,0 @@
|
||||
Welcome mod
|
||||
===========
|
||||
By Kaadmy, for Pixture
|
||||
|
||||
Prompts users to accept the rules when joining
|
||||
|
||||
Source license: LGPLv2.1
|
@ -1,2 +0,0 @@
|
||||
default
|
||||
|
@ -1,89 +0,0 @@
|
||||
--
|
||||
-- Welcome mod
|
||||
-- By Kaadmy, for Pixture
|
||||
--
|
||||
|
||||
welcome = {}
|
||||
|
||||
welcome.rules = {
|
||||
"Welcome!",
|
||||
"",
|
||||
"Rules:",
|
||||
"1. No swearing.",
|
||||
"2. No griefing.",
|
||||
"3. No spamming."
|
||||
}
|
||||
|
||||
function welcome.get_formspec(name)
|
||||
if not minetest.settings:get_bool("welcome_enable") then
|
||||
minetest.chat_send_player(name, "Welcoming is disabled")
|
||||
return ""
|
||||
end
|
||||
|
||||
local form = default.ui.get_page("default:notabs")
|
||||
|
||||
local rules = ""
|
||||
|
||||
for _, t in ipairs(welcome.rules) do
|
||||
if rules ~= "" then rules = rules .. "," end
|
||||
|
||||
rules = rules .. minetest.formspec_escape(t)
|
||||
end
|
||||
|
||||
form = form .. "textlist[0.25,0.75;7.75,6.75;rules;" .. rules .. "]"
|
||||
|
||||
if not minetest.check_player_privs(name, {interact = true}) then
|
||||
form = form .. default.ui.button_exit(1.25, 7.75, 3, 1, "decline_rules", "Nope")
|
||||
form = form .. default.ui.button_exit(4.25, 7.75, 3, 1, "accept_rules", "Okay")
|
||||
else
|
||||
form = form .. default.ui.button_exit(2.9, 7.75, 3, 1, "", "Okay")
|
||||
end
|
||||
|
||||
return form
|
||||
end
|
||||
|
||||
function welcome.show_rules(name)
|
||||
local f = welcome.get_formspec(name)
|
||||
|
||||
if f ~= "" then
|
||||
minetest.show_formspec(name, "welcome:welcome", f)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(
|
||||
function(player, form_name, fields)
|
||||
local name = player:get_player_name()
|
||||
local privs = minetest.get_player_privs(name)
|
||||
|
||||
if privs.interact or fields.rules then
|
||||
return
|
||||
end
|
||||
|
||||
if fields.accept_rules then
|
||||
privs.interact = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
minetest.chat_send_player(name, "You now have interact, follow the rules and have fun!")
|
||||
else
|
||||
minetest.chat_send_player(name, "If you want to interact, please read and accept the rules. Type /welcome to show rules.")
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_chatcommand(
|
||||
"welcome",
|
||||
{
|
||||
description = "Show rules",
|
||||
func = function(name, param)
|
||||
welcome.show_rules(name)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(
|
||||
function(player)
|
||||
local name = player:get_player_name()
|
||||
|
||||
if not minetest.check_player_privs(name, {interact = true}) and minetest.settings:get_bool("welcome_enable") then
|
||||
welcome.show_rules(name)
|
||||
end
|
||||
end)
|
||||
|
||||
default.log("mod:welcome", "loaded")
|
@ -5,8 +5,6 @@
|
||||
|
||||
## Multiplayer settings
|
||||
|
||||
welcome_enable (Welcome) bool true
|
||||
|
||||
## Player stuff
|
||||
|
||||
drop_items_on_die (Drop items on death) bool true
|
||||
|
Loading…
Reference in New Issue
Block a user