|
|
(4 intermediate revisions by one other user not shown) |
Line 1: |
Line 1: |
− | <div class="toccolours mw-collapsible mw-collapsed tbl-ds">
| + | #REDIRECT [[Global Command: getProperty]] |
− | <span class="bold">Command History</span>
| |
− | <div class="mw-collapsible-content">
| |
− | <div class="alt-bg">Available since v3.7</div>
| |
− | <div>system_language property added to v3.8</div>
| |
− | </div></div>
| |
− | | |
− | | |
− | Return the requested property.
| |
− | | |
− | | |
− | Syntax:
| |
− | <syntaxhighlight>
| |
− | getProperty(property)
| |
− | </syntaxhighlight>
| |
− | | |
− | | |
− | Example 1: "platform"
| |
− | <syntaxhighlight>
| |
− | -- if platform equals windows then do some action else if mac do some other action!
| |
− | if getProperty("platform") == "win" then
| |
− | getObject("Conditions[win?]"):setValue(VConditionValue, true)
| |
− | elseif getProperty("platform") == "mac" then
| |
− | getObject("Conditions[mac?]"):setValue(VConditionValue, true)
| |
− | end
| |
− | </syntaxhighlight>
| |
− | | |
− | Example 2: "steam_initialized"
| |
− | <syntaxhighlight>
| |
− | -- let's check if steam has initialized & set a value based on return value!
| |
− | local steamLoaded == getProperty("steam_initialized")
| |
− | | |
− | if steamLoaded then
| |
− | getObject("Conditions[steamLoaded?]"):setValue(VConditionValue, true)
| |
− | else
| |
− | getObject("Conditions[steamLoaded?]"):setValue(VConditionValue, false)
| |
− | end
| |
− | </syntaxhighlight>
| |
− | | |
− | Example 3: "system_language"
| |
− | <syntaxhighlight>
| |
− | -- let's check the current users operating system language & store it in a variable!
| |
− | local sysLang == getProperty("system_language")
| |
− | | |
− | if sysLang == "English" then
| |
− | game:setValue(VGameStandardLanguage, getObject("Languages[English]"))
| |
− | elseif sysLang == "German" then
| |
− | game:setValue(VGameStandardLanguage, getObject("Languages[Deutsch]"))
| |
− | end
| |
− | </syntaxhighlight>
| |
− | | |
− | | |
− | | |
− | <span class="bold underline">Arguments</span>
| |
− | | |
− | <span class="bold">property</span>: "string" <br/>
| |
− | * "platform" (returns "win" or "mac" depending on users operating system)
| |
− | * "steam_initialized" (true/false depending if the steam_api is successfully loaded & client is connected)
| |
− | * "system_language" (returns users system language in english; english, german, spanish etc)
| |
− | | |
− | | |
− | <span class="bold underline">Flags</span>
| |
− | | |
− | none
| |
− | | |
− | | |
− | <span class="bold underline">Return</span>
| |
− | | |
− | <span class="bold">property</span> <br/>
| |
− | The requested property value
| |
− | {{i18n|GetProperty}}
| |