aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/init.lua
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-06-25 11:52:09 +0200
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-06-25 16:23:05 +0200
commit09ba047c0175adfaca4a6bccc41c8a0570c295db (patch)
treeb3bb762911ecc2fd6480d5f63b6cfcee0e419b79 /builtin/mainmenu/init.lua
parent27538ecef51ebcc7622f13956d2f8e101d0f71a7 (diff)
downloadminetest-09ba047c0175adfaca4a6bccc41c8a0570c295db.tar.gz
minetest-09ba047c0175adfaca4a6bccc41c8a0570c295db.tar.bz2
minetest-09ba047c0175adfaca4a6bccc41c8a0570c295db.zip
Add setting for tooltips show delay.
Diffstat (limited to 'builtin/mainmenu/init.lua')
0 files changed, 0 insertions, 0 deletions
a> 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "cpp_api/s_env.h"
#include "cpp_api/s_internal.h"
#include "common/c_converter.h"
#include "log.h"
#include "environment.h"
#include "mapgen.h"
#include "lua_api/l_env.h"
#include "server.h"

void ScriptApiEnv::environment_OnGenerated(v3s16 minp, v3s16 maxp,
		u32 blockseed)
{
	SCRIPTAPI_PRECHECKHEADER

	// Get core.registered_on_generateds
	lua_getglobal(L, "core");
	lua_getfield(L, -1, "registered_on_generateds");
	// Call callbacks
	push_v3s16(L, minp);
	push_v3s16(L, maxp);
	lua_pushnumber(L, blockseed);
	script_run_callbacks(L, 3, RUN_CALLBACKS_MODE_FIRST);
}

void ScriptApiEnv::environment_Step(float dtime)
{
	SCRIPTAPI_PRECHECKHEADER
	//infostream<<"scriptapi_environment_step"<<std::endl;

	// Get core.registered_globalsteps
	lua_getglobal(L, "core");
	lua_getfield(L, -1, "registered_globalsteps");
	// Call callbacks
	lua_pushnumber(L, dtime);
	try {
		script_run_callbacks(L, 1, RUN_CALLBACKS_MODE_FIRST);
	} catch (LuaError &e) {
		getServer()->setAsyncFatalError(e.what());
	}
}

void ScriptApiEnv::player_event(ServerActiveObject* player, std::string type)
{
	SCRIPTAPI_PRECHECKHEADER

	if (player == NULL)
		return;

	// Get minetest.registered_playerevents