aboutsummaryrefslogtreecommitdiff
path: root/mods
diff options
context:
space:
mode:
authorSfan5 <sfan5@live.de>2013-09-09 20:26:46 +0200
committerSfan5 <sfan5@live.de>2013-09-09 22:50:51 +0200
commit1f3402e7a1e160c4be25c596f33d916b988075fb (patch)
treefa1aa3f72c96e4939424ce4c70c5a552cb0ee248 /mods
parent49a75b18945bcbc75e59857374356497345f08af (diff)
downloadminetest-1f3402e7a1e160c4be25c596f33d916b988075fb.tar.gz
minetest-1f3402e7a1e160c4be25c596f33d916b988075fb.tar.bz2
minetest-1f3402e7a1e160c4be25c596f33d916b988075fb.zip
Prevent ModMgr from deleting backend setting in world.mt
Diffstat (limited to 'mods')
0 files changed, 0 insertions, 0 deletions
> 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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
--[[
    signs mod for Minetest - Various signs with text displayed on
    (c) Pierre-Yves Rollo

    This file is part of signs.

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

    signs 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 General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with signs.  If not, see <http://www.gnu.org/licenses/>.
--]]

local S = signs.intllib
local F = function(...) return minetest.formspec_escape(S(...)) end

-- Poster specific formspec
local function display_poster(pos, node, player)
	local meta = minetest.get_meta(pos)

	local def = minetest.registered_nodes[node.name].display_entities["signs:display_text"]

	local p_text = meta:get_string("text")
	local d_text = meta:get_string("display_text")
	-- If orwell96's modified signs_lib version is available and sign macros are active,
	-- replace them in display_lib's text too.
	if signs_lib and signs_lib.replace_macros then
		p_text = signs_lib.replace_macros(p_text)
		d_text = signs_lib.replace_macros(d_text)
	end

	local font = font_api.get_font(meta:get_string("font") or def.font_name)

	local fs
	local fname = string.format("%s@%s:display",
		node.name, minetest.pos_to_string(pos))

	-- Title texture
	local titletexture = font:make_text_texture(
		d_text, font:get_height()*8.4,
		font:get_height(), 1, "center")

	fs = string.format([=[
		size[7,9]bgcolor[#0000]
		background[0,0;7,9;signs_poster_formspec.png]
		image[0,-0.2;8.4,2;%s]
		textarea[0.3,1.5;7,8;;%s;]]=],
		titletexture,
		minetest.colorize("#111",
			minetest.formspec_escape(p_text)))

	if minetest.is_protected(pos, player:get_player_name()) then
		fs = string.format("%sbutton_exit[2.5,8;2,1;ok;%s]", fs, F("Close"))