It is currently April 27th, 2024, 10:17 pm

[suggestion] global variables

Report bugs with the Rainmeter application and suggest features.
Alex Becherer

[suggestion] global variables

Post by Alex Becherer »

how about a global variables file that can be configured in the "Manage" dialogue?

so in future skins these variables could be included and backwards compatibility would not be broken.
i am thinking of stuff like:

Code: Select all

useCelsius=1
useImperialUnits=1
also could be nice for time measures as these default to English (unless i am doing something terribly wrong).
so in the globalvariables.inc file would be:

Code: Select all

am=vorm.
pm=nachm.
Monday=Montag
Tuesday=Dienstag
Wednesday=Mittwoch
Thursday=Donnerstag
...
which could be used in Substitute settings.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: [suggestion] global variables

Post by MerlinTheRed »

Would there be a fixed number of variables or would skin authors be able to devise their own variable names (probably leading to conflicts)?
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!
Alex Becherer

Re: [suggestion] global variables

Post by Alex Becherer »

a fixed number of course as this file would come with the Rainmeter installer.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: [suggestion] global variables

Post by Kaelri »

This has been discussed a few times before. Although it remains a tantalizing idea, we haven't yet found a way to do it that wouldn't be too complex and error-prone.

If there is a fixed list of global variables, that makes us responsible for deciding what they are, and maintaining standards and documentation for all of them. It also becomes a backwards-compatibility issue if we need to change them for any reason. And since it's so trivial to add a single variable, it's easy to see how quickly this would degenerate into either a) a huge, ever-growing list of "standard" variable names that are reserved for global use, constraining skin authors with regard to naming options, or b) a revolving door of proposal, argument and rejection of new global variables, which would suck time and energy away from working on real functionality.

On the other side, if the list is not fixed, then users and skin authors will presumably be able to expand the list on their own, and in doing so, it will be very easy to create conflicts, break each other's skins by overwriting important values, or just generate such a sprawling morass of redundant data that it becomes more of a complication than a useful resource. Every skin that wants to use the global list would be forced to account for an indefinite range of user-defined variables, most of which would be completely irrelevant to the skin in question.

This is one of the many reasons that we have settled on a "self-containment" model for Rainmeter skins. We prefer to minimize the chance that one skin's plugins, addons or variables will interfere with another's, and we have found that this approach has had better results for everyone.

We are, of course, always open to new ideas. I'd be delighted if there's some elegant way to implement global variables that we just haven't thought of yet. :)
Alex Becherer

Re: [suggestion] global variables

Post by Alex Becherer »

i see and i agree with you mostly.
just let me add this:

naming options shouldn't be an issue if you name the global variables like:
RainmeterGlobalVariableUseCelsius=1
(also the global variables would only be used if the skin author includes the file with @Include)

maybe it should be restricted to on/off values (as in a checkbox), so the whole maintaining and documentiation thing wouldn't be an issue.