[Mod] Signs Redo [1.0] [signs]

Post Reply
MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

[Mod] Signs Redo [1.0] [signs]

by MoNTE48 » Post

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
Last edited by MoNTE48 on Mon Mar 16, 2020 12:51, edited 1 time in total.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

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!
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

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.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

Did you know you can do PR on github? :)

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

Image
Attachments
cyrillic.png
cyrillic.png (997.03 KiB) Viewed 1460 times

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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...

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

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.

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

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).

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

With the last version I have issues: 'ñ' is converted to 'n', 'ç' to 'c'...

Edit: Oh, it is cause the slugify.

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

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)

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

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

by Pyrollo » Post

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 :)
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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.

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

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 :)
Last edited by MoNTE48 on Thu Apr 02, 2020 05:47, edited 1 time in total.

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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()"

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

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 :)
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

MoNTE48
Member
Posts: 323
Joined: Sat Apr 06, 2013 11:58
GitHub: MoNTE48
In-game: MoNTE48
Location: Internet

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

by MoNTE48 » Post

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...

Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests