Textarea in detached inventory

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Textarea in detached inventory

by 4aiman » Mon Feb 25, 2013 16:34

I wanted to show detached inventory and this is what I get:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest: ../../include/irrString.h:330: T& irr::core::string<T, TAlloc>::operator[](irr::u32) [with T = wchar_t, TAlloc = irr::core::irrAllocator<wchar_t>, irr::u32 = unsigned int]: Assertion `!(index>=used)' failed.

Inventory DID show, but after 0.5-2 seconds minetest crashed. And that happens every time I try to do it.

I make this with help of a function:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
function showmessage(player, message)
    minetest.show_formspec(player, "message_box",
                "size[6,4]"..
                   "textarea[0.5,0.5;5,3;message;;"..message.."]")
end


Which I call like this ("name" here contains players name and <> nil and corresponds to one of the connected atm players):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
showmessage(name,"Usage:\n /forgive <playername>")


Is it smth with the engine, or I'm doing it all wrong?
 

User avatar
Traxie21
Member
 
Posts: 753
Joined: Mon Dec 31, 2012 10:48

by Traxie21 » Mon Feb 25, 2013 19:34

A stab in the dark, but try
print(tostring(message))
"textarea[0.5,0.5;5,3;message;"..tostring(message).."]"
Last edited by Traxie21 on Mon Feb 25, 2013 19:37, edited 1 time in total.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Wed Mar 12, 2014 00:50

In case it's still relevant: minetest.formspec_escape(string) ought to help.
A list of my mods can be found here.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Wed Mar 12, 2014 05:25

Thanks, Sokomine!
To tell the truth I don't remember where did I try to use it...
But I always can search for the strings above in my game's folder :)
It's nice to get an answer now and not when I wouldn't be able to thank you (e.g. during last year I was banned).
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 16 guests

cron