From 4eb72f0c3f3bdbd7cd6f2320f508d4376b6ce3b5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Rollo Date: Sun, 18 Nov 2018 15:31:53 +0100 Subject: [PATCH] Moved compatibility functions to compatibility.lua --- signs/common.lua | 34 ---------------------------------- signs/compatibility.lua | 29 ++++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/signs/common.lua b/signs/common.lua index 2b40db2..733a44c 100644 --- a/signs/common.lua +++ b/signs/common.lua @@ -21,40 +21,6 @@ local S = signs.intllib local F = function(...) return minetest.formspec_escape(S(...)) end - ---Backwards compatibility functions - -signs.set_display_text = function(...) - minetest.log("warning", "signs.set_display_text() is deprecated, please use signs_api.set_display_text() instead.") - return signs_api.set_display_text(...) -end - -signs.set_formspec = function(...) - minetest.log("warning", "signs.set_formspec() is deprecated, please use signs_api.set_formspec() instead.") - return signs_api.set_formspec(...) -end - -signs.on_receive_fields = function(...) - minetest.log("warning", "signs.on_receive_fields() is deprecated, please use signs_api.on_receive_fields() instead.") - return signs_api.on_receive_fields(...) -end - -signs.on_place_direction = function(...) - minetest.log("warning", "signs.on_place_direction() is deprecated, please use signs_api.on_place_direction() instead.") - return signs_api.on_place_direction(...) -end - -signs.on_rotate = function(...) - minetest.log("warning", "signs.on_rotate() is deprecated, please use signs_api.on_rotate() instead.") - return signs_api.on_rotate(...) -end - -signs.register_sign = function(...) - minetest.log("warning", "signs.register_sign() is deprecated, please use signs_api.register_sign() instead.") - return signs_api.register_sign(...) -end - - -- Generic callback for show_formspec displayed formspecs of "sign" mod minetest.register_on_player_receive_fields(function(player, formname, fields) diff --git a/signs/compatibility.lua b/signs/compatibility.lua index e798a67..dea8750 100644 --- a/signs/compatibility.lua +++ b/signs/compatibility.lua @@ -23,7 +23,7 @@ ------------------------------------ local wallmounted_to_facedir = { - [0]=1, -- Should not happend with signs + [0]=1, -- Should not happend with signs [1]=1, -- Should not happend with signs [2]=1, [3]=3, @@ -84,7 +84,34 @@ minetest.register_lbm({ name = "signs:conpatibility_2", action = compatibility_check_2, }) +--Backwards compatibility API functions +signs.set_display_text = function(...) + minetest.log("warning", "signs.set_display_text() is deprecated, please use signs_api.set_display_text() instead.") + return signs_api.set_display_text(...) +end +signs.set_formspec = function(...) + minetest.log("warning", "signs.set_formspec() is deprecated, please use signs_api.set_formspec() instead.") + return signs_api.set_formspec(...) +end +signs.on_receive_fields = function(...) + minetest.log("warning", "signs.on_receive_fields() is deprecated, please use signs_api.on_receive_fields() instead.") + return signs_api.on_receive_fields(...) +end +signs.on_place_direction = function(...) + minetest.log("warning", "signs.on_place_direction() is deprecated, please use signs_api.on_place_direction() instead.") + return signs_api.on_place_direction(...) +end + +signs.on_rotate = function(...) + minetest.log("warning", "signs.on_rotate() is deprecated, please use signs_api.on_rotate() instead.") + return signs_api.on_rotate(...) +end + +signs.register_sign = function(...) + minetest.log("warning", "signs.register_sign() is deprecated, please use signs_api.register_sign() instead.") + return signs_api.register_sign(...) +end