mirror of
https://github.com/mt-mods/signs_lib.git
synced 2025-06-28 22:06:20 +02:00
Compare commits
5 Commits
2021-02-17
...
2021-03-04
Author | SHA1 | Date | |
---|---|---|---|
b0fac5ef9f | |||
34689b5b04 | |||
8b6e41c3fe | |||
d077d23f1a | |||
d71dcf4874 |
16
api.lua
16
api.lua
@ -252,7 +252,10 @@ function signs_lib.set_obj_text(pos, text)
|
|||||||
local text_ansi = Utf8ToAnsi(text)
|
local text_ansi = Utf8ToAnsi(text)
|
||||||
local n = minetest.registered_nodes[minetest.get_node(pos).name]
|
local n = minetest.registered_nodes[minetest.get_node(pos).name]
|
||||||
signs_lib.delete_objects(pos)
|
signs_lib.delete_objects(pos)
|
||||||
signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
|
-- only create sign entity for actual text
|
||||||
|
if text_ansi and text_ansi ~= "" then
|
||||||
|
signs_lib.spawn_entity(pos, signs_lib.make_sign_texture(split(text_ansi), pos) )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- rotation
|
-- rotation
|
||||||
@ -1225,16 +1228,17 @@ function get_sign_formspec(pos, nodename)
|
|||||||
|
|
||||||
local formspec = {
|
local formspec = {
|
||||||
"size[6,4]",
|
"size[6,4]",
|
||||||
"textarea[0,-0.3;6.5,3;text;;" .. minetest.formspec_escape(txt) .. "]",
|
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.png]",
|
||||||
"background[-0.5,-0.5;7,5;signs_lib_sign_bg.jpg]",
|
"image[0.1,2.4;7,1;signs_lib_sign_color_palette.png]",
|
||||||
"button_exit[2,3.4;2,1;ok;" .. S("Write") .. "]"
|
"textarea[0.15,-0.2;6.3,2.8;text;;" .. minetest.formspec_escape(txt) .. "]",
|
||||||
|
"button_exit[3,3.4;2,1;ok;" .. S("Write") .. "]"
|
||||||
}
|
}
|
||||||
|
|
||||||
if minetest.registered_nodes[nodename].allow_widefont then
|
if minetest.registered_nodes[nodename].allow_widefont then
|
||||||
local state = "off"
|
local state = "off"
|
||||||
if meta:get_int("widefont") == 1 then state = "on" end
|
if meta:get_int("widefont") == 1 then state = "on" end
|
||||||
formspec[5] = "label[0.5,3.4;Use wide font]"
|
formspec[#formspec+1] = "label[0.9,3.4;Use wide font]"
|
||||||
formspec[6] = "image_button[0.6,3.7;1,0.6;signs_lib_switch_" .. state .. ".png;"
|
formspec[#formspec+1] = "image_button[1.1,3.7;1,0.6;signs_lib_switch_" .. state .. ".png;"
|
||||||
.. state .. ";;;false;signs_lib_switch_interm.png]"
|
.. state .. ";;;false;signs_lib_switch_interm.png]"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
default
|
|
||||||
intllib?
|
|
||||||
screwdriver?
|
|
||||||
streetspoles?
|
|
||||||
streetlamps?
|
|
||||||
cottages?
|
|
||||||
prefab_redo?
|
|
@ -1 +0,0 @@
|
|||||||
Adds signs with readable text.
|
|
6
mod.conf
6
mod.conf
@ -1,2 +1,6 @@
|
|||||||
name = signs_lib
|
name = signs_lib
|
||||||
min_minetest_version = 5.2.0
|
author = VanessaE
|
||||||
|
depends = default
|
||||||
|
optional_depends = intllib, screwdriver, streetspoles, streetlamps, cottages, prefab_redo
|
||||||
|
description = Adds signs with readable text.
|
||||||
|
min_minetest_version = 5.4.0
|
||||||
|
@ -14,7 +14,8 @@ signs_lib.register_sign("default:sign_wall_wood", {
|
|||||||
allow_widefont = true,
|
allow_widefont = true,
|
||||||
allow_onpole = true,
|
allow_onpole = true,
|
||||||
allow_onpole_horizontal = true,
|
allow_onpole_horizontal = true,
|
||||||
allow_yard = true
|
allow_yard = true,
|
||||||
|
use_texture_alpha = "clip",
|
||||||
})
|
})
|
||||||
|
|
||||||
signs_lib.register_sign("default:sign_wall_steel", {
|
signs_lib.register_sign("default:sign_wall_steel", {
|
||||||
@ -35,7 +36,8 @@ signs_lib.register_sign("default:sign_wall_steel", {
|
|||||||
allow_widefont = true,
|
allow_widefont = true,
|
||||||
allow_onpole = true,
|
allow_onpole = true,
|
||||||
allow_onpole_horizontal = true,
|
allow_onpole_horizontal = true,
|
||||||
allow_yard = true
|
allow_yard = true,
|
||||||
|
use_texture_alpha = "clip",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("signs:sign_hanging", "default:sign_wood_hanging")
|
minetest.register_alias("signs:sign_hanging", "default:sign_wood_hanging")
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 81 KiB |
BIN
textures/signs_lib_sign_bg.png
Normal file
BIN
textures/signs_lib_sign_bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 75 B |
BIN
textures/signs_lib_sign_color_palette.png
Normal file
BIN
textures/signs_lib_sign_color_palette.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Reference in New Issue
Block a user