<constant> not usable in the same file?
#1
Am I doing something wrong, or <constant> is not seen in the file it is defined in?
Reply
#2
They should be, but they must be inside an include file that has <includes> tags, so you can't define them in, for example, MyVideoNav between the <controls> tags.

I usually just put them in a separate file and then link that file in my Includes.xml -- I find it much neater and consistent this way, plus in eminence it allows me to have a skin setting that toggles the amount of padding and then I include the relevant constants file based upon this condition:

e.g. my Includes.xml
https://github.com/jurialmunkey/skin.emi...cludes.xml

And then my two constants files:
https://github.com/jurialmunkey/skin.emi...Padded.xml
https://github.com/jurialmunkey/skin.emi...Screen.xml

And then you just reference the constant name in controls e.g.
Code:
<left>sidepad</left>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
OK, I've found just that the <constant> cannot be in the same <include> as its usage (in include file). Thanks.
Reply
#4
Oh, well, for some elements it works (like <width>), for some not (like <texture>)....
Reply
#5
Constants can only be numbers afaik

Sent from my GT-I9305T
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#6
Moreover, they do not work for all elements it seems (in the below it works for <top> but not for <number>):

Quote:<control type="label">
<number>some_constant</number>
<top>some_constant</top>
<left>100</left>
<height>100</height>
<width>300</width>
</control>

Also, something like ActivateWindow(some_constant) does not work.
Reply
#7
They are only for defining dimensions (<left> <width> etc.) and durations (<fadetime> and maybe animation time="constant" - I can't remember). They aren't actual constants like in a real programming language.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#8
I may be wrong but wouldn't defaults, or just a plain simple include be more of what your looking for?
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#9
(2017-04-11, 02:57)smitchell6879 Wrote: I may be wrong but wouldn't defaults, or just a plain simple include be more of what your looking for?

Nah, he wants a way to define the ID value of a custom window as a name to, I assume, make it more human readable. Which, afaik, isn't possible. You just have to keep a list of all your custom IDs and what they refer to. Though you really shouldn't be making that many custom windows as most things can be achieved with includes and using the default windows.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
(2017-04-11, 03:44)jurialmunkey Wrote: Nah, he wants a way to define the ID value of a custom window as a name to, I assume, make it more human readable.

Right, plus be able to easily adjust some global values from a single place.
Reply

Logout Mark Read Team Forum Stats Members Help
<constant> not usable in the same file?0