mirror of
				https://github.com/minetest-mods/i3.git
				synced 2025-11-04 10:05:31 +01:00 
			
		
		
		
	Use get_short_description
This commit is contained in:
		
							
								
								
									
										9
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								init.lua
									
									
									
									
									
								
							@@ -636,7 +636,7 @@ local function snip(str, limit)
 | 
			
		||||
	return #str > limit and fmt("%s...", sub(str, 1, limit - 3)) or str
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function get_desc(item, lang_code)
 | 
			
		||||
local function get_desc(item)
 | 
			
		||||
	if sub(item, 1, 1) == "_" then
 | 
			
		||||
		item = sub(item, 2)
 | 
			
		||||
	end
 | 
			
		||||
@@ -644,11 +644,10 @@ local function get_desc(item, lang_code)
 | 
			
		||||
	local def = reg_items[item]
 | 
			
		||||
 | 
			
		||||
	if def then
 | 
			
		||||
		local desc = def.description
 | 
			
		||||
		desc = lang_code and translate(lang_code, desc) or desc
 | 
			
		||||
		local desc = ItemStack(item):get_short_description()
 | 
			
		||||
 | 
			
		||||
		if true_str(desc) then
 | 
			
		||||
			desc = desc:trim():match("[^\n]*")
 | 
			
		||||
			desc = desc:trim()
 | 
			
		||||
 | 
			
		||||
			if not find(desc, "%u") then
 | 
			
		||||
				desc = toupper(desc)
 | 
			
		||||
@@ -1624,7 +1623,7 @@ local function get_header(fs, data)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local desc_lim, name_lim = 32, 34
 | 
			
		||||
	local desc = ESC(get_desc(data.query_item, data.lang_code))
 | 
			
		||||
	local desc = ESC(get_desc(data.query_item))
 | 
			
		||||
	local tech_name = data.query_item
 | 
			
		||||
	local X = data.xoffset + 1.05
 | 
			
		||||
	local Y1 = data.yoffset + 0.47
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user