Page 1 of 1

Force Enable/Disable D2D rending with your skin

Posted: December 22nd, 2014, 8:31 am
by XANCI

Code: Select all

	bWKV='!WriteKeyValue'
	bRFA='!RefreshApp'
	sV=tostring(SKIN:GetVariable('SETTINGSPATH'))..'Rainmeter.ini'
	fR=io.open(sV,'r')
	if type(fR)~='nil' then
		sR=fR:read('*a')
		fR:close()
		iD=tonumber(string.match(sR,'%[Rainmeter%][^%[%]]*\nUseD2D=(%d*)'))
		if type(iD)=='nil' then
			SKIN:Bang(bWKV,'Rainmeter','UseD2D',0,sV)
			SKIN:Bang(bRFA)
		elseif iD~=0 then
			SKIN:Bang(bWKV,'Rainmeter','UseD2D',0,sV)
			SKIN:Bang(bRFA)
		end
	end
:D have fun

Re: Force Enable/Disable D2D rending with your skin

Posted: December 22nd, 2014, 2:51 pm
by jsmorley
I see how that turns D2D "off", but don't see where it turns it "on"... I would also recommend that for completeness you might want to take into account that UseD2D can in theory be in any string case, if a user manually adds it to Rainmeter.ini.