|
|
..:: General LS Scripting FAQ ::.. |
|
|
- What is a !Bang Command?
A !Bang command is an internal command specifically designed to control LiteStep or one of its modules.
All !Bang commands are prefixed with an exclamation point, "!".
For example, the !Bang command "!Run" displays the Windows Run dialog box.
Bang commands can be executed by hotkeys, shortcuts, popups and so on.
A full list of the !Bang commands available to LiteStep at any particular time can be obtained
by issuing the !About command and selecting "!Bang Commands" from the drop-down list.
An explanation of the function of each !Bang command can be found in the appropriate documentation.
For example, to put the !Recycle command in the popup menu:
*Popup "Recycle LiteStep" !Recycle
Remember any !Bang Command that alters something in the Step.RC is only a temporary change
and will be changed once you !Recycle, !Refresh or restart LiteStep.
-
What is an $Environment$ Variable?
Environment Variables allow you to define certain words to abbreviate commonly used paths.
They are surrounded by dollar signs ($) and can be used in any LiteStep command,
although most commonly in the Step.RC. Environment Variables are best used for replacing
long paths or frequently used paths so that they can be quickly typed into the Step.RC when
required. In addition, Environment Variables are a useful tool for making themes easily customisable.
The user can quickly enter their own paths for the Environment Variables used in the theme,
reducing the need to fix every single path in the Step.RC.
Note: When replacing path names with Environment Variables you should always end the path with a "\".
Defining the Environment Variable "ModuleDir":
ModulesDir "C:\LiteStep\modules\"
Referencing this path in the Step.RC is done like this:
LoadModule $ModulesDir$popup2-2.1.6.dll or with the new syntax *netloadmodule popup2-2.1.6
There are a large number of predefined Environment Variables configured into LiteStep.
Please refer to the LiteStep Core documentation.
- Can I use conditional Statements?
Conditional statements allow for themes to be more platform independent and are similar to the
"conditional compilation" feature in programming languages such as C and C++.
Conditionals allow different actions to be carried out, depending on the result of a statement.
If [expression1]
[block1]
ElseIf [expression2]
[block2]
...
ElseIf [expressionN]
[blockN]
...
Else
[else-block]
EndIf
The example above illustrates the basic layout of a conditional statement.
If [expression1] is true, then [block1] will be processed.
If [expression1] is false, [expression2] will be evaluated.
Expressions will continue to be evaluated until a true statement is reached,
at which point processing of the conditional statement will stop.
If no expressions are found to be true, the final [else-block] will be carried out.
The only required parts of the conditional statement are "If" and "EndIf".
There can be any number of "ElseIf" expressions but only one (optional)
"Else" command. If an "Else" command is present, it must be placed at the end of
the entire conditional statement, immediately before "EndIf".
Expressions can contain boolean operators, like "and", "or", and "not", and relational operators,
such as "<", "<=", "<>", "=", ">=", and ">".
The equals sign, "=", is used for testing equality and the greater than/less than combination,
"<>", is used for testing inequality; C-style combinations "==" and "!=" are not supported.
Currently only comparison of integers is supported, but strings will be supported in the future.
Examples:
; Use a predefined Environment Variable to select different commands based on OS
If WinNT
*Popup "DOS Prompt" cmd.exe
Else
*Popup "DOS Prompt" command.com
EndIf
; Comparison of integer values and use of boolean operators
If ResolutionX < 800 or ResolutionY < 600
Wallpaper wpsmall.bmp
ElseIf ResolutionX = 800 and ResolutionY = 600
Wallpaper wpjustright.bmp
Else
Wallpaper wplarge.bmp
EndIf
-
What about maths?
I'm sure you want to release someday you theme, but every user got another resolution,
so your theme could look very weird, especially in a bar theme.
Take a look at your set elements and decide which you can "stretch".
These are the math formulas you can use:
* - multiply
/ - divide
+ - add
- - substract
Example:
Name |
Clock |
Winamp |
Slider |
Taskbar |
Startbutton |
Width |
100 pixel |
200 pixel |
80 pixel |
<resizable> |
50 pixel |
x - Coordinate |
x = 0 |
x = 100 |
x = 300 |
x = 380 |
x = -50 |
Now we got the x positions of each element and their width (excapt the taskbar).
So we do some math that the bar is resizing for each resolution:
TaskbarWidth $resolutionx-(first 4 element width + one end element width)$
Looks strange, but very easy to understand:
Taskbarwidth $resolutionx-330$
What have I done? simple add together all widths I know and substracts from the whole
resolution x.
This is now a playground for everything:
var $(var_something/2+50)*3+2$
Just try it on your own.
↑
© by LS-Universe
|
|
|