It is currently September 20th, 2019, 5:36 pm

Force Enable/Disable D2D rending with your skin

Discuss the use of Lua in Script measures.
User avatar
XANCI
Posts: 106
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Force Enable/Disable D2D rending with your skin

XANCI » December 22nd, 2014, 8:31 am

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
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Force Enable/Disable D2D rending with your skin

jsmorley » December 22nd, 2014, 2:51 pm

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.