It is currently March 28th, 2024, 6:20 pm

Force Enable/Disable D2D rending with your skin

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

Force Enable/Disable D2D rending with your skin

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

Re: Force Enable/Disable D2D rending with your skin

Post 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.
Post Reply