starlit  Diff

Differences From Artifact [765cced2b5]:

To Artifact [77b0e87fc7]:


    10     10   				self.curs.y = math.max(h, self.curs.y + self.curs.maxh)
    11     11   				self.curs.maxh = 0
    12     12   			end;
    13     13   			attach = function(self, elt, x, y, w, h, ...)
    14     14   				local content = ''
    15     15   				if self.width - self.curs.x < w then self:nl() end
    16     16   				for _, v in pairs{...} do
    17         -					content = content .. ';' .. minetest.formspec_escape(tostring(v))
           17  +					content = content .. ';' .. core.formspec_escape(tostring(v))
    18     18   				end
    19     19   				self.src = self.src .. string.format('%s[%f,%f;%f,%f%s]', elt, x,y, w,h, content)
    20     20   				if h > self.curs.maxh then self.curs.maxh = h end
    21     21   			end;
    22     22   			add = function(self, elt, w, h, ...)
    23     23   				local ax, ay = self.curs.x, self.curs.y
    24     24   				self:attach(elt, ax,ay, w,h, ...)
................................................................................
    45     45   		-- takes a configuration table mapping affinities to colors.
    46     46   		-- 'neutral' is the only required affinity
    47     47   		return function(a)
    48     48   			local color = a.color and a.color:readable(0.65, 1.0)
    49     49   			if color == nil then color = l.color(.5,.5,.5) end
    50     50   			local str = a.title
    51     51   			if a.desc then
    52         -				str = str .. '\n' .. color:fmt(minetest.wrap_text(a.desc,60))
           52  +				str = str .. '\n' .. color:fmt(core.wrap_text(a.desc,60))
    53     53   			end
    54     54   			if a.props then
    55     55   				-- str = str .. '\n'
    56     56   				for _,prop in pairs(a.props) do
    57     57   					local c
    58     58   					if prop.color and l.color.id(prop.color) then
    59     59   						c = prop.color:readable(0.6, 1.0)
................................................................................
    65     65   
    66     66   					str = str .. '\n ' .. c:fmt('* ')
    67     67   
    68     68   					if prop.title then
    69     69   						str = str .. c:brighten(1.2):fmt(prop.title) .. ': '
    70     70   					end
    71     71   
    72         -					local lines = minetest.wrap_text(prop.desc, 55, true)
           72  +					local lines = core.wrap_text(prop.desc, 55, true)
    73     73   					str = str .. c:fmt(lines[1])
    74     74   					for i=2,#lines do
    75     75   						str = str .. '\n' .. string.rep(' ',5) .. c:fmt(lines[i])
    76     76   					end
    77     77   				end
    78     78   			end
    79     79   			return color:darken(0.8):bg(str)
    80     80   		end;
    81     81   	end;
    82     82   }