starlit  Diff

Differences From Artifact [01dfc2a3de]:

To Artifact [3ce8488360]:


    46     46   			return state, created
    47     47   		end;
    48     48   		render = function(self, state, user)
    49     49   			return self.pages[state.page].render(state, user)
    50     50   		end;
    51     51   		show = function(self, user)
    52     52   			local state = self:begin(user)
    53         -			minetest.show_formspec(user.name, self.id,self:render(state, user))
           53  +			core.show_formspec(user.name, self.id,self:render(state, user))
    54     54   		end;
    55     55   		open = function(self, user, page, ...)
    56     56   			user:suitSound 'starlit-nav'
    57     57   			self:begin(user, page, ...)
    58     58   			self:show(user)
    59     59   		end;
    60     60   		close = function(self, user)
    61     61   			local state = starlit.activeUI[user.name]
    62     62   			if state and state.form == self.id then
    63     63   				self:cb('onClose', user)
    64     64   				starlit.activeUI[user.name] = nil
    65         -				minetest.close_formspec(user.name, self.id)
           65  +				core.close_formspec(user.name, self.id)
    66     66   			end
    67     67   		end;
    68     68   	};
    69     69   	construct = function(p)
    70     70   		if not p.id then error('UI missing id') end
    71     71   		p.pages = p.pages or {}
    72     72   		return p
................................................................................
    98     98   			hue = 260, sat = 0, lum = 0
    99     99   		};
   100    100   	}
   101    101   	local lines = state.lines
   102    102   	local cmod = string.format('^[hsl:%s:%s:%s',
   103    103   		state.color.hue, state.color.sat*0xff, state.color.lum*0xff)
   104    104   
   105         -	local E = minetest.formspec_escape
          105  +	local E = core.formspec_escape
   106    106   	if state.padding/2 > state.x then state.x = state.padding/2 end
   107    107   	if state.padding/2 > state.y then state.y = state.padding/2 end
   108    108   
   109    109   	local function btnColorDef(sel)
   110    110   		local function climg(state,img)
   111    111   			local selstr
   112    112   			if sel == nil then