Like SKIN:GetX() and SKIN:GetY(), implement SKIN:GetZ().
It would enable us to easily manipulate relative skin windows. Also, #CURRENTCONFIGZ# would be nice. Well, just #CURRENTCONFIGZ# would work. Especially with AlwaysOnTop skins.
It is currently September 1st, 2024, 1:45 am
Expose current zpos of skin though lua
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Expose current zpos of skin though lua
from the Realm of Death
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Expose current zpos of skin though lua
While there is no built-in way today, and I'm not sure how much value it really is to be honest, there is a work around that can get it.death.crafter wrote: ↑November 13th, 2021, 2:17 pm Like SKIN:GetX() and SKIN:GetY(), implement SKIN:GetZ().
It would enable us to easily manipulate relative skin windows. Also, #CURRENTCONFIGZ# would be nice. Well, just #CURRENTCONFIGZ# would work. Especially with AlwaysOnTop skins.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[MeasureZPos]
Measure=WebParser
URL=file://#SETTINGSPATH#Rainmeter.ini
CodePage=1200
RegExp=(?siU)\[#CURRENTCONFIG#\].*AlwaysOnTop=(.*)\r\n
StringIndex=1
DynamicVariables=1
[MeterZPos]
Meter=String
MeasureName=MeasureZPos
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Expose current zpos of skin though lua
I know the workaround, but it's a bit too much to just get the zpos of a skin. Like, it's there and we can get it. So why not?jsmorley wrote: ↑November 13th, 2021, 3:10 pm While there is no built-in way today, and I'm not sure how much value it really is to be honest, there is a work around that can get it.
Code: Select all
[Rainmeter] Update=1000 DynamicWindowSize=1 AccurateText=1 [MeasureZPos] Measure=WebParser URL=file://#SETTINGSPATH#Rainmeter.ini CodePage=1200 RegExp=(?siU)\[#CURRENTCONFIG#\].*AlwaysOnTop=(.*)\r\n StringIndex=1 DynamicVariables=1 [MeterZPos] Meter=String MeasureName=MeasureZPos FontSize=11 FontWeight=400 FontColor=255,255,255,255 SolidColor=47,47,47,255 Padding=5,5,5,5 AntiAlias=1
It can be handy when I have a skin with AlwaysOnTop and I want another addon skin on top of it. Most of the time the main skin's zpos is unknown. So, placing the addon skin correctly is impossible. With zpos exposed, I can set and revert zpos of main skin. Which will be handy, other than placing another measure, which will slow me down.
from the Realm of Death
-
- Moderator
- Posts: 1295
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
Re: Expose current zpos of skin though lua
Have you seen LoadOrder? It does what you wantdeath.crafter wrote: ↑November 13th, 2021, 3:31 pm It can be handy when I have a skin with AlwaysOnTop and I want another addon skin on top of it. Most of the time the main skin's zpos is unknown. So, placing the addon skin correctly is impossible. With zpos exposed, I can set and revert zpos of main skin. Which will be handy, other than placing another measure, which will slow me down.
https://docs.rainmeter.net/manual/settings/skin-sections/#LoadOrder
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Expose current zpos of skin though lua
It doesn'tActive Colors wrote: ↑November 15th, 2021, 8:55 am Have you seen LoadOrder? It does what you want
https://docs.rainmeter.net/manual/settings/skin-sections/#LoadOrder
![Sad :(](./images/smilies/ac.gif)
I want my addon to lower the zpos of an arbitrary skin if it is always on top, and then restore it's zpos. But I can't do that unless I read the zpos from Rainmeter settings, which I wish could read from Rainmeter.ini, but it's in UTF-16.
from the Realm of Death
-
- Moderator
- Posts: 1295
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
Re: Expose current zpos of skin though lua
Can you @include=#SETTINGSPATH#Rainmeter.ini in your skin and read it through your skin?death.crafter wrote: ↑November 15th, 2021, 10:33 am It doesn't![]()
I want my addon to lower the zpos of an arbitrary skin if it is always on top, and then restore it's zpos. But I can't do that unless I read the zpos from Rainmeter settings, which I wish could read from Rainmeter.ini, but it's in UTF-16.
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Expose current zpos of skin though lua
That's too extreme lol. And how is that even supposed to work. If I @include the setting file, say it's possible, I can't possibly read from it, since that's not how @include works and the sections aren't measures or meters. Or am I wrong?Active Colors wrote: ↑November 15th, 2021, 10:39 am Can you @include=#SETTINGSPATH#Rainmeter.ini in your skin and read it through your skin?
from the Realm of Death
-
- Moderator
- Posts: 1295
- Joined: February 16th, 2012, 3:32 am
- Location: Berlin, Germany
Re: Expose current zpos of skin though lua
Yeah, I am not sure, that was a very wild guess of me.death.crafter wrote: ↑November 15th, 2021, 10:42 am That's too extreme lol. And how is that even supposed to work. If I @include the setting file, say it's possible, I can't possibly read from it, since that's not how @include works and the sections aren't measures or meters. Or am I wrong?
Other variants that come to my mind are even more extreme, like to create a copy of Rainmeter.ini then change its encoding and read it with lua.
-
- Rainmeter Sage
- Posts: 1398
- Joined: April 24th, 2021, 8:13 pm
Re: Expose current zpos of skin though lua
I have a plugin that can read a file, and I can parse it with lua, but I don't want to, because it is something that should be there.Active Colors wrote: ↑November 15th, 2021, 10:49 am Yeah, I am not sure, that was a very wild guess of me.
Other variants that come to my mind are even more extreme, like to create a copy of Rainmeter.ini then change its encoding and read it with lua.
And to be honest, I would like it if all the setting were exposed through lua. Like SKIN:Settings('SettingName'). Tho, I wonder if that would happen.
from the Realm of Death
-
- Developer
- Posts: 22710
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Expose current zpos of skin though lua
Not that I think it's a particularly good idea, but you could use WebParser to just get the entire Rainmeter.ini file with RegExp=(?siU)^(.*)$ and then read the value of the WebParser measure in Lua as you like.
We will look at exposing this value as a built-in Variable.
We will look at exposing this value as a built-in Variable.