Page 1 of 1

[Mod] Signs Redo [1.0] [signs]

Posted: Mon Mar 16, 2020 11:24
by MoNTE48
Image

Signs Redo

Description:
Lightweight wooden signs with text display and automatic formatting.

Features:
1) Very lightweight, designed with the idea of highly loaded servers
2) Display the written text. Even after /clearobjects!
3) Simple and easy to read font.
2) Automatic centering and text wrapping.
4) Nice appearance.
5) Two types: floor and wall.

Compatible with Minetest 0.4+ and 5.0+.

License:
Source code: LGPLv3+
Textures: CC-BY-SA 4.0

Download: https://github.com/MultiCraft-Community ... master.zip
Github: https://github.com/MultiCraft-Community/signs

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Mon Mar 16, 2020 11:55
by runs
Thanks, really!

I always missed a simple sign mod as in Minecraft. In fact I had it in my TODO list of mods to create.

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Mon Mar 16, 2020 15:44
by FreeGamers
I really like the simplicity of this one. Other signs mods are very bloated and contain many HUD elements, colors, and unnecessary features. I feel like this a much better approach. Thank you!

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Mon Mar 16, 2020 16:07
by MoNTE48
Thanks. In the future I will release additional submods for other languages. It can be used if necessary.
However, even now all non-Latin text will be shown in infotext when selecting sign.

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Tue Mar 17, 2020 16:17
by runs
I've made a spanish version (mod translated too).
More chars: Ñ, ñ, ¿, ¡, €
No accents. Cos I do not know to introduce them on a input box even.

Image

Download

Ps: Monte48 Simply I've changed a function

Code: Select all

local function generate_sign_line_texture(str, texture, row)
	local leftover = floor((20 - #str) * 16 / 2) or 0
	local i = 1
	for char in string.gmatch(str, ".[\128-\191]*") do
		local char_byte_1 = char:byte(1)
		local char_byte_2 = char:byte(2)
		if char_byte_2 then
			char_byte_1 = char_byte_2
		end
		if char_byte_1 then
			texture = texture .. ":" .. (i - 1) * 16 + leftover .. ","
				.. row * 20 .. "=signs_" .. char_byte_1 .. ".png"
		end
		i = i + 1
		if i == 20 then
			break
		end
	end
	return texture
end

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Tue Mar 17, 2020 16:46
by MoNTE48
Did you know you can do PR on github? :)

---
Edit: The essence of 95% of the mods on this forum in one screenshot.

Image

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Tue Mar 17, 2020 19:40
by runs
MoNTE48 wrote:Did you know you can do PR on github? :)

---
Edit: The essence of 95% of the mods on this forum in one screenshot.

Image
It is impossible it belongs to my game.
My solution is for latin based languages: english, spanish, french, german, italian...

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Tue Mar 17, 2020 21:39
by MoNTE48
Writing code without exception is bad practice.

Update:
1) automatic centering of the text,
2) transliteration for the Latin alphabet and Cyrillic alphabet,
3) minor improvements.

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Wed Mar 18, 2020 17:30
by MoNTE48
Update:
1) Removing an entity if the sign is missing
(a bug rarely happened when the text remained after digging the sign).

2) Do not break checking after deleting the first entity when digging sign
(a bug very rarely happened when LBM restored sign entity faster than will load the existing. As a result, we had 2 entities for 1 sign).

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Thu Mar 19, 2020 18:33
by runs
With the last version I have issues: 'ñ' is converted to 'n', 'ç' to 'c'...

Edit: Oh, it is cause the slugify.

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Fri Mar 20, 2020 14:17
by MoNTE48
I consider this a necessary measure. Each additional letter is +2 texture (uppercase+lowercase). As a result, about 300+ textures are needed to fully support all major languages.

Original text is always displayed as `infotext`!
While there is no better way to visually display the text, I want to keep this mod compact and lightweight.
For advanced Signs with support for fonts, images and other things, the best and time-tested solutions have long existed.
While my version is about 23 kb (code and textures)

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Fri Mar 20, 2020 15:42
by Pyrollo
Something quite light that can be done : translate accentuated letters to simple letters. This would work for most latin languages.

EDIT: Sorry, that is already done :)

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Sat Mar 21, 2020 10:45
by runs
MoNTE48 wrote:I consider this a necessary measure. Each additional letter is +2 texture (uppercase+lowercase). As a result, about 300+ textures are needed to fully support all major languages.

Original text is always displayed as `infotext`!
While there is no better way to visually display the text, I want to keep this mod compact and lightweight.
For advanced Signs with support for fonts, images and other things, the best and time-tested solutions have long existed.
While my version is about 23 kb (code and textures)
I understand.

So I did a spanish specific version for better readibility in this language.

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Tue Mar 31, 2020 12:02
by MoNTE48
Update!
* Do not break punctuation marks with the word.
* Save the texture of the entity in the meta data to quickly restore when reloaded. The mod has become even more lightweight for servers.
* Other fixes and optimizations.

---
If someone thinks that the mod needs localization of formspec or some other function, I will be glad to know about it :)

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Thu Apr 02, 2020 01:54
by runs
MoNTE48 wrote:Update!
* Do not break punctuation marks with the word.
* Save the texture of the essence in the meta block to quickly restore when reloaded. The mod has become even more lightweight for servers.
* Other fixes and optimizations.

---
If someone thinks that the mod needs localization of formspec or some other function, I will be glad to know about it :)
Yes, please, enclose into a "S()"

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Tue May 12, 2020 09:00
by FreeGamers
I really enjoy how lightweight this one is compared to the other signs api's. I'm compared mods for this functionality now, and this seems like the one to go with :)

Re: [Mod] Signs Redo [1.0] [signs]

Posted: Fri Feb 19, 2021 22:03
by MoNTE48
This mod has received several small but important updates from the MultiCraft upstream.
And I would really like the mod to be moved to the Mod Releases section...