Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1584

Bugs & Feature Suggestions • Re: Why does this nested inline Lua function crash Rainmeter only when used in MeterStyle?

$
0
0
Simple test case:

INI (in this state it's just showing the identical inline function working in a Text string, to see crashing behavior comment out the normal `MeterStyle` and enable the second one below it)

Code:

[Variables]C1=58,188,109C2=209,82,79[Rainmeter]AccurateText=1DynamicWindowSize=1Update=1000[Sc]Measure=ScriptScriptFile=Script.lua[SomeStyle]X=0Y=0DynamicVariables=1[AnotherStyle]W=200H=100FontColor=#C1#[YetAnotherStyle]FontColor=#C2#[Example]Meter=StringMeterStyle=SomeStyle | AnotherStyle | YetAnotherStyle; MeterStyle=SomeStyle | AnotherStyle [&Sc:Repl('[&Sc:Chk('#CURRENTSECTION#','SomeOption')]','MyVal','| YetAnotherStyle')]SomeOption=MyValText=[&Sc:Repl('[&Sc:Chk('#CURRENTSECTION#','SomeOption')]','MyVal','| YetAnotherStyle')]SolidColor=0,0,0
Script

Code:

function Initialize()endfunction Repl(in1,in2,ret)    if in1 == in2 then        return ret    else        return ""    endendfunction Chk(name,op)    local m = SKIN:GetMeter(name)    local o = m:GetOption(op,'',false)    if o then        return o    else        return 0    endend
The Lua itself doesn't have an endless loop but internally perhaps yeah I'm guessing like you mentioned it may be something self-referencing.

The workaround is having to define the base MeterStyles as a variable then using a measure to conditionally add to/restore from but would have been neater to have it work inline, since it works for other scenarios.

Statistics: Posted by Crest — Today, 1:59 am



Viewing all articles
Browse latest Browse all 1584

Trending Articles